@brainervirus/workit-core 0.10.0 → 1.0.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 (150) hide show
  1. package/README.md +5 -3
  2. package/package.json +8 -3
  3. package/scripts/analyze-release-scope.ts +4 -1
  4. package/scripts/doctor-check.ts +3 -1
  5. package/scripts/install-codex-plugin.sh +28 -0
  6. package/scripts/install-cursor-plugin.sh +1 -0
  7. package/scripts/install-opencode-plugin.sh +1 -0
  8. package/scripts/install-pi-package.sh +56 -0
  9. package/scripts/rewrite-workspace-deps.ts +22 -5
  10. package/scripts/sync-release-manifests.ts +8 -5
  11. package/scripts/sync-runtime.sh +7 -3
  12. package/scripts/validate-cursor-marketplace.ts +16 -62
  13. package/skills/workit-babysit/SKILL.md +33 -0
  14. package/skills/workit-behavioral-tdd/SKILL.md +53 -0
  15. package/skills/workit-blast-radius/SKILL.md +31 -0
  16. package/skills/workit-challenge/SKILL.md +62 -0
  17. package/skills/workit-debug/SKILL.md +61 -0
  18. package/skills/workit-deslop/SKILL.md +36 -0
  19. package/skills/workit-diagram/SKILL.md +32 -0
  20. package/skills/workit-green-run/SKILL.md +29 -0
  21. package/skills/workit-handoff/SKILL.md +43 -0
  22. package/skills/workit-implement/SKILL.md +46 -0
  23. package/skills/workit-mockup/SKILL.md +28 -0
  24. package/skills/workit-plan/SKILL.md +66 -0
  25. package/skills/workit-review/SKILL.md +60 -0
  26. package/skills/workit-steer/SKILL.md +32 -0
  27. package/src/core/authority.ts +918 -0
  28. package/src/core/boundary.ts +29 -0
  29. package/src/core/branch.ts +26 -255
  30. package/src/core/changelog.ts +95 -18
  31. package/src/core/commit-flavors.ts +65 -0
  32. package/src/core/config-conversion.ts +183 -0
  33. package/src/core/config.ts +42 -0
  34. package/src/core/cutover.ts +721 -0
  35. package/src/core/detect-hosts.ts +107 -0
  36. package/src/core/doctor.ts +428 -18
  37. package/src/core/external-action-effects.ts +1171 -0
  38. package/src/core/external-action.ts +541 -0
  39. package/src/core/init.ts +83 -32
  40. package/src/core/methods.ts +125 -0
  41. package/src/core/policy-resolver.ts +523 -0
  42. package/src/core/pr-create.ts +7 -1
  43. package/src/core/registration.ts +69 -4
  44. package/src/core/repo-context.ts +59 -1
  45. package/src/core/setup.ts +28 -0
  46. package/src/core/skill-manifests.ts +40 -42
  47. package/src/core/support-matrix.ts +8 -3
  48. package/src/core/sync-runtime.ts +15 -3
  49. package/src/core/task-context.ts +179 -0
  50. package/src/core/task-contract.ts +1136 -0
  51. package/src/core/task-engine.ts +2562 -0
  52. package/src/core/task-evaluation.ts +679 -0
  53. package/src/core/task-store.ts +1071 -0
  54. package/src/core/tracker-issues.ts +237 -0
  55. package/src/core/uninstall.ts +67 -3
  56. package/src/core/vcs-config.ts +53 -22
  57. package/src/core/workers.ts +166 -0
  58. package/src/core/workspaces.ts +3 -1
  59. package/src/core/youtrack-tools.ts +2 -0
  60. package/src/core/youtrack.ts +145 -10
  61. package/src/core.ts +126 -0
  62. package/templates/execution-contract.md +17 -50
  63. package/templates/plan-template.md +3 -3
  64. package/templates/spec-template.md +15 -3
  65. package/templates/workit-contract.md +12 -0
  66. package/commands/wk-changelog.md +0 -2
  67. package/commands/wk-commit.md +0 -2
  68. package/commands/wk-docs-refresh.md +0 -2
  69. package/commands/wk-handoff.md +0 -2
  70. package/commands/wk-implement.md +0 -2
  71. package/commands/wk-init.md +0 -2
  72. package/commands/wk-issue-update.md +0 -2
  73. package/commands/wk-meetings.md +0 -2
  74. package/commands/wk-pr.md +0 -2
  75. package/commands/wk-release-notes.md +0 -2
  76. package/commands/wk-status.md +0 -2
  77. package/commands/wk-verify.md +0 -2
  78. package/scripts/update-superpowers.sh +0 -82
  79. package/scripts/vendor-assets.ts +0 -37
  80. package/skills/wk-changelog/SKILL.md +0 -15
  81. package/skills/wk-commit/SKILL.md +0 -16
  82. package/skills/wk-docs-refresh/SKILL.md +0 -15
  83. package/skills/wk-handoff/SKILL.md +0 -20
  84. package/skills/wk-implement/SKILL.md +0 -47
  85. package/skills/wk-init/SKILL.md +0 -31
  86. package/skills/wk-issue-update/SKILL.md +0 -27
  87. package/skills/wk-issue-update/references/youtrack-update-style.md +0 -81
  88. package/skills/wk-meetings/SKILL.md +0 -17
  89. package/skills/wk-pr/SKILL.md +0 -27
  90. package/skills/wk-release-notes/SKILL.md +0 -15
  91. package/skills/wk-status/SKILL.md +0 -16
  92. package/skills/wk-verify/SKILL.md +0 -16
  93. package/src/core/detector.ts +0 -239
  94. package/src/core/flow-state.ts +0 -3048
  95. package/src/core/handoff-context.ts +0 -136
  96. package/src/core/handoff-tools.ts +0 -133
  97. package/src/core/menu.ts +0 -70
  98. package/src/core/plan-tasks.ts +0 -43
  99. package/src/core/reminder.ts +0 -124
  100. package/src/core/sdd.ts +0 -353
  101. package/src/state.ts +0 -22
  102. package/templates/superpowers-doc-contract.md +0 -75
  103. package/vendor/superpowers/skills/brainstorming/SKILL.md +0 -159
  104. package/vendor/superpowers/skills/brainstorming/scripts/frame-template.html +0 -213
  105. package/vendor/superpowers/skills/brainstorming/scripts/helper.js +0 -167
  106. package/vendor/superpowers/skills/brainstorming/scripts/server.cjs +0 -723
  107. package/vendor/superpowers/skills/brainstorming/scripts/start-server.sh +0 -209
  108. package/vendor/superpowers/skills/brainstorming/scripts/stop-server.sh +0 -120
  109. package/vendor/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  110. package/vendor/superpowers/skills/brainstorming/visual-companion.md +0 -291
  111. package/vendor/superpowers/skills/dispatching-parallel-agents/SKILL.md +0 -185
  112. package/vendor/superpowers/skills/executing-plans/SKILL.md +0 -70
  113. package/vendor/superpowers/skills/finishing-a-development-branch/SKILL.md +0 -241
  114. package/vendor/superpowers/skills/receiving-code-review/SKILL.md +0 -213
  115. package/vendor/superpowers/skills/requesting-code-review/SKILL.md +0 -103
  116. package/vendor/superpowers/skills/requesting-code-review/code-reviewer.md +0 -172
  117. package/vendor/superpowers/skills/subagent-driven-development/SKILL.md +0 -426
  118. package/vendor/superpowers/skills/subagent-driven-development/implementer-prompt.md +0 -139
  119. package/vendor/superpowers/skills/subagent-driven-development/scripts/review-package +0 -44
  120. package/vendor/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
  121. package/vendor/superpowers/skills/subagent-driven-development/scripts/task-brief +0 -40
  122. package/vendor/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
  123. package/vendor/superpowers/skills/systematic-debugging/CREATION-LOG.md +0 -119
  124. package/vendor/superpowers/skills/systematic-debugging/SKILL.md +0 -296
  125. package/vendor/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +0 -158
  126. package/vendor/superpowers/skills/systematic-debugging/condition-based-waiting.md +0 -115
  127. package/vendor/superpowers/skills/systematic-debugging/defense-in-depth.md +0 -122
  128. package/vendor/superpowers/skills/systematic-debugging/find-polluter.sh +0 -63
  129. package/vendor/superpowers/skills/systematic-debugging/root-cause-tracing.md +0 -169
  130. package/vendor/superpowers/skills/systematic-debugging/test-academic.md +0 -14
  131. package/vendor/superpowers/skills/systematic-debugging/test-pressure-1.md +0 -58
  132. package/vendor/superpowers/skills/systematic-debugging/test-pressure-2.md +0 -68
  133. package/vendor/superpowers/skills/systematic-debugging/test-pressure-3.md +0 -69
  134. package/vendor/superpowers/skills/test-driven-development/SKILL.md +0 -371
  135. package/vendor/superpowers/skills/test-driven-development/testing-anti-patterns.md +0 -299
  136. package/vendor/superpowers/skills/using-git-worktrees/SKILL.md +0 -202
  137. package/vendor/superpowers/skills/using-superpowers/SKILL.md +0 -62
  138. package/vendor/superpowers/skills/using-superpowers/references/antigravity-tools.md +0 -23
  139. package/vendor/superpowers/skills/using-superpowers/references/codex-tools.md +0 -39
  140. package/vendor/superpowers/skills/using-superpowers/references/pi-tools.md +0 -16
  141. package/vendor/superpowers/skills/verification-before-completion/SKILL.md +0 -139
  142. package/vendor/superpowers/skills/writing-plans/SKILL.md +0 -174
  143. package/vendor/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
  144. package/vendor/superpowers/skills/writing-skills/SKILL.md +0 -689
  145. package/vendor/superpowers/skills/writing-skills/anthropic-best-practices.md +0 -1150
  146. package/vendor/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  147. package/vendor/superpowers/skills/writing-skills/graphviz-conventions.dot +0 -172
  148. package/vendor/superpowers/skills/writing-skills/persuasion-principles.md +0 -187
  149. package/vendor/superpowers/skills/writing-skills/render-graphs.js +0 -168
  150. package/vendor/superpowers/skills/writing-skills/testing-skills-with-subagents.md +0 -384
@@ -1,426 +0,0 @@
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
- "Run verification, then workit_plan_complete once the ledger is complete and verification passes" [shape=box];
67
- "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
68
-
69
- "Read plan, note context and global constraints, create todos" -> "Dispatch implementer subagent (./implementer-prompt.md)";
70
- "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
71
- "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
72
- "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
73
- "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
74
- "Implementer subagent implements, tests, commits, self-reviews" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)";
75
- "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" -> "Task reviewer reports spec ✅ and quality approved?";
76
- "Task reviewer reports spec ✅ and quality approved?" -> "Dispatch fix subagent for Critical/Important findings" [label="no"];
77
- "Dispatch fix subagent for Critical/Important findings" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [label="re-review"];
78
- "Task reviewer reports spec ✅ and quality approved?" -> "Mark task complete in todo list and progress ledger" [label="yes"];
79
- "Mark task complete in todo list and progress ledger" -> "More tasks remain?";
80
- "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
81
- "More tasks remain?" -> "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [label="no"];
82
- "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" -> "Run verification, then workit_plan_complete once the ledger is complete and verification passes";
83
- "Run verification, then workit_plan_complete once the ledger is complete and verification passes" -> "Use superpowers:finishing-a-development-branch";
84
- }
85
- ```
86
-
87
- **Mandatory completion:** after the final whole-branch review, run repository verification. Once the SDD ledger is complete and verification passes, end the run by calling `workit_plan_complete` (or the CLI `workit flow complete`) — a complete ledger and green verification are the tool's gates. Never finish while the plan is still `active`.
88
-
89
- ## Pre-Flight Plan Review
90
-
91
- Before dispatching Task 1, scan the plan once for conflicts:
92
-
93
- - tasks that contradict each other or the plan's Global Constraints
94
- - anything the plan explicitly mandates that the review rubric treats as a
95
- defect (a test that asserts nothing, verbatim duplication of a logic block)
96
-
97
- Present everything you find to your human partner as one batched question —
98
- each finding beside the plan text that mandates it, asking which governs —
99
- before execution begins, not one interrupt per discovery mid-plan. If the
100
- scan is clean, proceed without comment. The review loop remains the net for
101
- conflicts that only emerge from implementation.
102
-
103
- ## Model Selection
104
-
105
- Use the least powerful model that can handle each role to conserve cost and increase speed.
106
-
107
- **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.
108
-
109
- **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
110
-
111
- **Architecture and design tasks**: use the most capable available model.
112
- The final whole-branch review is one of these — dispatch it on the most
113
- capable available model, not the session default.
114
-
115
- **Review tasks**: choose the model with the same judgment, scaled to the
116
- diff's size, complexity, and risk. A small mechanical diff does not need the
117
- most capable model; a subtle concurrency change does.
118
-
119
- **Always specify the model explicitly when dispatching a subagent.** An
120
- omitted model inherits your session's model — often the most capable and
121
- most expensive — which silently defeats this section.
122
-
123
- **Turn count beats token price.** Wall-clock and context cost scale with how
124
- many turns a subagent takes, and the cheapest models routinely take 2-3× the
125
- turns on multi-step work — costing more overall. Use a mid-tier model as the
126
- floor for reviewers and for implementers working from prose descriptions.
127
- When the task's plan text contains the complete code to write, the
128
- implementation is transcription plus testing: use the cheapest tier for
129
- that implementer. Single-file mechanical fixes also take the cheapest tier.
130
-
131
- **Task complexity signals (implementation tasks):**
132
- - Touches 1-2 files with a complete spec → cheap model
133
- - Touches multiple files with integration concerns → standard model
134
- - Requires design judgment or broad codebase understanding → most capable model
135
-
136
- ## Handling Implementer Status
137
-
138
- Implementer subagents report one of four statuses. Handle each appropriately:
139
-
140
- **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.
141
-
142
- **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.
143
-
144
- **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
145
-
146
- **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
147
- 1. If it's a context problem, provide more context and re-dispatch with the same model
148
- 2. If the task requires more reasoning, re-dispatch with a more capable model
149
- 3. If the task is too large, break it into smaller pieces
150
- 4. If the plan itself is wrong, escalate to the human
151
-
152
- **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
153
-
154
- ## Handling Reviewer ⚠️ Items
155
-
156
- The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
157
- that live in unchanged code or span tasks. These do not block the rest of the
158
- review, but you must resolve each one yourself before marking the task
159
- complete: you hold the plan and cross-task context the reviewer
160
- lacks. If you confirm an item is a real gap, treat it as a failed spec
161
- review — send it back to the implementer and re-review.
162
-
163
- ## Constructing Reviewer Prompts
164
-
165
- Per-task reviews are task-scoped gates. The broad review happens once, at the
166
- final whole-branch review. When you fill a reviewer template:
167
-
168
- - Do not add open-ended directives like "check all uses" or "run race tests
169
- if useful" without a concrete, task-specific reason
170
- - Do not ask a reviewer to re-run tests the implementer already ran on the
171
- same code — the implementer's report carries the test evidence
172
- - Do not pre-judge findings for the reviewer — never instruct a reviewer to
173
- ignore or not flag a specific issue. If you believe a finding would be a
174
- false positive, let the reviewer raise it and adjudicate it in the review
175
- loop. If the prompt you are writing contains "do not flag," "don't treat X
176
- as a defect," "at most Minor," or "the plan chose" — stop: you are
177
- pre-judging, usually to spare yourself a review loop.
178
- - The global-constraints block you hand the reviewer is its attention
179
- lens. Copy the binding requirements verbatim from the plan's Global
180
- Constraints section or the spec: exact values, exact formats, and the
181
- stated relationships between components ("same layout as X", "matches
182
- Y"). The reviewer's template already carries the process rules (YAGNI,
183
- test hygiene, review method) — the constraints block is for what THIS
184
- project's spec demands.
185
- - Hand the reviewer its diff as a file: run this skill's
186
- `scripts/review-package BASE HEAD` and pass the reviewer the file path
187
- it prints (or, without bash: `git log --oneline`, `git diff --stat`,
188
- and `git diff -U10` for the range, redirected to one uniquely named
189
- file). The output never enters your own context, and the reviewer sees
190
- the commit list, stat summary, and full diff with context in one Read
191
- call. Use the BASE you recorded before dispatching the implementer —
192
- never `HEAD~1`, which silently truncates multi-commit tasks.
193
- - A dispatch prompt describes one task, not the session's history. Do not
194
- paste accumulated prior-task summaries ("state after Tasks 1-3") into
195
- later dispatches — a real session's dispatch hit 42k chars of which 99%
196
- was pasted history. A fresh subagent needs its task, the interfaces it
197
- touches, and the global constraints. Nothing else.
198
- - Dispatch fix subagents for Critical and Important findings. Record Minor
199
- findings in the progress ledger as you go, and point the final
200
- whole-branch review at that list so it can triage which must be fixed
201
- before merge. A roll-up nobody reads is a silent discard.
202
- - A finding labeled plan-mandated — or any finding that conflicts with
203
- what the plan's text requires — is the human's decision, like any plan
204
- contradiction: present the finding and the plan text, ask which governs.
205
- Do not dismiss the finding because the plan mandates it, and do not
206
- dispatch a fix that contradicts the plan without asking.
207
- - The final whole-branch review gets a package too: run
208
- `scripts/review-package MERGE_BASE HEAD` (MERGE_BASE = the commit the
209
- branch started from, e.g. `git merge-base main HEAD`) and include the
210
- printed path in the final review dispatch, so the final reviewer reads
211
- one file instead of re-deriving the branch diff with git commands.
212
- - Every fix dispatch carries the implementer contract: the fix subagent
213
- re-runs the tests covering its change and reports the results. Name the
214
- covering test files in the dispatch — a one-line fix does not need the
215
- whole suite. Before re-dispatching the reviewer, confirm the fix report
216
- contains the covering tests, the command run, and the output; dispatch
217
- the re-review once all three are present.
218
- - If the final whole-branch review returns findings, dispatch ONE fix
219
- subagent with the complete findings list — not one fixer per finding.
220
- Per-finding fixers each rebuild context and re-run suites; a real
221
- session's final-review fix wave cost more than all its tasks combined.
222
-
223
- ## File Handoffs
224
-
225
- Everything you paste into a dispatch prompt — and everything a subagent
226
- prints back — stays resident in your context for the rest of the session
227
- and is re-read on every later turn. Hand artifacts over as files:
228
-
229
- - **Task brief:** before dispatching an implementer, run this skill's
230
- `scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
231
- uniquely named file and prints the path. Compose the dispatch so the
232
- brief stays the single source of requirements. Your dispatch should
233
- contain: (1) one line on where this task fits in the project; (2) the
234
- brief path, introduced as "read this first — it is your requirements,
235
- with the exact values to use verbatim"; (3) interfaces and decisions
236
- from earlier tasks that the brief cannot know; (4) your resolution of
237
- any ambiguity you noticed in the brief; (5) the report-file path and
238
- report contract. Exact values (numbers, magic strings, signatures, test
239
- cases) appear only in the brief.
240
- - **Report file:** name the implementer's report file after the brief
241
- (brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
242
- the dispatch prompt. The implementer writes the full report there and
243
- returns only status, commits, a one-line test summary, and concerns.
244
- - **Reviewer inputs:** the task reviewer gets three paths — the same brief
245
- file, the report file, and the review package — plus the global
246
- constraints that bind the task.
247
- - Fix dispatches append their fix report (with test results) to the same
248
- report file and return a short summary; re-reviews read the updated file.
249
-
250
- ## Durable Progress
251
-
252
- Conversation memory does not survive compaction. In real sessions,
253
- controllers that lost their place have re-dispatched entire completed task
254
- sequences — the single most expensive failure observed. Track progress in
255
- a ledger file, not only in todos.
256
-
257
- - At skill start, check for a ledger:
258
- `cat "$(git rev-parse --show-toplevel)/.superpowers/sdd/progress.md"`. Tasks listed there
259
- as complete are DONE — do not re-dispatch them; resume at the first task
260
- not marked complete.
261
- - When a task's review comes back clean, append one line to the ledger in
262
- the same message as your other bookkeeping:
263
- `Task N: complete (commits <base7>..<head7>, review clean)`.
264
- - Each task produces exactly one contiguous non-empty commit range: fix
265
- rounds append commits to it, never amend or rewrite an active review
266
- range, and the ledger progress line records the task's real base..head
267
- shas.
268
- - The ledger is your recovery map: the commits it names exist in git even
269
- when your context no longer remembers creating them. After compaction,
270
- trust the ledger and `git log` over your own recollection.
271
- - `git clean -fdx` will destroy the ledger (it's git-ignored scratch); if
272
- that happens, recover from `git log`.
273
-
274
- ## Prompt Templates
275
-
276
- - [implementer-prompt.md](implementer-prompt.md) - Dispatch implementer subagent
277
- - [task-reviewer-prompt.md](task-reviewer-prompt.md) - Dispatch task reviewer subagent (spec compliance + code quality)
278
- - Final whole-branch review: use superpowers:requesting-code-review's [code-reviewer.md](../requesting-code-review/code-reviewer.md)
279
-
280
- ## Example Workflow
281
-
282
- ```
283
- You: I'm using Subagent-Driven Development to execute this plan.
284
-
285
- [Read plan file once: docs/<slug>/plan.md]
286
- [Create todos for all tasks]
287
-
288
- Task 1: Hook installation script
289
-
290
- [Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
291
-
292
- Implementer: "Before I begin - should the hook be installed at user or system level?"
293
-
294
- You: "User level (~/.config/superpowers/hooks/)"
295
-
296
- Implementer: "Got it. Implementing now..."
297
- [Later] Implementer:
298
- - Implemented install-hook command
299
- - Added tests, 5/5 passing
300
- - Self-review: Found I missed --force flag, added it
301
- - Committed
302
-
303
- [Run review-package, dispatch task reviewer with the printed path]
304
- Task reviewer: Spec ✅ - all requirements met, nothing extra.
305
- Strengths: Good test coverage, clean. Issues: None. Task quality: Approved.
306
-
307
- [Mark Task 1 complete]
308
-
309
- Task 2: Recovery modes
310
-
311
- [Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
312
-
313
- Implementer: [No questions, proceeds]
314
- Implementer:
315
- - Added verify/repair modes
316
- - 8/8 tests passing
317
- - Self-review: All good
318
- - Committed
319
-
320
- [Run review-package, dispatch task reviewer with the printed path]
321
- Task reviewer: Spec ❌:
322
- - Missing: Progress reporting (spec says "report every 100 items")
323
- - Extra: Added --json flag (not requested)
324
- Issues (Important): Magic number (100)
325
-
326
- [Dispatch fix subagent with all findings]
327
- Fixer: Removed --json flag, added progress reporting, extracted PROGRESS_INTERVAL constant
328
-
329
- [Task reviewer reviews again]
330
- Task reviewer: Spec ✅. Task quality: Approved.
331
-
332
- [Mark Task 2 complete]
333
-
334
- ...
335
-
336
- [After all tasks]
337
- [Dispatch final code-reviewer]
338
- Final reviewer: All requirements met, ready to merge
339
-
340
- Done!
341
- ```
342
-
343
- ## Advantages
344
-
345
- **vs. Manual execution:**
346
- - Subagents follow TDD naturally
347
- - Fresh context per task (no confusion)
348
- - Parallel-safe (subagents don't interfere)
349
- - Subagent can ask questions (before AND during work)
350
-
351
- **vs. Executing Plans:**
352
- - Same session (no handoff)
353
- - Continuous progress (no waiting)
354
- - Review checkpoints automatic
355
-
356
- **Efficiency gains:**
357
- - Controller curates exactly what context is needed; bulk artifacts move
358
- as files, not pasted text
359
- - Subagent gets complete information upfront
360
- - Questions surfaced before work begins (not after)
361
-
362
- **Quality gates:**
363
- - Self-review catches issues before handoff
364
- - Task review carries two verdicts: spec compliance and code quality
365
- - Review loops ensure fixes actually work
366
- - Spec compliance prevents over/under-building
367
- - Code quality ensures implementation is well-built
368
-
369
- **Cost:**
370
- - More subagent invocations (implementer + reviewer per task)
371
- - Controller does more prep work (extracting all tasks upfront)
372
- - Review loops add iterations
373
- - But catches issues early (cheaper than debugging later)
374
-
375
- ## Red Flags
376
-
377
- **Never:**
378
- - Start implementation on main/master branch without explicit user consent
379
- - Skip task review, or accept a report missing either verdict (spec compliance AND task quality are both required)
380
- - Proceed with unfixed issues
381
- - Dispatch multiple implementation subagents in parallel (conflicts)
382
- - Make a subagent read the whole plan file (hand it its task brief —
383
- `scripts/task-brief` — instead)
384
- - Skip scene-setting context (subagent needs to understand where task fits)
385
- - Ignore subagent questions (answer before letting them proceed)
386
- - Accept "close enough" on spec compliance (reviewer found spec issues = not done)
387
- - Skip review loops (reviewer found issues = implementer fixes = review again)
388
- - Let implementer self-review replace actual review (both are needed)
389
- - Tell a reviewer what not to flag, or pre-rate a finding's severity in the
390
- dispatch prompt ("treat it as Minor at most") — the plan's example code is
391
- a starting point, not evidence that its weaknesses were chosen
392
- - Dispatch a task reviewer without a diff file — generate it first
393
- (`scripts/review-package BASE HEAD`) and name the printed path in the
394
- prompt
395
- - Move to next task while the review has open Critical/Important issues
396
- - Re-dispatch a task the progress ledger already marks complete — check
397
- the ledger (and `git log`) after any compaction or resume
398
-
399
- **If subagent asks questions:**
400
- - Answer clearly and completely
401
- - Provide additional context if needed
402
- - Don't rush them into implementation
403
-
404
- **If reviewer finds issues:**
405
- - Implementer (same subagent) fixes them
406
- - Reviewer reviews again
407
- - Repeat until approved
408
- - Don't skip the re-review
409
-
410
- **If subagent fails task:**
411
- - Dispatch fix subagent with specific instructions
412
- - Don't try to fix manually (context pollution)
413
-
414
- ## Integration
415
-
416
- **Required workflow skills:**
417
- - **superpowers:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)
418
- - **superpowers:writing-plans** - Creates the plan this skill executes
419
- - **superpowers:requesting-code-review** - Code review template for the final whole-branch review
420
- - **superpowers:finishing-a-development-branch** - Complete development after all tasks
421
-
422
- **Subagents should use:**
423
- - **superpowers:test-driven-development** - Subagents follow TDD for each task
424
-
425
- **Alternative workflow:**
426
- - **superpowers:executing-plans** - Use for parallel session instead of same-session execution
@@ -1,139 +0,0 @@
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
- ```
@@ -1,44 +0,0 @@
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"
@@ -1,22 +0,0 @@
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
@@ -1,40 +0,0 @@
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"