simple-skills 1.3.0 → 1.3.2
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/README.md +2 -1
- package/package.json +1 -1
- package/skills/engineering/brainstorming/SKILL.md +41 -134
- package/skills/engineering/brainstorming/scripts/frame-template.html +299 -51
- package/skills/engineering/brainstorming/scripts/start-server.sh +4 -4
- package/skills/engineering/brainstorming/scripts/stop-server.sh +1 -1
- package/skills/engineering/brainstorming/spec-document-reviewer-prompt.md +1 -1
- package/skills/engineering/brainstorming/visual-companion.md +4 -4
- package/skills/engineering/chart-generator/SKILL.md +0 -2
- package/skills/engineering/code-review/SKILL.md +43 -1
- package/skills/engineering/dispatching-parallel-agents/SKILL.md +30 -65
- package/skills/engineering/doc-coauthoring/SKILL.md +78 -240
- package/skills/engineering/finishing-a-development-branch/SKILL.md +13 -21
- package/skills/engineering/frontend-design/SKILL.md +18 -74
- package/skills/engineering/image-to-code/SKILL.md +61 -121
- package/skills/engineering/implement/SKILL.md +4 -0
- package/skills/engineering/skill-translator/SKILL.md +128 -0
- package/skills/engineering/subagent-driven-development/SKILL.md +43 -57
- package/skills/engineering/subagent-driven-development/scripts/review-package +1 -1
- package/skills/engineering/subagent-driven-development/scripts/sdd-workspace +3 -3
- package/skills/engineering/subagent-driven-development/scripts/task-brief +1 -5
- package/skills/engineering/systematic-debugging/SKILL.md +2 -15
- package/skills/engineering/verification-before-completion/SKILL.md +0 -5
- package/skills/engineering/xlsx/SKILL.md +0 -1
- package/skills/engineering/software-architecture/SKILL.md +0 -76
- package/skills/engineering/systematic-debugging/CREATION-LOG.md +0 -119
- package/skills/engineering/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/skills/engineering/systematic-debugging/condition-based-waiting.md +0 -115
- package/skills/engineering/systematic-debugging/defense-in-depth.md +0 -122
- package/skills/engineering/systematic-debugging/find-polluter.sh +0 -72
- package/skills/engineering/systematic-debugging/root-cause-tracing.md +0 -169
- package/skills/engineering/systematic-debugging/test-academic.md +0 -14
- package/skills/engineering/systematic-debugging/test-pressure-1.md +0 -58
- package/skills/engineering/systematic-debugging/test-pressure-2.md +0 -68
- package/skills/engineering/systematic-debugging/test-pressure-3.md +0 -69
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagent-driven-development
|
|
3
3
|
description: 当在当前会话中执行包含独立任务的实现计划时使用
|
|
4
|
-
version: "1.0.0"
|
|
5
|
-
license: MIT
|
|
6
|
-
metadata:
|
|
7
|
-
hermes:
|
|
8
|
-
tags: [agents, development]
|
|
9
4
|
---
|
|
10
5
|
|
|
11
6
|
# 子智能体驱动开发
|
|
12
7
|
|
|
13
|
-
|
|
8
|
+
为每个任务分派一个全新的实现子智能体来执行计划:任务完成后做一次任务审查(规格合规性 + 代码质量),全部任务结束后再做一次覆盖整个分支的宽范围审查。
|
|
14
9
|
|
|
15
|
-
**为什么用子智能体:**
|
|
10
|
+
**为什么用子智能体:** 把任务委派给具有隔离上下文的专用智能体。精心设计它们的指令和上下文,确保它们专注并成功完成任务。它们绝不应继承你会话的上下文或历史记录——你要精确构造它们所需的一切。这样也能为你自己保留用于协调工作的上下文。
|
|
16
11
|
|
|
17
12
|
**核心原则:** 每个任务一个全新子智能体 + 任务审查(规格 + 质量)+ 结尾宽范围审查 = 高质量、快速迭代
|
|
18
13
|
|
|
19
|
-
**旁白:**
|
|
14
|
+
**旁白:** 工具调用之间最多说一句简短旁白——进度账本和工具结果本身就是记录。
|
|
20
15
|
|
|
21
|
-
**持续执行:**
|
|
16
|
+
**持续执行:** 不要在任务之间停下来向你的人类伙伴确认。不间断地执行计划里的所有任务。唯一该停下的理由:你无法解决的 BLOCKED 状态、确实妨碍推进的歧义,或所有任务已完成。不要问"我该继续吗?"或做进度小结——他们让你执行计划,那就执行。
|
|
22
17
|
|
|
23
18
|
## 何时使用
|
|
24
19
|
|
|
@@ -75,10 +70,10 @@ digraph process {
|
|
|
75
70
|
|
|
76
71
|
"准备: 工作树、查账本、读计划、起飞前审查" [shape=box];
|
|
77
72
|
"还有任务?" [shape=diamond];
|
|
78
|
-
"分派最终代码审查者 (../
|
|
73
|
+
"分派最终代码审查者 (../code-review/code-reviewer.md)" [shape=box];
|
|
79
74
|
"最终审查有发现? 一次修复分派、一次定向复审、裁定残留项" [shape=box];
|
|
80
75
|
"最终审查干净: 删除本计划的工作区" [shape=box];
|
|
81
|
-
"使用
|
|
76
|
+
"使用 /finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
|
|
82
77
|
|
|
83
78
|
"准备: 工作树、查账本、读计划、起飞前审查" -> "分派实现子智能体 (./implementer-prompt.md)";
|
|
84
79
|
"分派实现子智能体 (./implementer-prompt.md)" -> "实现者有疑问?";
|
|
@@ -104,51 +99,45 @@ digraph process {
|
|
|
104
99
|
"把发现连同裁定搁置进账本" -> "往账本追加完成行,标记待办完成";
|
|
105
100
|
"往账本追加完成行,标记待办完成" -> "还有任务?";
|
|
106
101
|
"还有任务?" -> "分派实现子智能体 (./implementer-prompt.md)" [label="是"];
|
|
107
|
-
"还有任务?" -> "分派最终代码审查者 (../
|
|
108
|
-
"分派最终代码审查者 (../
|
|
102
|
+
"还有任务?" -> "分派最终代码审查者 (../code-review/code-reviewer.md)" [label="否"];
|
|
103
|
+
"分派最终代码审查者 (../code-review/code-reviewer.md)" -> "最终审查有发现? 一次修复分派、一次定向复审、裁定残留项";
|
|
109
104
|
"最终审查有发现? 一次修复分派、一次定向复审、裁定残留项" -> "最终审查干净: 删除本计划的工作区";
|
|
110
|
-
"最终审查干净: 删除本计划的工作区" -> "使用
|
|
105
|
+
"最终审查干净: 删除本计划的工作区" -> "使用 /finishing-a-development-branch";
|
|
111
106
|
}
|
|
112
107
|
```
|
|
113
108
|
|
|
114
109
|
## 准备
|
|
115
110
|
|
|
116
|
-
|
|
111
|
+
把工作放进隔离的工作区:用 /using-git-worktrees 创建,或核实已有的那个。没有人类伙伴的明确同意,绝不在 main/master 分支上开始实现。
|
|
117
112
|
|
|
118
|
-
会话记忆无法在上下文压缩(compaction
|
|
113
|
+
会话记忆无法在上下文压缩(compaction)中存活。丢失了位置的控制者曾重新分派整段已经完成的任务序列——这是观察到的最昂贵的失败。把进度记在一个账本文件里,而不只是记在待办里。
|
|
119
114
|
|
|
120
|
-
- **每个计划拥有自己的工作区:** 技能启动时,运行本技能的 `scripts/sdd-workspace PLAN_FILE`——它会打印这个计划专属的、被 git 忽略的目录(`<repo-root
|
|
121
|
-
- 到 `<工作区>/progress.md`
|
|
115
|
+
- **每个计划拥有自己的工作区:** 技能启动时,运行本技能的 `scripts/sdd-workspace PLAN_FILE`——它会打印这个计划专属的、被 git 忽略的目录(`<repo-root>/docs/sdd/<计划文件名>/`),**本计划**的一切产物(账本、简报、报告、审查包)都放在那里。别的计划的目录不属于你,不读也不写。
|
|
116
|
+
- 到 `<工作区>/progress.md` 查本计划的账本。第一行点名你的计划文件 → 带 `Task <N>: complete` 行的任务**已完成**——不要重新分派;从第一个没有该行的任务处继续。某任务的最后一行是一轮修复 → 它正卡在修复循环中,从下一轮继续。账本第一行点名**另一个**计划文件——或你在旧的扁平路径 `docs/sdd/progress.md` 发现游离账本——那是别人的进度:原地别动,另起你自己的新账本。
|
|
122
117
|
- 创建账本时,把它的身份写在第一行:`# SDD ledger — plan: <计划文件路径>`。
|
|
123
|
-
-
|
|
118
|
+
- 这个账本是你的恢复地图:它点名的提交,即使你的上下文已经不记得创建过它们,也确实存在于 git 中。压缩之后,相信账本和 `git log`,而不是你自己的记忆。
|
|
124
119
|
- `git clean -fdx` 会毁掉这个工作区(它是被 git 忽略的临时文件);万一发生了,就从 `git log` 恢复。
|
|
125
120
|
|
|
126
121
|
把计划**读一遍**,记下它的上下文和全局约束,并为每个任务建一条待办。
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
分派任务 1 之前,把计划通扫一遍找冲突:
|
|
130
124
|
- 互相矛盾的任务,或与计划的"全局约束"矛盾的任务
|
|
131
|
-
-
|
|
125
|
+
- 计划明确要求、但审查标准会判为缺陷的东西(如一个什么都不断言的测试、一整块逻辑的逐字复制)
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
把你找到的所有问题**一次性打包成一个问题**呈现给人类伙伴——每条发现都并列上要求它的那段计划原文,问以哪个为准——在执行开始之前问,而不是执行过程中每发现一个就打断一次。扫描干净就不要多说,直接开始。审查循环仍然是只有那些在实现中才浮现的冲突的兜底网。
|
|
134
128
|
|
|
135
129
|
## 模型选择
|
|
136
130
|
|
|
137
131
|
在能胜任的前提下,为每个角色选用最弱的模型,以节省成本、提升速度。
|
|
138
132
|
|
|
139
|
-
**机械性实现任务**(孤立的函数、清晰的规格、1-2 个文件):用快而便宜的模型。计划写得好时,大多数实现任务都是机械性的。
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
**审查任务**:用同样的判断来选模型,并按 diff 的体量、复杂度和风险来缩放。一个小的机械性 diff 不需要最强模型;一个微妙的并发改动需要。小修复 diff 的定向复审用便宜到中档的层级即可。
|
|
146
|
-
|
|
147
|
-
**修复循环的升级(第 4-5 轮)**:用比那个卡住了的实现者**至少高一档**的模型。
|
|
133
|
+
- **机械性实现任务**(孤立的函数、清晰的规格、1-2 个文件):用快而便宜的模型。计划写得好时,大多数实现任务都是机械性的。
|
|
134
|
+
- **集成与判断类任务**(跨文件协调、模式匹配、调试):用标准模型。
|
|
135
|
+
- **架构与设计类任务**:用可用的最强模型。覆盖整个分支的最终审查就属于这一类——用可用的最强模型去分派它,不要用会话默认模型。
|
|
136
|
+
- **审查任务**:用同样的判断来选模型,并按 diff 的体量、复杂度和风险缩放。小的机械性 diff 不需要最强模型;微妙的并发改动需要。小修复 diff 的定向复审用便宜到中档的层级即可。
|
|
137
|
+
- **修复循环的升级(第 4-5 轮)**:用比那个卡住了的实现者**至少高一档**的模型。
|
|
138
|
+
- **分派子智能体时永远显式指定模型。** 省略模型会继承你会话的模型——往往是最强也最贵的那个——这会让本节的努力全部失效。
|
|
148
139
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
**轮次数比 token 单价更要紧。** 墙钟时间和上下文成本是随子智能体花掉多少轮次而增长的,而最便宜的模型在多步工作上经常要花 2-3 倍轮次——总账反而更贵。审查者、以及依据散文式描述工作的实现者,都以中档模型为下限。当任务的计划原文里已经包含了要写的完整代码时,实现就是抄写加测试:这种实现者用最便宜的层级。单文件的机械性修复也用最便宜的层级。
|
|
140
|
+
**轮次数比 token 单价更要紧。** 墙钟时间和上下文成本随子智能体花掉的轮次增长,而最便宜的模型在多步工作上经常要花 2-3 倍轮次——总账反而更贵。审查者、以及依据散文式描述工作的实现者,都以中档模型为下限。计划原文里已包含要写的完整代码时,实现就是抄写加测试——用最便宜的层级。单文件的机械性修复也用最便宜的层级。
|
|
152
141
|
|
|
153
142
|
**任务复杂度信号(实现类任务):**
|
|
154
143
|
- 涉及 1-2 个文件且规格完整 → 便宜模型
|
|
@@ -163,7 +152,7 @@ digraph process {
|
|
|
163
152
|
|
|
164
153
|
分派之前记录 BASE(`git rev-parse HEAD`)——审查包和各轮修复的 diff 都要用它。
|
|
165
154
|
|
|
166
|
-
- **任务简报:** 分派实现者之前,运行本技能的 `scripts/task-brief PLAN_FILE N
|
|
155
|
+
- **任务简报:** 分派实现者之前,运行本技能的 `scripts/task-brief PLAN_FILE N`——它把该任务的完整文本抽取到一个唯一命名的文件并打印路径。组织你的分派,让这份简报保持为需求的唯一来源。分派应包含:(1) 一行说明这个任务在项目中的位置;(2) 简报路径,引入语为"先读这个——它是你的需求,里面有要逐字使用的精确取值";(3) 简报无从知晓的、来自前序任务的接口和决策;(4) 你对简报中注意到的任何歧义的裁定;(5) 报告文件路径和报告契约。精确取值(数字、魔法字符串、签名、测试用例)只出现在简报里。**绝不**让子智能体去读整个计划文件。
|
|
167
156
|
- **报告文件:** 实现者的报告文件按简报来命名(简报 `…/task-N-brief.md` → 报告 `…/task-N-report.md`),并写进分派提示词。实现者把完整报告写在那里,只回传状态、提交、一行测试小结和疑虑。
|
|
168
157
|
- 一个分派提示词描述的是**一个任务**,不是会话的历史。不要把累积的前序任务小结("任务 1-3 之后的状态")粘进后面的分派——真实会话里曾出现过 42k 字符的分派,其中 99% 是粘贴的历史。一个全新的子智能体需要的是:它的任务、它要碰的接口、以及全局约束。别无其他。
|
|
169
158
|
- 如果前面某个任务把一条发现搁置在本任务要碰的区域,就在分派里带上指向那条账本记录的指针。
|
|
@@ -174,33 +163,33 @@ digraph process {
|
|
|
174
163
|
|
|
175
164
|
### 2. 处理报告
|
|
176
165
|
|
|
177
|
-
|
|
166
|
+
实现子智能体会回传四种状态之一,分别处理:
|
|
178
167
|
|
|
179
168
|
**DONE:** 生成审查包(在本技能目录下运行 `scripts/review-package PLAN_FILE BASE HEAD`——它会打印出自己写入的那个唯一文件路径;BASE 是你在分派实现者之前记录下来的那个提交——**绝不用** `HEAD~1`,那会悄悄丢掉多提交任务里除最后一个之外的所有提交),然后把打印出的路径交给任务审查者去分派。
|
|
180
169
|
|
|
181
|
-
**DONE_WITH_CONCERNS:**
|
|
170
|
+
**DONE_WITH_CONCERNS:** 实现者完成了工作但提出了疑虑。继续之前先读这些疑虑。关乎正确性或范围 → 在审查之前先处理掉。只是观察(比如"这个文件变大了")→ 记下来,继续走审查。
|
|
182
171
|
|
|
183
172
|
**NEEDS_CONTEXT:** 实现者需要没被提供的信息。补上缺失的上下文并重新分派。
|
|
184
173
|
|
|
185
174
|
**BLOCKED:** 实现者无法完成任务。评估这个阻塞:
|
|
186
|
-
1.
|
|
187
|
-
2.
|
|
188
|
-
3.
|
|
189
|
-
4.
|
|
175
|
+
1. 上下文问题 → 补充上下文,用同一个模型重新分派
|
|
176
|
+
2. 任务需要更多推理 → 用更强的模型重新分派
|
|
177
|
+
3. 任务太大 → 拆成更小的块
|
|
178
|
+
4. 计划本身错了 → 上报给人类
|
|
190
179
|
|
|
191
|
-
|
|
180
|
+
**绝不**忽视一次上报,也**绝不**在什么都没改的情况下强迫同一个模型重试。实现者说卡住了,那就一定有东西需要改变。
|
|
192
181
|
|
|
193
182
|
如果实现者提问——不论是开始前还是任务中途——清楚完整地回答,需要时补充上下文,不要催着它进入实现。
|
|
194
183
|
|
|
195
184
|
### 3. 审查任务
|
|
196
185
|
|
|
197
|
-
|
|
186
|
+
逐任务审查是**任务范围内的关卡**。宽范围审查只做一次,在最终的整分支审查那里。绝不跳过任务审查,也绝不接受缺少任一结论的报告——规格合规性**和**任务质量两者都必须有。实现者的自审永远不能替代任务审查;两者都需要。
|
|
198
187
|
|
|
199
|
-
- **把 diff 作为文件交给审查者:** 运行本技能的 `scripts/review-package PLAN_FILE BASE HEAD
|
|
188
|
+
- **把 diff 作为文件交给审查者:** 运行本技能的 `scripts/review-package PLAN_FILE BASE HEAD`,把它打印出的文件路径交给审查者(若无 bash:对该区间跑 `git log --oneline`、`git diff --stat`、`git diff -U10`,重定向到一个唯一命名的文件)。这些输出永远不会进入你自己的上下文,而审查者在一次 Read 调用里就能看到提交列表、stat 摘要和带上下文的完整 diff。用你在分派实现者之前记录下的 BASE——**绝不用** `HEAD~1`,那会悄悄截断多提交任务。**绝不**在没有 diff 文件的情况下分派任务审查者。
|
|
200
189
|
- **审查者的输入:** 任务审查者拿到三个路径——同一份简报文件、报告文件、审查包——外加约束该任务的全局约束。
|
|
201
190
|
- 你交给审查者的全局约束块是它的**注意力透镜**。从计划的"全局约束"一节或规格里**逐字**抄下有约束力的需求:精确的取值、精确的格式,以及组件之间被明确规定的关系("与 X 相同的布局"、"匹配 Y")。审查者的模板里已经带了流程规则(YAGNI、测试卫生、审查方法)——约束块是用来装**这个项目**的规格所要求的东西的。
|
|
202
|
-
- 不要在没有具体的、任务专属的理由时,加上"检查所有用法"或"有用的话跑一下竞态测试"
|
|
203
|
-
-
|
|
191
|
+
- 不要在没有具体的、任务专属的理由时,加上"检查所有用法"或"有用的话跑一下竞态测试"这类开放式指令。
|
|
192
|
+
- 不要让审查者重跑实现者已经在同一份代码上跑过的测试——实现者的报告承载着测试证据。
|
|
204
193
|
- **不要替审查者预先给发现定性**——绝不指示审查者忽略或不要标记某个具体问题。如果你认为某条发现会是误报,让审查者提出来,然后在审查循环里裁定它。如果你正在写的提示词里出现了"不要标记"、"不要把 X 当缺陷"、"顶多按 Minor 处理"、"计划选择了"——停下:你正在预先定性,而且通常是为了让自己少走一轮审查循环。
|
|
205
194
|
|
|
206
195
|
任务审查者可能报告"⚠️ 无法从 diff 核实"的条目——那些活在未改动代码里、或者跨任务的需求。这些不阻塞审查的其余部分,但在标记任务完成之前**你必须自己逐条解决它们**:你掌握着审查者所缺的计划和跨任务上下文。如果你确认某一条是真实的缺口,就把它当作规格审查失败来处理——它和其他发现一起进入修复循环。
|
|
@@ -212,8 +201,7 @@ digraph process {
|
|
|
212
201
|
当审查报告规格 ❌、任何 Critical 或 Important 发现、或者你确认为真实缺口的 ⚠️ 条目时,循环触发。
|
|
213
202
|
|
|
214
203
|
循环开始之前,有两条路会立刻离开它:
|
|
215
|
-
|
|
216
|
-
- **Minor 发现**随手记进进度账本(`Task <N>: minor (deferred): <一句话>`),并把最终的整分支审查指向那份清单,让它去甄别哪些必须在合并前修掉。**没人读的汇总等于静默丢弃。** Minor 发现永远不进入循环。
|
|
204
|
+
- **Minor 发现**随手记进进度账本(`Task <N>: minor (deferred): <一句话>`),并把最终的整分支审查指向那份清单,让它甄别哪些必须在合并前修掉。**没人读的汇总等于静默丢弃。** Minor 发现永远不进入循环。
|
|
217
205
|
- 被标为"计划要求的"发现——或任何与计划原文所要求的内容冲突的发现——和任何计划矛盾一样,属于**人类的决定**:把这条发现和那段计划原文一起呈现,问以哪个为准。不要因为计划要求就驳回这条发现,也不要在没问过的情况下分派一个与计划相违的修复。
|
|
218
206
|
|
|
219
207
|
其他一切都进入循环。**一轮修复 = 一次修复分派 + 一次定向复审。每个任务最多五轮。**
|
|
@@ -232,7 +220,6 @@ digraph process {
|
|
|
232
220
|
**绝不在控制者会话里自己修发现**——你的上下文要保持干净以供协调,而且控制者的修复会跳过审查。
|
|
233
221
|
|
|
234
222
|
**熔断。** 当第 5 轮的复审仍然留下未解决的发现时,**停止分派**。你自己逐条裁定这些未解决的发现——你掌握着审查者所缺的计划和跨任务上下文:
|
|
235
|
-
|
|
236
223
|
- **审查者错了,或者这一点是可争议的:** 搁置它——`Task <N>: parked — <发现> — ruling: <为什么代码可以维持原样>`。最终审查会看到双方说法。
|
|
237
224
|
- **是真实的,但下游没有任何东西建立在它之上:** 同样搁置,裁定里写明它是真的、被延后了。
|
|
238
225
|
- **真实且承重**——后面的任务建立在它之上,或者它揭示了一个计划缺陷:**停止**。追加 `Task <N>: BLOCKED — <原因>`,并连同这条发现、与之冲突的计划原文、以及修复历史一起报告给你的人类伙伴。把一个结构性失败搁置掉,会让每个依赖它的任务都建立在它之上,并且把一个最终审查同样无法修复的问题丢给最终审查。
|
|
@@ -242,7 +229,6 @@ digraph process {
|
|
|
242
229
|
### 5. 完成任务
|
|
243
230
|
|
|
244
231
|
当审查干净地返回——或者在触及上限时每条未解决的发现都已带着裁定被搁置——在你做其他记账的同一条消息里,往账本追加完成行:
|
|
245
|
-
|
|
246
232
|
- `Task <N>: complete (commits <base7>..<head7>, review clean)`
|
|
247
233
|
- 熔断触发过的话:`Task <N>: complete (commits <base7>..<head7>, <K> parked)`
|
|
248
234
|
|
|
@@ -250,7 +236,7 @@ digraph process {
|
|
|
250
236
|
|
|
251
237
|
## 最终审查
|
|
252
238
|
|
|
253
|
-
覆盖整个分支的最终审查也拿到一个审查包:运行 `scripts/review-package PLAN_FILE MERGE_BASE HEAD`(MERGE_BASE = 分支起点的那个提交,例如 `git merge-base main HEAD`),把打印出的路径放进最终审查的分派里,这样最终审查者读一个文件就行,不必用 git 命令重新推导整个分支的 diff。用可用的最强模型分派(见"模型选择"),使用
|
|
239
|
+
覆盖整个分支的最终审查也拿到一个审查包:运行 `scripts/review-package PLAN_FILE MERGE_BASE HEAD`(MERGE_BASE = 分支起点的那个提交,例如 `git merge-base main HEAD`),把打印出的路径放进最终审查的分派里,这样最终审查者读一个文件就行,不必用 git 命令重新推导整个分支的 diff。用可用的最强模型分派(见"模型选择"),使用 /code-review 的 [code-reviewer.md](../code-review/code-reviewer.md)。把它指向账本里那些"延后的 Minor"和"已搁置"的行,让它甄别哪些必须在合并前修掉。
|
|
254
240
|
|
|
255
241
|
如果覆盖整个分支的最终审查返回了发现,用**一个**修复子智能体带着**完整的**发现清单去分派——不要一条发现一个修复者。逐条发现各派一个修复者,每个都要重建上下文、重跑测试套件;真实会话里,一次最终审查的修复浪潮花掉的成本超过它全部任务的总和。然后对这波修复跑**恰好一次**定向复审(对修复区间跑 `scripts/review-package PLAN_FILE FIX_BASE HEAD`,用 [re-review-prompt.md](re-review-prompt.md))。残留的发现按任务循环里熔断那套来裁定:带裁定搁置,或者在承重项上停下。**没有第二波修复**——残留的承重发现会在 finishing-a-development-branch 呈现选项时浮到你人类伙伴面前。
|
|
256
242
|
|
|
@@ -258,7 +244,7 @@ digraph process {
|
|
|
258
244
|
|
|
259
245
|
当覆盖整个分支的最终审查干净、且它的修复已合并时,删除**本计划**的工作区(`rm -rf <工作区>`)——现在 git 历史就是记录了。同级目录属于别的计划,别去动它们。
|
|
260
246
|
|
|
261
|
-
使用
|
|
247
|
+
使用 /finishing-a-development-branch。
|
|
262
248
|
|
|
263
249
|
## 常见的合理化借口
|
|
264
250
|
|
|
@@ -279,8 +265,8 @@ digraph process {
|
|
|
279
265
|
你:我正在用子智能体驱动开发来执行这个计划。
|
|
280
266
|
|
|
281
267
|
[准备:工作树已核实]
|
|
282
|
-
[把计划文件读一遍:docs/
|
|
283
|
-
[解析工作区:scripts/sdd-workspace docs/
|
|
268
|
+
[把计划文件读一遍:docs/plans/feature-plan.md]
|
|
269
|
+
[解析工作区:scripts/sdd-workspace docs/plans/feature-plan.md —— 里面没有账本,全新开始]
|
|
284
270
|
[为所有任务创建待办]
|
|
285
271
|
|
|
286
272
|
任务 1:Hook 安装脚本
|
|
@@ -289,7 +275,7 @@ digraph process {
|
|
|
289
275
|
|
|
290
276
|
实现者:"开始之前——这个 hook 应该装在用户级还是系统级?"
|
|
291
277
|
|
|
292
|
-
你:"用户级(~/.config/
|
|
278
|
+
你:"用户级(~/.config/hooks/)"
|
|
293
279
|
|
|
294
280
|
实现者:[稍后]
|
|
295
281
|
- 实现了 install-hook 命令
|
|
@@ -337,5 +323,5 @@ digraph process {
|
|
|
337
323
|
|
|
338
324
|
[删除本计划的工作区 —— 现在记录活在 git 里]
|
|
339
325
|
|
|
340
|
-
搞定!使用
|
|
326
|
+
搞定!使用 /finishing-a-development-branch。
|
|
341
327
|
```
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# tasks intact.
|
|
6
6
|
#
|
|
7
7
|
# Usage: review-package PLAN_FILE BASE HEAD [OUTFILE]
|
|
8
|
-
# Default OUTFILE: <repo-root
|
|
8
|
+
# Default OUTFILE: <repo-root>/docs/sdd/<plan-basename>/review-<base7>..<head7>.diff
|
|
9
9
|
# (named per range, so a re-review after fixes gets a distinct fresh file).
|
|
10
10
|
set -euo pipefail
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# short-lived artifacts: task briefs, implementer reports, review packages,
|
|
4
4
|
# and the progress ledger. Print the plan directory's absolute path.
|
|
5
5
|
#
|
|
6
|
-
# One directory per plan (
|
|
6
|
+
# One directory per plan (docs/sdd/<plan-basename>/) so a follow-up
|
|
7
7
|
# plan in the same working tree can never read or overwrite another plan's
|
|
8
8
|
# artifacts. A stale ledger misread as current progress makes controllers
|
|
9
9
|
# skip whole task sequences — plan-scoping removes that failure structurally.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# The workspace lives in the working tree (not under .git/) because Claude Code
|
|
12
12
|
# treats .git/ as a protected path and denies agent writes there — which blocks
|
|
13
13
|
# an implementer subagent from writing its report file. A self-ignoring
|
|
14
|
-
# .gitignore at
|
|
14
|
+
# .gitignore at docs/sdd/ keeps every plan's workspace out of
|
|
15
15
|
# `git status` and out of accidental commits without modifying any tracked file.
|
|
16
16
|
#
|
|
17
17
|
# Single source of truth for the workspace location, so task-brief and
|
|
@@ -33,7 +33,7 @@ slug=$(basename "$plan" .md)
|
|
|
33
33
|
|| { echo "cannot derive a workspace name from: $plan" >&2; exit 2; }
|
|
34
34
|
|
|
35
35
|
root=$(git rev-parse --show-toplevel)
|
|
36
|
-
base="$root
|
|
36
|
+
base="$root/docs/sdd"
|
|
37
37
|
dir="$base/$slug"
|
|
38
38
|
mkdir -p "$dir"
|
|
39
39
|
printf '*\n' > "$base/.gitignore"
|
|
@@ -4,13 +4,9 @@
|
|
|
4
4
|
# through the controller's context.
|
|
5
5
|
#
|
|
6
6
|
# Usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]
|
|
7
|
-
# Default OUTFILE: <repo-root
|
|
7
|
+
# Default OUTFILE: <repo-root>/docs/sdd/<plan-basename>/task-<N>-brief.md
|
|
8
8
|
# (per plan and per worktree; concurrent runs of the SAME plan in the same
|
|
9
9
|
# working tree share it).
|
|
10
|
-
#
|
|
11
|
-
# 中文 fork 适配:上游只识别英文任务标题 "## Task N",而 superpowers-zh
|
|
12
|
-
# 的 writing-plans 产出的是 "### 任务 N:..."。下方 awk 同时匹配
|
|
13
|
-
# "Task" 与 "任务",两种计划都能抽取。
|
|
14
10
|
set -euo pipefail
|
|
15
11
|
|
|
16
12
|
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: systematic-debugging
|
|
3
3
|
description: 遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行
|
|
4
|
-
version: "1.0.0"
|
|
5
|
-
license: MIT
|
|
6
|
-
metadata:
|
|
7
|
-
hermes:
|
|
8
|
-
tags: [debugging]
|
|
9
4
|
---
|
|
10
5
|
|
|
11
6
|
# 系统化调试
|
|
@@ -162,7 +157,7 @@ metadata:
|
|
|
162
157
|
- 尽可能用自动化测试
|
|
163
158
|
- 没有测试框架就写一次性测试脚本
|
|
164
159
|
- 修复前必须先有测试
|
|
165
|
-
- 使用 `
|
|
160
|
+
- 使用 `/tdd` 技能来编写规范的失败测试
|
|
166
161
|
|
|
167
162
|
2. **实施单一修复**
|
|
168
163
|
- 修复已定位的根本原因
|
|
@@ -174,7 +169,7 @@ metadata:
|
|
|
174
169
|
- 测试现在通过了吗?
|
|
175
170
|
- 其他测试没有被破坏吧?
|
|
176
171
|
- 问题真的解决了吗?
|
|
177
|
-
- 宣称成功之前,使用
|
|
172
|
+
- 宣称成功之前,使用 `/verification-before-completion` 技能
|
|
178
173
|
|
|
179
174
|
4. **如果修复不起作用**
|
|
180
175
|
- 停下来
|
|
@@ -262,11 +257,3 @@ metadata:
|
|
|
262
257
|
|
|
263
258
|
**但是:** 95% 的"找不到根因"其实是排查不充分。
|
|
264
259
|
|
|
265
|
-
## 辅助技术
|
|
266
|
-
|
|
267
|
-
以下技术是系统化调试的组成部分,可在本目录中找到:
|
|
268
|
-
|
|
269
|
-
- **`root-cause-tracing.md`** - 沿调用栈反向追踪 bug,找到最初的触发点
|
|
270
|
-
- **`defense-in-depth.md`** - 找到根因后,在多个层级添加校验
|
|
271
|
-
- **`condition-based-waiting.md`** - 用条件轮询替代硬编码等待时间
|
|
272
|
-
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: xlsx
|
|
3
3
|
description: "当电子表格文件是主要输入或输出时使用此技能。适用于用户需要执行以下操作的任何任务:打开、读取、编辑或修复现有.xlsx、.xlsm、.csv或.tsv文件(例如添加列、计算公式、格式化、制作图表、清理杂乱数据);从零开始或从其他数据源创建新电子表格;或在表格类文件格式之间转换。尤其当用户通过名称或路径引用电子表格文件时——即使是随意提及(比如"我下载文件夹里的xlsx")——并且需要对其进行操作或基于其生成内容时触发。也适用于清理或重构杂乱的表格数据文件(格式错误的行、错位的表头、垃圾数据)为规范的电子表格。交付物必须是电子表格文件。当主要交付物是Word文档、HTML报告、独立Python脚本、数据库流水线或Google Sheets API集成时,即使涉及表格数据也不要触发此技能。"
|
|
4
|
-
license: 专有。完整条款见LICENSE.txt
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# 输出要求
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: software-architecture
|
|
3
|
-
description: Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Software Architecture Development Skill
|
|
7
|
-
|
|
8
|
-
This skill provides guidance for quality focused software development and architecture. It is based on Clean Architecture and Domain Driven Design principles.
|
|
9
|
-
|
|
10
|
-
## Code Style Rules
|
|
11
|
-
|
|
12
|
-
### General Principles
|
|
13
|
-
|
|
14
|
-
- **Early return pattern**: Always use early returns when possible, over nested conditions for better readability
|
|
15
|
-
- Avoid code duplication through creation of reusable functions and modules
|
|
16
|
-
- Decompose long (more than 80 lines of code) components and functions into multiple smaller components and functions. If they cannot be used anywhere else, keep it in the same file. But if file longer than 200 lines of code, it should be split into multiple files.
|
|
17
|
-
- Use arrow functions instead of function declarations when possible
|
|
18
|
-
|
|
19
|
-
### Best Practices
|
|
20
|
-
|
|
21
|
-
#### Library-First Approach
|
|
22
|
-
|
|
23
|
-
- **ALWAYS search for existing solutions before writing custom code**
|
|
24
|
-
- Check npm for existing libraries that solve the problem
|
|
25
|
-
- Evaluate existing services/SaaS solutions
|
|
26
|
-
- Consider third-party APIs for common functionality
|
|
27
|
-
- Use libraries instead of writing your own utils or helpers. For example, use `cockatiel` instead of writing your own retry logic.
|
|
28
|
-
- **When custom code IS justified:**
|
|
29
|
-
- Specific business logic unique to the domain
|
|
30
|
-
- Performance-critical paths with special requirements
|
|
31
|
-
- When external dependencies would be overkill
|
|
32
|
-
- Security-sensitive code requiring full control
|
|
33
|
-
- When existing solutions don't meet requirements after thorough evaluation
|
|
34
|
-
|
|
35
|
-
#### Architecture and Design
|
|
36
|
-
|
|
37
|
-
- **Clean Architecture & DDD Principles:**
|
|
38
|
-
- Follow domain-driven design and ubiquitous language
|
|
39
|
-
- Separate domain entities from infrastructure concerns
|
|
40
|
-
- Keep business logic independent of frameworks
|
|
41
|
-
- Define use cases clearly and keep them isolated
|
|
42
|
-
- **Naming Conventions:**
|
|
43
|
-
- **AVOID** generic names: `utils`, `helpers`, `common`, `shared`
|
|
44
|
-
- **USE** domain-specific names: `OrderCalculator`, `UserAuthenticator`, `InvoiceGenerator`
|
|
45
|
-
- Follow bounded context naming patterns
|
|
46
|
-
- Each module should have a single, clear purpose
|
|
47
|
-
- **Separation of Concerns:**
|
|
48
|
-
- Do NOT mix business logic with UI components
|
|
49
|
-
- Keep database queries out of controllers
|
|
50
|
-
- Maintain clear boundaries between contexts
|
|
51
|
-
- Ensure proper separation of responsibilities
|
|
52
|
-
|
|
53
|
-
#### Anti-Patterns to Avoid
|
|
54
|
-
|
|
55
|
-
- **NIH (Not Invented Here) Syndrome:**
|
|
56
|
-
- Don't build custom auth when Auth0/Supabase exists
|
|
57
|
-
- Don't write custom state management instead of using Redux/Zustand
|
|
58
|
-
- Don't create custom form validation instead of using established libraries
|
|
59
|
-
- **Poor Architectural Choices:**
|
|
60
|
-
- Mixing business logic with UI components
|
|
61
|
-
- Database queries directly in controllers
|
|
62
|
-
- Lack of clear separation of concerns
|
|
63
|
-
- **Generic Naming Anti-Patterns:**
|
|
64
|
-
- `utils.js` with 50 unrelated functions
|
|
65
|
-
- `helpers/misc.js` as a dumping ground
|
|
66
|
-
- `common/shared.js` with unclear purpose
|
|
67
|
-
- Remember: Every line of custom code is a liability that needs maintenance, testing, and documentation
|
|
68
|
-
|
|
69
|
-
#### Code Quality
|
|
70
|
-
|
|
71
|
-
- Proper error handling with typed catch blocks
|
|
72
|
-
- Break down complex logic into smaller, reusable functions
|
|
73
|
-
- Avoid deep nesting (max 3 levels)
|
|
74
|
-
- Keep functions focused and under 50 lines when possible
|
|
75
|
-
- Keep files focused and under 200 lines of code when possible
|
|
76
|
-
```
|
|
@@ -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*
|