opencode-ship 0.8.0 → 0.10.0-rc.17

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 (137) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +5 -3
  3. package/THIRD_PARTY_NOTICES.md +77 -18
  4. package/assets/agents/ship-controller.md +122 -0
  5. package/assets/agents/ship-final-spec-reviewer.md +87 -0
  6. package/assets/agents/ship-final-standards-reviewer.md +83 -0
  7. package/assets/agents/ship-planner.md +78 -0
  8. package/assets/agents/ship-task-builder.md +91 -0
  9. package/assets/agents/ship-task-reviewer.md +78 -0
  10. package/assets/commands/ship-deliver.md +30 -0
  11. package/assets/commands/ship-resume.md +28 -0
  12. package/assets/commands/ship-status.md +25 -0
  13. package/assets/skills/brainstorming/SKILL.md +160 -0
  14. package/assets/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  15. package/assets/skills/brainstorming/visual-companion.md +298 -0
  16. package/assets/skills/code-review/SKILL.md +98 -0
  17. package/assets/skills/codebase-design/DEEPENING.md +37 -0
  18. package/assets/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  19. package/assets/skills/codebase-design/SKILL.md +123 -0
  20. package/assets/skills/dispatching-parallel-agents/SKILL.md +176 -0
  21. package/assets/skills/domain-modeling/ADR-FORMAT.md +47 -0
  22. package/assets/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  23. package/assets/skills/domain-modeling/SKILL.md +83 -0
  24. package/assets/skills/engineering-workflow/SKILL.md +125 -0
  25. package/assets/skills/engineering-workflow/domain.md +51 -0
  26. package/assets/skills/engineering-workflow/issue-tracker-github.md +45 -0
  27. package/assets/skills/engineering-workflow/issue-tracker-gitlab.md +46 -0
  28. package/assets/skills/engineering-workflow/issue-tracker-local.md +30 -0
  29. package/assets/skills/engineering-workflow/triage-labels.md +15 -0
  30. package/assets/skills/executing-plans/SKILL.md +73 -0
  31. package/assets/skills/grill-with-docs/SKILL.md +10 -14
  32. package/assets/skills/grilling/SKILL.md +21 -0
  33. package/assets/skills/handoff/SKILL.md +25 -0
  34. package/assets/skills/prototype/LOGIC.md +79 -0
  35. package/assets/skills/prototype/SKILL.md +35 -0
  36. package/assets/skills/prototype/UI.md +112 -0
  37. package/assets/skills/receiving-code-review/SKILL.md +214 -0
  38. package/assets/skills/requesting-code-review/SKILL.md +104 -0
  39. package/assets/skills/requesting-code-review/code-reviewer.md +172 -0
  40. package/assets/skills/research/SKILL.md +21 -0
  41. package/assets/skills/setup-engineering-workflow/SKILL.md +125 -0
  42. package/assets/skills/setup-engineering-workflow/domain.md +51 -0
  43. package/assets/skills/setup-engineering-workflow/issue-tracker-github.md +45 -0
  44. package/assets/skills/setup-engineering-workflow/issue-tracker-gitlab.md +46 -0
  45. package/assets/skills/setup-engineering-workflow/issue-tracker-local.md +30 -0
  46. package/assets/skills/setup-engineering-workflow/triage-labels.md +15 -0
  47. package/assets/skills/subagent-driven-development/SKILL.md +512 -0
  48. package/assets/skills/subagent-driven-development/implementer-prompt.md +142 -0
  49. package/assets/skills/subagent-driven-development/re-review-prompt.md +106 -0
  50. package/assets/skills/subagent-driven-development/task-reviewer-prompt.md +185 -0
  51. package/assets/skills/systematic-debugging/CREATION-LOG.md +119 -0
  52. package/assets/skills/systematic-debugging/SKILL.md +292 -0
  53. package/assets/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  54. package/assets/skills/systematic-debugging/condition-based-waiting.md +115 -0
  55. package/assets/skills/systematic-debugging/defense-in-depth.md +122 -0
  56. package/assets/skills/systematic-debugging/find-polluter.sh +72 -0
  57. package/assets/skills/systematic-debugging/root-cause-tracing.md +169 -0
  58. package/assets/skills/systematic-debugging/test-academic.md +14 -0
  59. package/assets/skills/systematic-debugging/test-pressure-1.md +58 -0
  60. package/assets/skills/systematic-debugging/test-pressure-2.md +68 -0
  61. package/assets/skills/systematic-debugging/test-pressure-3.md +69 -0
  62. package/assets/skills/test-driven-development/SKILL.md +329 -0
  63. package/assets/skills/test-driven-development/writing-good-tests.md +198 -0
  64. package/assets/skills/to-spec/SKILL.md +84 -0
  65. package/assets/skills/to-tickets/SKILL.md +114 -0
  66. package/assets/skills/triage/AGENT-BRIEF.md +207 -0
  67. package/assets/skills/triage/OUT-OF-SCOPE.md +105 -0
  68. package/assets/skills/triage/SKILL.md +114 -15
  69. package/assets/skills/verification-before-completion/SKILL.md +129 -0
  70. package/assets/skills/wayfinder/SKILL.md +137 -0
  71. package/assets/skills/writing-plans/SKILL.md +177 -0
  72. package/assets/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  73. package/dist/cli.js +1146 -435
  74. package/dist/core.js +210 -61
  75. package/dist/plugin.js +2368 -230
  76. package/package.json +3 -1
  77. package/schema/ship-config.schema.json +63 -2
  78. package/schema/ship-lock.schema.json +5 -3
  79. package/tests/plugin/plugin-load.test.mjs +85 -0
  80. package/vendor/mattpocock/LICENSE +30 -0
  81. package/vendor/obra/LICENSE +30 -0
  82. package/vendor/sources.json +976 -0
  83. package/vendor/superpowers/LICENSE +30 -0
  84. package/vendor/upstreams/mattpocock/skills/engineering/code-review/SKILL.md +89 -0
  85. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DEEPENING.md +37 -0
  86. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
  87. package/vendor/upstreams/mattpocock/skills/engineering/codebase-design/SKILL.md +114 -0
  88. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/ADR-FORMAT.md +47 -0
  89. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/CONTEXT-FORMAT.md +60 -0
  90. package/vendor/upstreams/mattpocock/skills/engineering/domain-modeling/SKILL.md +74 -0
  91. package/vendor/upstreams/mattpocock/skills/engineering/grill-with-docs/SKILL.md +7 -0
  92. package/vendor/upstreams/mattpocock/skills/engineering/prototype/LOGIC.md +79 -0
  93. package/vendor/upstreams/mattpocock/skills/engineering/prototype/SKILL.md +26 -0
  94. package/vendor/upstreams/mattpocock/skills/engineering/prototype/UI.md +112 -0
  95. package/vendor/upstreams/mattpocock/skills/engineering/research/SKILL.md +12 -0
  96. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/SKILL.md +116 -0
  97. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/domain.md +51 -0
  98. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  99. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  100. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  101. package/vendor/upstreams/mattpocock/skills/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
  102. package/vendor/upstreams/mattpocock/skills/engineering/to-spec/SKILL.md +75 -0
  103. package/vendor/upstreams/mattpocock/skills/engineering/to-tickets/SKILL.md +105 -0
  104. package/vendor/upstreams/mattpocock/skills/engineering/triage/AGENT-BRIEF.md +207 -0
  105. package/vendor/upstreams/mattpocock/skills/engineering/triage/OUT-OF-SCOPE.md +105 -0
  106. package/vendor/upstreams/mattpocock/skills/engineering/triage/SKILL.md +112 -0
  107. package/vendor/upstreams/mattpocock/skills/engineering/wayfinder/SKILL.md +128 -0
  108. package/vendor/upstreams/mattpocock/skills/productivity/grilling/SKILL.md +12 -0
  109. package/vendor/upstreams/mattpocock/skills/productivity/handoff/SKILL.md +16 -0
  110. package/vendor/upstreams/obra/skills/brainstorming/SKILL.md +151 -0
  111. package/vendor/upstreams/obra/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  112. package/vendor/upstreams/obra/skills/brainstorming/visual-companion.md +298 -0
  113. package/vendor/upstreams/obra/skills/dispatching-parallel-agents/SKILL.md +167 -0
  114. package/vendor/upstreams/obra/skills/executing-plans/SKILL.md +64 -0
  115. package/vendor/upstreams/obra/skills/receiving-code-review/SKILL.md +205 -0
  116. package/vendor/upstreams/obra/skills/requesting-code-review/SKILL.md +95 -0
  117. package/vendor/upstreams/obra/skills/requesting-code-review/code-reviewer.md +172 -0
  118. package/vendor/upstreams/obra/skills/subagent-driven-development/SKILL.md +503 -0
  119. package/vendor/upstreams/obra/skills/subagent-driven-development/implementer-prompt.md +142 -0
  120. package/vendor/upstreams/obra/skills/subagent-driven-development/re-review-prompt.md +106 -0
  121. package/vendor/upstreams/obra/skills/subagent-driven-development/task-reviewer-prompt.md +185 -0
  122. package/vendor/upstreams/obra/skills/systematic-debugging/CREATION-LOG.md +119 -0
  123. package/vendor/upstreams/obra/skills/systematic-debugging/SKILL.md +283 -0
  124. package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  125. package/vendor/upstreams/obra/skills/systematic-debugging/condition-based-waiting.md +115 -0
  126. package/vendor/upstreams/obra/skills/systematic-debugging/defense-in-depth.md +122 -0
  127. package/vendor/upstreams/obra/skills/systematic-debugging/find-polluter.sh +72 -0
  128. package/vendor/upstreams/obra/skills/systematic-debugging/root-cause-tracing.md +169 -0
  129. package/vendor/upstreams/obra/skills/systematic-debugging/test-academic.md +14 -0
  130. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-1.md +58 -0
  131. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-2.md +68 -0
  132. package/vendor/upstreams/obra/skills/systematic-debugging/test-pressure-3.md +69 -0
  133. package/vendor/upstreams/obra/skills/test-driven-development/SKILL.md +320 -0
  134. package/vendor/upstreams/obra/skills/test-driven-development/writing-good-tests.md +198 -0
  135. package/vendor/upstreams/obra/skills/verification-before-completion/SKILL.md +120 -0
  136. package/vendor/upstreams/obra/skills/writing-plans/SKILL.md +168 -0
  137. package/vendor/upstreams/obra/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
@@ -0,0 +1,512 @@
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 asks questions?" [shape=diamond];
55
+ "Answer questions, provide context" [shape=box];
56
+ "Implementer implements, tests, commits, self-reviews" [shape=box];
57
+ "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" [shape=box];
58
+ "Spec ✅ and quality approved?" [shape=diamond];
59
+ "Finding conflicts with plan text?" [shape=diamond];
60
+ "Ask human partner which governs" [shape=box];
61
+ "Fix round R of 5: R≤3 resume implementer; R≥4 fresh implementer, more capable model" [shape=box];
62
+ "Dispatch scoped re-review (./re-review-prompt.md)" [shape=box];
63
+ "All findings addressed?" [shape=diamond];
64
+ "R = 5?" [shape=diamond];
65
+ "Adjudicate each open finding" [shape=box];
66
+ "Any load-bearing finding?" [shape=diamond];
67
+ "STOP: report BLOCKED to human partner" [shape=box];
68
+ "Park findings in ledger with rulings" [shape=box];
69
+ "Append completion to ledger, mark todo complete" [shape=box];
70
+ }
71
+
72
+ "Setup: worktree, ledger check, read plan, pre-flight review" [shape=box];
73
+ "More tasks remain?" [shape=diamond];
74
+ "Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" [shape=box];
75
+ "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals" [shape=box];
76
+ "Final review clean: delete this plan's workspace" [shape=box];
77
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
78
+
79
+ "Setup: worktree, ledger check, read plan, pre-flight review" -> "Dispatch implementer subagent (./implementer-prompt.md)";
80
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer asks questions?";
81
+ "Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
82
+ "Answer questions, provide context" -> "Implementer implements, tests, commits, self-reviews";
83
+ "Implementer asks questions?" -> "Implementer implements, tests, commits, self-reviews" [label="no"];
84
+ "Implementer implements, tests, commits, self-reviews" -> "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)";
85
+ "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" -> "Spec ✅ and quality approved?";
86
+ "Spec ✅ and quality approved?" -> "Append completion to ledger, mark todo complete" [label="yes"];
87
+ "Spec ✅ and quality approved?" -> "Finding conflicts with plan text?" [label="no"];
88
+ "Finding conflicts with plan text?" -> "Ask human partner which governs" [label="yes"];
89
+ "Ask human partner which governs" -> "Fix round R of 5: R≤3 resume implementer; R≥4 fresh implementer, more capable model";
90
+ "Finding conflicts with plan text?" -> "Fix round R of 5: R≤3 resume implementer; R≥4 fresh implementer, more capable model" [label="no"];
91
+ "Fix round R of 5: R≤3 resume implementer; R≥4 fresh implementer, more capable model" -> "Dispatch scoped re-review (./re-review-prompt.md)";
92
+ "Dispatch scoped re-review (./re-review-prompt.md)" -> "All findings addressed?";
93
+ "All findings addressed?" -> "Append completion to ledger, mark todo complete" [label="yes"];
94
+ "All findings addressed?" -> "R = 5?" [label="no"];
95
+ "R = 5?" -> "Fix round R of 5: R≤3 resume implementer; R≥4 fresh implementer, more capable model" [label="no - next round"];
96
+ "R = 5?" -> "Adjudicate each open finding" [label="yes - breaker trips"];
97
+ "Adjudicate each open finding" -> "Any load-bearing finding?";
98
+ "Any load-bearing finding?" -> "STOP: report BLOCKED to human partner" [label="yes"];
99
+ "Any load-bearing finding?" -> "Park findings in ledger with rulings" [label="no"];
100
+ "Park findings in ledger with rulings" -> "Append completion to ledger, mark todo complete";
101
+ "Append completion to ledger, mark todo complete" -> "More tasks remain?";
102
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
103
+ "More tasks remain?" -> "Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" [label="no"];
104
+ "Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" -> "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals";
105
+ "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals" -> "Final review clean: delete this plan's workspace";
106
+ "Final review clean: delete this plan's workspace" -> "Use superpowers:finishing-a-development-branch";
107
+ }
108
+ ```
109
+
110
+ ## Setup
111
+
112
+ Ensure the work happens in an isolated workspace: use
113
+ superpowers:using-git-worktrees to create one or verify the existing one.
114
+ Never start implementation on a main/master branch without your human
115
+ partner's explicit consent.
116
+
117
+ Conversation memory does not survive compaction. In real sessions,
118
+ controllers that lost their place have re-dispatched entire completed task
119
+ sequences — the single most expensive failure observed. Track progress in
120
+ a ledger file, not only in todos.
121
+
122
+ - Each plan owns a workspace: at skill start, run this skill's
123
+ `scripts/sdd-workspace PLAN_FILE` — it prints the plan's git-ignored
124
+ directory (`<repo-root>/.superpowers/sdd/<plan-basename>/`), home to
125
+ every artifact for THIS plan: ledger, briefs, reports, review packages.
126
+ Another plan's directory is never yours to read or write.
127
+ - Check for this plan's ledger at `<workspace>/progress.md`. If its first
128
+ line names your plan file, tasks with a `Task <N>: complete` line are DONE
129
+ — do not re-dispatch them; resume at the first task without one. A task
130
+ whose last line is a fix round is mid-loop: resume the loop at the next
131
+ round. A ledger whose first line names a different plan file — or a stray
132
+ ledger at the old flat path `.superpowers/sdd/progress.md` — is another
133
+ plan's progress: leave it in place and start your own, fresh.
134
+ - Create the ledger with its identity as the first line:
135
+ `# SDD ledger — plan: <plan file path>`.
136
+ - The ledger is your recovery map: the commits it names exist in git even
137
+ when your context no longer remembers creating them. After compaction,
138
+ trust the ledger and `git log` over your own recollection.
139
+ - `git clean -fdx` will destroy the workspace (it's git-ignored scratch); if
140
+ that happens, recover from `git log`.
141
+
142
+ Read the plan once, note its context and Global Constraints, and create a
143
+ todo per task.
144
+
145
+ Before dispatching Task 1, scan the plan once for conflicts:
146
+
147
+ - tasks that contradict each other or the plan's Global Constraints
148
+ - anything the plan explicitly mandates that the review rubric treats as a
149
+ defect (a test that asserts nothing, verbatim duplication of a logic block)
150
+
151
+ Present everything you find to your human partner as one batched question —
152
+ each finding beside the plan text that mandates it, asking which governs —
153
+ before execution begins, not one interrupt per discovery mid-plan. If the
154
+ scan is clean, proceed without comment. The review loop remains the net for
155
+ conflicts that only emerge from implementation.
156
+
157
+ ## Model Selection
158
+
159
+ Use the least powerful model that can handle each role to conserve cost and increase speed.
160
+
161
+ **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.
162
+
163
+ **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
164
+
165
+ **Architecture and design tasks**: use the most capable available model.
166
+ The final whole-branch review is one of these — dispatch it on the most
167
+ capable available model, not the session default.
168
+
169
+ **Review tasks**: choose the model with the same judgment, scaled to the
170
+ diff's size, complexity, and risk. A small mechanical diff does not need the
171
+ most capable model; a subtle concurrency change does. Scoped re-reviews of
172
+ small fix diffs take a cheap-to-mid tier.
173
+
174
+ **Fix-loop escalation (rounds 4-5)**: use a model at least one tier above
175
+ the implementer that got stuck.
176
+
177
+ **Always specify the model explicitly when dispatching a subagent.** An
178
+ omitted model inherits your session's model — often the most capable and
179
+ most expensive — which silently defeats this section.
180
+
181
+ **Turn count beats token price.** Wall-clock and context cost scale with how
182
+ many turns a subagent takes, and the cheapest models routinely take 2-3× the
183
+ turns on multi-step work — costing more overall. Use a mid-tier model as the
184
+ floor for reviewers and for implementers working from prose descriptions.
185
+ When the task's plan text contains the complete code to write, the
186
+ implementation is transcription plus testing: use the cheapest tier for
187
+ that implementer. Single-file mechanical fixes also take the cheapest tier.
188
+
189
+ **Task complexity signals (implementation tasks):**
190
+ - Touches 1-2 files with a complete spec → cheap model
191
+ - Touches multiple files with integration concerns → standard model
192
+ - Requires design judgment or broad codebase understanding → most capable model
193
+
194
+ ## The Task Loop
195
+
196
+ Everything you paste into a dispatch prompt — and everything a subagent
197
+ prints back — stays resident in your context for the rest of the session
198
+ and is re-read on every later turn. Hand artifacts over as files.
199
+
200
+ ### 1. Dispatch the implementer
201
+
202
+ Record BASE (`git rev-parse HEAD`) before dispatching — the review package
203
+ and fix-round diffs need it.
204
+
205
+ - **Task brief:** before dispatching an implementer, run this skill's
206
+ `scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
207
+ uniquely named file and prints the path. Compose the dispatch so the
208
+ brief stays the single source of
209
+ requirements. Your dispatch should contain: (1) one line on where this
210
+ task fits in the project; (2) the brief path, introduced as "read this
211
+ first — it is your requirements, with the exact values to use verbatim";
212
+ (3) interfaces and decisions from earlier tasks that the brief cannot
213
+ know; (4) your resolution of any ambiguity you noticed in the brief;
214
+ (5) the report-file path and report contract. Exact values (numbers,
215
+ magic strings, signatures, test cases) appear only in the brief. Never
216
+ make a subagent read the whole plan file.
217
+ - **Report file:** name the implementer's report file after the brief
218
+ (brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
219
+ the dispatch prompt. The implementer writes the full report there and
220
+ returns only status, commits, a one-line test summary, and concerns.
221
+ - A dispatch prompt describes one task, not the session's history. Do not
222
+ paste accumulated prior-task summaries ("state after Tasks 1-3") into
223
+ later dispatches — a real session's dispatch hit 42k chars of which 99%
224
+ was pasted history. A fresh subagent needs its task, the interfaces it
225
+ touches, and the global constraints. Nothing else.
226
+ - If an earlier task parked a finding in the area this task touches, carry
227
+ a pointer to that ledger entry in the dispatch.
228
+ - Record the implementer's agent identity from the dispatch result —
229
+ fix-loop rounds 1-3 resume this agent.
230
+ - Never dispatch multiple implementation subagents in parallel (conflicts).
231
+
232
+ Template: [implementer-prompt.md](implementer-prompt.md)
233
+
234
+ ### 2. Handle the report
235
+
236
+ Implementer subagents report one of four statuses. Handle each appropriately:
237
+
238
+ **DONE:** Generate the review package (`scripts/review-package PLAN_FILE 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.
239
+
240
+ **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.
241
+
242
+ **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
243
+
244
+ **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
245
+ 1. If it's a context problem, provide more context and re-dispatch with the same model
246
+ 2. If the task requires more reasoning, re-dispatch with a more capable model
247
+ 3. If the task is too large, break it into smaller pieces
248
+ 4. If the plan itself is wrong, escalate to the human
249
+
250
+ **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
251
+
252
+ If the implementer asks questions — before starting or mid-task — answer
253
+ clearly and completely, provide additional context if needed, and don't
254
+ rush it into implementation.
255
+
256
+ ### 3. Review the task
257
+
258
+ Per-task reviews are task-scoped gates. The broad review happens once, at the
259
+ final whole-branch review. Never skip the task review, and never accept a
260
+ report missing either verdict — spec compliance AND task quality are both
261
+ required. Implementer self-review never replaces the task review; both are
262
+ needed.
263
+
264
+ - Hand the reviewer its diff as a file: run this skill's
265
+ `scripts/review-package PLAN_FILE BASE HEAD` and pass the reviewer the file path
266
+ it prints (or, without bash: `git log --oneline`, `git diff --stat`,
267
+ and `git diff -U10` for the range, redirected to one uniquely named
268
+ file). The output never enters your own context, and the reviewer sees
269
+ the commit list, stat summary, and full diff with context in one Read
270
+ call. Use the BASE you recorded before dispatching the implementer —
271
+ never `HEAD~1`, which silently truncates multi-commit tasks. Never
272
+ dispatch a task reviewer without a diff file.
273
+ - **Reviewer inputs:** the task reviewer gets three paths — the same brief
274
+ file, the report file, and the review package — plus the global
275
+ constraints that bind the task.
276
+ - The global-constraints block you hand the reviewer is its attention
277
+ lens. Copy the binding requirements verbatim from the plan's Global
278
+ Constraints section or the spec: exact values, exact formats, and the
279
+ stated relationships between components ("same layout as X", "matches
280
+ Y"). The reviewer's template already carries the process rules (YAGNI,
281
+ test hygiene, review method) — the constraints block is for what THIS
282
+ project's spec demands.
283
+ - Do not add open-ended directives like "check all uses" or "run race tests
284
+ if useful" without a concrete, task-specific reason
285
+ - Do not ask a reviewer to re-run tests the implementer already ran on the
286
+ same code — the implementer's report carries the test evidence
287
+ - Do not pre-judge findings for the reviewer — never instruct a reviewer to
288
+ ignore or not flag a specific issue. If you believe a finding would be a
289
+ false positive, let the reviewer raise it and adjudicate it in the review
290
+ loop. If the prompt you are writing contains "do not flag," "don't treat X
291
+ as a defect," "at most Minor," or "the plan chose" — stop: you are
292
+ pre-judging, usually to spare yourself a review loop.
293
+ The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
294
+ that live in unchanged code or span tasks. These do not block the rest of the
295
+ review, but you must resolve each one yourself before marking the task
296
+ complete: you hold the plan and cross-task context the reviewer
297
+ lacks. If you confirm an item is a real gap, treat it as a failed spec
298
+ review — it enters the fix loop with the other findings.
299
+
300
+ Template: [task-reviewer-prompt.md](task-reviewer-prompt.md)
301
+
302
+ ### 4. The fix loop
303
+
304
+ The loop triggers when the review reports spec ❌, any Critical or Important
305
+ finding, or a ⚠️ item you confirmed as a real gap.
306
+
307
+ Before the loop starts, two routes leave it immediately:
308
+
309
+ - Record Minor findings in the progress ledger as you go
310
+ (`Task <N>: minor (deferred): <one-liner>`), and point the final
311
+ whole-branch review at that list so it can triage which must be fixed
312
+ before merge. A roll-up nobody reads is a silent discard. Minor findings
313
+ never enter the loop.
314
+ - A finding labeled plan-mandated — or any finding that conflicts with
315
+ what the plan's text requires — is the human's decision, like any plan
316
+ contradiction: present the finding and the plan text, ask which governs.
317
+ Do not dismiss the finding because the plan mandates it, and do not
318
+ dispatch a fix that contradicts the plan without asking.
319
+ Everything else enters the loop. A fix round is one fix dispatch plus one
320
+ scoped re-review. Five rounds maximum per task:
321
+
322
+ **Rounds 1-3 — resume the original implementer.** Send it the open findings
323
+ verbatim. Its context is intact: it knows the task, the code, and its own
324
+ choices. If your harness cannot send another message to a live subagent,
325
+ dispatch a fresh implementer carrying the brief path, the report-file path,
326
+ and the findings — the report file is the persistent memory either way.
327
+
328
+ **Rounds 4-5 — dispatch a fresh implementer on a more capable model** (per
329
+ Model Selection), with the brief path, the report-file path, the open
330
+ findings, and this framing: "A prior implementer attempted this task
331
+ [N] times; you own it now. Read the report file for what was tried." A loop
332
+ that survives three resumes usually means the implementer cannot see its
333
+ own problem — fresh eyes and a capability bump in one move.
334
+
335
+ **Every round, either way:** the implementer fixes, re-runs the tests
336
+ covering the amended code, appends its fix report to the same report file,
337
+ and returns the short contract. Before re-dispatching the reviewer, confirm
338
+ the fix report contains the covering tests, the command run, and the
339
+ output; dispatch the re-review once all three are present. Name the
340
+ covering test files in the fix message — a one-line fix does not need the
341
+ whole suite.
342
+
343
+ **The re-review is scoped.** Run `scripts/review-package PLAN_FILE FIX_BASE HEAD`
344
+ where FIX_BASE is the head the previous review saw, and dispatch
345
+ [re-review-prompt.md](re-review-prompt.md) with the findings list, the
346
+ brief, the report file, and the printed diff path. The re-reviewer verdicts
347
+ each finding ADDRESSED or NOT ADDRESSED and flags new breakage in the fix
348
+ diff only. New Critical/Important breakage in the fix diff joins the open
349
+ findings list. Out-of-scope observations go to the ledger as deferred
350
+ minors — they never extend the loop.
351
+
352
+ **After each round,** append to the ledger:
353
+ `Task <N>: fix round <R>/5 (<X> addressed, <Y> open — <finding one-liners>; commits <a7>..<b7>)`
354
+
355
+ Never fix findings yourself in the controller session — your context stays
356
+ clean for coordination, and controller fixes skip review.
357
+
358
+ **The breaker.** When round 5's re-review still leaves findings open, stop
359
+ dispatching. Adjudicate each open finding yourself — you hold the plan and
360
+ the cross-task context the reviewer lacks:
361
+
362
+ - **The reviewer is wrong, or the point is contestable:** park it —
363
+ `Task <N>: parked — <finding> — ruling: <why the code stands>`. The final
364
+ review sees both sides.
365
+ - **Real, but nothing downstream builds on it:** park it the same way, with
366
+ a ruling that says it's real and deferred.
367
+ - **Real and load-bearing** — a later task builds on it, or it reveals a
368
+ plan defect: STOP. Append `Task <N>: BLOCKED — <reason>` and report to
369
+ your human partner with the finding, the plan text it collides with, and
370
+ the fix history. Parking a structural failure lets every dependent task
371
+ build on it and hands the final review a problem it cannot fix either.
372
+
373
+ Adjudicate only at the cap. Adjudicating earlier to end a loop is
374
+ pre-judging with a different name. Every adjudication is a ledger entry —
375
+ a silent discard is forbidden.
376
+
377
+ ### 5. Complete the task
378
+
379
+ When the review comes back clean — or every open finding is parked with a
380
+ ruling at the cap — append the completion line to the ledger in the same
381
+ message as your other bookkeeping:
382
+
383
+ - `Task <N>: complete (commits <base7>..<head7>, review clean)`
384
+ - `Task <N>: complete (commits <base7>..<head7>, <K> parked)` after a
385
+ tripped breaker
386
+
387
+ Then mark the todo complete and move on. Never move to the next task while
388
+ the review has open Critical/Important issues that are neither fixed nor
389
+ parked-with-ruling at the cap.
390
+
391
+ ## Final Review
392
+
393
+ The final whole-branch review gets a package too: run
394
+ `scripts/review-package PLAN_FILE MERGE_BASE HEAD` (MERGE_BASE = the commit the
395
+ branch started from, e.g. `git merge-base main HEAD`) and include the
396
+ printed path in the final review dispatch, so the final reviewer reads
397
+ one file instead of re-deriving the branch diff with git commands. Dispatch
398
+ on the most capable available model (see Model Selection), using
399
+ superpowers:requesting-code-review's
400
+ [code-reviewer.md](../requesting-code-review/code-reviewer.md). Point it at
401
+ the ledger's deferred-minor and parked lines so it can triage which must be
402
+ fixed before merge.
403
+
404
+ If the final whole-branch review returns findings, dispatch ONE fix subagent
405
+ with the complete findings list — not one fixer per finding.
406
+ Per-finding fixers each rebuild context and re-run suites; a real
407
+ session's final-review fix wave cost more than all its tasks combined.
408
+ Then run exactly one scoped re-review of the fix wave
409
+ (`scripts/review-package PLAN_FILE FIX_BASE HEAD` over the fix range,
410
+ [re-review-prompt.md](re-review-prompt.md)).
411
+ Adjudicate any residual findings as in the task loop's breaker: park with
412
+ rulings, or stop on load-bearing ones. There is no second fix wave —
413
+ residual load-bearing findings surface to your human partner when
414
+ finishing-a-development-branch presents the options.
415
+
416
+ ## Finish
417
+
418
+ When the final whole-branch review is clean and its fixes are merged,
419
+ delete this plan's workspace (`rm -rf <workspace>`) — the git history is
420
+ the record now. Sibling directories belong to other plans; leave them
421
+ alone.
422
+
423
+ Use superpowers:finishing-a-development-branch.
424
+
425
+ ## Common Rationalizations
426
+
427
+ | Excuse | Reality |
428
+ |--------|---------|
429
+ | "Close enough on spec compliance" | Reviewer found spec gaps = not done. Fix or hit the cap and adjudicate — those are the only exits. |
430
+ | "I'll fix it myself, dispatching is overhead" | Controller fixes pollute your context and skip review. Resume the implementer. |
431
+ | "One more round will converge" | Past the cap, rounds don't converge — the failure is structural. Adjudicate and route. |
432
+ | "The reviewer will just find something new anyway" | Scoped re-reviews verify fixes; they cannot wander. New findings on untouched code go to the ledger, not the loop. |
433
+ | "This finding is obviously wrong, I'll drop it" | You adjudicate only at the cap, and every ruling is a ledger entry. Silent discards are forbidden. |
434
+ | "The fix was small, skip the re-review" | Unreviewed fixes are how regressions land. Every round ends with a scoped re-review. |
435
+ | "Reviews slow the loop down" | The loop without reviews is just unverified churn. Reviews are the loop's brakes and steering. |
436
+ | "Ledger bookkeeping is overhead" | The ledger is what survives compaction. Controllers without one have re-dispatched entire completed task sequences. |
437
+
438
+ ## Example Workflow
439
+
440
+ ```
441
+ You: I'm using Subagent-Driven Development to execute this plan.
442
+
443
+ [Setup: worktree verified]
444
+ [Read plan file once: docs/superpowers/plans/feature-plan.md]
445
+ [Resolve workspace: scripts/sdd-workspace docs/superpowers/plans/feature-plan.md — no ledger inside, fresh start]
446
+ [Create todos for all tasks]
447
+
448
+ Task 1: Hook installation script
449
+
450
+ [Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
451
+
452
+ Implementer: "Before I begin - should the hook be installed at user or system level?"
453
+
454
+ You: "User level (~/.config/superpowers/hooks/)"
455
+
456
+ Implementer: [Later]
457
+ - Implemented install-hook command
458
+ - Added tests, 5/5 passing
459
+ - Self-review: Found I missed --force flag, added it
460
+ - Committed
461
+
462
+ [Run review-package PLAN_FILE BASE HEAD; dispatch task reviewer with the printed path]
463
+ Task reviewer: Spec ✅ - all requirements met, nothing extra.
464
+ Strengths: Good test coverage, clean. Issues: None. Task quality: Approved.
465
+
466
+ [Ledger: Task 1: complete (commits a1b2c3d..d4e5f6a, review clean)]
467
+
468
+ Task 2: Recovery modes
469
+
470
+ [Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
471
+
472
+ Implementer: [No questions]
473
+ - Added verify/repair modes
474
+ - 8/8 tests passing
475
+ - Committed
476
+
477
+ [Run review-package PLAN_FILE BASE HEAD; dispatch task reviewer with the printed path]
478
+ Task reviewer: Spec ❌:
479
+ - Missing: Progress reporting (spec says "report every 100 items")
480
+ Issues (Important): Magic number (100)
481
+
482
+ [Fix round 1: resume the implementer with both findings]
483
+ Implementer: Added progress reporting, extracted PROGRESS_INTERVAL constant.
484
+ Re-ran test/recovery.test.js — 10/10 passing. Fix report appended.
485
+
486
+ [Run review-package PLAN_FILE FIX_BASE HEAD; dispatch scoped re-review]
487
+ Re-reviewer: Missing progress reporting — ADDRESSED (src/recovery.js:41).
488
+ Magic number — ADDRESSED (src/recovery.js:7). New breakage: none.
489
+ Verdict: all findings addressed.
490
+
491
+ [Ledger: Task 2: fix round 1/5 (2 addressed, 0 open; commits d4e5f6a..b7c8d9e)]
492
+ [Ledger: Task 2: complete (commits d4e5f6a..b7c8d9e, review clean)]
493
+
494
+ ...
495
+
496
+ [After all tasks]
497
+ [Run review-package PLAN_FILE MERGE_BASE HEAD; dispatch final code-reviewer, most capable model]
498
+ Final reviewer: All requirements met. Deferred minors triaged: none block merge.
499
+
500
+ [Delete this plan's workspace — the record now lives in git]
501
+
502
+ Done! Using superpowers:finishing-a-development-branch.
503
+ ```
504
+
505
+ ## Ship integration
506
+
507
+ This skill is part of the engineering profile shipped by
508
+ `opencode-ship@1.0`. Execution is driven by the deterministic
509
+ Ship controller; the cheap builder (`minimax/MiniMax-M3`) cannot
510
+ commit, push, mutate GitHub, mark Ready, or merge. The
511
+ verification-before-completion rule is enforced by
512
+ `delivery_verify`, not by the model self-asserting completion.
@@ -0,0 +1,142 @@
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 the task review finds issues, you will be resumed with the findings.
110
+ Fix them, re-run the tests that cover the amended code, and append a fix
111
+ report to your report file: what you changed, the covering tests you
112
+ ran, the command, and the output. Reviewers will not re-run tests for
113
+ you — your report is the test evidence. Then reply with the same short
114
+ status contract as your first report.
115
+
116
+ ## Report Format
117
+
118
+ Write your full report to [REPORT_FILE]:
119
+ - What you implemented (or what you attempted, if blocked)
120
+ - What you tested and test results
121
+ - **TDD Evidence** (if TDD was required for this task):
122
+ - RED: command run, relevant failing output before implementation, and why the failure was expected
123
+ - GREEN: command run and relevant passing output after implementation
124
+ - Files changed
125
+ - Self-review findings (if any)
126
+ - Any issues or concerns
127
+
128
+ Then report back with ONLY (under 15 lines — the detail lives in the
129
+ report file):
130
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
131
+ - Commits created (short SHA + subject)
132
+ - One-line test summary (e.g. "14/14 passing, output pristine")
133
+ - Your concerns, if any
134
+ - The report file path
135
+
136
+ If BLOCKED or NEEDS_CONTEXT, put the specifics in the final message
137
+ itself — the controller acts on it directly.
138
+
139
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
140
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
141
+ information that wasn't provided. Never silently produce work you're unsure about.
142
+ ```