sdd-full 4.2.0 → 4.3.0
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.
- package/bin.js +31 -63
- package/package.json +1 -1
- package/skills/README.md +97 -0
- package/skills/call-adaptation/SKILL.md +23 -0
- package/skills/call-adaptation/call-adaptation-guide.md +136 -0
- package/skills/call-adaptation/claude-code-call-spec.md +50 -0
- package/skills/call-adaptation/trae-call-spec.md +56 -0
- package/skills/checklist.md +154 -0
- package/skills/design-planning/ai-coding-rules/SKILL.md +52 -0
- package/skills/design-planning/design-to-code/SKILL.md +53 -0
- package/skills/design-planning/enterprise-spec/SKILL.md +52 -3
- package/skills/design-planning/flutter-av/SKILL.md +44 -34
- package/skills/design-planning/flutter-map/SKILL.md +41 -31
- package/skills/design-planning/function-sdd/SKILL.md +54 -0
- package/skills/design-planning/sdd-code/SKILL.md +347 -0
- package/skills/design-planning/sdd-deploy/SKILL.md +501 -0
- package/skills/design-planning/sdd-ops/SKILL.md +306 -0
- package/skills/design-planning/sdd-test/SKILL.md +383 -0
- package/skills/design-planning/ui-sdd/SKILL.md +291 -0
- package/skills/design-planning/ui-sdd-specialized/SKILL.md +46 -40
- package/skills/design-planning/writing-plans/SKILL.md +144 -0
- package/skills/development-execution/flutter-errors/SKILL.md +44 -34
- package/skills/development-execution/sdd-add/SKILL.md +540 -0
- package/skills/development-execution/systematic-debugging/SKILL.md +298 -0
- package/skills/development-execution/test-driven-development/SKILL.md +373 -0
- package/skills/development-execution/verification-before-completion/SKILL.md +141 -0
- package/skills/knowledge-precipitation/claudeception/SKILL.md +96 -0
- package/skills/knowledge-precipitation/mempalace-auto-saver/SKILL.md +302 -0
- package/skills/quality-assurance/bdd-acceptance/SKILL.md +44 -37
- package/skills/quality-assurance/flutter-test/SKILL.md +56 -0
- package/skills/quality-assurance/quality-gate/SKILL.md +350 -0
- package/skills/quality-assurance/security-audit/SKILL.md +386 -0
- package/skills/release-ops/finishing-a-development-branch/SKILL.md +202 -0
- package/skills/release-ops/release-flow/SKILL.md +404 -0
- package/skills/requirement-analysis/brainstorming/SKILL.md +166 -0
- package/skills/requirement-analysis/competitive-brief/SKILL.md +121 -0
- package/skills/requirement-analysis/market-research/SKILL.md +143 -0
- package/skills/requirement-analysis/prd-write/SKILL.md +111 -0
- package/skills/requirement-analysis/requirement-completion-officer/SKILL.md +124 -0
- package/skills/requirement-analysis/sdd/SKILL.md +1044 -0
- package/skills/requirement-analysis/sdd-full/SKILL.md +717 -36
- package/skills/requirement-analysis/unified-flow/SKILL.md +128 -26
- package/skills/rules/project_rules.md +167 -0
- package/skills/rules/user_rules.md +254 -69
- package/skills/special-tools/env-check/SKILL.md +40 -34
- package/skills/special-tools/receiving-code-review/SKILL.md +215 -0
- package/skills/special-tools/requesting-code-review/SKILL.md +107 -0
- package/skills/special-tools/using-superpowers/SKILL.md +117 -0
- package/skills/templates/API-SDD.md +31 -0
- package/skills/templates/Andrej Karpathy AI/347/274/226/347/240/201/350/247/204/345/210/231/350/220/275/345/234/260SDD.md" +117 -0
- package/skills/templates/BDD/351/243/216/346/240/274/351/252/214/346/224/266/346/240/207/345/207/206SDD.md +147 -0
- package/skills/templates/Base-SDD.md +38 -0
- package/skills/templates/Brain-SDD.md +36 -0
- package/skills/templates/Code-SDD.md +41 -0
- package/skills/templates/Competitor-SDD.md +34 -0
- package/skills/templates/Env-SDD.md +37 -0
- package/skills/templates/Flutter/345/205/250/347/261/273/345/236/213/346/265/213/350/257/225/347/255/226/347/225/245SDD.md +162 -0
- package/skills/templates/Flutter/345/234/260/345/233/276/345/257/274/350/210/252/344/270/232/345/212/241SDD.md +136 -0
- package/skills/templates/Flutter/345/270/270/350/247/201/345/274/202/345/270/270/344/270/223/351/241/271SDD.md +159 -0
- package/skills/templates/Flutter/351/237/263/350/247/206/351/242/221/345/205/250/346/240/210SDD.md +121 -0
- package/skills/templates/PRD-SDD.md +45 -0
- package/skills/templates/SKILL.md +91 -0
- package/skills/templates/Test-SDD.md +34 -0
- package/skills/templates/UI-SDD.md +38 -0
- package/skills/templates/UI-SDD/344/270/223/347/224/250/346/250/241/346/235/277.md +141 -0
- package/skills/templates/UI/350/265/204/346/272/220/346/217/220/347/244/272/350/257/215/347/224/237/346/210/220SDD.md +67 -0
- package/skills/templates//344/274/201/344/270/232/347/272/247/345/205/250/346/240/210/345/267/245/347/250/213/350/247/204/350/214/203SDD.md +152 -0
- package/skills/templates//345/205/250/346/265/201/347/250/213SDD/350/236/215/345/220/210/344/275/223/347/263/273.md +198 -0
- package/skills/templates//345/212/237/350/203/275SDD/344/270/223/347/224/250/346/250/241/346/235/277.md +132 -0
- package/skills/templates//347/216/257/345/242/203/351/242/204/346/243/200/346/240/207/345/207/206/345/214/226SDD.md +153 -0
- package/skills/templates//351/253/230/344/277/235/347/234/237/350/256/276/350/256/241/350/275/254/344/273/243/347/240/201SDD.md +119 -0
- package/skills//345/256/214/346/225/264/345/274/200/345/217/221/346/265/201/347/250/213/346/211/213/345/206/214.md +408 -0
- package/skills//346/212/200/350/203/275/344/275/223/347/263/273/345/256/214/345/226/204/345/273/272/350/256/256.md +305 -0
- package/skills//346/212/200/350/203/275/344/275/277/347/224/250/346/214/207/345/215/227.md +285 -0
- package/skills//346/212/200/350/203/275/345/206/263/347/255/226/346/240/221.md +320 -0
- package/skills/brainstorming/SKILL.md +0 -164
- package/skills/brainstorming/scripts/frame-template.html +0 -214
- package/skills/brainstorming/scripts/helper.js +0 -88
- package/skills/brainstorming/scripts/server.cjs +0 -338
- package/skills/brainstorming/scripts/start-server.sh +0 -153
- package/skills/brainstorming/scripts/stop-server.sh +0 -55
- package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -48
- package/skills/brainstorming/visual-companion.md +0 -286
- package/skills/chinese-code-review/SKILL.md +0 -277
- package/skills/chinese-commit-conventions/SKILL.md +0 -364
- package/skills/chinese-documentation/SKILL.md +0 -448
- package/skills/chinese-git-workflow/SKILL.md +0 -510
- package/skills/dispatching-parallel-agents/SKILL.md +0 -182
- package/skills/executing-plans/SKILL.md +0 -175
- package/skills/finishing-a-development-branch/SKILL.md +0 -200
- package/skills/mcp-builder/SKILL.md +0 -255
- package/skills/receiving-code-review/SKILL.md +0 -213
- package/skills/requesting-code-review/SKILL.md +0 -105
- package/skills/requesting-code-review/code-reviewer.md +0 -146
- package/skills/rules/skill-map.md +0 -97
- package/skills/subagent-driven-development/SKILL.md +0 -277
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -26
- package/skills/subagent-driven-development/implementer-prompt.md +0 -113
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -61
- package/skills/systematic-debugging/CREATION-LOG.md +0 -119
- package/skills/systematic-debugging/SKILL.md +0 -296
- package/skills/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/skills/systematic-debugging/condition-based-waiting.md +0 -115
- package/skills/systematic-debugging/defense-in-depth.md +0 -122
- package/skills/systematic-debugging/find-polluter.sh +0 -63
- package/skills/systematic-debugging/root-cause-tracing.md +0 -169
- package/skills/systematic-debugging/test-academic.md +0 -14
- package/skills/systematic-debugging/test-pressure-1.md +0 -58
- package/skills/systematic-debugging/test-pressure-2.md +0 -68
- package/skills/systematic-debugging/test-pressure-3.md +0 -69
- package/skills/test-driven-development/SKILL.md +0 -371
- package/skills/test-driven-development/testing-anti-patterns.md +0 -299
- package/skills/using-git-worktrees/SKILL.md +0 -218
- package/skills/using-superpowers/SKILL.md +0 -134
- package/skills/using-superpowers/references/codex-tools.md +0 -25
- package/skills/using-superpowers/references/gemini-tools.md +0 -33
- package/skills/verification-before-completion/SKILL.md +0 -139
- package/skills/workflow-runner/SKILL.md +0 -172
- package/skills/writing-plans/SKILL.md +0 -152
- package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
- package/skills/writing-skills/SKILL.md +0 -654
- package/skills/writing-skills/anthropic-best-practices.md +0 -1149
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
- package/skills/writing-skills/graphviz-conventions.dot +0 -172
- package/skills/writing-skills/persuasion-principles.md +0 -187
- package/skills/writing-skills/render-graphs.js +0 -168
- package/skills/writing-skills/testing-skills-with-subagents.md +0 -384
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: subagent-driven-development
|
|
3
|
-
description: 当在当前会话中执行包含独立任务的实现计划时使用
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 子智能体驱动开发
|
|
7
|
-
|
|
8
|
-
通过为每个任务分派一个全新的子智能体来执行计划,每个任务完成后进行两阶段审查:先审查规格合规性,再审查代码质量。
|
|
9
|
-
|
|
10
|
-
**为什么用子智能体:** 你将任务委派给具有隔离上下文的专用智能体。通过精心设计它们的指令和上下文,确保它们专注并成功完成任务。它们不应继承你的会话上下文或历史记录——你要精确构造它们所需的一切。这样也能为你自己保留用于协调工作的上下文。
|
|
11
|
-
|
|
12
|
-
**核心原则:** 每个任务一个全新子智能体 + 两阶段审查(先规格后质量)= 高质量、快速迭代
|
|
13
|
-
|
|
14
|
-
## 何时使用
|
|
15
|
-
|
|
16
|
-
```dot
|
|
17
|
-
digraph when_to_use {
|
|
18
|
-
"有实现计划?" [shape=diamond];
|
|
19
|
-
"任务基本独立?" [shape=diamond];
|
|
20
|
-
"留在当前会话?" [shape=diamond];
|
|
21
|
-
"subagent-driven-development" [shape=box];
|
|
22
|
-
"executing-plans" [shape=box];
|
|
23
|
-
"手动执行或先头脑风暴" [shape=box];
|
|
24
|
-
|
|
25
|
-
"有实现计划?" -> "任务基本独立?" [label="是"];
|
|
26
|
-
"有实现计划?" -> "手动执行或先头脑风暴" [label="否"];
|
|
27
|
-
"任务基本独立?" -> "留在当前会话?" [label="是"];
|
|
28
|
-
"任务基本独立?" -> "手动执行或先头脑风暴" [label="否 - 紧密耦合"];
|
|
29
|
-
"留在当前会话?" -> "subagent-driven-development" [label="是"];
|
|
30
|
-
"留在当前会话?" -> "executing-plans" [label="否 - 并行会话"];
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**与 Executing Plans(并行会话)的对比:**
|
|
35
|
-
- 同一会话(无上下文切换)
|
|
36
|
-
- 每个任务全新子智能体(无上下文污染)
|
|
37
|
-
- 每个任务后两阶段审查:先规格合规性,再代码质量
|
|
38
|
-
- 更快的迭代(任务间无需人工介入)
|
|
39
|
-
|
|
40
|
-
## 流程
|
|
41
|
-
|
|
42
|
-
```dot
|
|
43
|
-
digraph process {
|
|
44
|
-
rankdir=TB;
|
|
45
|
-
|
|
46
|
-
subgraph cluster_per_task {
|
|
47
|
-
label="每个任务";
|
|
48
|
-
"分派实现子智能体 (./implementer-prompt.md)" [shape=box];
|
|
49
|
-
"实现子智能体有疑问?" [shape=diamond];
|
|
50
|
-
"回答问题,提供上下文" [shape=box];
|
|
51
|
-
"实现子智能体实现、测试、提交、自审" [shape=box];
|
|
52
|
-
"分派规格审查子智能体 (./spec-reviewer-prompt.md)" [shape=box];
|
|
53
|
-
"规格审查子智能体确认代码匹配规格?" [shape=diamond];
|
|
54
|
-
"实现子智能体修复规格差距" [shape=box];
|
|
55
|
-
"分派代码质量审查子智能体 (./code-quality-reviewer-prompt.md)" [shape=box];
|
|
56
|
-
"代码质量审查子智能体通过?" [shape=diamond];
|
|
57
|
-
"实现子智能体修复质量问题" [shape=box];
|
|
58
|
-
"在 TodoWrite 中标记任务完成" [shape=box];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
"读取计划,提取所有任务的完整文本,记录上下文,创建 TodoWrite" [shape=box];
|
|
62
|
-
"还有剩余任务?" [shape=diamond];
|
|
63
|
-
"分派最终代码审查子智能体审查整体实现" [shape=box];
|
|
64
|
-
"使用 superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
|
|
65
|
-
|
|
66
|
-
"读取计划,提取所有任务的完整文本,记录上下文,创建 TodoWrite" -> "分派实现子智能体 (./implementer-prompt.md)";
|
|
67
|
-
"分派实现子智能体 (./implementer-prompt.md)" -> "实现子智能体有疑问?";
|
|
68
|
-
"实现子智能体有疑问?" -> "回答问题,提供上下文" [label="是"];
|
|
69
|
-
"回答问题,提供上下文" -> "分派实现子智能体 (./implementer-prompt.md)";
|
|
70
|
-
"实现子智能体有疑问?" -> "实现子智能体实现、测试、提交、自审" [label="否"];
|
|
71
|
-
"实现子智能体实现、测试、提交、自审" -> "分派规格审查子智能体 (./spec-reviewer-prompt.md)";
|
|
72
|
-
"分派规格审查子智能体 (./spec-reviewer-prompt.md)" -> "规格审查子智能体确认代码匹配规格?";
|
|
73
|
-
"规格审查子智能体确认代码匹配规格?" -> "实现子智能体修复规格差距" [label="否"];
|
|
74
|
-
"实现子智能体修复规格差距" -> "分派规格审查子智能体 (./spec-reviewer-prompt.md)" [label="重新审查"];
|
|
75
|
-
"规格审查子智能体确认代码匹配规格?" -> "分派代码质量审查子智能体 (./code-quality-reviewer-prompt.md)" [label="是"];
|
|
76
|
-
"分派代码质量审查子智能体 (./code-quality-reviewer-prompt.md)" -> "代码质量审查子智能体通过?";
|
|
77
|
-
"代码质量审查子智能体通过?" -> "实现子智能体修复质量问题" [label="否"];
|
|
78
|
-
"实现子智能体修复质量问题" -> "分派代码质量审查子智能体 (./code-quality-reviewer-prompt.md)" [label="重新审查"];
|
|
79
|
-
"代码质量审查子智能体通过?" -> "在 TodoWrite 中标记任务完成" [label="是"];
|
|
80
|
-
"在 TodoWrite 中标记任务完成" -> "还有剩余任务?";
|
|
81
|
-
"还有剩余任务?" -> "分派实现子智能体 (./implementer-prompt.md)" [label="是"];
|
|
82
|
-
"还有剩余任务?" -> "分派最终代码审查子智能体审查整体实现" [label="否"];
|
|
83
|
-
"分派最终代码审查子智能体审查整体实现" -> "使用 superpowers:finishing-a-development-branch";
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 模型选择
|
|
88
|
-
|
|
89
|
-
使用能胜任每个角色的最低成本模型,以节省开支并提高速度。
|
|
90
|
-
|
|
91
|
-
**机械性实现任务**(隔离的函数、清晰的规格、1-2 个文件):使用快速、便宜的模型。当计划编写得足够详细时,大多数实现任务都是机械性的。
|
|
92
|
-
|
|
93
|
-
**集成和判断类任务**(多文件协调、模式匹配、调试):使用标准模型。
|
|
94
|
-
|
|
95
|
-
**架构、设计和审查类任务**:使用最强的可用模型。
|
|
96
|
-
|
|
97
|
-
**任务复杂度信号:**
|
|
98
|
-
- 涉及 1-2 个文件且有完整规格 → 便宜模型
|
|
99
|
-
- 涉及多个文件且有集成考虑 → 标准模型
|
|
100
|
-
- 需要设计判断或广泛的代码库理解 → 最强模型
|
|
101
|
-
|
|
102
|
-
## 处理实现者状态
|
|
103
|
-
|
|
104
|
-
实现子智能体报告四种状态之一。根据每种状态进行相应处理:
|
|
105
|
-
|
|
106
|
-
**DONE:** 进入规格合规性审查。
|
|
107
|
-
|
|
108
|
-
**DONE_WITH_CONCERNS:** 实现者完成了工作但标记了疑虑。在继续之前阅读这些疑虑。如果疑虑涉及正确性或范围,在审查前解决。如果只是观察性说明(如"这个文件越来越大了"),记录下来并继续审查。
|
|
109
|
-
|
|
110
|
-
**NEEDS_CONTEXT:** 实现者需要未提供的信息。提供缺失的上下文并重新分派。
|
|
111
|
-
|
|
112
|
-
**BLOCKED:** 实现者无法完成任务。评估阻塞原因:
|
|
113
|
-
1. 如果是上下文问题,提供更多上下文并用同一模型重新分派
|
|
114
|
-
2. 如果任务需要更强的推理能力,用更强的模型重新分派
|
|
115
|
-
3. 如果任务太大,拆分为更小的部分
|
|
116
|
-
4. 如果计划本身有问题,上报给人类
|
|
117
|
-
|
|
118
|
-
**绝不** 忽略上报或在不做任何更改的情况下让同一模型重试。如果实现者说卡住了,说明有什么东西需要改变。
|
|
119
|
-
|
|
120
|
-
## 提示词模板
|
|
121
|
-
|
|
122
|
-
- `./implementer-prompt.md` - 分派实现子智能体
|
|
123
|
-
- `./spec-reviewer-prompt.md` - 分派规格合规审查子智能体
|
|
124
|
-
- `./code-quality-reviewer-prompt.md` - 分派代码质量审查子智能体
|
|
125
|
-
|
|
126
|
-
## 示例工作流
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
你:我正在使用子智能体驱动开发来执行这个计划。
|
|
130
|
-
|
|
131
|
-
[一次性读取计划文件:docs/superpowers/plans/feature-plan.md]
|
|
132
|
-
[提取全部 5 个任务的完整文本和上下文]
|
|
133
|
-
[用所有任务创建 TodoWrite]
|
|
134
|
-
|
|
135
|
-
任务 1:Hook 安装脚本
|
|
136
|
-
|
|
137
|
-
[获取任务 1 的文本和上下文(已提取)]
|
|
138
|
-
[分派实现子智能体,附带完整任务文本 + 上下文]
|
|
139
|
-
|
|
140
|
-
实现者:"在我开始之前——hook 应该安装在用户级别还是系统级别?"
|
|
141
|
-
|
|
142
|
-
你:"用户级别(~/.config/superpowers/hooks/)"
|
|
143
|
-
|
|
144
|
-
实现者:"明白了。现在开始实现……"
|
|
145
|
-
[稍后] 实现者:
|
|
146
|
-
- 实现了 install-hook 命令
|
|
147
|
-
- 添加了测试,5/5 通过
|
|
148
|
-
- 自审:发现遗漏了 --force 参数,已添加
|
|
149
|
-
- 已提交
|
|
150
|
-
|
|
151
|
-
[分派规格合规审查]
|
|
152
|
-
规格审查者:✅ 符合规格 - 所有需求已满足,无多余内容
|
|
153
|
-
|
|
154
|
-
[获取 git SHA,分派代码质量审查]
|
|
155
|
-
代码审查者:优点:测试覆盖好,代码整洁。问题:无。通过。
|
|
156
|
-
|
|
157
|
-
[标记任务 1 完成]
|
|
158
|
-
|
|
159
|
-
任务 2:恢复模式
|
|
160
|
-
|
|
161
|
-
[获取任务 2 的文本和上下文(已提取)]
|
|
162
|
-
[分派实现子智能体,附带完整任务文本 + 上下文]
|
|
163
|
-
|
|
164
|
-
实现者:[无疑问,直接开始]
|
|
165
|
-
实现者:
|
|
166
|
-
- 添加了 verify/repair 模式
|
|
167
|
-
- 8/8 测试通过
|
|
168
|
-
- 自审:一切正常
|
|
169
|
-
- 已提交
|
|
170
|
-
|
|
171
|
-
[分派规格合规审查]
|
|
172
|
-
规格审查者:❌ 问题:
|
|
173
|
-
- 缺失:进度报告(规格要求"每 100 项报告一次")
|
|
174
|
-
- 多余:添加了 --json 参数(未被要求)
|
|
175
|
-
|
|
176
|
-
[实现者修复问题]
|
|
177
|
-
实现者:移除了 --json 参数,添加了进度报告
|
|
178
|
-
|
|
179
|
-
[规格审查者再次审查]
|
|
180
|
-
规格审查者:✅ 现在符合规格
|
|
181
|
-
|
|
182
|
-
[分派代码质量审查]
|
|
183
|
-
代码审查者:优点:扎实。问题(重要):魔法数字(100)
|
|
184
|
-
|
|
185
|
-
[实现者修复]
|
|
186
|
-
实现者:提取了 PROGRESS_INTERVAL 常量
|
|
187
|
-
|
|
188
|
-
[代码审查者再次审查]
|
|
189
|
-
代码审查者:✅ 通过
|
|
190
|
-
|
|
191
|
-
[标记任务 2 完成]
|
|
192
|
-
|
|
193
|
-
...
|
|
194
|
-
|
|
195
|
-
[所有任务完成后]
|
|
196
|
-
[分派最终代码审查]
|
|
197
|
-
最终审查者:所有需求已满足,可以合并
|
|
198
|
-
|
|
199
|
-
完成!
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## 优势
|
|
203
|
-
|
|
204
|
-
**与手动执行相比:**
|
|
205
|
-
- 子智能体自然遵循 TDD
|
|
206
|
-
- 每个任务全新上下文(不会混淆)
|
|
207
|
-
- 并行安全(子智能体不会互相干扰)
|
|
208
|
-
- 子智能体可以提问(工作前和工作中都可以)
|
|
209
|
-
|
|
210
|
-
**与 Executing Plans 相比:**
|
|
211
|
-
- 同一会话(无交接)
|
|
212
|
-
- 持续进展(无需等待)
|
|
213
|
-
- 审查检查点自动化
|
|
214
|
-
|
|
215
|
-
**效率提升:**
|
|
216
|
-
- 无文件读取开销(控制者提供完整文本)
|
|
217
|
-
- 控制者精确策划所需上下文
|
|
218
|
-
- 子智能体预先获得完整信息
|
|
219
|
-
- 问题在工作开始前就被提出(而非工作结束后)
|
|
220
|
-
|
|
221
|
-
**质量关卡:**
|
|
222
|
-
- 自审在交接前发现问题
|
|
223
|
-
- 两阶段审查:规格合规性,然后代码质量
|
|
224
|
-
- 审查循环确保修复确实有效
|
|
225
|
-
- 规格合规防止过度/不足构建
|
|
226
|
-
- 代码质量确保实现良好
|
|
227
|
-
|
|
228
|
-
**成本:**
|
|
229
|
-
- 更多子智能体调用(每个任务需要实现者 + 2 个审查者)
|
|
230
|
-
- 控制者需要更多准备工作(预先提取所有任务)
|
|
231
|
-
- 审查循环增加迭代次数
|
|
232
|
-
- 但能及早发现问题(比后期调试更省成本)
|
|
233
|
-
|
|
234
|
-
## 红线
|
|
235
|
-
|
|
236
|
-
**绝不:**
|
|
237
|
-
- 未经用户明确同意就在 main/master 分支上开始实现
|
|
238
|
-
- 跳过审查(规格合规性或代码质量)
|
|
239
|
-
- 带着未修复的问题继续
|
|
240
|
-
- 并行分派多个实现子智能体(会冲突)
|
|
241
|
-
- 让子智能体读取计划文件(应提供完整文本)
|
|
242
|
-
- 跳过场景铺设上下文(子智能体需要理解任务在哪个环节)
|
|
243
|
-
- 忽视子智能体的问题(在让它们继续之前先回答)
|
|
244
|
-
- 在规格合规性上接受"差不多就行"(规格审查者发现问题 = 未完成)
|
|
245
|
-
- 跳过审查循环(审查者发现问题 = 实现者修复 = 再次审查)
|
|
246
|
-
- 让实现者的自审替代正式审查(两者都需要)
|
|
247
|
-
- **在规格合规性审查通过之前开始代码质量审查**(顺序错误)
|
|
248
|
-
- 在任一审查有未解决问题时就进入下一个任务
|
|
249
|
-
|
|
250
|
-
**如果子智能体提问:**
|
|
251
|
-
- 清晰完整地回答
|
|
252
|
-
- 必要时提供额外上下文
|
|
253
|
-
- 不要催促它们进入实现阶段
|
|
254
|
-
|
|
255
|
-
**如果审查者发现问题:**
|
|
256
|
-
- 实现者(同一子智能体)修复
|
|
257
|
-
- 审查者再次审查
|
|
258
|
-
- 重复直到通过
|
|
259
|
-
- 不要跳过重新审查
|
|
260
|
-
|
|
261
|
-
**如果子智能体失败:**
|
|
262
|
-
- 分派修复子智能体并提供具体指令
|
|
263
|
-
- 不要尝试手动修复(上下文污染)
|
|
264
|
-
|
|
265
|
-
## 集成
|
|
266
|
-
|
|
267
|
-
**必需的工作流技能:**
|
|
268
|
-
- **superpowers:using-git-worktrees** - 必需:在开始前建立隔离工作区
|
|
269
|
-
- **superpowers:writing-plans** - 创建本技能执行的计划
|
|
270
|
-
- **superpowers:requesting-code-review** - 审查子智能体的代码审查模板
|
|
271
|
-
- **superpowers:finishing-a-development-branch** - 所有任务完成后收尾
|
|
272
|
-
|
|
273
|
-
**子智能体应使用:**
|
|
274
|
-
- **superpowers:test-driven-development** - 子智能体对每个任务遵循 TDD
|
|
275
|
-
|
|
276
|
-
**替代工作流:**
|
|
277
|
-
- **superpowers:executing-plans** - 用于并行会话而非同会话执行
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# 代码质量审查者提示词模板
|
|
2
|
-
|
|
3
|
-
分派代码质量审查子智能体时使用此模板。
|
|
4
|
-
|
|
5
|
-
**目的:** 验证实现是否构建良好(整洁、有测试、可维护)
|
|
6
|
-
|
|
7
|
-
**仅在规格合规性审查通过后才分派。**
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Task tool (superpowers:code-reviewer):
|
|
11
|
-
使用模板 requesting-code-review/code-reviewer.md
|
|
12
|
-
|
|
13
|
-
WHAT_WAS_IMPLEMENTED: [来自实现者的报告]
|
|
14
|
-
PLAN_OR_REQUIREMENTS: [plan-file] 中的任务 N
|
|
15
|
-
BASE_SHA: [任务开始前的提交]
|
|
16
|
-
HEAD_SHA: [当前提交]
|
|
17
|
-
DESCRIPTION: [任务摘要]
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
**除标准代码质量关注点外,审查者还应检查:**
|
|
21
|
-
- 每个文件是否有单一明确的职责和定义清晰的接口?
|
|
22
|
-
- 各单元是否拆分得足以独立理解和测试?
|
|
23
|
-
- 实现是否遵循了计划中的文件结构?
|
|
24
|
-
- 本次实现是否创建了已经很大的新文件,或显著增大了现有文件?(不要标记已有的文件大小问题——聚焦于本次变更带来的影响。)
|
|
25
|
-
|
|
26
|
-
**代码审查者返回:** 优点、问题(关键/重要/次要)、评估结论
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# 实现子智能体提示词模板
|
|
2
|
-
|
|
3
|
-
分派实现子智能体时使用此模板。
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
Task tool (general-purpose):
|
|
7
|
-
description: "实现任务 N:[任务名称]"
|
|
8
|
-
prompt: |
|
|
9
|
-
你正在实现任务 N:[任务名称]
|
|
10
|
-
|
|
11
|
-
## 任务描述
|
|
12
|
-
|
|
13
|
-
[计划中任务的完整文本 - 粘贴到这里,不要让子智能体去读文件]
|
|
14
|
-
|
|
15
|
-
## 上下文
|
|
16
|
-
|
|
17
|
-
[场景铺设:这个任务在哪个环节、依赖关系、架构上下文]
|
|
18
|
-
|
|
19
|
-
## 开始之前
|
|
20
|
-
|
|
21
|
-
如果你对以下内容有疑问:
|
|
22
|
-
- 需求或验收标准
|
|
23
|
-
- 方案或实现策略
|
|
24
|
-
- 依赖或假设
|
|
25
|
-
- 任务描述中任何不清楚的地方
|
|
26
|
-
|
|
27
|
-
**现在就问。** 在开始工作之前提出任何疑虑。
|
|
28
|
-
|
|
29
|
-
## 你的工作
|
|
30
|
-
|
|
31
|
-
当你确认需求清晰后:
|
|
32
|
-
1. 严格按照任务指定的内容实现
|
|
33
|
-
2. 编写测试(如果任务要求则遵循 TDD)
|
|
34
|
-
3. 验证实现是否正常工作
|
|
35
|
-
4. 提交你的工作
|
|
36
|
-
5. 自审(见下文)
|
|
37
|
-
6. 汇报
|
|
38
|
-
|
|
39
|
-
工作目录:[directory]
|
|
40
|
-
|
|
41
|
-
**工作过程中:** 如果遇到意料之外或不清楚的情况,**提问**。
|
|
42
|
-
随时可以暂停并澄清。不要猜测或做假设。
|
|
43
|
-
|
|
44
|
-
## 代码组织
|
|
45
|
-
|
|
46
|
-
你在能一次性放入上下文的代码上推理效果最好,文件聚焦时编辑也更可靠。
|
|
47
|
-
请牢记:
|
|
48
|
-
- 遵循计划中定义的文件结构
|
|
49
|
-
- 每个文件应有单一明确的职责和定义清晰的接口
|
|
50
|
-
- 如果你正在创建的文件超出了计划预期的规模,停下来并以
|
|
51
|
-
DONE_WITH_CONCERNS 状态报告——不要在没有计划指导的情况下自行拆分文件
|
|
52
|
-
- 如果你正在修改的现有文件已经很大或很混乱,小心操作
|
|
53
|
-
并在报告中将其标注为疑虑
|
|
54
|
-
- 在已有代码库中,遵循已建立的模式。像一个好的开发者那样
|
|
55
|
-
改善你接触的代码,但不要重构你任务范围之外的东西。
|
|
56
|
-
|
|
57
|
-
## 当你力不从心时
|
|
58
|
-
|
|
59
|
-
说"这对我来说太难了"完全没问题。劣质的工作比不做更糟。
|
|
60
|
-
上报不会受到惩罚。
|
|
61
|
-
|
|
62
|
-
**遇到以下情况时停下来上报:**
|
|
63
|
-
- 任务需要在多个有效方案之间做架构决策
|
|
64
|
-
- 你需要理解提供内容之外的代码但找不到答案
|
|
65
|
-
- 你对自己的方案是否正确感到不确定
|
|
66
|
-
- 任务涉及计划未预期的现有代码重构
|
|
67
|
-
- 你一直在逐个读文件试图理解系统但没有进展
|
|
68
|
-
|
|
69
|
-
**如何上报:** 以 BLOCKED 或 NEEDS_CONTEXT 状态汇报。具体描述
|
|
70
|
-
你卡在哪里、尝试了什么、需要什么帮助。
|
|
71
|
-
控制者可以提供更多上下文、用更强的模型重新分派,
|
|
72
|
-
或将任务拆分为更小的部分。
|
|
73
|
-
|
|
74
|
-
## 汇报前:自审
|
|
75
|
-
|
|
76
|
-
用全新的视角审查你的工作。问自己:
|
|
77
|
-
|
|
78
|
-
**完整性:**
|
|
79
|
-
- 我是否完全实现了规格中的所有内容?
|
|
80
|
-
- 我是否遗漏了任何需求?
|
|
81
|
-
- 是否有我没处理的边界情况?
|
|
82
|
-
|
|
83
|
-
**质量:**
|
|
84
|
-
- 这是我最好的工作吗?
|
|
85
|
-
- 命名是否清晰准确(匹配事物做什么,而非怎么做)?
|
|
86
|
-
- 代码是否整洁且可维护?
|
|
87
|
-
|
|
88
|
-
**纪律:**
|
|
89
|
-
- 我是否避免了过度构建(YAGNI)?
|
|
90
|
-
- 我是否只构建了被要求的内容?
|
|
91
|
-
- 我是否遵循了代码库中的已有模式?
|
|
92
|
-
|
|
93
|
-
**测试:**
|
|
94
|
-
- 测试是否真正验证了行为(而非只是 mock 行为)?
|
|
95
|
-
- 如果要求了 TDD,我是否遵循了?
|
|
96
|
-
- 测试是否全面?
|
|
97
|
-
|
|
98
|
-
如果在自审中发现问题,在汇报前就修复。
|
|
99
|
-
|
|
100
|
-
## 汇报格式
|
|
101
|
-
|
|
102
|
-
完成后汇报:
|
|
103
|
-
- **状态:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
104
|
-
- 你实现了什么(或尝试了什么,如果被阻塞)
|
|
105
|
-
- 你测试了什么以及测试结果
|
|
106
|
-
- 修改了哪些文件
|
|
107
|
-
- 自审发现(如果有)
|
|
108
|
-
- 任何问题或疑虑
|
|
109
|
-
|
|
110
|
-
如果你完成了工作但对正确性有疑虑,使用 DONE_WITH_CONCERNS。
|
|
111
|
-
如果你无法完成任务,使用 BLOCKED。如果你需要
|
|
112
|
-
未提供的信息,使用 NEEDS_CONTEXT。绝不默默产出你不确定的工作。
|
|
113
|
-
```
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# 规格合规审查者提示词模板
|
|
2
|
-
|
|
3
|
-
分派规格合规审查子智能体时使用此模板。
|
|
4
|
-
|
|
5
|
-
**目的:** 验证实现者是否构建了所要求的内容(不多不少)
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
Task tool (general-purpose):
|
|
9
|
-
description: "审查任务 N 的规格合规性"
|
|
10
|
-
prompt: |
|
|
11
|
-
你正在审查一个实现是否与其规格匹配。
|
|
12
|
-
|
|
13
|
-
## 要求的内容
|
|
14
|
-
|
|
15
|
-
[任务需求的完整文本]
|
|
16
|
-
|
|
17
|
-
## 实现者声称构建了什么
|
|
18
|
-
|
|
19
|
-
[来自实现者的报告]
|
|
20
|
-
|
|
21
|
-
## 关键:不要信任报告
|
|
22
|
-
|
|
23
|
-
实现者完成得疑似过快。他们的报告可能不完整、
|
|
24
|
-
不准确或过于乐观。你必须独立验证所有内容。
|
|
25
|
-
|
|
26
|
-
**不要:**
|
|
27
|
-
- 相信他们关于实现内容的说法
|
|
28
|
-
- 信任他们关于完整性的声明
|
|
29
|
-
- 接受他们对需求的解读
|
|
30
|
-
|
|
31
|
-
**要做的:**
|
|
32
|
-
- 阅读他们写的实际代码
|
|
33
|
-
- 逐行对比实际实现和需求
|
|
34
|
-
- 检查他们声称已实现但实际遗漏的部分
|
|
35
|
-
- 寻找他们未提及的多余功能
|
|
36
|
-
|
|
37
|
-
## 你的工作
|
|
38
|
-
|
|
39
|
-
阅读实现代码并验证:
|
|
40
|
-
|
|
41
|
-
**缺失的需求:**
|
|
42
|
-
- 他们是否实现了所有被要求的内容?
|
|
43
|
-
- 是否有他们跳过或遗漏的需求?
|
|
44
|
-
- 是否有他们声称可用但实际未实现的功能?
|
|
45
|
-
|
|
46
|
-
**多余/不需要的工作:**
|
|
47
|
-
- 他们是否构建了未被要求的内容?
|
|
48
|
-
- 他们是否过度工程化或添加了不必要的功能?
|
|
49
|
-
- 他们是否添加了规格中没有的"锦上添花"功能?
|
|
50
|
-
|
|
51
|
-
**理解偏差:**
|
|
52
|
-
- 他们是否以不同于预期的方式解读了需求?
|
|
53
|
-
- 他们是否解决了错误的问题?
|
|
54
|
-
- 他们是否实现了正确的功能但方式不对?
|
|
55
|
-
|
|
56
|
-
**通过阅读代码来验证,而非信任报告。**
|
|
57
|
-
|
|
58
|
-
报告:
|
|
59
|
-
- ✅ 符合规格(如果经过代码检查后一切匹配)
|
|
60
|
-
- ❌ 发现问题:[具体列出缺失或多余的内容,附带 file:line 引用]
|
|
61
|
-
```
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Creation Log: Systematic Debugging Skill
|
|
2
|
-
|
|
3
|
-
Reference example of extracting, structuring, and bulletproofing a critical skill.
|
|
4
|
-
|
|
5
|
-
## Source Material
|
|
6
|
-
|
|
7
|
-
Extracted debugging framework from `/Users/jesse/.claude/CLAUDE.md`:
|
|
8
|
-
- 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
|
|
9
|
-
- Core mandate: ALWAYS find root cause, NEVER fix symptoms
|
|
10
|
-
- Rules designed to resist time pressure and rationalization
|
|
11
|
-
|
|
12
|
-
## Extraction Decisions
|
|
13
|
-
|
|
14
|
-
**What to include:**
|
|
15
|
-
- Complete 4-phase framework with all rules
|
|
16
|
-
- Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
|
|
17
|
-
- Pressure-resistant language ("even if faster", "even if I seem in a hurry")
|
|
18
|
-
- Concrete steps for each phase
|
|
19
|
-
|
|
20
|
-
**What to leave out:**
|
|
21
|
-
- Project-specific context
|
|
22
|
-
- Repetitive variations of same rule
|
|
23
|
-
- Narrative explanations (condensed to principles)
|
|
24
|
-
|
|
25
|
-
## Structure Following skill-creation/SKILL.md
|
|
26
|
-
|
|
27
|
-
1. **Rich when_to_use** - Included symptoms and anti-patterns
|
|
28
|
-
2. **Type: technique** - Concrete process with steps
|
|
29
|
-
3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
|
|
30
|
-
4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
|
|
31
|
-
5. **Phase-by-phase breakdown** - Scannable checklist format
|
|
32
|
-
6. **Anti-patterns section** - What NOT to do (critical for this skill)
|
|
33
|
-
|
|
34
|
-
## Bulletproofing Elements
|
|
35
|
-
|
|
36
|
-
Framework designed to resist rationalization under pressure:
|
|
37
|
-
|
|
38
|
-
### Language Choices
|
|
39
|
-
- "ALWAYS" / "NEVER" (not "should" / "try to")
|
|
40
|
-
- "even if faster" / "even if I seem in a hurry"
|
|
41
|
-
- "STOP and re-analyze" (explicit pause)
|
|
42
|
-
- "Don't skip past" (catches the actual behavior)
|
|
43
|
-
|
|
44
|
-
### Structural Defenses
|
|
45
|
-
- **Phase 1 required** - Can't skip to implementation
|
|
46
|
-
- **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
|
|
47
|
-
- **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
|
|
48
|
-
- **Anti-patterns section** - Shows exactly what shortcuts look like
|
|
49
|
-
|
|
50
|
-
### Redundancy
|
|
51
|
-
- Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
|
|
52
|
-
- "NEVER fix symptom" appears 4 times in different contexts
|
|
53
|
-
- Each phase has explicit "don't skip" guidance
|
|
54
|
-
|
|
55
|
-
## Testing Approach
|
|
56
|
-
|
|
57
|
-
Created 4 validation tests following skills/meta/testing-skills-with-subagents:
|
|
58
|
-
|
|
59
|
-
### Test 1: Academic Context (No Pressure)
|
|
60
|
-
- Simple bug, no time pressure
|
|
61
|
-
- **Result:** Perfect compliance, complete investigation
|
|
62
|
-
|
|
63
|
-
### Test 2: Time Pressure + Obvious Quick Fix
|
|
64
|
-
- User "in a hurry", symptom fix looks easy
|
|
65
|
-
- **Result:** Resisted shortcut, followed full process, found real root cause
|
|
66
|
-
|
|
67
|
-
### Test 3: Complex System + Uncertainty
|
|
68
|
-
- Multi-layer failure, unclear if can find root cause
|
|
69
|
-
- **Result:** Systematic investigation, traced through all layers, found source
|
|
70
|
-
|
|
71
|
-
### Test 4: Failed First Fix
|
|
72
|
-
- Hypothesis doesn't work, temptation to add more fixes
|
|
73
|
-
- **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
|
|
74
|
-
|
|
75
|
-
**All tests passed.** No rationalizations found.
|
|
76
|
-
|
|
77
|
-
## Iterations
|
|
78
|
-
|
|
79
|
-
### Initial Version
|
|
80
|
-
- Complete 4-phase framework
|
|
81
|
-
- Anti-patterns section
|
|
82
|
-
- Flowchart for "fix failed" decision
|
|
83
|
-
|
|
84
|
-
### Enhancement 1: TDD Reference
|
|
85
|
-
- Added link to skills/testing/test-driven-development
|
|
86
|
-
- Note explaining TDD's "simplest code" ≠ debugging's "root cause"
|
|
87
|
-
- Prevents confusion between methodologies
|
|
88
|
-
|
|
89
|
-
## Final Outcome
|
|
90
|
-
|
|
91
|
-
Bulletproof skill that:
|
|
92
|
-
- ✅ Clearly mandates root cause investigation
|
|
93
|
-
- ✅ Resists time pressure rationalization
|
|
94
|
-
- ✅ Provides concrete steps for each phase
|
|
95
|
-
- ✅ Shows anti-patterns explicitly
|
|
96
|
-
- ✅ Tested under multiple pressure scenarios
|
|
97
|
-
- ✅ Clarifies relationship to TDD
|
|
98
|
-
- ✅ Ready for use
|
|
99
|
-
|
|
100
|
-
## Key Insight
|
|
101
|
-
|
|
102
|
-
**Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
|
|
103
|
-
|
|
104
|
-
## Usage Example
|
|
105
|
-
|
|
106
|
-
When encountering a bug:
|
|
107
|
-
1. Load skill: skills/debugging/systematic-debugging
|
|
108
|
-
2. Read overview (10 sec) - reminded of mandate
|
|
109
|
-
3. Follow Phase 1 checklist - forced investigation
|
|
110
|
-
4. If tempted to skip - see anti-pattern, stop
|
|
111
|
-
5. Complete all phases - root cause found
|
|
112
|
-
|
|
113
|
-
**Time investment:** 5-10 minutes
|
|
114
|
-
**Time saved:** Hours of symptom-whack-a-mole
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
*Created: 2025-10-03*
|
|
119
|
-
*Purpose: Reference example for skill extraction and bulletproofing*
|