@wenaixi/dsh-superpower 7.4.1 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +110 -105
  2. package/README.zh.md +216 -0
  3. package/lib/catalog.d.ts +8 -2
  4. package/lib/catalog.d.ts.map +1 -1
  5. package/lib/catalog.js +64 -9
  6. package/lib/catalog.js.map +1 -1
  7. package/lib/client.js +68 -21
  8. package/lib/document.d.ts +8 -2
  9. package/lib/document.d.ts.map +1 -1
  10. package/lib/document.js +14 -4
  11. package/lib/document.js.map +1 -1
  12. package/lib/superpowers.d.ts +2 -0
  13. package/lib/superpowers.d.ts.map +1 -1
  14. package/lib/superpowers.js +8 -0
  15. package/lib/superpowers.js.map +1 -1
  16. package/lib/switches.d.ts +2 -10
  17. package/lib/switches.d.ts.map +1 -1
  18. package/lib/switches.js +29 -5
  19. package/lib/switches.js.map +1 -1
  20. package/package.json +3 -3
  21. package/skills/brainstorming/SKILL.md +235 -171
  22. package/skills/brainstorming/spec-document-reviewer-prompt.md +27 -25
  23. package/skills/brainstorming/visual-companion.md +65 -69
  24. package/skills/diagnosing-superpowers/SKILL.md +107 -43
  25. package/skills/diagnosing-superpowers/prompts/analyst-common.md +32 -18
  26. package/skills/diagnosing-superpowers/prompts/cost-and-time.md +25 -9
  27. package/skills/diagnosing-superpowers/prompts/plan-adherence.md +26 -12
  28. package/skills/diagnosing-superpowers/prompts/quality-evidence.md +23 -8
  29. package/skills/diagnosing-superpowers/prompts/repeated-work.md +25 -14
  30. package/skills/diagnosing-superpowers/prompts/request-conflicts.md +18 -9
  31. package/skills/diagnosing-superpowers/prompts/scrub-audit.md +23 -10
  32. package/skills/diagnosing-superpowers/prompts/scrub.md +25 -12
  33. package/skills/diagnosing-superpowers/prompts/similar-session.md +30 -22
  34. package/skills/diagnosing-superpowers/prompts/skill-timeline.md +26 -12
  35. package/skills/diagnosing-superpowers/prompts/stumbles.md +24 -12
  36. package/skills/diagnosing-superpowers/references/context-safety.md +15 -7
  37. package/skills/diagnosing-superpowers/references/github-issues.md +17 -9
  38. package/skills/diagnosing-superpowers/references/redaction-policy.md +27 -15
  39. package/skills/diagnosing-superpowers/references/session-discovery.md +31 -20
  40. package/skills/diagnosing-superpowers/templates/bundle-README.md +66 -40
  41. package/skills/diagnosing-superpowers/templates/case.md +49 -42
  42. package/skills/diagnosing-superpowers/templates/issue.md +32 -26
  43. package/skills/diagnosing-superpowers/templates/report.md +54 -48
  44. package/skills/dispatching-parallel-agents/SKILL.md +92 -90
  45. package/skills/executing-plans/SKILL.md +345 -197
  46. package/skills/finishing-a-development-branch/SKILL.md +107 -82
  47. package/skills/receiving-code-review/SKILL.md +129 -127
  48. package/skills/requesting-code-review/SKILL.md +52 -50
  49. package/skills/requesting-code-review/code-reviewer.md +132 -111
  50. package/skills/subagent-driven-development/SKILL.md +521 -298
  51. package/skills/subagent-driven-development/implementer-prompt.md +138 -117
  52. package/skills/subagent-driven-development/re-review-prompt.md +80 -48
  53. package/skills/subagent-driven-development/task-reviewer-prompt.md +189 -110
  54. package/skills/systematic-debugging/CREATION-LOG.md +85 -85
  55. package/skills/systematic-debugging/SKILL.md +221 -219
  56. package/skills/systematic-debugging/condition-based-waiting.md +48 -49
  57. package/skills/systematic-debugging/defense-in-depth.md +46 -46
  58. package/skills/systematic-debugging/root-cause-tracing.md +63 -63
  59. package/skills/systematic-debugging/test-academic.md +10 -10
  60. package/skills/systematic-debugging/test-pressure-1.md +40 -40
  61. package/skills/systematic-debugging/test-pressure-2.md +58 -58
  62. package/skills/systematic-debugging/test-pressure-3.md +48 -48
  63. package/skills/test-driven-development/SKILL.md +161 -153
  64. package/skills/test-driven-development/writing-good-tests.md +137 -84
  65. package/skills/using-git-worktrees/SKILL.md +74 -72
  66. package/skills/using-superpowers/SKILL.md +40 -39
  67. package/skills/using-superpowers/references/dsh-tools.md +36 -36
  68. package/skills/verification-before-completion/SKILL.md +85 -83
  69. package/skills/writing-plans/SKILL.md +123 -84
  70. package/skills/writing-skills/SKILL.md +419 -417
  71. package/skills/writing-skills/persuasion-principles.md +118 -118
  72. package/skills/writing-skills/testing-skills-with-subagents.md +190 -190
@@ -1,681 +1,683 @@
1
1
  ---
2
2
  name: writing-skills
3
- description: "Superpower Skill:在创建新技能、编辑或重构现有技能,以及在部署前验证技能可用性、合规性与实际生效情况时使用。"
3
+ description: "Superpower Skill: Use when creating new skills, editing existing skills, or verifying skills work before deployment"
4
+ description_zh: "Superpower Skill:在创建新技能、编辑或重构现有技能,以及在部署前验证技能可用性、合规性与实际生效情况时使用。"
4
5
  ---
5
6
 
6
- # 技能编写
7
7
 
8
- ## 概览
8
+ # Writing Skills
9
9
 
10
- **编写技能就是将测试驱动开发应用于流程文档。**
10
+ ## Overview
11
11
 
12
- **个人技能存放于 DSH 的技能目录**:全局技能为 `~/.dsh/skills/`,项目级技能为 `<project>/.dsh/skills/`,亦可通过 DSH bundle 插件(`cordis.patch.yml` 注入 `ctx.skills`)分发提供。详细工具映射请参见 [dsh-tools.md](../using-superpowers/references/dsh-tools.md)。
12
+ **Writing skills IS Test-Driven Development applied to process documentation.**
13
13
 
14
- 你编写测试用例(带 subagent 的压力场景)、观察其失败(基线行为)、编写技能(文档)、观察测试通过(agent 已遵守)、再进行重构(堵住漏洞)。
14
+ **Personal skills live in DSH** at `~/.dsh/skills/` (global), `<project>/.dsh/skills/` (project-level), or distributed by a DSH bundle plugin (`cordis.patch.yml` injecting `ctx.skills`). See [dsh-tools.md](../using-superpowers/references/dsh-tools.md) for the DSH tool mapping.
15
15
 
16
- **核心原则:** 如果你没有亲眼看到 agent 在没有技能的情况下失败,你就无法判断技能是否真正教会了正确的内容。
16
+ You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
17
17
 
18
- **必备前置知识:** 使用本技能前,你必须理解 test-driven-development。该技能定义了基本的 红-绿-重构 循环,本技能则是将 TDD 适配到文档编写上。
18
+ **Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
19
19
 
20
- **官方指引:** 关于 DSH 平台技能的标准与工具规范,请参见 [dsh-tools.md](../using-superpowers/references/dsh-tools.md)。本文档在以 TDD 为核心的方法之外,提供了额外的模式与指南作为补充。
20
+ **REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
21
21
 
22
- ## 什么是技能?
22
+ **Official guidance:** For the DSH platform skill standards and tool conventions, see [dsh-tools.md](../using-superpowers/references/dsh-tools.md). This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
23
23
 
24
- **技能**是用于已被验证有效的技巧、模式或工具的参考指南。技能帮助未来的 agent 快速找到并应用高效方法。
24
+ ## What is a Skill?
25
25
 
26
- **技能是:** 可复用的技巧、模式、工具、参考指南
26
+ A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future agents find and apply effective approaches.
27
27
 
28
- **技能不是:** 对某次问题解决过程的叙事记录
28
+ **Skills are:** Reusable techniques, patterns, tools, reference guides
29
29
 
30
- ## TDD 与技能编写的映射
30
+ **Skills are NOT:** Narratives about how you solved a problem once
31
31
 
32
- | TDD 概念 | 技能创建 |
32
+ ## TDD Mapping for Skills
33
+
34
+ | TDD Concept | Skill Creation |
33
35
  |-------------|----------------|
34
- | **测试用例** | 带 subagent 的压力场景 |
35
- | **生产代码** | 技能文档(SKILL.md) |
36
- | **测试失败(红)** | agent 在无技能情况下违反规则(基线) |
37
- | **测试通过(绿)** | agent 在有技能情况下遵守规则 |
38
- | **重构** | 在保持合规的前提下堵住漏洞 |
39
- | **先写测试** | 在编写技能之前先运行基线场景 |
40
- | **观察失败** | 记录 agent 使用的确切辩解话术 |
41
- | **最小化代码** | 编写针对性解决上述违规行为的技能 |
42
- | **观察通过** | 验证 agent 现在已遵守规则 |
43
- | **重构循环** | 发现新的辩解话术 → 堵住 → 重新验证 |
36
+ | **Test case** | Pressure scenario with subagent |
37
+ | **Production code** | Skill document (SKILL.md) |
38
+ | **Test fails (RED)** | Agent violates rule without skill (baseline) |
39
+ | **Test passes (GREEN)** | Agent complies with skill present |
40
+ | **Refactor** | Close loopholes while maintaining compliance |
41
+ | **Write test first** | Run baseline scenario BEFORE writing skill |
42
+ | **Watch it fail** | Document exact rationalizations agent uses |
43
+ | **Minimal code** | Write skill addressing those specific violations |
44
+ | **Watch it pass** | Verify agent now complies |
45
+ | **Refactor cycle** | Find new rationalizations → plug → re-verify |
44
46
 
45
- 整个技能创建过程遵循 红-绿-重构 循环。
47
+ The entire skill creation process follows RED-GREEN-REFACTOR.
46
48
 
47
- ## 何时创建技能
49
+ ## When to Create a Skill
48
50
 
49
- **满足以下情况时创建:**
50
- - 该技巧对你而言并非直观可见
51
- - 你会在多个项目中反复查阅它
52
- - 该模式具有普适性(非项目特有)
53
- - 他人也能从中受益
51
+ **Create when:**
52
+ - Technique wasn't intuitively obvious to you
53
+ - You'd reference this again across projects
54
+ - Pattern applies broadly (not project-specific)
55
+ - Others would benefit
54
56
 
55
- **以下情况不要创建:**
56
- - 一次性的解决方案
57
- - 已在别处有完善文档的标准实践
58
- - 项目特定的约定(应放在你的 instructions 文件中)
59
- - 可机械化约束的内容(如果能用正则/校验强制执行,就自动化处理——文档应留给需要判断的场景)
57
+ **Don't create for:**
58
+ - One-off solutions
59
+ - Standard practices well-documented elsewhere
60
+ - Project-specific conventions (put in your instructions file)
61
+ - Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)
60
62
 
61
- ## 技能类型
63
+ ## Skill Types
62
64
 
63
- ### 技巧型(Technique)
64
- 具有明确执行步骤的具体方法(condition-based-waiting、root-cause-tracing)
65
+ ### Technique
66
+ Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
65
67
 
66
- ### 模式型(Pattern)
67
- 思考问题的方式(flatten-with-flags、test-invariants)
68
+ ### Pattern
69
+ Way of thinking about problems (flatten-with-flags, test-invariants)
68
70
 
69
- ### 参考型(Reference)
70
- API 文档、语法指南、工具说明(office docs)
71
+ ### Reference
72
+ API docs, syntax guides, tool documentation (office docs)
71
73
 
72
- ## 目录结构
74
+ ## Directory Structure
73
75
 
74
76
 
75
77
  ```
76
78
  skills/
77
79
  skill-name/
78
- SKILL.md # 主文档(必需)
79
- supporting-file.* # 仅在需要时添加
80
+ SKILL.md # Main reference (required)
81
+ supporting-file.* # Only if needed
80
82
  ```
81
83
 
82
- **扁平命名空间** - 所有技能处于同一个可搜索的命名空间
84
+ **Flat namespace** - all skills in one searchable namespace
83
85
 
84
- **以下情况需拆分为独立文件:**
85
- 1. **重量级参考**(100 行以上)- API 文档、完整语法说明
86
- 2. **可复用工具** - 脚本、实用程序、模板
86
+ **Separate files for:**
87
+ 1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax
88
+ 2. **Reusable tools** - Scripts, utilities, templates
87
89
 
88
- **保持内联的情况:**
89
- - 原则与概念
90
- - 代码模式(< 50 行)
91
- - 其他所有内容
90
+ **Keep inline:**
91
+ - Principles and concepts
92
+ - Code patterns (< 50 lines)
93
+ - Everything else
92
94
 
93
- ## SKILL.md 结构
95
+ ## SKILL.md Structure
94
96
 
95
- **Frontmatter(YAML):**
96
- - 两个必填字段:`name` 和 `description`(所有支持的字段见 [agentskills.io/specification](https://agentskills.io/specification))
97
- - 总计不超过 1024 字符
98
- - `name`:仅使用字母、数字和连字符(不要包含括号、特殊字符)
99
- - `description`:使用第三人称,仅描述何时使用(而非技能做了什么)
100
- - 以 "Use when..." 开头,聚焦触发条件
101
- - 包含具体的症状、场景和上下文
102
- - **切勿概括技能的流程或工作流**(原因见 SDO 一节)
103
- - 尽量控制在 500 字符以内
97
+ **Frontmatter (YAML):**
98
+ - Two required fields: `name` and `description` (see [agentskills.io/specification](https://agentskills.io/specification) for all supported fields)
99
+ - Max 1024 characters total
100
+ - `name`: Use letters, numbers, and hyphens only (no parentheses, special chars)
101
+ - `description`: Third-person, describes ONLY when to use (NOT what it does)
102
+ - Start with "Use when..." to focus on triggering conditions
103
+ - Include specific symptoms, situations, and contexts
104
+ - **NEVER summarize the skill's process or workflow** (see SDO section for why)
105
+ - Keep under 500 characters if possible
104
106
 
105
107
  ```markdown
106
108
  ---
107
109
  name: Skill-Name-With-Hyphens
108
- description: Use when [具体的触发条件与症状]
110
+ description: Use when [specific triggering conditions and symptoms]
109
111
  ---
110
112
 
111
- # 技能名称
113
+ # Skill Name
112
114
 
113
- ## 概览
114
- 这是什么?用 1-2 句话说明核心原则。
115
+ ## Overview
116
+ What is this? Core principle in 1-2 sentences.
115
117
 
116
- ## 何时使用
117
- [如果判断逻辑不直观,则加入小型内联流程图]
118
+ ## When to Use
119
+ [Small inline flowchart IF decision non-obvious]
118
120
 
119
- 带症状和使用场景的要点列表
120
- 何时不使用
121
+ Bullet list with SYMPTOMS and use cases
122
+ When NOT to use
121
123
 
122
- ## 核心模式(适用于技巧/模式类)
123
- 修改前后的代码对比
124
+ ## Core Pattern (for techniques/patterns)
125
+ Before/after code comparison
124
126
 
125
- ## 快速参考
126
- 用于快速查阅的表格或要点列表
127
+ ## Quick Reference
128
+ Table or bullets for scanning common operations
127
129
 
128
- ## 实现
129
- 简单模式直接内联代码
130
- 重量级参考或可复用工具则链接到独立文件
130
+ ## Implementation
131
+ Inline code for simple patterns
132
+ Link to file for heavy reference or reusable tools
131
133
 
132
- ## 常见错误
133
- 哪里会出错 + 修复方法
134
+ ## Common Mistakes
135
+ What goes wrong + fixes
134
136
 
135
- ## 实际影响(可选)
136
- 具体成果
137
+ ## Real-World Impact (optional)
138
+ Concrete results
137
139
  ```
138
140
 
139
141
 
140
- ## 技能发现优化(SDO)
142
+ ## Skill Discovery Optimization (SDO)
141
143
 
142
- **对发现至关重要:** 未来的 agent 需要能够找到你的技能
144
+ **Critical for discovery:** Future agents need to FIND your skill
143
145
 
144
- ### 1. 丰富的 Description 字段
146
+ ### 1. Rich Description Field
145
147
 
146
- **目的:** 你的 agent 会读取 description 来判断当前任务是否需要加载某个技能。要让它能回答:"我现在该读这个技能吗?"
148
+ **Purpose:** Your agent reads the description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
147
149
 
148
- **格式:** 以 "Use when..." 开头,聚焦触发条件
150
+ **Format:** Start with "Use when..." to focus on triggering conditions
149
151
 
150
- **关键:Description = 何时使用,而非技能做了什么**
152
+ **CRITICAL: Description = When to Use, NOT What the Skill Does**
151
153
 
152
- description 应仅描述触发条件,不要概括技能的流程或工作流。
154
+ The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
153
155
 
154
- **为什么这很重要:** 测试发现,当 description 概括了技能的工作流时,agent 可能会直接沿用 description 的描述,而不再阅读完整的技能内容。一个写着「code review between tasks」的 description 曾导致 agent 只做了一次审查,尽管技能中的流程图明确展示了两次审查(先合规性审查,再代码质量审查)。
156
+ **Why this matters:** Testing revealed that when a description summarizes the skill's workflow, an agent may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).
155
157
 
156
- 当 description 被改为仅保留「Use when executing implementation plans with independent tasks」(不含工作流概括)后,agent 才正确读取了流程图,并执行了两阶段审查流程。
158
+ When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), the agent correctly read the flowchart and followed the two-stage review process.
157
159
 
158
- **陷阱:** 概括工作流的 description 会成为 agent 走捷径的入口,技能正文反而被跳过。
160
+ **The trap:** Descriptions that summarize workflow create a shortcut agents will take. The skill body becomes documentation agents skip.
159
161
 
160
162
  ```yaml
161
- # [FAIL] 错误:概括了工作流——agent 可能直接照做而不读技能正文
163
+ # [FAIL] BAD: Summarizes workflow - agents may follow this instead of reading skill
162
164
  description: Use when executing plans - dispatches subagent per task with code review between tasks
163
165
 
164
- # [FAIL] 错误:过多流程细节
166
+ # [FAIL] BAD: Too much process detail
165
167
  description: Use for TDD - write test first, watch it fail, write minimal code, refactor
166
168
 
167
- # [OK] 正确:仅包含触发条件,不概括工作流
169
+ # [OK] GOOD: Just triggering conditions, no workflow summary
168
170
  description: Use when executing implementation plans with independent tasks in the current session
169
171
 
170
- # [OK] 正确:仅包含触发条件
172
+ # [OK] GOOD: Triggering conditions only
171
173
  description: Use when implementing any feature or bugfix, before writing implementation code
172
174
  ```
173
175
 
174
- **内容要求:**
175
- - 使用具体的触发词、症状和场景来表明技能的适用条件
176
- - 描述问题本身(竞态条件、行为不一致)而非特定语言的表象(setTimeout、sleep)
177
- - 保持触发条件技术无关,除非技能本身就是面向特定技术的
178
- - 如果技能面向特定技术,需在触发条件中明确说明
179
- - 使用第三人称(会被注入到系统提示中)
180
- - **切勿概括技能的流程或工作流**
176
+ **Content:**
177
+ - Use concrete triggers, symptoms, and situations that signal this skill applies
178
+ - Describe the *problem* (race conditions, inconsistent behavior) not *language-specific symptoms* (setTimeout, sleep)
179
+ - Keep triggers technology-agnostic unless the skill itself is technology-specific
180
+ - If skill is technology-specific, make that explicit in the trigger
181
+ - Write in third person (injected into system prompt)
182
+ - **NEVER summarize the skill's process or workflow**
181
183
 
182
184
  ```yaml
183
- # [FAIL] 错误:过于抽象、模糊,未说明何时使用
185
+ # [FAIL] BAD: Too abstract, vague, doesn't include when to use
184
186
  description: For async testing
185
187
 
186
- # [FAIL] 错误:第一人称
188
+ # [FAIL] BAD: First person
187
189
  description: I can help you with async tests when they're flaky
188
190
 
189
- # [FAIL] 错误:提到了技术,但技能本身并不面向该技术
191
+ # [FAIL] BAD: Mentions technology but skill isn't specific to it
190
192
  description: Use when tests use setTimeout/sleep and are flaky
191
193
 
192
- # [OK] 正确:以 "Use when" 开头,描述问题,不含工作流
194
+ # [OK] GOOD: Starts with "Use when", describes problem, no workflow
193
195
  description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
194
196
 
195
- # [OK] 正确:面向特定技术的技能,触发条件明确
197
+ # [OK] GOOD: Technology-specific skill with explicit trigger
196
198
  description: Use when using React Router and handling authentication redirects
197
199
  ```
198
200
 
199
- ### 2. 关键词覆盖
201
+ ### 2. Keyword Coverage
200
202
 
201
- 使用 agent 会搜索的词语:
202
- - 错误信息:"Hook timed out"、"ENOTEMPTY"、"race condition"
203
- - 症状:"flaky"、"hanging"、"zombie"、"pollution"
204
- - 同义词:"timeout/hang/freeze"、"cleanup/teardown/afterEach"
205
- - 工具:实际的命令、库名、文件类型
203
+ Use words an agent would search for:
204
+ - Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
205
+ - Symptoms: "flaky", "hanging", "zombie", "pollution"
206
+ - Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
207
+ - Tools: Actual commands, library names, file types
206
208
 
207
- ### 3. 描述性命名
209
+ ### 3. Descriptive Naming
208
210
 
209
- **使用主动语态、动词优先:**
210
- - [OK] `creating-skills` 而非 `skill-creation`
211
- - [OK] `condition-based-waiting` 而非 `async-test-helpers`
211
+ **Use active voice, verb-first:**
212
+ - [OK] `creating-skills` not `skill-creation`
213
+ - [OK] `condition-based-waiting` not `async-test-helpers`
212
214
 
213
- ### 4. Token 效率(关键)
215
+ ### 4. Token Efficiency (Critical)
214
216
 
215
- **问题:** getting-started 和高频引用的技能会在每次对话中都被加载,每一个 token 都很重要。
217
+ **Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
216
218
 
217
- **目标字数:**
218
- - getting-started 类工作流:每个 <150 词
219
- - 高频加载的技能:总计 <200 词
220
- - 其他技能:<500 词(仍需保持简洁)
219
+ **Target word counts:**
220
+ - getting-started workflows: <150 words each
221
+ - Frequently-loaded skills: <200 words total
222
+ - Other skills: <500 words (still be concise)
221
223
 
222
- **技巧:**
224
+ **Techniques:**
223
225
 
224
- **将细节移至工具帮助中:**
226
+ **Move details to tool help:**
225
227
  ```bash
226
- # [FAIL] 错误:在 SKILL.md 中罗列所有参数
228
+ # [FAIL] BAD: Document all flags in SKILL.md
227
229
  search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
228
230
 
229
- # [OK] 正确:引用 --help
230
- search-conversations 支持多种模式和过滤条件。运行 --help 查看详情。
231
+ # [OK] GOOD: Reference --help
232
+ search-conversations supports multiple modes and filters. Run --help for details.
231
233
  ```
232
234
 
233
- **使用交叉引用:**
235
+ **Use cross-references:**
234
236
  ```markdown
235
- # [FAIL] 错误:重复工作流细节
237
+ # [FAIL] BAD: Repeat workflow details
236
238
  When searching, dispatch subagent with template...
237
- [20 行重复说明]
239
+ [20 lines of repeated instructions]
238
240
 
239
- # [OK] 正确:引用其他技能
240
- 始终使用 subagent(可节省 50-100 倍上下文)。必需:工作流请使用 [other-skill-name]。
241
+ # [OK] GOOD: Reference other skill
242
+ Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
241
243
  ```
242
244
 
243
- **压缩示例:**
245
+ **Compress examples:**
244
246
  ```markdown
245
- # [FAIL] 错误:冗长示例(42 词)
247
+ # [FAIL] BAD: Verbose example (42 words)
246
248
  your human partner: "How did we handle authentication errors in React Router before?"
247
249
  You: I'll search past conversations for React Router authentication patterns.
248
250
  [Dispatch subagent with search query: "React Router authentication error handling 401"]
249
251
 
250
- # [OK] 正确:精简示例(20 词)
252
+ # [OK] GOOD: Minimal example (20 words)
251
253
  Partner: "How did we handle auth errors in React Router?"
252
254
  You: Searching...
253
255
  [Dispatch subagent → synthesis]
254
256
  ```
255
257
 
256
- **消除冗余:**
257
- - 不要重复交叉引用技能中已有的内容
258
- - 不要解释从命令本身就能看出含义的内容
259
- - 不要为同一模式提供多个示例
258
+ **Eliminate redundancy:**
259
+ - Don't repeat what's in cross-referenced skills
260
+ - Don't explain what's obvious from command
261
+ - Don't include multiple examples of same pattern
260
262
 
261
- **验证:**
263
+ **Verification:**
262
264
  ```bash
263
265
  wc -w skills/path/SKILL.md
264
- # getting-started 工作流:目标 <150 词/个
265
- # 其他高频加载:目标总计 <200 词
266
+ # getting-started workflows: aim for <150 each
267
+ # Other frequently-loaded: aim for <200 total
266
268
  ```
267
269
 
268
- **按功能或核心洞察命名:**
270
+ **Name by what you DO or core insight:**
269
271
  - [OK] `condition-based-waiting` > `async-test-helpers`
270
- - [OK] `using-skills` 而非 `skill-usage`
272
+ - [OK] `using-skills` not `skill-usage`
271
273
  - [OK] `flatten-with-flags` > `data-structure-refactoring`
272
274
  - [OK] `root-cause-tracing` > `debugging-techniques`
273
275
 
274
- **动名词(-ing)适合描述过程:**
275
- - `creating-skills`、`testing-skills`、`debugging-with-logs`
276
- - 主动语态,描述你正在执行的动作
276
+ **Gerunds (-ing) work well for processes:**
277
+ - `creating-skills`, `testing-skills`, `debugging-with-logs`
278
+ - Active, describes the action you're taking
277
279
 
278
- ### 5. 交叉引用其他技能
280
+ ### 5. Cross-Referencing Other Skills
279
281
 
280
- **在编写引用其他技能的文档时:**
282
+ **When writing documentation that references other skills:**
281
283
 
282
- 仅使用技能名称,并加上明确的必要性标记:
283
- - [OK] 正确:`**REQUIRED SUB-SKILL:** Use test-driven-development`
284
- - [OK] 正确:`**REQUIRED BACKGROUND:** You MUST understand systematic-debugging`
285
- - [FAIL] 错误:`See skills/testing/test-driven-development`(是否必需不明确)
286
- - [FAIL] 错误:`@skills/testing/test-driven-development/SKILL.md`(会强制加载,浪费上下文)
284
+ Use skill name only, with explicit requirement markers:
285
+ - [OK] Good: `**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development`
286
+ - [OK] Good: `**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging`
287
+ - [FAIL] Bad: `See skills/testing/test-driven-development` (unclear if required)
288
+ - [FAIL] Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
287
289
 
288
- **为什么不要使用 @ 链接:** `@` 语法会立即强制加载文件,在你真正需要之前就消耗掉 20 万以上的上下文。
290
+ **Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
289
291
 
290
- ## 流程图使用
292
+ ## Flowchart Usage
291
293
 
292
294
  ```dot
293
295
  digraph when_flowchart {
294
- "需要展示信息?" [shape=diamond];
295
- "可能出错的决策点?" [shape=diamond];
296
- "使用 Markdown" [shape=box];
297
- "小型内联流程图" [shape=box];
298
-
299
- "需要展示信息?" -> "可能出错的决策点?" [label="是"];
300
- "可能出错的决策点?" -> "小型内联流程图" [label="是"];
301
- "可能出错的决策点?" -> "使用 Markdown" [label="否"];
296
+ "Need to show information?" [shape=diamond];
297
+ "Decision where I might go wrong?" [shape=diamond];
298
+ "Use markdown" [shape=box];
299
+ "Small inline flowchart" [shape=box];
300
+
301
+ "Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
302
+ "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
303
+ "Decision where I might go wrong?" -> "Use markdown" [label="no"];
302
304
  }
303
305
  ```
304
306
 
305
- **仅在以下情况使用流程图:**
306
- - 不直观的决策点
307
- - 可能过早结束的流程循环
308
- - "何时使用 A 还是 B" 的判断
307
+ **Use flowcharts ONLY for:**
308
+ - Non-obvious decision points
309
+ - Process loops where you might stop too early
310
+ - "When to use A vs B" decisions
309
311
 
310
- **切勿在以下情况使用流程图:**
311
- - 参考材料 → 使用表格、列表
312
- - 代码示例 → 使用 Markdown 代码块
313
- - 线性步骤说明 → 使用有序列表
314
- - 无语义的标签(step1、helper2)
312
+ **Never use flowcharts for:**
313
+ - Reference material → Tables, lists
314
+ - Code examples → Markdown blocks
315
+ - Linear instructions → Numbered lists
316
+ - Labels without semantic meaning (step1, helper2)
315
317
 
316
- 风格规则见本目录下的 `graphviz-conventions.dot`。
318
+ See `graphviz-conventions.dot` in this directory for graphviz style rules.
317
319
 
318
- **为你的 human partner 可视化:** 使用本目录下的 `render-graphs.js` 将技能中的流程图渲染为 SVG:
320
+ **Visualizing for your human partner:** Use `render-graphs.js` in this directory to render a skill's flowcharts to SVG:
319
321
  ```bash
320
- node ./render-graphs.js ../some-skill # 逐个单独渲染
321
- node ./render-graphs.js ../some-skill --combine # 合并到一个 SVG 中
322
+ node ./render-graphs.js ../some-skill # Each diagram separately
323
+ node ./render-graphs.js ../some-skill --combine # All diagrams in one SVG
322
324
  ```
323
325
 
324
- ## 代码示例
326
+ ## Code Examples
325
327
 
326
- **一个优秀的示例胜过多个平庸的示例**
328
+ **One excellent example beats many mediocre ones**
327
329
 
328
- 选择最相关的语言:
329
- - 测试技巧 → TypeScript/JavaScript
330
- - 系统调试 → Shell/Python
331
- - 数据处理 → Python
330
+ Choose most relevant language:
331
+ - Testing techniques → TypeScript/JavaScript
332
+ - System debugging → Shell/Python
333
+ - Data processing → Python
332
334
 
333
- **好的示例:**
334
- - 完整且可运行
335
- - 注释充分,并解释原因
336
- - 来自真实场景
337
- - 清晰展示模式
338
- - 易于改编(而非通用模板)
335
+ **Good example:**
336
+ - Complete and runnable
337
+ - Well-commented explaining WHY
338
+ - From real scenario
339
+ - Shows pattern clearly
340
+ - Ready to adapt (not generic template)
339
341
 
340
- **不要:**
341
- - 用 5 种以上语言实现
342
- - 制作填空式模板
343
- - 编写刻意的示例
342
+ **Don't:**
343
+ - Implement in 5+ languages
344
+ - Create fill-in-the-blank templates
345
+ - Write contrived examples
344
346
 
345
- 你擅长移植——一个高质量示例就足够了。
347
+ You're good at porting - one great example is enough.
346
348
 
347
- ## 文件组织
349
+ ## File Organization
348
350
 
349
- ### 自包含技能
351
+ ### Self-Contained Skill
350
352
  ```
351
353
  defense-in-depth/
352
- SKILL.md # 所有内容内联
354
+ SKILL.md # Everything inline
353
355
  ```
354
- 适用场景:所有内容都能容纳,无需重量级参考
356
+ When: All content fits, no heavy reference needed
355
357
 
356
- ### 带可复用工具的技能
358
+ ### Skill with Reusable Tool
357
359
  ```
358
360
  condition-based-waiting/
359
- SKILL.md # 概览 + 模式
360
- example.ts # 可直接改编的可用辅助函数
361
+ SKILL.md # Overview + patterns
362
+ example.ts # Working helpers to adapt
361
363
  ```
362
- 适用场景:工具是可复用的代码,而不仅仅是叙述
364
+ When: Tool is reusable code, not just narrative
363
365
 
364
- ### 带重量级参考的技能
366
+ ### Skill with Heavy Reference
365
367
  ```
366
368
  pptx/
367
- SKILL.md # 概览 + 工作流
368
- pptxgenjs.md # 600 行 API 参考
369
- ooxml.md # 500 行 XML 结构
370
- scripts/ # 可执行工具
369
+ SKILL.md # Overview + workflows
370
+ pptxgenjs.md # 600 lines API reference
371
+ ooxml.md # 500 lines XML structure
372
+ scripts/ # Executable tools
371
373
  ```
372
- 适用场景:参考材料篇幅过大,不适合内联
374
+ When: Reference material too large for inline
373
375
 
374
- 通过解释器调用随包脚本(正文中用 `bash scripts/tool.sh`、`node scripts/tool.js`),绝不用裸路径调用:部分宿主插件打包器会剥掉可执行位,裸调 `scripts/tool.sh` 会以 `Permission denied` 失败。
376
+ Invoke bundled scripts through their interpreter in the prose (`bash scripts/tool.sh`, `node scripts/tool.js`), never by bare path: some harness plugin packagers strip executable bits, and a bare `scripts/tool.sh` fails there with `Permission denied`.
375
377
 
376
- ## 铁律(与 TDD 相同)
378
+ ## The Iron Law (Same as TDD)
377
379
 
378
380
  ```
379
381
  NO SKILL WITHOUT A FAILING TEST FIRST
380
382
  ```
381
383
 
382
- 这适用于新建技能和对现有技能的编辑。
384
+ This applies to NEW skills AND EDITS to existing skills.
383
385
 
384
- 在测试之前编写技能?删掉,重来。
385
- 未测试就编辑技能?同样违规。
386
+ Write skill before testing? Delete it. Start over.
387
+ Edit skill without testing? Same violation.
386
388
 
387
- **没有例外:**
388
- - 不能因为"只是简单补充"就例外
389
- - 不能因为"只是加一节"就例外
390
- - 不能因为"只是文档更新"就例外
391
- - 不要将未经测试的改动当作"参考"保留
392
- - 测试运行时不要"边测边改"
393
- - 删除就是删除
389
+ **No exceptions:**
390
+ - Not for "simple additions"
391
+ - Not for "just adding a section"
392
+ - Not for "documentation updates"
393
+ - Don't keep untested changes as "reference"
394
+ - Don't "adapt" while running tests
395
+ - Delete means delete
394
396
 
395
- **必备前置知识:** test-driven-development 技能解释了为何这很重要,同样的原则也适用于文档。
397
+ **REQUIRED BACKGROUND:** The superpowers:test-driven-development skill explains why this matters. Same principles apply to documentation.
396
398
 
397
- ## 测试所有技能类型
399
+ ## Testing All Skill Types
398
400
 
399
- 不同类型的技能需要不同的测试方法:
401
+ Different skill types need different test approaches:
400
402
 
401
- ### 纪律约束型技能(规则/要求)
403
+ ### Discipline-Enforcing Skills (rules/requirements)
402
404
 
403
- **示例:** TDD、完成前验证、编码前设计
405
+ **Examples:** TDD, verification-before-completion, designing-before-coding
404
406
 
405
- **测试方式:**
406
- - 学术性提问:是否理解规则?
407
- - 压力场景:高压下是否仍遵守?
408
- - 多重压力叠加:时间 + 沉没成本 + 疲惫
409
- - 识别辩解话术并添加明确反制
407
+ **Test with:**
408
+ - Academic questions: Do they understand the rules?
409
+ - Pressure scenarios: Do they comply under stress?
410
+ - Multiple pressures combined: time + sunk cost + exhaustion
411
+ - Identify rationalizations and add explicit counters
410
412
 
411
- **成功标准:** agent 在最大压力下仍遵守规则
413
+ **Success criteria:** Agent follows rule under maximum pressure
412
414
 
413
- ### 技巧型技能(操作指南)
415
+ ### Technique Skills (how-to guides)
414
416
 
415
- **示例:** condition-based-waiting、root-cause-tracing、defensive-programming
417
+ **Examples:** condition-based-waiting, root-cause-tracing, defensive-programming
416
418
 
417
- **测试方式:**
418
- - 应用场景:能否正确应用该技巧?
419
- - 变体场景:能否处理边界情况?
420
- - 信息缺失测试:说明中是否存在 gaps?
419
+ **Test with:**
420
+ - Application scenarios: Can they apply the technique correctly?
421
+ - Variation scenarios: Do they handle edge cases?
422
+ - Missing information tests: Do instructions have gaps?
421
423
 
422
- **成功标准:** agent 能将技巧成功应用于新场景
424
+ **Success criteria:** Agent successfully applies technique to new scenario
423
425
 
424
- ### 模式型技能(心智模型)
426
+ ### Pattern Skills (mental models)
425
427
 
426
- **示例:** reducing-complexity、information-hiding 相关概念
428
+ **Examples:** reducing-complexity, information-hiding concepts
427
429
 
428
- **测试方式:**
429
- - 识别场景:能否识别模式的适用时机?
430
- - 应用场景:能否运用该心智模型?
431
- - 反例:是否知道何时不应使用?
430
+ **Test with:**
431
+ - Recognition scenarios: Do they recognize when pattern applies?
432
+ - Application scenarios: Can they use the mental model?
433
+ - Counter-examples: Do they know when NOT to apply?
432
434
 
433
- **成功标准:** agent 能正确判断何时/如何应用该模式
435
+ **Success criteria:** Agent correctly identifies when/how to apply pattern
434
436
 
435
- ### 参考型技能(文档/API)
437
+ ### Reference Skills (documentation/APIs)
436
438
 
437
- **示例:** API 文档、命令参考、库指南
439
+ **Examples:** API documentation, command references, library guides
438
440
 
439
- **测试方式:**
440
- - 检索场景:能否找到正确信息?
441
- - 应用场景:能否正确使用检索到的信息?
442
- - Gap 测试:常见用例是否已覆盖?
441
+ **Test with:**
442
+ - Retrieval scenarios: Can they find the right information?
443
+ - Application scenarios: Can they use what they found correctly?
444
+ - Gap testing: Are common use cases covered?
443
445
 
444
- **成功标准:** agent 能找到并正确应用参考信息
446
+ **Success criteria:** Agent finds and correctly applies reference information
445
447
 
446
- ## 跳过测试的常见借口
448
+ ## Common Rationalizations for Skipping Testing
447
449
 
448
- | 借口 | 现实 |
450
+ | Excuse | Reality |
449
451
  |--------|---------|
450
- | "技能已经足够清晰" | 对你清晰 ≠ 对其他 agent 清晰,必须测试。 |
451
- | "这只是个参考" | 参考也可能存在缺口、表述不清,需要测试检索效果。 |
452
- | "测试太小题大做" | 未经测试的技能一定有问题,15 分钟测试能节省数小时。 |
453
- | "有问题再测" | 问题 = agent 无法使用该技能,部署前就必须测试。 |
454
- | "测试太繁琐" | 测试的繁琐程度远低于在生产环境调试有缺陷技能的痛苦。 |
455
- | "我很有把握没问题" | 过度自信必然导致问题,仍需测试。 |
456
- | "学术性审查就够了" | 阅读 ≠ 会用,必须测试应用场景。 |
457
- | "没时间测试" | 部署未经测试的技能,后续修复会浪费更多时间。 |
452
+ | "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. |
453
+ | "It's just a reference" | References can have gaps, unclear sections. Test retrieval. |
454
+ | "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. |
455
+ | "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
456
+ | "Too tedious to test" | Testing is less tedious than debugging bad skill in production. |
457
+ | "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. |
458
+ | "Academic review is enough" | Reading ≠ using. Test application scenarios. |
459
+ | "No time to test" | Deploying untested skill wastes more time fixing it later. |
458
460
 
459
- **以上所有情况都意味着:部署前必须测试,没有例外。**
461
+ **All of these mean: Test before deploying. No exceptions.**
460
462
 
461
- ## 让形式匹配失效类型
463
+ ## Match the Form to the Failure
462
464
 
463
- 在编写指引前,先对基线失效进行分类。针对一种失效类型有效的形式,用在另一种类型上会明显适得其反。
465
+ Before writing guidance, classify the baseline failure. The form that bulletproofs one failure type measurably backfires on another.
464
466
 
465
- | 基线失效 | 正确形式 | 错误形式 |
467
+ | Baseline failure | Right form | Wrong form |
466
468
  |---|---|---|
467
- | 在压力下跳过/违反规则(明知故犯) | 禁止项 + 辩解对照表 + 危险信号(见下文加固方法) | 软性指引("尽量..."、"考虑...") |
468
- | 遵守了,但输出形态错误(prompt臃肿、结论被淹没、复述需求) | 正向配方或契约:明确输出是什么——包含哪些部分、按什么顺序 | 禁止清单("不要复述"、"切勿叙述") |
469
- | 对已产出内容遗漏了必需元素 | 结构化:模板中设置必填字段或槽位 | 模板附近的文字提醒 |
470
- | 行为应取决于某个条件 | 以可观察谓词为键的条件式("如果 brief 存在,则引用它") | 无条件规则 + 例外条款 |
469
+ | Skips/violates a rule under pressure (knows better, does it anyway) | Prohibition + rationalization table + red flags (see Bulletproofing below) | Soft guidance ("prefer...", "consider...") |
470
+ | Complies, but output has the wrong shape (bloated prompt, buried verdict, restated spec) | Positive recipe or contract: state what the output IS — its parts, in order | Prohibition list ("don't restate", "never narrate") |
471
+ | Omits a required element from something they already produce | Structural: REQUIRED field or slot in the template they fill in | Prose reminders near the template |
472
+ | Behavior should depend on a condition | Conditional keyed to an observable predicate ("if the brief exists, reference it") | Unconditional rule + exemption clauses |
471
473
 
472
- **为什么禁止项在形态塑造问题上会适得其反:** 在竞争性动机("让prompt自包含")的影响下,agent 会与"不要做 X"进行博弈。在针对分发prompt指引的措辞对比测试中,禁止式措辞比配方式产生了明显更多的非期望内容,甚至比无指引的对照组表现更差——请对你自己的场景做微观测试而非想当然,但切勿默认使用禁止式。配方式无可博弈:输出要么符合既定形态,要么不符合。
474
+ **Why prohibitions backfire on shaping problems:** under a competing incentive ("make the prompt self-contained"), agents negotiate with "don't X". In head-to-head wording tests on dispatch-prompt guidance, the prohibition arm produced clearly more of the unwanted content than the recipe arm (fully separated distributions), and trended worse than even the no-guidance control — micro-test your own case rather than assuming, but never reach for the prohibition by default. A recipe leaves nothing to negotiate: the output matches the stated shape or it doesn't.
473
475
 
474
- **无论选择哪种形式,都需遵守以下规则:**
475
- - **不要加细腻化条款。** "除非有必要否则不要做 X" 会重新打开博弈空间——在同一措辞测试中,给获胜配方追加一条细腻化条款,就使其从稳定表现退化为不稳定。真正的例外应表述为基于可观察谓词的独立条件式。
476
- - **豁免条款不会自动限定范围。** "此限制不适用于代码块" 仍会抑制代码块的生成。如果部分输出必须豁免,应重构规则使其无法触及该部分。
476
+ **Rules for whichever form you pick:**
477
+ - **No nuance clauses.** "Don't X unless it matters" reopens the negotiation — appending a single nuance clause to a winning recipe degraded it from consistent to noisy in the same wording tests. Express a real exception as its own conditional on an observable predicate.
478
+ - **Exemption clauses don't scope.** "This limit doesn't apply to code blocks" still suppresses code blocks. If part of the output must be exempt, restructure so the rule can't reach it.
477
479
 
478
- ## 加固技能以抵御辩解
480
+ ## Bulletproofing Skills Against Rationalization
479
481
 
480
- 需要强制执行纪律的技能(如 TDD)必须能抵御辩解。agent 很聪明,在压力下会找到漏洞。
482
+ Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
481
483
 
482
- **适用范围:** 本工具箱适用于纪律性失效——agent 明知规则却在压力下跳过。对于输出形态错误或要素遗漏问题,基于禁止的加固会适得其反;请改用上一节"让形式匹配失效类型"中的形式。
484
+ **Scope:** this toolkit is for discipline failures — an agent that knows the rule and skips it under pressure. For wrong-shaped output or omitted elements, prohibition-based bulletproofing backfires; use the forms in Match the Form to the Failure instead.
483
485
 
484
- **心理学提示:** 理解说服技巧为何有效,有助于你系统化地运用它们。研究基础(Cialdini, 2021; Meincke et al., 2025)涵盖权威、承诺、稀缺、社会认同和统一性原则,详见 persuasion-principles.md。
486
+ **Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
485
487
 
486
- ### 明确堵住每一个漏洞
488
+ ### Close Every Loophole Explicitly
487
489
 
488
- 不要只陈述规则——要明确禁止具体的绕过方式:
490
+ Don't just state the rule - forbid specific workarounds:
489
491
 
490
492
  <Bad>
491
493
  ```markdown
492
- 在写测试之前就写了代码?删掉。
494
+ Write code before test? Delete it.
493
495
  ```
494
496
  </Bad>
495
497
 
496
498
  <Good>
497
499
  ```markdown
498
- 在写测试之前就写了代码?删掉,重来。
500
+ Write code before test? Delete it. Start over.
499
501
 
500
- **没有例外:**
501
- - 不要将其保留为"参考"
502
- - 不要在写测试时"改编"它
503
- - 不要去看它
504
- - 删除就是删除
502
+ **No exceptions:**
503
+ - Don't keep it as "reference"
504
+ - Don't "adapt" it while writing tests
505
+ - Don't look at it
506
+ - Delete means delete
505
507
  ```
506
508
  </Good>
507
509
 
508
- ### 应对"精神 vs 文字" 的诡辩
510
+ ### Address "Spirit vs Letter" Arguments
509
511
 
510
- 在开头加入基础原则:
512
+ Add foundational principle early:
511
513
 
512
514
  ```markdown
513
- **违反规则的字面含义,就是违反规则的精神。**
515
+ **Violating the letter of the rules is violating the spirit of the rules.**
514
516
  ```
515
517
 
516
- 这能一次性堵住整类"我遵循的是精神"的辩解。
518
+ This cuts off entire class of "I'm following the spirit" rationalizations.
517
519
 
518
- ### 构建辩解对照表
520
+ ### Build Rationalization Table
519
521
 
520
- 捕获基线测试中的辩解话术(见下文测试一节)。agent 提出的每一个借口都要进入表格:
522
+ Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
521
523
 
522
524
  ```markdown
523
- | 借口 | 现实 |
525
+ | Excuse | Reality |
524
526
  |--------|---------|
525
- | "太简单了不用测" | 简单的代码也会出错,测试只需 30 秒。 |
526
- | "我之后会补测试" | 立即通过的测试毫无证明力。 |
527
- | "后补测试也能达到同样目的" | 后补测试回答的是"它做了什么?",先写测试回答的是"它应该做什么?" |
527
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
528
+ | "I'll test after" | Tests passing immediately prove nothing. |
529
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
528
530
  ```
529
531
 
530
- ### 创建危险信号清单
532
+ ### Create Red Flags List
531
533
 
532
- 让 agent 易于自检是否正在为自己辩解:
534
+ Make it easy for agents to self-check when rationalizing:
533
535
 
534
536
  ```markdown
535
- ## 危险信号 - 立即停止并重来
537
+ ## Red Flags - STOP and Start Over
536
538
 
537
- - 在测试之前写了代码
538
- - "我已经手动测试过了"
539
- - "后补测试也能达到同样目的"
540
- - "重在精神而非仪式"
541
- - "这次情况特殊,因为..."
539
+ - Code before test
540
+ - "I already manually tested it"
541
+ - "Tests after achieve the same purpose"
542
+ - "It's about spirit not ritual"
543
+ - "This is different because..."
542
544
 
543
- **以上所有情况都意味着:删除代码,从 TDD 重新开始。**
545
+ **All of these mean: Delete code. Start over with TDD.**
544
546
  ```
545
547
 
546
- ### 更新 SDO 以覆盖违规前兆
548
+ ### Update SDO for Violation Symptoms
547
549
 
548
- 在 description 中加入即将违规时的症状:
550
+ Add to description: symptoms of when you're ABOUT to violate the rule:
549
551
 
550
552
  ```yaml
551
553
  description: use when implementing any feature or bugfix, before writing implementation code
552
554
  ```
553
555
 
554
- ## 技能的 红-绿-重构
556
+ ## RED-GREEN-REFACTOR for Skills
555
557
 
556
- 遵循 TDD 循环:
558
+ Follow the TDD cycle:
557
559
 
558
- ### 红:编写失败的测试(基线)
560
+ ### RED: Write Failing Test (Baseline)
559
561
 
560
- 在不带技能的情况下用 subagent 运行压力场景,记录确切行为:
561
- - 它们做了什么选择?
562
- - 使用了什么辩解话术(逐字记录)?
563
- - 哪些压力触发了违规?
562
+ Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
563
+ - What choices did they make?
564
+ - What rationalizations did they use (verbatim)?
565
+ - Which pressures triggered violations?
564
566
 
565
- 这就是"观察测试失败"——在编写技能之前,你必须看到 agent 的自然行为。
567
+ This is "watch the test fail" - you must see what agents naturally do before writing the skill.
566
568
 
567
- ### 绿:编写最小化技能
569
+ ### GREEN: Write Minimal Skill
568
570
 
569
- 编写针对上述具体辩解的技能,不要为假想情况添加额外内容。
571
+ Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.
570
572
 
571
- 在带技能的情况下运行相同场景,agent 现在应能遵守规则。
573
+ Run same scenarios WITH skill. Agent should now comply.
572
574
 
573
- ### 重构:堵住漏洞
575
+ ### REFACTOR: Close Loopholes
574
576
 
575
- agent 找到了新的辩解?添加明确的反制措施,重新测试直至坚不可摧。
577
+ Agent found new rationalization? Add explicit counter. Re-test until bulletproof.
576
578
 
577
- ### 在完整场景之前先做措辞微观测试
579
+ ### Micro-Test Wording Before Full Scenarios
578
580
 
579
- 完整的压力场景运行是最终关卡,但每次迭代都跑全量既慢又贵。在措辞层面先用微观测试验证:
581
+ Full pressure-scenario runs are the final gate, but they are slow and expensive per iteration. Verify the wording itself first with micro-tests:
580
582
 
581
- 1. **每次调用一个全新上下文样本**——一次原生 API 调用,或在无 API 访问时使用单次 subagent。系统提示 = 指引实际所处的真实上下文(完整的技能或提示模板,而非孤立的指引);用户消息 = 会诱发失效的任务。
582
- 2. **始终包含无指引对照组。** 如果对照组没有出现失效,就说明没有需要修复的问题——立即停止,不要编写指引。
583
- 3. **每个变体至少 5 次重复。** 单次样本会误导。
584
- 4. **逐一人工复核每个被标记的命中。** 可以用程序化评分,但模板回声和引用的反例会被误判为命中;仅靠自动化计数会同时高估失败率和成功率。
585
- 5. **方差本身就是指标。** 当指引有效时,多次重复会收敛到同一种形态;五次重复出现五种不同解读,说明措辞不具备约束力——应先收紧形式,而非堆砌文字。
583
+ 1. **One fresh-context sample per call** — a raw API call, or a single-shot subagent if you don't have API access. System prompt = the realistic context the guidance will live in (the full skill or prompt template, not the guidance in isolation); user message = a task that tempts the failure.
584
+ 2. **Always include a no-guidance control.** If the control doesn't exhibit the failure, there is nothing to fix — stop, don't author the guidance.
585
+ 3. **5+ reps per variant.** Single samples lie.
586
+ 4. **Manually read every flagged match.** Score programmatically if you like, but template echoes and quoted counter-examples masquerade as hits; automated counts alone overstate both failure and success.
587
+ 5. **Variance is a metric.** When guidance lands, reps converge on the same shape. Five different interpretations across five reps means the wording isn't binding — tighten the form before adding words.
586
588
 
587
- 微观测试验证措辞,它们不能替代纪律型技能所需的压力场景测试。
589
+ Micro-tests verify wording; they do not replace pressure scenarios for discipline skills.
588
590
 
589
- **测试方法论:** 完整测试方法见 [testing-skills-with-subagents.md](testing-skills-with-subagents.md):
590
- - 如何编写压力场景
591
- - 压力类型(时间、沉没成本、权威、疲惫)
592
- - 系统化堵洞
593
- - 元测试技术
591
+ **Testing methodology:** See [testing-skills-with-subagents.md](testing-skills-with-subagents.md) for the complete testing methodology:
592
+ - How to write pressure scenarios
593
+ - Pressure types (time, sunk cost, authority, exhaustion)
594
+ - Plugging holes systematically
595
+ - Meta-testing techniques
594
596
 
595
- ## 反模式
597
+ ## Anti-Patterns
596
598
 
597
- ### [FAIL] 叙事性示例
599
+ ### [FAIL] Narrative Example
598
600
  "In session 2025-10-03, we found empty projectDir caused..."
599
- **为何不好:** 过于具体,不可复用
601
+ **Why bad:** Too specific, not reusable
600
602
 
601
- ### [FAIL] 多语言稀释
602
- example-js.js、example-py.py、example-go.go
603
- **为何不好:** 质量平庸,维护负担重
603
+ ### [FAIL] Multi-Language Dilution
604
+ example-js.js, example-py.py, example-go.go
605
+ **Why bad:** Mediocre quality, maintenance burden
604
606
 
605
- ### [FAIL] 在流程图中使用代码
607
+ ### [FAIL] Code in Flowcharts
606
608
  ```dot
607
609
  step1 [label="import fs"];
608
610
  step2 [label="read file"];
609
611
  ```
610
- **为何不好:** 无法复制粘贴,难以阅读
611
-
612
- ### [FAIL] 通用标签
613
- helper1、helper2、step3、pattern4
614
- **为何不好:** 标签应具有语义含义
615
-
616
- ## 停止:在进入下一个技能之前
617
-
618
- **编写完任何技能后,你必须停下来并完成部署流程。**
619
-
620
- **不要:**
621
- - 未逐个测试就批量创建多个技能
622
- - 在当前技能验证完成前就进入下一个
623
- - 以"批量更高效"为由跳过测试
624
-
625
- **以下部署清单对每个技能都是强制性的。**
626
-
627
- 部署未经测试的技能 = 部署未经测试的代码,这违反了质量标准。
628
-
629
- ## 技能创建清单(TDD 适配版)
630
-
631
- **重要:为下方每个清单项创建一个 todo。**
632
-
633
- **红阶段 - 编写失败的测试:**
634
- - [ ] 创建压力场景(纪律型技能需包含 3 种以上复合压力)
635
- - [ ] 在无技能情况下运行场景——逐字记录基线行为
636
- - [ ] 识别辩解话术/失败中的模式
637
-
638
- **绿阶段 - 编写最小化技能:**
639
- - [ ] 名称仅使用字母、数字、连字符(不含括号/特殊字符)
640
- - [ ] YAML frontmatter 包含必填的 `name` 和 `description` 字段(总计不超过 1024 字符;见 [规范](https://agentskills.io/specification))
641
- - [ ] Description 以 "Use when..." 开头,并包含具体的触发条件/症状
642
- - [ ] Description 使用第三人称
643
- - [ ] 全文包含便于搜索的关键词(错误、症状、工具)
644
- - [ ] 清晰的概览与核心原则
645
- - [ ] 针对红阶段发现的具体基线失效进行处理
646
- - [ ] 指引形式与失效类型匹配(见"让形式匹配失效类型")
647
- - [ ] 对于行为塑造类指引:措辞已通过微观测试验证(与无指引对照组对比,5 次以上重复,每个命中均人工复核)—— 纯参考型技能可标记为 N/A
648
- - [ ] 代码内联或链接到独立文件
649
- - [ ] 一个高质量示例(而非多语言示例)
650
- - [ ] 在有技能情况下运行场景——验证 agent 现在已遵守
651
-
652
- **重构阶段 - 堵住漏洞:**
653
- - [ ] 识别测试中出现的新辩解
654
- - [ ] 添加明确反制(如果是纪律型技能)
655
- - [ ] 基于所有测试轮次构建辩解对照表
656
- - [ ] 创建危险信号清单
657
- - [ ] 反复重测直至坚不可摧
658
-
659
- **质量检查:**
660
- - [ ] 仅在决策不直观时使用小型流程图
661
- - [ ] 包含快速参考表格
662
- - [ ] 包含常见错误一节
663
- - [ ] 无叙事性讲述
664
- - [ ] 仅在需要工具或重量级参考时才添加支撑文件
665
-
666
- **部署:**
667
- - [ ] 将技能提交到 git 并推送到你的 fork(如果已配置)
668
- - [ ] 考虑通过 PR 回馈上游(如果具有普适价值)
669
-
670
- ## 发现工作流
671
-
672
- 未来 agent 发现你技能的流程:
673
-
674
- 1. **遇到问题**("测试不稳定")
675
- 2. **搜索技能**(grep description、浏览分类)
676
- 3. **找到技能**(description 匹配)
677
- 4. **浏览概览**(判断是否相关?)
678
- 5. **阅读模式**(快速参考表)
679
- 6. **加载示例**(仅在实际实现时)
680
-
681
- **针对此流程进行优化** - 将可搜索的关键词前置并高频出现。
612
+ **Why bad:** Can't copy-paste, hard to read
613
+
614
+ ### [FAIL] Generic Labels
615
+ helper1, helper2, step3, pattern4
616
+ **Why bad:** Labels should have semantic meaning
617
+
618
+ ## STOP: Before Moving to Next Skill
619
+
620
+ **After writing ANY skill, you MUST STOP and complete the deployment process.**
621
+
622
+ **Do NOT:**
623
+ - Create multiple skills in batch without testing each
624
+ - Move to next skill before current one is verified
625
+ - Skip testing because "batching is more efficient"
626
+
627
+ **The deployment checklist below is MANDATORY for EACH skill.**
628
+
629
+ Deploying untested skills = deploying untested code. It's a violation of quality standards.
630
+
631
+ ## Skill Creation Checklist (TDD Adapted)
632
+
633
+ **IMPORTANT: Create a todo for EACH checklist item below.**
634
+
635
+ **RED Phase - Write Failing Test:**
636
+ - [ ] Create pressure scenarios (3+ combined pressures for discipline skills)
637
+ - [ ] Run scenarios WITHOUT skill - document baseline behavior verbatim
638
+ - [ ] Identify patterns in rationalizations/failures
639
+
640
+ **GREEN Phase - Write Minimal Skill:**
641
+ - [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars)
642
+ - [ ] YAML frontmatter with required `name` and `description` fields (max 1024 chars; see [spec](https://agentskills.io/specification))
643
+ - [ ] Description starts with "Use when..." and includes specific triggers/symptoms
644
+ - [ ] Description written in third person
645
+ - [ ] Keywords throughout for search (errors, symptoms, tools)
646
+ - [ ] Clear overview with core principle
647
+ - [ ] Address specific baseline failures identified in RED
648
+ - [ ] Guidance form matches the failure type (see Match the Form to the Failure)
649
+ - [ ] For behavior-shaping guidance: wording micro-tested against a no-guidance control (5+ reps, every flagged match read manually) — N/A for pure reference skills
650
+ - [ ] Code inline OR link to separate file
651
+ - [ ] One excellent example (not multi-language)
652
+ - [ ] Run scenarios WITH skill - verify agents now comply
653
+
654
+ **REFACTOR Phase - Close Loopholes:**
655
+ - [ ] Identify NEW rationalizations from testing
656
+ - [ ] Add explicit counters (if discipline skill)
657
+ - [ ] Build rationalization table from all test iterations
658
+ - [ ] Create red flags list
659
+ - [ ] Re-test until bulletproof
660
+
661
+ **Quality Checks:**
662
+ - [ ] Small flowchart only if decision non-obvious
663
+ - [ ] Quick reference table
664
+ - [ ] Common mistakes section
665
+ - [ ] No narrative storytelling
666
+ - [ ] Supporting files only for tools or heavy reference
667
+
668
+ **Deployment:**
669
+ - [ ] Commit skill to git and push to your fork (if configured)
670
+ - [ ] Consider contributing back via PR (if broadly useful)
671
+
672
+ ## Discovery Workflow
673
+
674
+ How future agents find your skill:
675
+
676
+ 1. **Encounters problem** ("tests are flaky")
677
+ 2. **Searches skills** (greps descriptions, browses categories)
678
+ 3. **Finds SKILL** (description matches)
679
+ 4. **Scans overview** (is this relevant?)
680
+ 5. **Reads patterns** (quick reference table)
681
+ 6. **Loads example** (only when implementing)
682
+
683
+ **Optimize for this flow** - put searchable terms early and often.