1实现原理 · 为什么它能做到
纯 prompt 编排:全部机制是「四层增强流程」——把模糊需求做 EARS 语法转换、领域理论落地、真实示例抽取,再包成固定骨架的增强 prompt。
**Four-layer enhancement process:** 1. **EARS syntax transformation** - Convert descriptive language to normative specifications 2. **Domain theory grounding** - Apply relevant industry frameworks (GTD, BJ Fogg, Gestalt, etc.) 3. **Example extraction** - Surface concrete use cases with real data 4. **Structured prompt generation** - Format using Role/Skills/Workflows/Examples/Formats framework
EARS 五范式落地:Ubiquitous / Event-driven / State-driven / Conditional / Unwanted behavior 各有固定句式,配 before/after 对照与一份改造 checklist(显式化条件、补触发器、量化标准、拆原子句、删含糊词)。
**Five core patterns:** 1. **Ubiquitous**: `The system shall <action>` 2. **Event-driven**: `When <trigger>, the system shall <action>` 3. **State-driven**: `While <state>, the system shall <action>` 4. **Conditional**: `If <condition>, the system shall <action>` 5. **Unwanted behavior**: `If <condition>, the system shall prevent <unwanted action>`
领域理论落地方式:先按需求关键词识别领域,再从 10 个域的目录里挑 2-4 条互补理论,把理论原则映射到具体功能,并在 prompt 里显式引用理论名。
**Selection process:** 1. Identify primary domain from requirement keywords 2. Match to 2-4 complementary theories 3. Apply theory principles to specific features 4. Cite theories in enhanced prompt for credibility
理论目录本身是主要资产:10 个领域(生产力/行为改变/UX/游戏化/学习/数据可视化/电商/信息架构/安全/无障碍),共 38 条编号理论条目,并给出『选 2-4 条 → 应用到功能与工作流 → 引用增信』的选择流程与一个完整选型示例。
## How to Select Theories 1. **Identify the domain** from user requirements 2. **Match to primary objective** (engagement, learning, conversion, etc.) 3. **Select 2-4 relevant theories** that complement each other 4. **Apply principles** to specific features and workflows 5. **Cite theories** in enhanced prompts to add credibility
输出骨架固定五段:Role / Skills / Workflows / Examples / Formats,且示例明令用真实数据(「Real data, not "Example 1", "Example 2"」),交付物是可整段粘走的 markdown 规格。
- **Concrete examples**: Real data, not "Example 1", "Example 2"
六步工作流有顺序且带诊断:先分析原需求的弱点(过宽/缺触发器/动作含糊/无约束),再逐步 EARS 化、选理论、抽示例、生成 prompt、按固定六段式呈现结果。
### Step 1: Analyze Original Requirement Identify weaknesses: - **Overly broad** - "Add user authentication" → Missing password requirements, session management - **Missing triggers** - "Send notifications" → Missing when/why notifications trigger - **Ambiguous actions** - "Make it user-friendly" → No measurable usability criteria - **No constraints** - "Process payments" → Missing security, compliance requirements
复杂需求有一份进阶手册:多利益相关者(按角色分别出 EARS、显式写角色条件与嵌套权限)、非功能需求(性能/安全/可扩展/可靠性四类量化阈值)、复杂条件逻辑(嵌套 AND/OR + 优先级 + 兜底分支)。
1. Quantify constraints explicitly (no vague terms like "fast" or "secure") 2. Specify measurement methods (how to verify the requirement) 3. Include threshold values (acceptable ranges) 4. Define degradation behavior (what happens when thresholds are exceeded)
参考文件按需加载,主文件只留骨架:SKILL.md 用一段 Resources 说明每份 reference 的适用时机,模型不必一次读全(195 行主文件 + 1014 行 references)。
- **`references/domain_theories.md`** - 40+ theories mapped to 10 domains (productivity, UX, gamification, learning, e-commerce, security, etc.)
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| network | 出处引用链接(方法论来源展示,运行时脚本并不访问) |
4风险提醒 风险提醒:绿色 · 放心使用
- 改写会放大原始需求的权威性,不能过滤其中的恶意或越界内容 — 它把用户给的文本规范化成正式规格并配理论背书,若原始需求来自不可信来源(抓取的网页、第三方消息),产物被粘进下游 agent 会话后即是更『像样』的 prompt injection 载体;skill 无任何内容安全判断环节。
- 『引用理论』被明示用于增加可信度,容易被误读为质量或安全背书 — SKILL.md 的选择流程第 4 步就写着 cite theories in enhanced prompts for credibility;而理论只被『引用名称+要点』,不推导、不校验适用性,读到 Zero Trust/Defense in Depth 不等于该安全设计被验证过。
- 宣传口径与实际目录存在出入 — SKILL.md Resources 段写 40+ theories,实读为 10 个域 38 条编号条目(跨域重复的 SDT、Gestalt 去重后更少)。引用该数字时应按实际计数修正。
- 没有任何一致性或事实核验机制 — 产出规格内部的矛盾(例如同时要求『无密码登录』与『密码复杂度 12 位』)、以及具体技术参数是否仍符合当前实践,都不在 skill 的检查范围内;checklist 只约束句式与粒度。
- 长需求下输出可能显著膨胀 — 流程要求把每条需求拆成原子 EARS 句、每条补示例与量化阈值,并再包一层五段式骨架;对大型需求容易产出体量远超原始输入的文档,缺少长度/取舍预算规则。
5第二遍独立确认
- [ok] 资产面:是否存在脚本、hooks 或隐藏文件 — find prompt-optimizer -type f(含隐藏)只有 5 个文件:SKILL.md、references/{advanced_techniques,domain_theories,ears_syntax,examples}.md。无 scripts/、无 tests/、无 frontmatter 里的 allowed-tools 之外的配置键(frontmatter 仅 name/description 两键)。第一遍『纯 prompt』结论成立。
- [ok] 外部依赖反例:是否有漏掉的网络/凭证/执行面 — 全目录 token 扫描:无 curl/wget/urllib/requests/子进程调用/环境变量读取/写文件指令;https?:// 仅 3 处且都是出处引用(mp.weixin.qq.com 在 SKILL.md 与 examples.md),其余命中(token、api、secret 等)均出现在 EARS 示例文本里(如 password_reset_tokens 表、POST /api/auth/reset-password),是指被改写的示例需求而非 skill 的依赖。external_deps 因此只列出处引用一条,并注明运行时并不访问。
- [discrepancy] 宣传口径核对:domain_theories.md 是否真有 40+ 理论与 10 个域 — SKILL.md 的 Resources 段写 `40+ theories mapped to 10 domains`。第二遍用脚本统计:域数 10 属实(Productivity 5、Behavior Change 4、UX 6、Gamification 4、Learning 5、DataViz 3、E-commerce 3、IA 3、Security 3、Accessibility 2),但编号理论条目合计 38 条,未达 40+;若把跨域重复的 Self-Determination Theory、Gestalt Principles 去重,唯一理论数更少。属宣传性口径略偏大,不影响目录可用性,但『40+』不应被当作已核实的数字引用。
- [ok] EARS 五范式与 checklist 是否在两处一致 — SKILL.md 的 Step 2 列出五范式与 6 项 checklist;ears_syntax.md 对同一五范式给出 Format/English/Use when/Example 完整四段(含中文句式 `当 <trigger> 时,系统应 <action>`)与同一份扩展 checklist(多出『Define the actor』『Specify measurable outcomes』两项)、再加多条件事件与分支动作两种复杂形态。两处无冲突,reference 是超集。
- [ok] 输出格式声明 vs 实际骨架(夸大检查) — SKILL.md Step 5 的骨架(Role/Skills/Workflows/Examples/Formats)、Step 6 的六段式结果格式、examples.md 的 Transformation Pattern Template 三处骨架一致;description 宣称的『precise, well-structured specifications』由 Formats 段的『File types, structure requirements / Technical constraints / Deliverable checklist』承载。无未兑现承诺,也没有声称会验证产出。
- [ok] 非功能需求与复杂条件的具体落地方式是否真实存在 — advanced_techniques.md 实读:非功能四类各给 3-8 条量化范式(200ms/95%、1.5s FCP/90%、TLS 1.3、tokenize 卡号、retry 3×2s、1,000/s 排队、fraud score>70);复杂条件给出嵌套层级、显式布尔、优先级、括号与兜底五步与多段示例。第一遍『量化阈值』结论逐条可定位。
- [ok] 案例数量与出处标注 — examples.md 标题清单:Example 1 拖延症消除器、Example 2 电商商品页、Example 3 学习仪表盘、Example 4 密码重置安全,加一个 Transformation Pattern Template;SKILL.md Resources 段自述『Four complete transformation examples (procrastination app, e-commerce product page, learning dashboard, password reset security)』与实读标题逐一对应。出处标注在 SKILL.md 与 examples.md 出现两次且互为一致。
- [ok] 对『改写是否会被当作事实核验』的找反例 — 通读 5 个文件,未发现任何『验证需求真实性/可达性』的步骤或声明,也没有针对输出自检的机制(checklist 只约束句式与粒度)。故 verdict.risks 中『只保证写法规范不保证内容正确』成立,且不构成夸大——SKILL.md 也未做此承诺。
6结论
a62c59842d84fe47…d5c4678cb5