prompt-optimizer by daymade/claude-code-skills
npx skills add https://github.com/daymade/claude-code-skills --skill prompt-optimizer使用 EARS(简易需求语法方法)将模糊的提示优化为精确、可执行的规范说明。EARS 是劳斯莱斯公司开发的一种方法论,用于将自然语言转化为结构化、可测试的需求。
方法论灵感来源: 本技能将 EARS 与领域理论相结合的方法,灵感来源于 阿星AI工作室 (A-Xing AI Studio),该工作室展示了 EARS 在提示词增强方面的实际应用。
四层增强流程:
在以下情况应用:
识别弱点:
将需求转换为 EARS 模式。完整语法规则请参见 references/ears_syntax.md。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
五种核心模式:
系统应 <行动>当 <触发器> 时,系统应 <行动>当处于 <状态> 时,系统应 <行动>如果 <条件>,系统应 <行动>如果 <条件>,系统应阻止 <非期望行动>快速示例:
Before: "创建一个带有任务管理的提醒应用"
After (EARS):
1. 当用户创建任务时,系统应指导将其分解为可执行的子任务
2. 当任务截止时间在 30 分钟内且用户尚未开始时,系统应发送带有声音提醒的通知
3. 当用户完成一个子任务时,系统应更新进度并提供积极反馈
转换检查清单:
将需求与已建立的框架相匹配。完整目录请参见 references/domain_theories.md。
常见领域映射:
选择过程:
生成包含真实数据的具体示例:
示例必须真实、具体、多样(成功/错误/边界情况)且可测试。
使用标准框架进行结构化:
# Role
[具有领域专业知识的特定专家角色]
## Skills
- [核心能力 1]
- [核心能力 2]
[列出 5-8 项与领域理论相符的技能]
## Workflows
1. [阶段 1] - [关键活动]
2. [阶段 2] - [关键活动]
[完整的逐步流程]
## Examples
[包含真实数据的具体示例,而非占位符]
## Formats
[精确的输出规范:
- 文件类型、结构要求
- 设计/样式期望
- 技术约束
- 交付物检查清单]
质量标准:
以结构化格式输出:
## Original Requirement
[用户的模糊需求]
**Identified Issues:**
- [问题 1: 例如,"缺少具体的触发条件"]
- [问题 2: 例如,"没有可衡量的成功标准"]
## EARS Transformation
[EARS 格式化需求的编号列表]
## Domain & Theories
**Primary Domain:** [例如,认证安全]
**Applicable Theories:**
- **[Theory 1]** - [简要相关性]
- **[Theory 2]** - [简要相关性]
## Enhanced Prompt
[完整的 角色/技能/工作流/示例/格式 提示词]
---
**How to use:**
[关于如何应用此提示词的简要指导]
对于复杂场景,请参见 references/advanced_techniques.md:
应做事项: ✅ 分解复合需求(每个需求一个 EARS 陈述) ✅ 指定可衡量的标准(数字、时间范围、百分比) ✅ 包含错误/边界情况 ✅ 基于已建立的理论 ✅ 使用包含真实数据的具体示例
避免事项: ❌ 避免模糊语言("快速"、"用户友好") ❌ 不要假设隐含知识 ❌ 不要在一个陈述中混合多个行动 ❌ 不要在示例中使用占位符
根据需要加载这些参考文件:
references/ears_syntax.md - 完整的 EARS 语法规则,所有 5 种模式,转换指南,优势references/domain_theories.md - 40+ 个理论映射到 10 个领域(生产力、用户体验、游戏化、学习、电子商务、安全等)references/examples.md - 四个完整的转换示例(拖延症应用、电子商务产品页面、学习仪表盘、密码重置安全),包含前后对比和可重用模板references/advanced_techniques.md - 多利益相关者需求、非功能性规范、复杂条件逻辑模式何时加载参考文件:
ears_syntax.mddomain_theories.mdexamples.mdadvanced_techniques.mdWeekly Installs
279
Repository
GitHub Stars
637
First Seen
Jan 21, 2026
Security Audits
Installed on
opencode240
gemini-cli220
codex220
cursor205
github-copilot200
claude-code195
Optimize vague prompts into precise, actionable specifications using EARS (Easy Approach to Requirements Syntax) - a Rolls-Royce methodology for transforming natural language into structured, testable requirements.
Methodology inspired by: This skill's approach to combining EARS with domain theory grounding was inspired by 阿星AI工作室 (A-Xing AI Studio), which demonstrated practical EARS application for prompt enhancement.
Four-layer enhancement process:
Apply when:
Identify weaknesses:
Convert requirements to EARS patterns. See references/ears_syntax.md for complete syntax rules.
Five core patterns:
The system shall <action>When <trigger>, the system shall <action>While <state>, the system shall <action>If <condition>, the system shall <action>If <condition>, the system shall prevent <unwanted action>Quick example:
Before: "Create a reminder app with task management"
After (EARS):
1. When user creates a task, the system shall guide decomposition into executable sub-tasks
2. When task deadline is within 30 minutes AND user has not started, the system shall send notification with sound alert
3. When user completes a sub-task, the system shall update progress and provide positive feedback
Transformation checklist:
Match requirements to established frameworks. See references/domain_theories.md for full catalog.
Common domain mappings:
Selection process:
Generate specific examples with real data:
Examples must be realistic , specific , varied (success/error/edge cases), and testable.
Structure using the standard framework:
# Role
[Specific expert role with domain expertise]
## Skills
- [Core capability 1]
- [Core capability 2]
[List 5-8 skills aligned with domain theories]
## Workflows
1. [Phase 1] - [Key activities]
2. [Phase 2] - [Key activities]
[Complete step-by-step process]
## Examples
[Concrete examples with real data, not placeholders]
## Formats
[Precise output specifications:
- File types, structure requirements
- Design/styling expectations
- Technical constraints
- Deliverable checklist]
Quality criteria:
Output in structured format:
## Original Requirement
[User's vague requirement]
**Identified Issues:**
- [Issue 1: e.g., "Lacks specific trigger conditions"]
- [Issue 2: e.g., "No measurable success criteria"]
## EARS Transformation
[Numbered list of EARS-formatted requirements]
## Domain & Theories
**Primary Domain:** [e.g., Authentication Security]
**Applicable Theories:**
- **[Theory 1]** - [Brief relevance]
- **[Theory 2]** - [Brief relevance]
## Enhanced Prompt
[Complete Role/Skills/Workflows/Examples/Formats prompt]
---
**How to use:**
[Brief guidance on applying the prompt]
For complex scenarios, see references/advanced_techniques.md:
Do's: ✅ Break down compound requirements (one EARS statement per requirement) ✅ Specify measurable criteria (numbers, timeframes, percentages) ✅ Include error/edge cases ✅ Ground in established theories ✅ Use concrete examples with real data
Don'ts: ❌ Avoid vague language ("fast", "user-friendly") ❌ Don't assume implicit knowledge ❌ Don't mix multiple actions in one statement ❌ Don't use placeholders in examples
Load these reference files as needed:
references/ears_syntax.md - Complete EARS syntax rules, all 5 patterns, transformation guidelines, benefitsreferences/domain_theories.md - 40+ theories mapped to 10 domains (productivity, UX, gamification, learning, e-commerce, security, etc.)references/examples.md - Four complete transformation examples (procrastination app, e-commerce product page, learning dashboard, password reset security) with before/after comparisons and reusable templatereferences/advanced_techniques.md - Multi-stakeholder requirements, non-functional specs, complex conditional logic patternsWhen to load references:
ears_syntax.mddomain_theories.mdexamples.mdadvanced_techniques.mdWeekly Installs
279
Repository
GitHub Stars
637
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode240
gemini-cli220
codex220
cursor205
github-copilot200
claude-code195
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
41,800 周安装