@hecer/yoke 1.11.0 → 1.13.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 (155) hide show
  1. package/.claude-plugin/plugin.json +13 -13
  2. package/.codex-plugin/plugin.json +7 -7
  3. package/CHANGELOG.md +435 -398
  4. package/README.md +943 -915
  5. package/TODOS.md +5 -5
  6. package/agents/docs.toml +6 -6
  7. package/agents/implementer.toml +6 -6
  8. package/agents/reviewer.toml +6 -6
  9. package/agents/security.toml +6 -6
  10. package/bench/README.md +86 -86
  11. package/bench/RESULTS.md +35 -35
  12. package/bench/output-compaction.mjs +65 -65
  13. package/bench/result-schema.mjs +12 -12
  14. package/bench/results/claude-2026-07-27T18-03-26.json +50 -50
  15. package/bench/results/codex-unavailable-1785175418318.json +15 -15
  16. package/bench/results/gemini-2026-07-27T18-03-44.json +46 -46
  17. package/bench/run-matrix.mjs +26 -26
  18. package/bench/run.mjs +106 -106
  19. package/canon/AGENTS.md +30 -30
  20. package/canon/context/DECISIONS.md +4 -4
  21. package/canon/context/GLOSSARY.md +11 -11
  22. package/canon/context/KNOWLEDGE.md +4 -4
  23. package/canon/context/PROJECT.md +15 -15
  24. package/canon/loop/loop-spec.md +65 -65
  25. package/canon/loop/prd.schema.md +41 -41
  26. package/canon/manifest.yaml +59 -59
  27. package/canon/policy/gates.md +7 -7
  28. package/canon/policy/roles.md +9 -9
  29. package/canon/skills/ATTRIBUTION.md +99 -99
  30. package/canon/skills/authoring-prd/SKILL.md +57 -57
  31. package/canon/skills/brainstorming/SKILL.md +164 -164
  32. package/canon/skills/codebase-design/DEEPENING.md +15 -15
  33. package/canon/skills/codebase-design/DESIGN-IT-TWICE.md +12 -12
  34. package/canon/skills/codebase-design/SKILL.md +39 -39
  35. package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -182
  36. package/canon/skills/document-release/SKILL.md +302 -302
  37. package/canon/skills/domain-modeling/ADR-FORMAT.md +19 -19
  38. package/canon/skills/domain-modeling/CONTEXT-FORMAT.md +39 -39
  39. package/canon/skills/domain-modeling/SKILL.md +35 -35
  40. package/canon/skills/executing-plans/SKILL.md +70 -70
  41. package/canon/skills/finishing-a-development-branch/SKILL.md +200 -200
  42. package/canon/skills/health/SKILL.md +177 -177
  43. package/canon/skills/maintaining-context/SKILL.md +34 -34
  44. package/canon/skills/minimal-code/SKILL.md +21 -21
  45. package/canon/skills/no-ai-slop/SKILL.md +103 -103
  46. package/canon/skills/no-ai-slop/eval.md +43 -43
  47. package/canon/skills/plan-ceo-review/SKILL.md +541 -541
  48. package/canon/skills/plan-eng-review/SKILL.md +362 -362
  49. package/canon/skills/receiving-code-review/SKILL.md +213 -213
  50. package/canon/skills/requesting-code-review/SKILL.md +105 -105
  51. package/canon/skills/resolving-merge-conflicts/SKILL.md +18 -18
  52. package/canon/skills/retro/SKILL.md +397 -397
  53. package/canon/skills/review/SKILL.md +246 -246
  54. package/canon/skills/ship/SKILL.md +691 -691
  55. package/canon/skills/subagent-driven-development/SKILL.md +277 -277
  56. package/canon/skills/systematic-debugging/SKILL.md +296 -296
  57. package/canon/skills/tdd/SKILL.md +371 -371
  58. package/canon/skills/unslop-ui/SKILL.md +34 -34
  59. package/canon/skills/using-git-worktrees/SKILL.md +218 -218
  60. package/canon/skills/verification-before-completion/SKILL.md +139 -139
  61. package/canon/skills/visual-verification/SKILL.md +54 -54
  62. package/canon/skills/workflow/SKILL.md +22 -22
  63. package/canon/skills/writing-for-agents/SKILL-MECHANICS.md +27 -27
  64. package/canon/skills/writing-for-agents/SKILL.md +42 -42
  65. package/canon/skills/writing-plans/SKILL.md +152 -152
  66. package/canon/skills/writing-skills/SKILL.md +655 -655
  67. package/canon/skills/yoke-retrofit/SKILL.md +26 -26
  68. package/canon/skills/yoke-workflow/SKILL.md +20 -20
  69. package/canon/tools/codex-rtk-hook.mjs +35 -35
  70. package/canon/tools/gemini-rtk-hook.mjs +25 -25
  71. package/canon/tools/graphify.md +3 -3
  72. package/canon/tools/playwright-mcp.md +3 -3
  73. package/canon/tools/qwen-rtk-hook.mjs +25 -0
  74. package/canon/tools/rtk.md +7 -7
  75. package/canon/tools/serena.md +6 -6
  76. package/dist/agents/catalog.js +7 -0
  77. package/dist/agents/contracts.js +3 -1
  78. package/dist/agents/host.js +5 -1
  79. package/dist/agents/process-streams.js +62 -0
  80. package/dist/agents/process.js +43 -3
  81. package/dist/agents/providers.js +61 -6
  82. package/dist/agents/telemetry.js +133 -37
  83. package/dist/canon/manifest.js +2 -1
  84. package/dist/change/inbox.js +1 -1
  85. package/dist/cli.js +30 -24
  86. package/dist/dashboard/page.js +122 -122
  87. package/dist/dashboard/panels.js +91 -91
  88. package/dist/goals/command.js +3 -2
  89. package/dist/loop/claims.js +2 -1
  90. package/dist/loop/decision.js +3 -2
  91. package/dist/loop/parallel-command.js +4 -2
  92. package/dist/loop/prd.js +2 -1
  93. package/dist/loop/reporter.js +1 -0
  94. package/dist/loop/run-command.js +31 -10
  95. package/dist/prd/command.js +19 -19
  96. package/dist/quality/candidate-comparison.js +6 -1
  97. package/dist/quality/command.js +17 -2
  98. package/dist/quality/types.js +6 -1
  99. package/dist/retrofit/apply.js +95 -2
  100. package/dist/retrofit/config.js +9 -1
  101. package/dist/retrofit/detect.js +8 -0
  102. package/dist/retrofit/plan.js +6 -0
  103. package/dist/retrofit/planners/claude.js +14 -14
  104. package/dist/retrofit/planners/kilo.js +44 -0
  105. package/dist/retrofit/planners/opencode.js +44 -0
  106. package/dist/retrofit/planners/pi.js +24 -0
  107. package/dist/retrofit/planners/qwen.js +3 -3
  108. package/dist/retrofit/preserve.js +2 -2
  109. package/dist/retrofit/qwen-settings.js +17 -0
  110. package/dist/retrofit/skill-actions.js +4 -1
  111. package/dist/retrofit/tools.js +8 -0
  112. package/dist/review/command.js +3 -2
  113. package/dist/review/verdict.js +1 -1
  114. package/dist/routing/capability.js +2 -2
  115. package/dist/routing/planning.js +2 -0
  116. package/dist/routing/registry.js +3 -1
  117. package/dist/routing/router.js +7 -3
  118. package/dist/setup/command.js +35 -11
  119. package/dist/setup/model-presets.js +48 -0
  120. package/docs/CAPABILITY-ROUTING.md +51 -51
  121. package/docs/DASHBOARD-EVOLUTION.md +33 -33
  122. package/docs/HARNESSES.md +81 -0
  123. package/docs/MIGRATING-TO-1.0.md +33 -33
  124. package/docs/MIGRATING-TO-1.1.md +27 -27
  125. package/docs/MIGRATING-TO-1.4.md +70 -70
  126. package/docs/PRODUCT-DIRECTION-2026-09-05.md +210 -210
  127. package/docs/PUBLISHING.md +114 -114
  128. package/docs/QWEN-MODEL-SUPPORT.md +142 -0
  129. package/docs/VERIFIED-PROJECTS-VALIDATION.md +29 -29
  130. package/docs/VERIFIED-PROJECTS.md +167 -167
  131. package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -981
  132. package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -258
  133. package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -1006
  134. package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -374
  135. package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -450
  136. package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -1024
  137. package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -574
  138. package/docs/superpowers/plans/2026-08-13-gauntlet-quality-loop.md +537 -537
  139. package/docs/superpowers/plans/2026-08-16-artifact-backed-output-compaction.md +329 -329
  140. package/docs/superpowers/plans/2026-09-05-verified-projects.md +83 -83
  141. package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -146
  142. package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -106
  143. package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -186
  144. package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -113
  145. package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -98
  146. package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -200
  147. package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -155
  148. package/docs/superpowers/specs/2026-08-13-gauntlet-quality-loop-design.md +422 -422
  149. package/docs/superpowers/specs/2026-08-16-artifact-backed-output-compaction-design.md +166 -166
  150. package/gemini-extension.json +6 -6
  151. package/hooks/hooks.json +19 -19
  152. package/package.json +91 -87
  153. package/dist/dashboard/discovery.js +0 -73
  154. package/docs/community-outreach-2026-08-20.md +0 -85
  155. package/docs/launch-copy-2026-08-21.md +0 -193
@@ -1,277 +1,277 @@
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 fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
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 + two-stage review (spec then quality) = high quality, fast iteration
13
-
14
- ## When to Use
15
-
16
- ```dot
17
- digraph when_to_use {
18
- "Have implementation plan?" [shape=diamond];
19
- "Tasks mostly independent?" [shape=diamond];
20
- "Stay in this session?" [shape=diamond];
21
- "subagent-driven-development" [shape=box];
22
- "executing-plans" [shape=box];
23
- "Manual execution or brainstorm first" [shape=box];
24
-
25
- "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
26
- "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
27
- "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
28
- "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
29
- "Stay in this session?" -> "subagent-driven-development" [label="yes"];
30
- "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
31
- }
32
- ```
33
-
34
- **vs. Executing Plans (parallel session):**
35
- - Same session (no context switch)
36
- - Fresh subagent per task (no context pollution)
37
- - Two-stage review after each task: spec compliance first, then code quality
38
- - Faster iteration (no human-in-loop between tasks)
39
-
40
- ## The Process
41
-
42
- ```dot
43
- digraph process {
44
- rankdir=TB;
45
-
46
- subgraph cluster_per_task {
47
- label="Per Task";
48
- "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
49
- "Implementer subagent asks questions?" [shape=diamond];
50
- "Answer questions, provide context" [shape=box];
51
- "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
52
- "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
53
- "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
54
- "Implementer subagent fixes spec gaps" [shape=box];
55
- "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
56
- "Code quality reviewer subagent approves?" [shape=diamond];
57
- "Implementer subagent fixes quality issues" [shape=box];
58
- "Mark task complete in TodoWrite" [shape=box];
59
- }
60
-
61
- "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
62
- "More tasks remain?" [shape=diamond];
63
- "Dispatch final code reviewer subagent for entire implementation" [shape=box];
64
- "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
65
-
66
- "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
67
- "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
68
- "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
69
- "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
70
- "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
71
- "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
72
- "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
73
- "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
74
- "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
75
- "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
76
- "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
77
- "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
78
- "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
79
- "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
80
- "Mark task complete in TodoWrite" -> "More tasks remain?";
81
- "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
82
- "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
83
- "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
84
- }
85
- ```
86
-
87
- ## Model Selection
88
-
89
- Use the least powerful model that can handle each role to conserve cost and increase speed.
90
-
91
- **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.
92
-
93
- **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
94
-
95
- **Architecture, design, and review tasks**: use the most capable available model.
96
-
97
- **Task complexity signals:**
98
- - Touches 1-2 files with a complete spec → cheap model
99
- - Touches multiple files with integration concerns → standard model
100
- - Requires design judgment or broad codebase understanding → most capable model
101
-
102
- ## Handling Implementer Status
103
-
104
- Implementer subagents report one of four statuses. Handle each appropriately:
105
-
106
- **DONE:** Proceed to spec compliance review.
107
-
108
- **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.
109
-
110
- **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
111
-
112
- **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
113
- 1. If it's a context problem, provide more context and re-dispatch with the same model
114
- 2. If the task requires more reasoning, re-dispatch with a more capable model
115
- 3. If the task is too large, break it into smaller pieces
116
- 4. If the plan itself is wrong, escalate to the human
117
-
118
- **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
119
-
120
- ## Prompt Templates
121
-
122
- - `./implementer-prompt.md` - Dispatch implementer subagent
123
- - `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
124
- - `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
125
-
126
- ## Example Workflow
127
-
128
- ```
129
- You: I'm using Subagent-Driven Development to execute this plan.
130
-
131
- [Read plan file once: docs/superpowers/plans/feature-plan.md]
132
- [Extract all 5 tasks with full text and context]
133
- [Create TodoWrite with all tasks]
134
-
135
- Task 1: Hook installation script
136
-
137
- [Get Task 1 text and context (already extracted)]
138
- [Dispatch implementation subagent with full task text + context]
139
-
140
- Implementer: "Before I begin - should the hook be installed at user or system level?"
141
-
142
- You: "User level (~/.config/superpowers/hooks/)"
143
-
144
- Implementer: "Got it. Implementing now..."
145
- [Later] Implementer:
146
- - Implemented install-hook command
147
- - Added tests, 5/5 passing
148
- - Self-review: Found I missed --force flag, added it
149
- - Committed
150
-
151
- [Dispatch spec compliance reviewer]
152
- Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
153
-
154
- [Get git SHAs, dispatch code quality reviewer]
155
- Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
156
-
157
- [Mark Task 1 complete]
158
-
159
- Task 2: Recovery modes
160
-
161
- [Get Task 2 text and context (already extracted)]
162
- [Dispatch implementation subagent with full task text + context]
163
-
164
- Implementer: [No questions, proceeds]
165
- Implementer:
166
- - Added verify/repair modes
167
- - 8/8 tests passing
168
- - Self-review: All good
169
- - Committed
170
-
171
- [Dispatch spec compliance reviewer]
172
- Spec reviewer: ❌ Issues:
173
- - Missing: Progress reporting (spec says "report every 100 items")
174
- - Extra: Added --json flag (not requested)
175
-
176
- [Implementer fixes issues]
177
- Implementer: Removed --json flag, added progress reporting
178
-
179
- [Spec reviewer reviews again]
180
- Spec reviewer: ✅ Spec compliant now
181
-
182
- [Dispatch code quality reviewer]
183
- Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
184
-
185
- [Implementer fixes]
186
- Implementer: Extracted PROGRESS_INTERVAL constant
187
-
188
- [Code reviewer reviews again]
189
- Code reviewer: ✅ Approved
190
-
191
- [Mark Task 2 complete]
192
-
193
- ...
194
-
195
- [After all tasks]
196
- [Dispatch final code-reviewer]
197
- Final reviewer: All requirements met, ready to merge
198
-
199
- Done!
200
- ```
201
-
202
- ## Advantages
203
-
204
- **vs. Manual execution:**
205
- - Subagents follow TDD naturally
206
- - Fresh context per task (no confusion)
207
- - Parallel-safe (subagents don't interfere)
208
- - Subagent can ask questions (before AND during work)
209
-
210
- **vs. Executing Plans:**
211
- - Same session (no handoff)
212
- - Continuous progress (no waiting)
213
- - Review checkpoints automatic
214
-
215
- **Efficiency gains:**
216
- - No file reading overhead (controller provides full text)
217
- - Controller curates exactly what context is needed
218
- - Subagent gets complete information upfront
219
- - Questions surfaced before work begins (not after)
220
-
221
- **Quality gates:**
222
- - Self-review catches issues before handoff
223
- - Two-stage review: spec compliance, then code quality
224
- - Review loops ensure fixes actually work
225
- - Spec compliance prevents over/under-building
226
- - Code quality ensures implementation is well-built
227
-
228
- **Cost:**
229
- - More subagent invocations (implementer + 2 reviewers per task)
230
- - Controller does more prep work (extracting all tasks upfront)
231
- - Review loops add iterations
232
- - But catches issues early (cheaper than debugging later)
233
-
234
- ## Red Flags
235
-
236
- **Never:**
237
- - Start implementation on main/master branch without explicit user consent
238
- - Skip reviews (spec compliance OR code quality)
239
- - Proceed with unfixed issues
240
- - Dispatch multiple implementation subagents in parallel (conflicts)
241
- - Make subagent read plan file (provide full text instead)
242
- - Skip scene-setting context (subagent needs to understand where task fits)
243
- - Ignore subagent questions (answer before letting them proceed)
244
- - Accept "close enough" on spec compliance (spec reviewer found issues = not done)
245
- - Skip review loops (reviewer found issues = implementer fixes = review again)
246
- - Let implementer self-review replace actual review (both are needed)
247
- - **Start code quality review before spec compliance is ✅** (wrong order)
248
- - Move to next task while either review has open issues
249
-
250
- **If subagent asks questions:**
251
- - Answer clearly and completely
252
- - Provide additional context if needed
253
- - Don't rush them into implementation
254
-
255
- **If reviewer finds issues:**
256
- - Implementer (same subagent) fixes them
257
- - Reviewer reviews again
258
- - Repeat until approved
259
- - Don't skip the re-review
260
-
261
- **If subagent fails task:**
262
- - Dispatch fix subagent with specific instructions
263
- - Don't try to fix manually (context pollution)
264
-
265
- ## Integration
266
-
267
- **Required workflow skills:**
268
- - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
269
- - **superpowers:writing-plans** - Creates the plan this skill executes
270
- - **superpowers:requesting-code-review** - Code review template for reviewer subagents
271
- - **superpowers:finishing-a-development-branch** - Complete development after all tasks
272
-
273
- **Subagents should use:**
274
- - **superpowers:test-driven-development** - Subagents follow TDD for each task
275
-
276
- **Alternative workflow:**
277
- - **superpowers:executing-plans** - Use for parallel session instead of same-session execution
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 fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
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 + two-stage review (spec then quality) = high quality, fast iteration
13
+
14
+ ## When to Use
15
+
16
+ ```dot
17
+ digraph when_to_use {
18
+ "Have implementation plan?" [shape=diamond];
19
+ "Tasks mostly independent?" [shape=diamond];
20
+ "Stay in this session?" [shape=diamond];
21
+ "subagent-driven-development" [shape=box];
22
+ "executing-plans" [shape=box];
23
+ "Manual execution or brainstorm first" [shape=box];
24
+
25
+ "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
26
+ "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
27
+ "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
28
+ "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
29
+ "Stay in this session?" -> "subagent-driven-development" [label="yes"];
30
+ "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
31
+ }
32
+ ```
33
+
34
+ **vs. Executing Plans (parallel session):**
35
+ - Same session (no context switch)
36
+ - Fresh subagent per task (no context pollution)
37
+ - Two-stage review after each task: spec compliance first, then code quality
38
+ - Faster iteration (no human-in-loop between tasks)
39
+
40
+ ## The Process
41
+
42
+ ```dot
43
+ digraph process {
44
+ rankdir=TB;
45
+
46
+ subgraph cluster_per_task {
47
+ label="Per Task";
48
+ "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
49
+ "Implementer subagent asks questions?" [shape=diamond];
50
+ "Answer questions, provide context" [shape=box];
51
+ "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
52
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
53
+ "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
54
+ "Implementer subagent fixes spec gaps" [shape=box];
55
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
56
+ "Code quality reviewer subagent approves?" [shape=diamond];
57
+ "Implementer subagent fixes quality issues" [shape=box];
58
+ "Mark task complete in TodoWrite" [shape=box];
59
+ }
60
+
61
+ "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
62
+ "More tasks remain?" [shape=diamond];
63
+ "Dispatch final code reviewer subagent for entire implementation" [shape=box];
64
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
65
+
66
+ "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
67
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
68
+ "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
69
+ "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
70
+ "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
71
+ "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
72
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
73
+ "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
74
+ "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
75
+ "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
76
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
77
+ "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
78
+ "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
79
+ "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
80
+ "Mark task complete in TodoWrite" -> "More tasks remain?";
81
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
82
+ "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
83
+ "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
84
+ }
85
+ ```
86
+
87
+ ## Model Selection
88
+
89
+ Use the least powerful model that can handle each role to conserve cost and increase speed.
90
+
91
+ **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.
92
+
93
+ **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
94
+
95
+ **Architecture, design, and review tasks**: use the most capable available model.
96
+
97
+ **Task complexity signals:**
98
+ - Touches 1-2 files with a complete spec → cheap model
99
+ - Touches multiple files with integration concerns → standard model
100
+ - Requires design judgment or broad codebase understanding → most capable model
101
+
102
+ ## Handling Implementer Status
103
+
104
+ Implementer subagents report one of four statuses. Handle each appropriately:
105
+
106
+ **DONE:** Proceed to spec compliance review.
107
+
108
+ **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.
109
+
110
+ **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
111
+
112
+ **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
113
+ 1. If it's a context problem, provide more context and re-dispatch with the same model
114
+ 2. If the task requires more reasoning, re-dispatch with a more capable model
115
+ 3. If the task is too large, break it into smaller pieces
116
+ 4. If the plan itself is wrong, escalate to the human
117
+
118
+ **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
119
+
120
+ ## Prompt Templates
121
+
122
+ - `./implementer-prompt.md` - Dispatch implementer subagent
123
+ - `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
124
+ - `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
125
+
126
+ ## Example Workflow
127
+
128
+ ```
129
+ You: I'm using Subagent-Driven Development to execute this plan.
130
+
131
+ [Read plan file once: docs/superpowers/plans/feature-plan.md]
132
+ [Extract all 5 tasks with full text and context]
133
+ [Create TodoWrite with all tasks]
134
+
135
+ Task 1: Hook installation script
136
+
137
+ [Get Task 1 text and context (already extracted)]
138
+ [Dispatch implementation subagent with full task text + context]
139
+
140
+ Implementer: "Before I begin - should the hook be installed at user or system level?"
141
+
142
+ You: "User level (~/.config/superpowers/hooks/)"
143
+
144
+ Implementer: "Got it. Implementing now..."
145
+ [Later] Implementer:
146
+ - Implemented install-hook command
147
+ - Added tests, 5/5 passing
148
+ - Self-review: Found I missed --force flag, added it
149
+ - Committed
150
+
151
+ [Dispatch spec compliance reviewer]
152
+ Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
153
+
154
+ [Get git SHAs, dispatch code quality reviewer]
155
+ Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
156
+
157
+ [Mark Task 1 complete]
158
+
159
+ Task 2: Recovery modes
160
+
161
+ [Get Task 2 text and context (already extracted)]
162
+ [Dispatch implementation subagent with full task text + context]
163
+
164
+ Implementer: [No questions, proceeds]
165
+ Implementer:
166
+ - Added verify/repair modes
167
+ - 8/8 tests passing
168
+ - Self-review: All good
169
+ - Committed
170
+
171
+ [Dispatch spec compliance reviewer]
172
+ Spec reviewer: ❌ Issues:
173
+ - Missing: Progress reporting (spec says "report every 100 items")
174
+ - Extra: Added --json flag (not requested)
175
+
176
+ [Implementer fixes issues]
177
+ Implementer: Removed --json flag, added progress reporting
178
+
179
+ [Spec reviewer reviews again]
180
+ Spec reviewer: ✅ Spec compliant now
181
+
182
+ [Dispatch code quality reviewer]
183
+ Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
184
+
185
+ [Implementer fixes]
186
+ Implementer: Extracted PROGRESS_INTERVAL constant
187
+
188
+ [Code reviewer reviews again]
189
+ Code reviewer: ✅ Approved
190
+
191
+ [Mark Task 2 complete]
192
+
193
+ ...
194
+
195
+ [After all tasks]
196
+ [Dispatch final code-reviewer]
197
+ Final reviewer: All requirements met, ready to merge
198
+
199
+ Done!
200
+ ```
201
+
202
+ ## Advantages
203
+
204
+ **vs. Manual execution:**
205
+ - Subagents follow TDD naturally
206
+ - Fresh context per task (no confusion)
207
+ - Parallel-safe (subagents don't interfere)
208
+ - Subagent can ask questions (before AND during work)
209
+
210
+ **vs. Executing Plans:**
211
+ - Same session (no handoff)
212
+ - Continuous progress (no waiting)
213
+ - Review checkpoints automatic
214
+
215
+ **Efficiency gains:**
216
+ - No file reading overhead (controller provides full text)
217
+ - Controller curates exactly what context is needed
218
+ - Subagent gets complete information upfront
219
+ - Questions surfaced before work begins (not after)
220
+
221
+ **Quality gates:**
222
+ - Self-review catches issues before handoff
223
+ - Two-stage review: spec compliance, then code quality
224
+ - Review loops ensure fixes actually work
225
+ - Spec compliance prevents over/under-building
226
+ - Code quality ensures implementation is well-built
227
+
228
+ **Cost:**
229
+ - More subagent invocations (implementer + 2 reviewers per task)
230
+ - Controller does more prep work (extracting all tasks upfront)
231
+ - Review loops add iterations
232
+ - But catches issues early (cheaper than debugging later)
233
+
234
+ ## Red Flags
235
+
236
+ **Never:**
237
+ - Start implementation on main/master branch without explicit user consent
238
+ - Skip reviews (spec compliance OR code quality)
239
+ - Proceed with unfixed issues
240
+ - Dispatch multiple implementation subagents in parallel (conflicts)
241
+ - Make subagent read plan file (provide full text instead)
242
+ - Skip scene-setting context (subagent needs to understand where task fits)
243
+ - Ignore subagent questions (answer before letting them proceed)
244
+ - Accept "close enough" on spec compliance (spec reviewer found issues = not done)
245
+ - Skip review loops (reviewer found issues = implementer fixes = review again)
246
+ - Let implementer self-review replace actual review (both are needed)
247
+ - **Start code quality review before spec compliance is ✅** (wrong order)
248
+ - Move to next task while either review has open issues
249
+
250
+ **If subagent asks questions:**
251
+ - Answer clearly and completely
252
+ - Provide additional context if needed
253
+ - Don't rush them into implementation
254
+
255
+ **If reviewer finds issues:**
256
+ - Implementer (same subagent) fixes them
257
+ - Reviewer reviews again
258
+ - Repeat until approved
259
+ - Don't skip the re-review
260
+
261
+ **If subagent fails task:**
262
+ - Dispatch fix subagent with specific instructions
263
+ - Don't try to fix manually (context pollution)
264
+
265
+ ## Integration
266
+
267
+ **Required workflow skills:**
268
+ - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
269
+ - **superpowers:writing-plans** - Creates the plan this skill executes
270
+ - **superpowers:requesting-code-review** - Code review template for reviewer subagents
271
+ - **superpowers:finishing-a-development-branch** - Complete development after all tasks
272
+
273
+ **Subagents should use:**
274
+ - **superpowers:test-driven-development** - Subagents follow TDD for each task
275
+
276
+ **Alternative workflow:**
277
+ - **superpowers:executing-plans** - Use for parallel session instead of same-session execution