claude-agent-skills 1.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.
Files changed (153) hide show
  1. package/README.md +65 -0
  2. package/bundled-skills/ask-matt/SKILL.md +61 -0
  3. package/bundled-skills/brainstorming/SKILL.md +159 -0
  4. package/bundled-skills/brainstorming/scripts/frame-template.html +213 -0
  5. package/bundled-skills/brainstorming/scripts/helper.js +167 -0
  6. package/bundled-skills/brainstorming/scripts/server.cjs +723 -0
  7. package/bundled-skills/brainstorming/scripts/start-server.sh +209 -0
  8. package/bundled-skills/brainstorming/scripts/stop-server.sh +120 -0
  9. package/bundled-skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  10. package/bundled-skills/brainstorming/visual-companion.md +298 -0
  11. package/bundled-skills/cavecrew/README.md +41 -0
  12. package/bundled-skills/cavecrew/SKILL.md +82 -0
  13. package/bundled-skills/caveman/README.md +48 -0
  14. package/bundled-skills/caveman/SKILL.md +78 -0
  15. package/bundled-skills/caveman-commit/README.md +44 -0
  16. package/bundled-skills/caveman-commit/SKILL.md +65 -0
  17. package/bundled-skills/caveman-compress/README.md +163 -0
  18. package/bundled-skills/caveman-compress/SECURITY.md +31 -0
  19. package/bundled-skills/caveman-compress/SKILL.md +111 -0
  20. package/bundled-skills/caveman-compress/scripts/__init__.py +9 -0
  21. package/bundled-skills/caveman-compress/scripts/__main__.py +3 -0
  22. package/bundled-skills/caveman-compress/scripts/benchmark.py +80 -0
  23. package/bundled-skills/caveman-compress/scripts/cli.py +85 -0
  24. package/bundled-skills/caveman-compress/scripts/compress.py +342 -0
  25. package/bundled-skills/caveman-compress/scripts/detect.py +121 -0
  26. package/bundled-skills/caveman-compress/scripts/validate.py +213 -0
  27. package/bundled-skills/caveman-help/README.md +38 -0
  28. package/bundled-skills/caveman-help/SKILL.md +63 -0
  29. package/bundled-skills/caveman-review/README.md +33 -0
  30. package/bundled-skills/caveman-review/SKILL.md +55 -0
  31. package/bundled-skills/caveman-stats/README.md +30 -0
  32. package/bundled-skills/caveman-stats/SKILL.md +10 -0
  33. package/bundled-skills/codebase-design/DEEPENING.md +37 -0
  34. package/bundled-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  35. package/bundled-skills/codebase-design/SKILL.md +114 -0
  36. package/bundled-skills/council/SKILL.md +77 -0
  37. package/bundled-skills/diagnosing-bugs/SKILL.md +134 -0
  38. package/bundled-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  39. package/bundled-skills/dispatching-parallel-agents/SKILL.md +185 -0
  40. package/bundled-skills/domain-modeling/ADR-FORMAT.md +47 -0
  41. package/bundled-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  42. package/bundled-skills/domain-modeling/SKILL.md +74 -0
  43. package/bundled-skills/edit-article/SKILL.md +15 -0
  44. package/bundled-skills/executing-plans/SKILL.md +70 -0
  45. package/bundled-skills/finishing-a-development-branch/SKILL.md +241 -0
  46. package/bundled-skills/git-guardrails-claude-code/SKILL.md +95 -0
  47. package/bundled-skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
  48. package/bundled-skills/grill-me/SKILL.md +7 -0
  49. package/bundled-skills/grill-with-docs/SKILL.md +7 -0
  50. package/bundled-skills/grilling/SKILL.md +10 -0
  51. package/bundled-skills/handoff/SKILL.md +16 -0
  52. package/bundled-skills/i-am-dumb/SKILL.md +57 -0
  53. package/bundled-skills/implement/SKILL.md +15 -0
  54. package/bundled-skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  55. package/bundled-skills/improve-codebase-architecture/SKILL.md +66 -0
  56. package/bundled-skills/migrate-to-shoehorn/SKILL.md +118 -0
  57. package/bundled-skills/obsidian-vault/SKILL.md +59 -0
  58. package/bundled-skills/ponytail/SKILL.md +117 -0
  59. package/bundled-skills/ponytail-audit/SKILL.md +50 -0
  60. package/bundled-skills/ponytail-debt/SKILL.md +59 -0
  61. package/bundled-skills/ponytail-gain/SKILL.md +51 -0
  62. package/bundled-skills/ponytail-help/SKILL.md +43 -0
  63. package/bundled-skills/ponytail-review/SKILL.md +51 -0
  64. package/bundled-skills/prototype/LOGIC.md +79 -0
  65. package/bundled-skills/prototype/SKILL.md +31 -0
  66. package/bundled-skills/prototype/UI.md +112 -0
  67. package/bundled-skills/receiving-code-review/SKILL.md +213 -0
  68. package/bundled-skills/requesting-code-review/SKILL.md +103 -0
  69. package/bundled-skills/requesting-code-review/code-reviewer.md +172 -0
  70. package/bundled-skills/resolving-merge-conflicts/SKILL.md +14 -0
  71. package/bundled-skills/scaffold-exercises/SKILL.md +106 -0
  72. package/bundled-skills/setup-matt-pocock-skills/SKILL.md +127 -0
  73. package/bundled-skills/setup-matt-pocock-skills/domain.md +51 -0
  74. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-github.md +34 -0
  75. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +35 -0
  76. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
  77. package/bundled-skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  78. package/bundled-skills/setup-pre-commit/SKILL.md +91 -0
  79. package/bundled-skills/subagent-driven-development/SKILL.md +418 -0
  80. package/bundled-skills/subagent-driven-development/implementer-prompt.md +139 -0
  81. package/bundled-skills/subagent-driven-development/scripts/review-package +44 -0
  82. package/bundled-skills/subagent-driven-development/scripts/sdd-workspace +22 -0
  83. package/bundled-skills/subagent-driven-development/scripts/task-brief +40 -0
  84. package/bundled-skills/subagent-driven-development/task-reviewer-prompt.md +188 -0
  85. package/bundled-skills/systematic-debugging/CREATION-LOG.md +119 -0
  86. package/bundled-skills/systematic-debugging/SKILL.md +296 -0
  87. package/bundled-skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  88. package/bundled-skills/systematic-debugging/condition-based-waiting.md +115 -0
  89. package/bundled-skills/systematic-debugging/defense-in-depth.md +122 -0
  90. package/bundled-skills/systematic-debugging/find-polluter.sh +63 -0
  91. package/bundled-skills/systematic-debugging/root-cause-tracing.md +169 -0
  92. package/bundled-skills/systematic-debugging/test-academic.md +14 -0
  93. package/bundled-skills/systematic-debugging/test-pressure-1.md +58 -0
  94. package/bundled-skills/systematic-debugging/test-pressure-2.md +68 -0
  95. package/bundled-skills/systematic-debugging/test-pressure-3.md +69 -0
  96. package/bundled-skills/tdd/SKILL.md +108 -0
  97. package/bundled-skills/tdd/mocking.md +59 -0
  98. package/bundled-skills/tdd/refactoring.md +10 -0
  99. package/bundled-skills/tdd/tests.md +61 -0
  100. package/bundled-skills/teach/GLOSSARY-FORMAT.md +35 -0
  101. package/bundled-skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  102. package/bundled-skills/teach/MISSION-FORMAT.md +31 -0
  103. package/bundled-skills/teach/RESOURCES-FORMAT.md +32 -0
  104. package/bundled-skills/teach/SKILL.md +140 -0
  105. package/bundled-skills/test-driven-development/SKILL.md +371 -0
  106. package/bundled-skills/test-driven-development/testing-anti-patterns.md +299 -0
  107. package/bundled-skills/to-issues/SKILL.md +84 -0
  108. package/bundled-skills/to-prd/SKILL.md +75 -0
  109. package/bundled-skills/triage/AGENT-BRIEF.md +207 -0
  110. package/bundled-skills/triage/OUT-OF-SCOPE.md +105 -0
  111. package/bundled-skills/triage/SKILL.md +112 -0
  112. package/bundled-skills/using-git-worktrees/SKILL.md +202 -0
  113. package/bundled-skills/using-superpowers/SKILL.md +121 -0
  114. package/bundled-skills/using-superpowers/references/antigravity-tools.md +96 -0
  115. package/bundled-skills/using-superpowers/references/claude-code-tools.md +50 -0
  116. package/bundled-skills/using-superpowers/references/codex-tools.md +72 -0
  117. package/bundled-skills/using-superpowers/references/copilot-tools.md +49 -0
  118. package/bundled-skills/using-superpowers/references/gemini-tools.md +63 -0
  119. package/bundled-skills/using-superpowers/references/pi-tools.md +28 -0
  120. package/bundled-skills/verification-before-completion/SKILL.md +139 -0
  121. package/bundled-skills/writing-great-skills/GLOSSARY.md +195 -0
  122. package/bundled-skills/writing-great-skills/SKILL.md +82 -0
  123. package/bundled-skills/writing-plans/SKILL.md +174 -0
  124. package/bundled-skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  125. package/bundled-skills/writing-skills/SKILL.md +689 -0
  126. package/bundled-skills/writing-skills/anthropic-best-practices.md +1150 -0
  127. package/bundled-skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  128. package/bundled-skills/writing-skills/graphviz-conventions.dot +172 -0
  129. package/bundled-skills/writing-skills/persuasion-principles.md +187 -0
  130. package/bundled-skills/writing-skills/render-graphs.js +168 -0
  131. package/bundled-skills/writing-skills/testing-skills-with-subagents.md +384 -0
  132. package/commands/add.js +97 -0
  133. package/commands/check.js +54 -0
  134. package/commands/exportSkills.js +30 -0
  135. package/commands/hub.js +52 -0
  136. package/commands/importSkills.js +68 -0
  137. package/commands/list.js +37 -0
  138. package/commands/remove.js +59 -0
  139. package/commands/sync.js +66 -0
  140. package/commands/update.js +70 -0
  141. package/index.js +100 -0
  142. package/lib/banner.js +108 -0
  143. package/lib/constants.js +10 -0
  144. package/lib/deps.js +51 -0
  145. package/lib/hash.js +26 -0
  146. package/lib/install.js +31 -0
  147. package/lib/lockfile.js +37 -0
  148. package/lib/prompts.js +50 -0
  149. package/lib/scope.js +19 -0
  150. package/lib/summary.js +108 -0
  151. package/lib/theme.js +11 -0
  152. package/package.json +43 -0
  153. package/skills.json +164 -0
@@ -0,0 +1,418 @@
1
+ ---
2
+ name: subagent-driven-development
3
+ description: Use when executing implementation plans with independent tasks in the current session
4
+ ---
5
+
6
+ # Subagent-Driven Development
7
+
8
+ Execute plan by dispatching a fresh implementer subagent per task, a task review (spec compliance + code quality) after each, and a broad whole-branch review at the end.
9
+
10
+ **Why subagents:** You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
11
+
12
+ **Core principle:** Fresh subagent per task + task review (spec + quality) + broad final review = high quality, fast iteration
13
+
14
+ **Narration:** between tool calls, narrate at most one short line — the
15
+ ledger and the tool results carry the record.
16
+
17
+ **Continuous execution:** Do not pause to check in with your human partner between tasks. Execute all tasks from the plan without stopping. The only reasons to stop are: BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
18
+
19
+ ## When to Use
20
+
21
+ ```dot
22
+ digraph when_to_use {
23
+ "Have implementation plan?" [shape=diamond];
24
+ "Tasks mostly independent?" [shape=diamond];
25
+ "Stay in this session?" [shape=diamond];
26
+ "subagent-driven-development" [shape=box];
27
+ "executing-plans" [shape=box];
28
+ "Manual execution or brainstorm first" [shape=box];
29
+
30
+ "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
31
+ "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
32
+ "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
33
+ "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
34
+ "Stay in this session?" -> "subagent-driven-development" [label="yes"];
35
+ "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
36
+ }
37
+ ```
38
+
39
+ **vs. Executing Plans (parallel session):**
40
+ - Same session (no context switch)
41
+ - Fresh subagent per task (no context pollution)
42
+ - Review after each task (spec compliance + code quality), broad review at the end
43
+ - Faster iteration (no human-in-loop between tasks)
44
+
45
+ ## The Process
46
+
47
+ ```dot
48
+ digraph process {
49
+ rankdir=TB;
50
+
51
+ subgraph cluster_per_task {
52
+ label="Per Task";
53
+ "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
54
+ "Implementer subagent asks questions?" [shape=diamond];
55
+ "Answer questions, provide context" [shape=box];
56
+ "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
57
+ "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [shape=box];
58
+ "Task reviewer reports spec ✅ and quality approved?" [shape=diamond];
59
+ "Dispatch fix subagent for Critical/Important findings" [shape=box];
60
+ "Mark task complete in todo list and progress ledger" [shape=box];
61
+ }
62
+
63
+ "Read plan, note context and global constraints, create todos" [shape=box];
64
+ "More tasks remain?" [shape=diamond];
65
+ "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [shape=box];
66
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
67
+
68
+ "Read plan, note context and global constraints, create todos" -> "Dispatch implementer subagent (./implementer-prompt.md)";
69
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
70
+ "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
71
+ "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
72
+ "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
73
+ "Implementer subagent implements, tests, commits, self-reviews" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)";
74
+ "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" -> "Task reviewer reports spec ✅ and quality approved?";
75
+ "Task reviewer reports spec ✅ and quality approved?" -> "Dispatch fix subagent for Critical/Important findings" [label="no"];
76
+ "Dispatch fix subagent for Critical/Important findings" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [label="re-review"];
77
+ "Task reviewer reports spec ✅ and quality approved?" -> "Mark task complete in todo list and progress ledger" [label="yes"];
78
+ "Mark task complete in todo list and progress ledger" -> "More tasks remain?";
79
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
80
+ "More tasks remain?" -> "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [label="no"];
81
+ "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" -> "Use superpowers:finishing-a-development-branch";
82
+ }
83
+ ```
84
+
85
+ ## Pre-Flight Plan Review
86
+
87
+ Before dispatching Task 1, scan the plan once for conflicts:
88
+
89
+ - tasks that contradict each other or the plan's Global Constraints
90
+ - anything the plan explicitly mandates that the review rubric treats as a
91
+ defect (a test that asserts nothing, verbatim duplication of a logic block)
92
+
93
+ Present everything you find to your human partner as one batched question —
94
+ each finding beside the plan text that mandates it, asking which governs —
95
+ before execution begins, not one interrupt per discovery mid-plan. If the
96
+ scan is clean, proceed without comment. The review loop remains the net for
97
+ conflicts that only emerge from implementation.
98
+
99
+ ## Model Selection
100
+
101
+ Use the least powerful model that can handle each role to conserve cost and increase speed.
102
+
103
+ **Mechanical implementation tasks** (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.
104
+
105
+ **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
106
+
107
+ **Architecture and design tasks**: use the most capable available model.
108
+ The final whole-branch review is one of these — dispatch it on the most
109
+ capable available model, not the session default.
110
+
111
+ **Review tasks**: choose the model with the same judgment, scaled to the
112
+ diff's size, complexity, and risk. A small mechanical diff does not need the
113
+ most capable model; a subtle concurrency change does.
114
+
115
+ **Always specify the model explicitly when dispatching a subagent.** An
116
+ omitted model inherits your session's model — often the most capable and
117
+ most expensive — which silently defeats this section.
118
+
119
+ **Turn count beats token price.** Wall-clock and context cost scale with how
120
+ many turns a subagent takes, and the cheapest models routinely take 2-3× the
121
+ turns on multi-step work — costing more overall. Use a mid-tier model as the
122
+ floor for reviewers and for implementers working from prose descriptions.
123
+ When the task's plan text contains the complete code to write, the
124
+ implementation is transcription plus testing: use the cheapest tier for
125
+ that implementer. Single-file mechanical fixes also take the cheapest tier.
126
+
127
+ **Task complexity signals (implementation tasks):**
128
+ - Touches 1-2 files with a complete spec → cheap model
129
+ - Touches multiple files with integration concerns → standard model
130
+ - Requires design judgment or broad codebase understanding → most capable model
131
+
132
+ ## Handling Implementer Status
133
+
134
+ Implementer subagents report one of four statuses. Handle each appropriately:
135
+
136
+ **DONE:** Generate the review package (`scripts/review-package BASE HEAD`, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.
137
+
138
+ **DONE_WITH_CONCERNS:** The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.
139
+
140
+ **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
141
+
142
+ **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
143
+ 1. If it's a context problem, provide more context and re-dispatch with the same model
144
+ 2. If the task requires more reasoning, re-dispatch with a more capable model
145
+ 3. If the task is too large, break it into smaller pieces
146
+ 4. If the plan itself is wrong, escalate to the human
147
+
148
+ **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
149
+
150
+ ## Handling Reviewer ⚠️ Items
151
+
152
+ The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
153
+ that live in unchanged code or span tasks. These do not block the rest of the
154
+ review, but you must resolve each one yourself before marking the task
155
+ complete: you hold the plan and cross-task context the reviewer
156
+ lacks. If you confirm an item is a real gap, treat it as a failed spec
157
+ review — send it back to the implementer and re-review.
158
+
159
+ ## Constructing Reviewer Prompts
160
+
161
+ Per-task reviews are task-scoped gates. The broad review happens once, at the
162
+ final whole-branch review. When you fill a reviewer template:
163
+
164
+ - Do not add open-ended directives like "check all uses" or "run race tests
165
+ if useful" without a concrete, task-specific reason
166
+ - Do not ask a reviewer to re-run tests the implementer already ran on the
167
+ same code — the implementer's report carries the test evidence
168
+ - Do not pre-judge findings for the reviewer — never instruct a reviewer to
169
+ ignore or not flag a specific issue. If you believe a finding would be a
170
+ false positive, let the reviewer raise it and adjudicate it in the review
171
+ loop. If the prompt you are writing contains "do not flag," "don't treat X
172
+ as a defect," "at most Minor," or "the plan chose" — stop: you are
173
+ pre-judging, usually to spare yourself a review loop.
174
+ - The global-constraints block you hand the reviewer is its attention
175
+ lens. Copy the binding requirements verbatim from the plan's Global
176
+ Constraints section or the spec: exact values, exact formats, and the
177
+ stated relationships between components ("same layout as X", "matches
178
+ Y"). The reviewer's template already carries the process rules (YAGNI,
179
+ test hygiene, review method) — the constraints block is for what THIS
180
+ project's spec demands.
181
+ - Hand the reviewer its diff as a file: run this skill's
182
+ `scripts/review-package BASE HEAD` and pass the reviewer the file path
183
+ it prints (or, without bash: `git log --oneline`, `git diff --stat`,
184
+ and `git diff -U10` for the range, redirected to one uniquely named
185
+ file). The output never enters your own context, and the reviewer sees
186
+ the commit list, stat summary, and full diff with context in one Read
187
+ call. Use the BASE you recorded before dispatching the implementer —
188
+ never `HEAD~1`, which silently truncates multi-commit tasks.
189
+ - A dispatch prompt describes one task, not the session's history. Do not
190
+ paste accumulated prior-task summaries ("state after Tasks 1-3") into
191
+ later dispatches — a real session's dispatch hit 42k chars of which 99%
192
+ was pasted history. A fresh subagent needs its task, the interfaces it
193
+ touches, and the global constraints. Nothing else.
194
+ - Dispatch fix subagents for Critical and Important findings. Record Minor
195
+ findings in the progress ledger as you go, and point the final
196
+ whole-branch review at that list so it can triage which must be fixed
197
+ before merge. A roll-up nobody reads is a silent discard.
198
+ - A finding labeled plan-mandated — or any finding that conflicts with
199
+ what the plan's text requires — is the human's decision, like any plan
200
+ contradiction: present the finding and the plan text, ask which governs.
201
+ Do not dismiss the finding because the plan mandates it, and do not
202
+ dispatch a fix that contradicts the plan without asking.
203
+ - The final whole-branch review gets a package too: run
204
+ `scripts/review-package MERGE_BASE HEAD` (MERGE_BASE = the commit the
205
+ branch started from, e.g. `git merge-base main HEAD`) and include the
206
+ printed path in the final review dispatch, so the final reviewer reads
207
+ one file instead of re-deriving the branch diff with git commands.
208
+ - Every fix dispatch carries the implementer contract: the fix subagent
209
+ re-runs the tests covering its change and reports the results. Name the
210
+ covering test files in the dispatch — a one-line fix does not need the
211
+ whole suite. Before re-dispatching the reviewer, confirm the fix report
212
+ contains the covering tests, the command run, and the output; dispatch
213
+ the re-review once all three are present.
214
+ - If the final whole-branch review returns findings, dispatch ONE fix
215
+ subagent with the complete findings list — not one fixer per finding.
216
+ Per-finding fixers each rebuild context and re-run suites; a real
217
+ session's final-review fix wave cost more than all its tasks combined.
218
+
219
+ ## File Handoffs
220
+
221
+ Everything you paste into a dispatch prompt — and everything a subagent
222
+ prints back — stays resident in your context for the rest of the session
223
+ and is re-read on every later turn. Hand artifacts over as files:
224
+
225
+ - **Task brief:** before dispatching an implementer, run this skill's
226
+ `scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
227
+ uniquely named file and prints the path. Compose the dispatch so the
228
+ brief stays the single source of requirements. Your dispatch should
229
+ contain: (1) one line on where this task fits in the project; (2) the
230
+ brief path, introduced as "read this first — it is your requirements,
231
+ with the exact values to use verbatim"; (3) interfaces and decisions
232
+ from earlier tasks that the brief cannot know; (4) your resolution of
233
+ any ambiguity you noticed in the brief; (5) the report-file path and
234
+ report contract. Exact values (numbers, magic strings, signatures, test
235
+ cases) appear only in the brief.
236
+ - **Report file:** name the implementer's report file after the brief
237
+ (brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
238
+ the dispatch prompt. The implementer writes the full report there and
239
+ returns only status, commits, a one-line test summary, and concerns.
240
+ - **Reviewer inputs:** the task reviewer gets three paths — the same brief
241
+ file, the report file, and the review package — plus the global
242
+ constraints that bind the task.
243
+ - Fix dispatches append their fix report (with test results) to the same
244
+ report file and return a short summary; re-reviews read the updated file.
245
+
246
+ ## Durable Progress
247
+
248
+ Conversation memory does not survive compaction. In real sessions,
249
+ controllers that lost their place have re-dispatched entire completed task
250
+ sequences — the single most expensive failure observed. Track progress in
251
+ a ledger file, not only in todos.
252
+
253
+ - At skill start, check for a ledger:
254
+ `cat "$(git rev-parse --show-toplevel)/.superpowers/sdd/progress.md"`. Tasks listed there
255
+ as complete are DONE — do not re-dispatch them; resume at the first task
256
+ not marked complete.
257
+ - When a task's review comes back clean, append one line to the ledger in
258
+ the same message as your other bookkeeping:
259
+ `Task N: complete (commits <base7>..<head7>, review clean)`.
260
+ - The ledger is your recovery map: the commits it names exist in git even
261
+ when your context no longer remembers creating them. After compaction,
262
+ trust the ledger and `git log` over your own recollection.
263
+ - `git clean -fdx` will destroy the ledger (it's git-ignored scratch); if
264
+ that happens, recover from `git log`.
265
+
266
+ ## Prompt Templates
267
+
268
+ - [implementer-prompt.md](implementer-prompt.md) - Dispatch implementer subagent
269
+ - [task-reviewer-prompt.md](task-reviewer-prompt.md) - Dispatch task reviewer subagent (spec compliance + code quality)
270
+ - Final whole-branch review: use superpowers:requesting-code-review's [code-reviewer.md](../requesting-code-review/code-reviewer.md)
271
+
272
+ ## Example Workflow
273
+
274
+ ```
275
+ You: I'm using Subagent-Driven Development to execute this plan.
276
+
277
+ [Read plan file once: docs/superpowers/plans/feature-plan.md]
278
+ [Create todos for all tasks]
279
+
280
+ Task 1: Hook installation script
281
+
282
+ [Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
283
+
284
+ Implementer: "Before I begin - should the hook be installed at user or system level?"
285
+
286
+ You: "User level (~/.config/superpowers/hooks/)"
287
+
288
+ Implementer: "Got it. Implementing now..."
289
+ [Later] Implementer:
290
+ - Implemented install-hook command
291
+ - Added tests, 5/5 passing
292
+ - Self-review: Found I missed --force flag, added it
293
+ - Committed
294
+
295
+ [Run review-package, dispatch task reviewer with the printed path]
296
+ Task reviewer: Spec ✅ - all requirements met, nothing extra.
297
+ Strengths: Good test coverage, clean. Issues: None. Task quality: Approved.
298
+
299
+ [Mark Task 1 complete]
300
+
301
+ Task 2: Recovery modes
302
+
303
+ [Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
304
+
305
+ Implementer: [No questions, proceeds]
306
+ Implementer:
307
+ - Added verify/repair modes
308
+ - 8/8 tests passing
309
+ - Self-review: All good
310
+ - Committed
311
+
312
+ [Run review-package, dispatch task reviewer with the printed path]
313
+ Task reviewer: Spec ❌:
314
+ - Missing: Progress reporting (spec says "report every 100 items")
315
+ - Extra: Added --json flag (not requested)
316
+ Issues (Important): Magic number (100)
317
+
318
+ [Dispatch fix subagent with all findings]
319
+ Fixer: Removed --json flag, added progress reporting, extracted PROGRESS_INTERVAL constant
320
+
321
+ [Task reviewer reviews again]
322
+ Task reviewer: Spec ✅. Task quality: Approved.
323
+
324
+ [Mark Task 2 complete]
325
+
326
+ ...
327
+
328
+ [After all tasks]
329
+ [Dispatch final code-reviewer]
330
+ Final reviewer: All requirements met, ready to merge
331
+
332
+ Done!
333
+ ```
334
+
335
+ ## Advantages
336
+
337
+ **vs. Manual execution:**
338
+ - Subagents follow TDD naturally
339
+ - Fresh context per task (no confusion)
340
+ - Parallel-safe (subagents don't interfere)
341
+ - Subagent can ask questions (before AND during work)
342
+
343
+ **vs. Executing Plans:**
344
+ - Same session (no handoff)
345
+ - Continuous progress (no waiting)
346
+ - Review checkpoints automatic
347
+
348
+ **Efficiency gains:**
349
+ - Controller curates exactly what context is needed; bulk artifacts move
350
+ as files, not pasted text
351
+ - Subagent gets complete information upfront
352
+ - Questions surfaced before work begins (not after)
353
+
354
+ **Quality gates:**
355
+ - Self-review catches issues before handoff
356
+ - Task review carries two verdicts: spec compliance and code quality
357
+ - Review loops ensure fixes actually work
358
+ - Spec compliance prevents over/under-building
359
+ - Code quality ensures implementation is well-built
360
+
361
+ **Cost:**
362
+ - More subagent invocations (implementer + reviewer per task)
363
+ - Controller does more prep work (extracting all tasks upfront)
364
+ - Review loops add iterations
365
+ - But catches issues early (cheaper than debugging later)
366
+
367
+ ## Red Flags
368
+
369
+ **Never:**
370
+ - Start implementation on main/master branch without explicit user consent
371
+ - Skip task review, or accept a report missing either verdict (spec compliance AND task quality are both required)
372
+ - Proceed with unfixed issues
373
+ - Dispatch multiple implementation subagents in parallel (conflicts)
374
+ - Make a subagent read the whole plan file (hand it its task brief —
375
+ `scripts/task-brief` — instead)
376
+ - Skip scene-setting context (subagent needs to understand where task fits)
377
+ - Ignore subagent questions (answer before letting them proceed)
378
+ - Accept "close enough" on spec compliance (reviewer found spec issues = not done)
379
+ - Skip review loops (reviewer found issues = implementer fixes = review again)
380
+ - Let implementer self-review replace actual review (both are needed)
381
+ - Tell a reviewer what not to flag, or pre-rate a finding's severity in the
382
+ dispatch prompt ("treat it as Minor at most") — the plan's example code is
383
+ a starting point, not evidence that its weaknesses were chosen
384
+ - Dispatch a task reviewer without a diff file — generate it first
385
+ (`scripts/review-package BASE HEAD`) and name the printed path in the
386
+ prompt
387
+ - Move to next task while the review has open Critical/Important issues
388
+ - Re-dispatch a task the progress ledger already marks complete — check
389
+ the ledger (and `git log`) after any compaction or resume
390
+
391
+ **If subagent asks questions:**
392
+ - Answer clearly and completely
393
+ - Provide additional context if needed
394
+ - Don't rush them into implementation
395
+
396
+ **If reviewer finds issues:**
397
+ - Implementer (same subagent) fixes them
398
+ - Reviewer reviews again
399
+ - Repeat until approved
400
+ - Don't skip the re-review
401
+
402
+ **If subagent fails task:**
403
+ - Dispatch fix subagent with specific instructions
404
+ - Don't try to fix manually (context pollution)
405
+
406
+ ## Integration
407
+
408
+ **Required workflow skills:**
409
+ - **superpowers:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)
410
+ - **superpowers:writing-plans** - Creates the plan this skill executes
411
+ - **superpowers:requesting-code-review** - Code review template for the final whole-branch review
412
+ - **superpowers:finishing-a-development-branch** - Complete development after all tasks
413
+
414
+ **Subagents should use:**
415
+ - **superpowers:test-driven-development** - Subagents follow TDD for each task
416
+
417
+ **Alternative workflow:**
418
+ - **superpowers:executing-plans** - Use for parallel session instead of same-session execution
@@ -0,0 +1,139 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementer subagent.
4
+
5
+ ```
6
+ Subagent (general-purpose):
7
+ description: "Implement Task N: [task name]"
8
+ model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
9
+ model silently inherits the session's most expensive one]
10
+ prompt: |
11
+ You are implementing Task N: [task name]
12
+
13
+ ## Task Description
14
+
15
+ Read your task brief first: [BRIEF_FILE]
16
+ It contains the full task text from the plan.
17
+
18
+ ## Context
19
+
20
+ [Scene-setting: where this fits, dependencies, architectural context]
21
+
22
+ ## Before You Begin
23
+
24
+ If you have questions about:
25
+ - The requirements or acceptance criteria
26
+ - The approach or implementation strategy
27
+ - Dependencies or assumptions
28
+ - Anything unclear in the task description
29
+
30
+ **Ask them now.** Raise any concerns before starting work.
31
+
32
+ ## Your Job
33
+
34
+ Once you're clear on requirements:
35
+ 1. Implement exactly what the task specifies
36
+ 2. Write tests (following TDD if task says to)
37
+ 3. Verify implementation works
38
+ 4. Commit your work
39
+ 5. Self-review (see below)
40
+ 6. Report back
41
+
42
+ Work from: [directory]
43
+
44
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
45
+ It's always OK to pause and clarify. Don't guess or make assumptions.
46
+
47
+ While iterating, run the focused test for what you're changing; run the
48
+ full suite once before committing, not after every edit.
49
+
50
+ ## Code Organization
51
+
52
+ You reason best about code you can hold in context at once, and your edits are more
53
+ reliable when files are focused. Keep this in mind:
54
+ - Follow the file structure defined in the plan
55
+ - Each file should have one clear responsibility with a well-defined interface
56
+ - If a file you're creating is growing beyond the plan's intent, stop and report
57
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
58
+ - If an existing file you're modifying is already large or tangled, work carefully
59
+ and note it as a concern in your report
60
+ - In existing codebases, follow established patterns. Improve code you're touching
61
+ the way a good developer would, but don't restructure things outside your task.
62
+
63
+ ## When You're in Over Your Head
64
+
65
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
66
+ no work. You will not be penalized for escalating.
67
+
68
+ **STOP and escalate when:**
69
+ - The task requires architectural decisions with multiple valid approaches
70
+ - You need to understand code beyond what was provided and can't find clarity
71
+ - You feel uncertain about whether your approach is correct
72
+ - The task involves restructuring existing code in ways the plan didn't anticipate
73
+ - You've been reading file after file trying to understand the system without progress
74
+
75
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
76
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
77
+ The controller can provide more context, re-dispatch with a more capable model,
78
+ or break the task into smaller pieces.
79
+
80
+ ## Before Reporting Back: Self-Review
81
+
82
+ Review your work with fresh eyes. Ask yourself:
83
+
84
+ **Completeness:**
85
+ - Did I fully implement everything in the spec?
86
+ - Did I miss any requirements?
87
+ - Are there edge cases I didn't handle?
88
+
89
+ **Quality:**
90
+ - Is this my best work?
91
+ - Are names clear and accurate (match what things do, not how they work)?
92
+ - Is the code clean and maintainable?
93
+
94
+ **Discipline:**
95
+ - Did I avoid overbuilding (YAGNI)?
96
+ - Did I only build what was requested?
97
+ - Did I follow existing patterns in the codebase?
98
+
99
+ **Testing:**
100
+ - Do tests actually verify behavior (not just mock behavior)?
101
+ - Did I follow TDD if required?
102
+ - Are tests comprehensive?
103
+ - Is the test output pristine (no stray warnings or noise)?
104
+
105
+ If you find issues during self-review, fix them now before reporting.
106
+
107
+ ## After Review Findings
108
+
109
+ If a reviewer finds issues and you fix them, re-run the tests that cover
110
+ the amended code and append the results to your report file. Reviewers
111
+ will not re-run tests for you — your report is the test evidence.
112
+
113
+ ## Report Format
114
+
115
+ Write your full report to [REPORT_FILE]:
116
+ - What you implemented (or what you attempted, if blocked)
117
+ - What you tested and test results
118
+ - **TDD Evidence** (if TDD was required for this task):
119
+ - RED: command run, relevant failing output before implementation, and why the failure was expected
120
+ - GREEN: command run and relevant passing output after implementation
121
+ - Files changed
122
+ - Self-review findings (if any)
123
+ - Any issues or concerns
124
+
125
+ Then report back with ONLY (under 15 lines — the detail lives in the
126
+ report file):
127
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
128
+ - Commits created (short SHA + subject)
129
+ - One-line test summary (e.g. "14/14 passing, output pristine")
130
+ - Your concerns, if any
131
+ - The report file path
132
+
133
+ If BLOCKED or NEEDS_CONTEXT, put the specifics in the final message
134
+ itself — the controller acts on it directly.
135
+
136
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
137
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
138
+ information that wasn't provided. Never silently produce work you're unsure about.
139
+ ```
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # Generate a review package: commit list, stat summary, and the net
3
+ # diff with extended context, written to a file the reviewer reads in one
4
+ # call. Using the recorded per-task BASE (not HEAD~1) keeps multi-commit
5
+ # tasks intact.
6
+ #
7
+ # Usage: review-package BASE HEAD [OUTFILE]
8
+ # Default OUTFILE: <repo-root>/.superpowers/sdd/review-<base7>..<head7>.diff
9
+ # (named per range, so a re-review after fixes gets a distinct fresh file).
10
+ set -euo pipefail
11
+
12
+ if [ $# -lt 2 ] || [ $# -gt 3 ]; then
13
+ echo "usage: review-package BASE HEAD [OUTFILE]" >&2
14
+ exit 2
15
+ fi
16
+
17
+ base=$1
18
+ head=$2
19
+
20
+ git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; }
21
+ git rev-parse --verify --quiet "$head" >/dev/null || { echo "bad HEAD: $head" >&2; exit 2; }
22
+
23
+ if [ $# -eq 3 ]; then
24
+ out=$3
25
+ else
26
+ dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace")
27
+ out="$dir/review-$(git rev-parse --short "$base")..$(git rev-parse --short "$head").diff"
28
+ fi
29
+
30
+ {
31
+ echo "# Review package: ${base}..${head}"
32
+ echo
33
+ echo "## Commits"
34
+ git log --oneline "${base}..${head}"
35
+ echo
36
+ echo "## Files changed"
37
+ git diff --stat "${base}..${head}"
38
+ echo
39
+ echo "## Diff"
40
+ git diff -U10 "${base}..${head}"
41
+ } > "$out"
42
+
43
+ commits=$(git rev-list --count "${base}..${head}")
44
+ echo "wrote ${out}: ${commits} commit(s), $(wc -c < "$out" | tr -d ' ') bytes"
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+ # Resolve and ensure the working-tree directory SDD uses for its short-lived
3
+ # artifacts: task briefs, implementer reports, review packages, and the
4
+ # progress ledger. Print the directory's absolute path.
5
+ #
6
+ # The workspace lives in the working tree (not under .git/) because Claude Code
7
+ # treats .git/ as a protected path and denies agent writes there — which blocks
8
+ # an implementer subagent from writing its report file. A self-ignoring
9
+ # .gitignore keeps the workspace out of `git status` and out of accidental
10
+ # commits without modifying any tracked file.
11
+ #
12
+ # Single source of truth for the workspace location, so task-brief and
13
+ # review-package cannot drift to different directories.
14
+ #
15
+ # Usage: sdd-workspace
16
+ set -euo pipefail
17
+
18
+ root=$(git rev-parse --show-toplevel)
19
+ dir="$root/.superpowers/sdd"
20
+ mkdir -p "$dir"
21
+ printf '*\n' > "$dir/.gitignore"
22
+ cd "$dir" && pwd
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bash
2
+ # Extract one task's full text from an implementation plan into a file the
3
+ # implementer reads in one call, so the task text never has to be pasted
4
+ # through the controller's context.
5
+ #
6
+ # Usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]
7
+ # Default OUTFILE: <repo-root>/.superpowers/sdd/task-<N>-brief.md
8
+ # (per worktree; concurrent runs in the same working tree share it).
9
+ set -euo pipefail
10
+
11
+ if [ $# -lt 2 ] || [ $# -gt 3 ]; then
12
+ echo "usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]" >&2
13
+ exit 2
14
+ fi
15
+
16
+ plan=$1
17
+ n=$2
18
+ [ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }
19
+
20
+ if [ $# -eq 3 ]; then
21
+ out=$3
22
+ else
23
+ dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace")
24
+ out="$dir/task-${n}-brief.md"
25
+ fi
26
+
27
+ awk -v n="$n" '
28
+ /^```/ { infence = !infence }
29
+ !infence && /^#+[ \t]+Task[ \t]+[0-9]+/ {
30
+ intask = ($0 ~ ("^#+[ \t]+Task[ \t]+" n "([^0-9]|$)"))
31
+ }
32
+ intask { print }
33
+ ' "$plan" > "$out"
34
+
35
+ if [ ! -s "$out" ]; then
36
+ echo "task ${n} not found in ${plan} (no heading matching 'Task ${n}')" >&2
37
+ exit 3
38
+ fi
39
+
40
+ echo "wrote ${out}: $(wc -l < "$out" | tr -d ' ') lines"