@ctxthuta/cxops 1.0.7 → 1.1.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 (94) hide show
  1. package/.antigravity-plugin/plugin.json +34 -0
  2. package/.claude-plugin/marketplace.json +20 -0
  3. package/.claude-plugin/plugin.json +25 -0
  4. package/.codex-plugin/plugin.json +50 -0
  5. package/CLAUDE.md +16 -1
  6. package/assets/antigravity-logo.png +0 -0
  7. package/assets/app-icon.png +0 -0
  8. package/assets/superpowers-small.svg +1 -0
  9. package/hooks/hooks-cursor.json +10 -0
  10. package/hooks/hooks.json +18 -0
  11. package/hooks/run-hook.cmd +79 -0
  12. package/hooks/session-start +90 -0
  13. package/package.json +12 -2
  14. package/plugin/plugin.json +25 -14
  15. package/plugin/skills/brainstorming/SKILL.md +316 -0
  16. package/plugin/skills/brainstorming/builder-check-prompt.md +23 -0
  17. package/plugin/skills/brainstorming/scripts/frame-template.html +213 -0
  18. package/plugin/skills/brainstorming/scripts/helper.js +167 -0
  19. package/plugin/skills/brainstorming/scripts/server.cjs +723 -0
  20. package/plugin/skills/brainstorming/scripts/start-server.sh +216 -0
  21. package/plugin/skills/brainstorming/scripts/stop-server.sh +120 -0
  22. package/plugin/skills/brainstorming/visual-companion.md +299 -0
  23. package/plugin/skills/diagnosing-superpowers/SKILL.md +120 -0
  24. package/plugin/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  25. package/plugin/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  26. package/plugin/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  27. package/plugin/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  28. package/plugin/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  29. package/plugin/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  30. package/plugin/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  31. package/plugin/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  32. package/plugin/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  33. package/plugin/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  34. package/plugin/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  35. package/plugin/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  36. package/plugin/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  37. package/plugin/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  38. package/plugin/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  39. package/plugin/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  40. package/plugin/skills/diagnosing-superpowers/templates/case.md +64 -0
  41. package/plugin/skills/diagnosing-superpowers/templates/issue.md +70 -0
  42. package/plugin/skills/diagnosing-superpowers/templates/report.md +82 -0
  43. package/plugin/skills/dispatching-parallel-agents/SKILL.md +167 -0
  44. package/plugin/skills/executing-plans/SKILL.md +323 -0
  45. package/plugin/skills/executing-plans/scripts/task-done +55 -0
  46. package/plugin/skills/executing-plans/scripts/task-start +32 -0
  47. package/plugin/skills/finishing-a-development-branch/SKILL.md +225 -0
  48. package/plugin/skills/receiving-code-review/SKILL.md +205 -0
  49. package/plugin/skills/requesting-code-review/SKILL.md +95 -0
  50. package/plugin/skills/requesting-code-review/code-reviewer.md +198 -0
  51. package/plugin/skills/subagent-driven-development/SKILL.md +339 -0
  52. package/plugin/skills/subagent-driven-development/implementer-prompt.md +154 -0
  53. package/plugin/skills/subagent-driven-development/re-review-prompt.md +116 -0
  54. package/plugin/skills/subagent-driven-development/references/batching.md +11 -0
  55. package/plugin/skills/subagent-driven-development/references/cannot-verify.md +10 -0
  56. package/plugin/skills/subagent-driven-development/references/final-review.md +49 -0
  57. package/plugin/skills/subagent-driven-development/references/fix-loop.md +77 -0
  58. package/plugin/skills/subagent-driven-development/references/handling-reports.md +15 -0
  59. package/plugin/skills/subagent-driven-development/references/preflight.md +26 -0
  60. package/plugin/skills/subagent-driven-development/references/resuming.md +12 -0
  61. package/plugin/skills/subagent-driven-development/scripts/review-package +64 -0
  62. package/plugin/skills/subagent-driven-development/scripts/sdd-repo +54 -0
  63. package/plugin/skills/subagent-driven-development/scripts/sdd-workspace +110 -0
  64. package/plugin/skills/subagent-driven-development/scripts/task-brief +108 -0
  65. package/plugin/skills/subagent-driven-development/task-reviewer-prompt.md +209 -0
  66. package/plugin/skills/systematic-debugging/SKILL.md +283 -0
  67. package/plugin/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  68. package/plugin/skills/systematic-debugging/condition-based-waiting.md +115 -0
  69. package/plugin/skills/systematic-debugging/defense-in-depth.md +122 -0
  70. package/plugin/skills/systematic-debugging/find-polluter.sh +72 -0
  71. package/plugin/skills/systematic-debugging/root-cause-tracing.md +169 -0
  72. package/plugin/skills/test-driven-development/SKILL.md +330 -0
  73. package/plugin/skills/test-driven-development/writing-good-tests.md +198 -0
  74. package/plugin/skills/using-git-worktrees/SKILL.md +167 -0
  75. package/plugin/skills/using-superpowers/SKILL.md +65 -0
  76. package/plugin/skills/using-superpowers/references/antigravity-tools.md +23 -0
  77. package/plugin/skills/using-superpowers/references/claude-code-tools.md +29 -0
  78. package/plugin/skills/using-superpowers/references/codex-tools.md +108 -0
  79. package/plugin/skills/using-superpowers/references/gemini-tools.md +63 -0
  80. package/plugin/skills/using-superpowers/references/hermes-tools.md +56 -0
  81. package/plugin/skills/using-superpowers/references/muse-tools.md +35 -0
  82. package/plugin/skills/using-superpowers/references/pi-tools.md +16 -0
  83. package/plugin/skills/verification-before-completion/SKILL.md +120 -0
  84. package/plugin/skills/writing-plans/SKILL.md +204 -0
  85. package/plugin/skills/writing-skills/SKILL.md +399 -0
  86. package/plugin/skills/writing-skills/references/CLAUDE_MD_TESTING.md +189 -0
  87. package/plugin/skills/writing-skills/references/anthropic-best-practices.md +1150 -0
  88. package/plugin/skills/writing-skills/references/bulletproofing.md +80 -0
  89. package/plugin/skills/writing-skills/references/discovery.md +201 -0
  90. package/plugin/skills/writing-skills/references/flowcharts.md +37 -0
  91. package/plugin/skills/writing-skills/references/graphviz-conventions.dot +172 -0
  92. package/plugin/skills/writing-skills/references/persuasion-principles.md +187 -0
  93. package/plugin/skills/writing-skills/references/testing-skills-with-subagents.md +384 -0
  94. package/plugin/skills/writing-skills/render-graphs.js +169 -0
@@ -0,0 +1,339 @@
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 the four named below, 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
+ **Rulings, not stalls.** A running plan does not wait on a human. Conflicts,
20
+ ambiguities, plan defects, a cap you would have asked to exceed — decide
21
+ them. The spec is the binding authority, the plan is its argument, and your
22
+ judgment settles what neither answers. Record every decision in the ledger as
23
+ `Ruling: <what you decided> — <why> — <what it costs if wrong>`, and keep
24
+ going. A wrong ruling costs rework your human partner can see and undo; a
25
+ session parked on a question costs their whole day and buys nothing.
26
+
27
+ Four things stop you, and only these: an irreversible or destructive
28
+ operation; a security-sensitive action; a side effect outside this worktree
29
+ that norms say you ask about first (a merge, a push to a shared branch, a
30
+ publish); and a plan so broken that every path forward is a guess. For those,
31
+ stop and ask.
32
+
33
+ ## When to Use
34
+
35
+ ```dot
36
+ digraph when_to_use {
37
+ "Have implementation plan?" [shape=diamond];
38
+ "Tasks mostly independent?" [shape=diamond];
39
+ "Partner chose inline, or no subagent tool?" [shape=diamond];
40
+ "subagent-driven-development" [shape=box];
41
+ "executing-plans" [shape=box];
42
+ "Manual execution or brainstorm first" [shape=box];
43
+
44
+ "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
45
+ "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
46
+ "Tasks mostly independent?" -> "Partner chose inline, or no subagent tool?" [label="yes"];
47
+ "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
48
+ "Partner chose inline, or no subagent tool?" -> "executing-plans" [label="yes"];
49
+ "Partner chose inline, or no subagent tool?" -> "subagent-driven-development" [label="no"];
50
+ }
51
+ ```
52
+
53
+ **vs. Executing Plans (inline):**
54
+ - Fresh subagent per task (no context pollution) instead of one context doing every task
55
+ - Review after each task (spec compliance + code quality) instead of only at the end
56
+ - Costs a fresh context per task and per review; inline costs one context plus one final reviewer
57
+ - Both run in this session, share the same plan workspace and ledger, and never pause between tasks
58
+
59
+ ## The Process
60
+
61
+ ```dot
62
+ digraph process {
63
+ rankdir=TB;
64
+
65
+ subgraph cluster_per_task {
66
+ label="Per Task";
67
+ "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
68
+ "Implementer asks questions?" [shape=diamond];
69
+ "Answer questions, provide context" [shape=box];
70
+ "Implementer implements, tests, commits, self-reviews" [shape=box];
71
+ "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" [shape=box];
72
+ "Spec ✅ and quality approved?" [shape=diamond];
73
+ "Fix loop: read references/fix-loop.md before every round" [shape=box];
74
+ "Append completion to ledger, mark todo complete" [shape=box];
75
+ }
76
+
77
+ "Setup: worktree, ledger check, read plan, pre-flight review" [shape=box];
78
+ "More tasks remain?" [shape=diamond];
79
+ "Final review and finish: read references/final-review.md" [shape=box];
80
+ "Final review clean: delete this plan's workspace" [shape=box];
81
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
82
+
83
+ "Setup: worktree, ledger check, read plan, pre-flight review" -> "Dispatch implementer subagent (./implementer-prompt.md)";
84
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer asks questions?";
85
+ "Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
86
+ "Answer questions, provide context" -> "Implementer implements, tests, commits, self-reviews";
87
+ "Implementer asks questions?" -> "Implementer implements, tests, commits, self-reviews" [label="no"];
88
+ "Implementer implements, tests, commits, self-reviews" -> "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)";
89
+ "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" -> "Spec ✅ and quality approved?";
90
+ "Spec ✅ and quality approved?" -> "Append completion to ledger, mark todo complete" [label="yes"];
91
+ "Spec ✅ and quality approved?" -> "Fix loop: read references/fix-loop.md before every round" [label="no"];
92
+ "Fix loop: read references/fix-loop.md before every round" -> "Append completion to ledger, mark todo complete" [label="addressed, or parked at the cap"];
93
+ "Append completion to ledger, mark todo complete" -> "More tasks remain?";
94
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
95
+ "More tasks remain?" -> "Final review and finish: read references/final-review.md" [label="no"];
96
+ "Final review and finish: read references/final-review.md" -> "Final review clean: delete this plan's workspace";
97
+ "Final review clean: delete this plan's workspace" -> "Use superpowers:finishing-a-development-branch";
98
+ }
99
+ ```
100
+
101
+ ## Setup
102
+
103
+ Ensure the work happens in an isolated workspace: use
104
+ superpowers:using-git-worktrees to create one or verify the existing one.
105
+ Never start implementation on a main/master branch without your human
106
+ partner's explicit consent.
107
+
108
+ Conversation memory does not survive compaction. In real sessions,
109
+ controllers that lost their place have re-dispatched entire completed task
110
+ sequences — the single most expensive failure observed. Track progress in
111
+ a ledger file, not only in todos.
112
+
113
+ - Each plan owns a workspace: at skill start, run this skill's
114
+ `bash scripts/sdd-workspace PLAN_FILE` by its absolute path, from the
115
+ working tree you're executing in — it prints the plan's git-ignored
116
+ directory (under `<repo-root>/.superpowers/sdd/`), home to
117
+ every artifact for THIS plan: ledger, briefs, reports, review packages.
118
+ Another plan's directory is never yours to read or write.
119
+ - Check for this plan's ledger at `<workspace>/progress.md`. If one exists,
120
+ read [references/resuming.md](references/resuming.md) before anything
121
+ else: it says whose ledger it is and where to resume.
122
+ - Create the ledger with its identity as the first line:
123
+ `# SDD ledger — plan: <plan file path>`.
124
+ - The ledger is your recovery map: the commits it names exist in git even
125
+ when your context no longer remembers creating them. After compaction,
126
+ trust the ledger and `git log` over your own recollection.
127
+ - `git clean -fdx` will destroy the workspace (it's git-ignored scratch); if
128
+ that happens, recover from `git log`.
129
+
130
+ Read the plan once, note its context and Global Constraints, and create a
131
+ todo per task. If the plan names a Spec, read that too: the spec is the
132
+ authority the plan argues from, and conflicts inside the plan resolve
133
+ against it. A plan with no reachable spec gets a ledger note saying so —
134
+ rulings made without one are provisional.
135
+
136
+ Before dispatching Task 1, read [references/preflight.md](references/preflight.md)
137
+ and run the conflict scan it describes. Its table and rulings go in the
138
+ ledger.
139
+
140
+ ## Model Selection
141
+
142
+ Use the least powerful model that can handle each role to conserve cost and increase speed.
143
+
144
+ **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.
145
+
146
+ **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
147
+
148
+ **Architecture and design tasks**: use the most capable available model.
149
+ The final whole-branch review is one of these — dispatch it on the most
150
+ capable available model, not the session default.
151
+
152
+ **Review tasks**: choose the model with the same judgment, scaled to the
153
+ diff's size, complexity, and risk. A small mechanical diff does not need the
154
+ most capable model; a subtle concurrency change does. Scoped re-reviews of
155
+ small fix diffs take a cheap-to-mid tier.
156
+
157
+ **Fix-loop escalation (rounds 4-5)**: use a model at least one tier above
158
+ the implementer that got stuck.
159
+
160
+ **Always specify the model explicitly when dispatching a subagent.** An
161
+ omitted model inherits your session's model — often the most capable and
162
+ most expensive — which silently defeats this section.
163
+
164
+ **Turn count beats token price.** Wall-clock and context cost scale with how
165
+ many turns a subagent takes, and the cheapest models routinely take 2-3× the
166
+ turns on multi-step work — costing more overall. Use a mid-tier model as the
167
+ floor for reviewers and for implementers working from prose descriptions.
168
+ When the task's plan text contains the complete code to write, the
169
+ implementation is transcription plus testing: use the cheapest tier for
170
+ that implementer. Single-file mechanical fixes also take the cheapest tier.
171
+
172
+ **Task complexity signals (implementation tasks):**
173
+ - Touches 1-2 files with a complete spec → cheap model
174
+ - Touches multiple files with integration concerns → standard model
175
+ - Requires design judgment or broad codebase understanding → most capable model
176
+
177
+ ## The Task Loop
178
+
179
+ **Small same-shape work:** when the plan lists several small edits of the
180
+ same kind across files, read [references/batching.md](references/batching.md)
181
+ before dispatching them.
182
+
183
+ Everything you paste into a dispatch prompt — and everything a subagent
184
+ prints back — stays resident in your context for the rest of the session
185
+ and is re-read on every later turn. Hand artifacts over as files.
186
+
187
+ **Waiting on dispatched subagents:** never poll a wait interface with
188
+ short timeouts, and never sit in one silent, open-ended wait either.
189
+ While you have local work — ledger updates, packaging the next review,
190
+ reading reports — keep working; child results arrive on their own.
191
+ When you are genuinely idle, wait in bounded stretches (five to ten
192
+ minutes, where your platform allows), and between stretches post one
193
+ line of status and reconcile your live children: list them, and chase
194
+ any that finished without reporting. A bounded stretch keeps nearly
195
+ all of a long wait's efficiency while guaranteeing a stuck or lost
196
+ child is noticed within minutes, not at the end of the session.
197
+
198
+ ### 1. Dispatch the implementer
199
+
200
+ Record BASE (`git rev-parse HEAD`) before dispatching — the review package
201
+ and fix-round diffs need it.
202
+
203
+ - **Task brief:** before dispatching an implementer, run this skill's
204
+ `bash scripts/task-brief PLAN_FILE N` by its absolute path, from the
205
+ working tree you're executing in — it extracts the task's full text to a
206
+ uniquely named file and prints the path. Compose the dispatch so the
207
+ brief stays the single source of
208
+ requirements. Your dispatch should contain: (1) one line on where this
209
+ task fits in the project; (2) the brief path, introduced as "read this
210
+ first — it is your requirements, with the exact values to use verbatim";
211
+ (3) interfaces and decisions from earlier tasks that the brief cannot
212
+ know; (4) your resolution of any ambiguity you noticed in the brief;
213
+ (5) the report-file path and report contract. Exact values (numbers,
214
+ magic strings, signatures, test cases) appear only in the brief. Never
215
+ make a subagent read the whole plan file.
216
+ - **Report file:** name the implementer's report file after the brief
217
+ (brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
218
+ the dispatch prompt. The implementer writes the full report there and
219
+ returns only status, commits, a one-line test summary, and concerns.
220
+ - A dispatch prompt describes one task, not the session's history. Do not
221
+ paste accumulated prior-task summaries ("state after Tasks 1-3") into
222
+ later dispatches — a real session's dispatch hit 42k chars of which 99%
223
+ was pasted history. A fresh subagent needs its task, the interfaces it
224
+ touches, and the global constraints. Nothing else.
225
+ - The dispatch carries the no-subagents contract (it is in the
226
+ implementer template): the implementer never dispatches subagents —
227
+ not helpers, and never a reviewer. Review arrives from you, after the
228
+ report. In real sessions, every reviewer a worker spawned duplicated
229
+ the task review the controller dispatched anyway — a full extra
230
+ review seat per task.
231
+ - If an earlier task parked a finding in the area this task touches, carry
232
+ a pointer to that ledger entry in the dispatch.
233
+ - Record the implementer's agent identity from the dispatch result —
234
+ fix-loop rounds 1-3 resume this agent.
235
+ - Never dispatch multiple implementation subagents in parallel (conflicts).
236
+
237
+ Template: [implementer-prompt.md](implementer-prompt.md)
238
+
239
+ ### 2. Handle the report
240
+
241
+ Implementer subagents report one of four statuses. Handle each appropriately:
242
+
243
+ **DONE:** Generate the review package (`bash scripts/review-package PLAN_FILE BASE HEAD` by its absolute path, from the working tree you're executing in — 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.
244
+
245
+ **Any other status** (DONE_WITH_CONCERNS, NEEDS_CONTEXT, BLOCKED): read
246
+ [references/handling-reports.md](references/handling-reports.md) and follow
247
+ it, every time you get one.
248
+
249
+ If the implementer asks questions — before starting or mid-task — answer
250
+ clearly and completely, provide additional context if needed, and don't
251
+ rush it into implementation.
252
+
253
+ ### 3. Review the task
254
+
255
+ Per-task reviews are task-scoped gates. The broad review happens once, at the
256
+ final whole-branch review. Never skip the task review, and never accept a
257
+ report missing either verdict — spec compliance AND task quality are both
258
+ required. Implementer self-review never replaces the task review; both are
259
+ needed.
260
+
261
+ - Hand the reviewer its diff as a file: run this skill's
262
+ `bash scripts/review-package PLAN_FILE BASE HEAD` by its absolute path, from
263
+ the working tree you're executing in, and pass the reviewer the file path
264
+ it prints (or, without bash: `git log --oneline`, `git diff --stat`,
265
+ and `git diff -U10` for the range, redirected to one uniquely named
266
+ file). The output never enters your own context, and the reviewer sees
267
+ the commit list, stat summary, and full diff with context in one Read
268
+ call. Use the BASE you recorded before dispatching the implementer —
269
+ never `HEAD~1`, which silently truncates multi-commit tasks. Never
270
+ dispatch a task reviewer without a diff file.
271
+ - **Reviewer inputs:** the task reviewer gets three paths — the same brief
272
+ file, the report file, and the review package — plus the global
273
+ constraints that bind the task.
274
+ - The global-constraints block you hand the reviewer is its attention
275
+ lens. Copy the binding requirements verbatim from the plan's Global
276
+ Constraints section or the spec: exact values, exact formats, and the
277
+ stated relationships between components ("same layout as X", "matches
278
+ Y"). The reviewer's template already carries the process rules (YAGNI,
279
+ test hygiene, review method) — the constraints block is for what THIS
280
+ project's spec demands.
281
+ - Do not add open-ended directives like "check all uses" or "run race tests
282
+ if useful" without a concrete, task-specific reason
283
+ - Do not ask a reviewer to re-run tests the implementer already ran on the
284
+ same code — the implementer's report carries the test evidence
285
+ - Do not pre-judge findings for the reviewer — never instruct a reviewer to
286
+ ignore or not flag a specific issue. If you believe a finding would be a
287
+ false positive, let the reviewer raise it and adjudicate it in the review
288
+ loop. If the prompt you are writing contains "do not flag," "don't treat X
289
+ as a defect," "at most Minor," or "the plan chose" — stop: you are
290
+ pre-judging, usually to spare yourself a review loop.
291
+ If the reviewer reports "⚠️ Cannot verify from diff" items, read
292
+ [references/cannot-verify.md](references/cannot-verify.md) before you mark
293
+ the task complete.
294
+
295
+ Template: [task-reviewer-prompt.md](task-reviewer-prompt.md)
296
+
297
+ ### 4. The fix loop
298
+
299
+ The loop triggers when the review reports spec ❌, any Critical or Important
300
+ finding, or a ⚠️ item you confirmed as a real gap.
301
+
302
+ When it triggers, read [references/fix-loop.md](references/fix-loop.md) and
303
+ follow it. Read it again before every round, even if you read it earlier in
304
+ this session: it holds the round cap, the breaker, and the ledger line each
305
+ round writes, and your memory of it does not survive compaction.
306
+
307
+ ### 5. Complete the task
308
+
309
+ When the review comes back clean — or every open finding is parked with a
310
+ ruling at the cap — append the completion line to the ledger in the same
311
+ message as your other bookkeeping:
312
+
313
+ - `Task <N>: complete (commits <base7>..<head7>, review clean)`
314
+ - `Task <N>: complete (commits <base7>..<head7>, <K> parked)` after a
315
+ tripped breaker
316
+
317
+ Then mark the todo complete and move on. Never move to the next task while
318
+ the review has open Critical/Important issues that are neither fixed nor
319
+ parked-with-ruling at the cap.
320
+
321
+ ## Final Review
322
+
323
+ When every task is complete, read
324
+ [references/final-review.md](references/final-review.md) and follow it. It
325
+ covers the whole-branch review, its single fix wave, and how you finish.
326
+
327
+ ## Common Rationalizations
328
+
329
+ | Excuse | Reality |
330
+ |--------|---------|
331
+ | "Close enough on spec compliance" | Reviewer found spec gaps = not done. Fix or hit the cap and adjudicate — those are the only exits. |
332
+ | "I'll fix it myself, dispatching is overhead" | Controller fixes pollute your context and skip review. Resume the implementer. |
333
+ | "One more round will converge" | Past the cap, rounds don't converge — the failure is structural. Adjudicate and route. |
334
+ | "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. |
335
+ | "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. |
336
+ | "The fix was small, skip the re-review" | Unreviewed fixes are how regressions land. Every round ends with a scoped re-review. |
337
+ | "Reviews slow the loop down" | The loop without reviews is just unverified churn. Reviews are the loop's brakes and steering. |
338
+ | "Ledger bookkeeping is overhead" | The ledger is what survives compaction. Controllers without one have re-dispatched entire completed task sequences. |
339
+ | "The implementer spawned its own reviewer — free extra assurance" | It's a duplicate seat reviewing the same diff; the task review is the gate. A worker-spawned reviewer is a defect to flag, not rigor. |
@@ -0,0 +1,154 @@
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
+ ## You Do Not Dispatch Subagents
51
+
52
+ Do all of this task's work yourself. Never spawn a subagent to
53
+ implement part of the task, and above all never spawn a reviewer to
54
+ check your work. Self-review (below) means reading your own diff.
55
+ Review is the controller's job: after you report, it dispatches a
56
+ fresh reviewer against your diff. A reviewer you spawn duplicates
57
+ that review at full cost, and its approval counts for nothing in
58
+ the process. If you catch yourself thinking "an independent review
59
+ would strengthen my report" — that review is already scheduled.
60
+ Report instead.
61
+
62
+ ## Code Organization
63
+
64
+ You reason best about code you can hold in context at once, and your edits are more
65
+ reliable when files are focused. Keep this in mind:
66
+ - Follow the file structure defined in the plan
67
+ - Each file should have one clear responsibility with a well-defined interface
68
+ - If a file you're creating is growing beyond the plan's intent, stop and report
69
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
70
+ - If an existing file you're modifying is already large or tangled, work carefully
71
+ and note it as a concern in your report
72
+ - In existing codebases, follow established patterns. Improve code you're touching
73
+ the way a good developer would, but don't restructure things outside your task.
74
+
75
+ ## When You're in Over Your Head
76
+
77
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
78
+ no work. You will not be penalized for escalating.
79
+
80
+ **STOP and escalate when:**
81
+ - The task requires architectural decisions with multiple valid approaches
82
+ - You need to understand code beyond what was provided and can't find clarity
83
+ - You feel uncertain about whether your approach is correct
84
+ - The task involves restructuring existing code in ways the plan didn't anticipate
85
+ - You've been reading file after file trying to understand the system without progress
86
+
87
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
88
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
89
+ The controller can provide more context, re-dispatch with a more capable model,
90
+ or break the task into smaller pieces.
91
+
92
+ ## Before Reporting Back: Self-Review
93
+
94
+ Review your work with fresh eyes. Ask yourself:
95
+
96
+ **Completeness:**
97
+ - Did I fully implement everything in the spec?
98
+ - Did I miss any requirements?
99
+ - Are there edge cases I didn't handle?
100
+
101
+ **Quality:**
102
+ - Is this my best work?
103
+ - Are names clear and accurate (match what things do, not how they work)?
104
+ - Is the code clean and maintainable?
105
+
106
+ **Discipline:**
107
+ - Did I avoid overbuilding (YAGNI)?
108
+ - Did I only build what was requested?
109
+ - Did I follow existing patterns in the codebase?
110
+
111
+ **Testing:**
112
+ - Do tests actually verify behavior (not just mock behavior)?
113
+ - Did I follow TDD if required?
114
+ - Are tests comprehensive?
115
+ - Is the test output pristine (no stray warnings or noise)?
116
+
117
+ If you find issues during self-review, fix them now before reporting.
118
+
119
+ ## After Review Findings
120
+
121
+ If the task review finds issues, you will be resumed with the findings.
122
+ Fix them, re-run the tests that cover the amended code, and append a fix
123
+ report to your report file: what you changed, the covering tests you
124
+ ran, the command, and the output. Reviewers will not re-run tests for
125
+ you — your report is the test evidence. Then reply with the same short
126
+ status contract as your first report.
127
+
128
+ ## Report Format
129
+
130
+ Write your full report to [REPORT_FILE]:
131
+ - What you implemented (or what you attempted, if blocked)
132
+ - What you tested and test results
133
+ - **TDD Evidence** (if TDD was required for this task):
134
+ - RED: command run, relevant failing output before implementation, and why the failure was expected
135
+ - GREEN: command run and relevant passing output after implementation
136
+ - Files changed
137
+ - Self-review findings (if any)
138
+ - Any issues or concerns
139
+
140
+ Then report back with ONLY (under 15 lines — the detail lives in the
141
+ report file):
142
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
143
+ - Commits created (short SHA + subject)
144
+ - One-line test summary (e.g. "14/14 passing, output pristine")
145
+ - Your concerns, if any
146
+ - The report file path
147
+
148
+ If BLOCKED or NEEDS_CONTEXT, put the specifics in the final message
149
+ itself — the controller acts on it directly.
150
+
151
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
152
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
153
+ information that wasn't provided. Never silently produce work you're unsure about.
154
+ ```
@@ -0,0 +1,116 @@
1
+ # Scoped Re-Review Prompt Template
2
+
3
+ Use this template when dispatching a re-review after a fix round. The
4
+ re-reviewer verifies the findings were addressed and checks the fix diff for
5
+ new breakage. It is not a fresh review — the full review already happened.
6
+
7
+ **Purpose:** Verify each finding from the previous review was addressed, and
8
+ that the fix itself broke nothing.
9
+
10
+ ```
11
+ Subagent (general-purpose):
12
+ description: "Re-review Task N fix round R"
13
+ model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
14
+ model silently inherits the session's most expensive one]
15
+ prompt: |
16
+ You are re-reviewing one task's fix round. A previous review produced
17
+ findings; an implementer has attempted to fix them. Your job is to
18
+ verdict each finding and inspect the fix diff — nothing else.
19
+
20
+ ## The Task
21
+
22
+ Read the task brief: [BRIEF_FILE]
23
+
24
+ ## The Findings Under Verification
25
+
26
+ [FINDINGS]
27
+
28
+ ## The Fix
29
+
30
+ Read the implementer's report (fix reports are appended at the end):
31
+ [REPORT_FILE]
32
+
33
+ **Fix base:** [FIX_BASE_SHA] (the head the previous review saw)
34
+ **Head:** [HEAD_SHA]
35
+ **Diff file:** [DIFF_FILE]
36
+
37
+ Read the diff file once — it contains the fix commits, a stat summary,
38
+ and the fix diff with surrounding context. Do not re-run git commands.
39
+ If the diff file is missing, fetch the diff yourself:
40
+ `git diff --stat [FIX_BASE_SHA]..[HEAD_SHA]` and
41
+ `git diff [FIX_BASE_SHA]..[HEAD_SHA]`.
42
+
43
+ Your review is read-only on this checkout. Do not mutate the working
44
+ tree, the index, HEAD, or branch state in any way.
45
+
46
+ ## You Do Not Dispatch Subagents
47
+
48
+ Do all of this review yourself. Never spawn a subagent to review part
49
+ of the diff, and never spawn another reviewer for a second opinion.
50
+ This process already provides every review seat the work gets; a
51
+ reviewer you spawn duplicates one of them at full cost, and its
52
+ verdict counts for nothing. If the diff feels too large for one
53
+ pass, review it in passes yourself and say so in your report.
54
+
55
+ ## Scope
56
+
57
+ Your scope is the findings list and the fix diff. Verdict every finding.
58
+ Inspect the fix diff for new problems the fix itself introduced. Do NOT
59
+ re-review code the fix did not touch: if you notice an issue entirely
60
+ outside the fix diff, report it under Out-of-Scope Observations — it
61
+ does not block this task and does not extend the loop. A broad
62
+ whole-branch review happens after all tasks are complete.
63
+
64
+ ## Tests
65
+
66
+ The implementer re-ran the tests covering the amended code and appended
67
+ the results to the report file. Treat the report as unverified claims:
68
+ confirm the fix report names the covering tests and shows their output,
69
+ and verify the claims against the diff. Do not re-run the suite to
70
+ confirm their report. Run a test only when reading the code raises a
71
+ specific doubt that no existing run answers — and then a focused test,
72
+ never a package-wide suite.
73
+
74
+ ## Output Format
75
+
76
+ Your final message is the report itself: begin directly with the first
77
+ finding's verdict. Every line is a verdict, a finding with file:line,
78
+ or a check you ran — no preamble, no process narration.
79
+
80
+ ### Finding Verdicts
81
+
82
+ For each finding in The Findings Under Verification, in order:
83
+ - **[finding one-liner]** — ADDRESSED | NOT ADDRESSED, with file:line
84
+ evidence. "Attempted" is not addressed: the specific defect must no
85
+ longer exist.
86
+
87
+ ### New Breakage in the Fix Diff
88
+
89
+ Anything the fix itself broke or introduced, with severity
90
+ (Critical/Important/Minor) and file:line. "None" if clean.
91
+
92
+ ### Out-of-Scope Observations
93
+
94
+ Issues you noticed entirely outside the fix diff. Non-blocking; the
95
+ controller ledgers these for the final review. "None" if none.
96
+
97
+ ### Verdict
98
+
99
+ **Fix round:** [All findings addressed, no new Critical/Important
100
+ breakage | Findings remain open] — list the open ones.
101
+ ```
102
+
103
+ **Placeholders:**
104
+ - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection; scoped
105
+ re-reviews of small fix diffs take a cheap-to-mid tier
106
+ - `[BRIEF_FILE]` — the task brief file (same file the implementer worked from)
107
+ - `[FINDINGS]` — the Critical/Important findings and spec gaps from the
108
+ previous review, copied verbatim, one per bullet
109
+ - `[REPORT_FILE]` — the implementer's report file (fix reports appended)
110
+ - `[FIX_BASE_SHA]` — the head the previous review saw
111
+ - `[HEAD_SHA]` — current commit
112
+ - `[DIFF_FILE]` — the path `bash scripts/review-package PLAN_FILE FIX_BASE HEAD` printed
113
+ (run by its absolute path, from the working tree you're executing in)
114
+
115
+ **Re-reviewer returns:** per-finding verdicts (ADDRESSED / NOT ADDRESSED),
116
+ new breakage in the fix diff, out-of-scope observations, and a round verdict.
@@ -0,0 +1,11 @@
1
+ # Batching Small Same-Shape Work
2
+
3
+ Part of superpowers:subagent-driven-development.
4
+
5
+ **Batch small same-shape work.** When the plan lists several tasks that are
6
+ each a small, independent edit of the same kind — the same one-line fix,
7
+ constant change, or field addition repeated across files — do not dispatch
8
+ one subagent per task. Compose ONE dispatch brief listing every file and
9
+ its change, send the whole batch to a single subagent, and review its diff
10
+ as one unit. Reserve one-dispatch-per-task for work that needs its own
11
+ judgment, its own tests, or its own review surface.
@@ -0,0 +1,10 @@
1
+ # "Cannot Verify From Diff" Items
2
+
3
+ Part of superpowers:subagent-driven-development.
4
+
5
+ The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
6
+ that live in unchanged code or span tasks. These do not block the rest of the
7
+ review, but you must resolve each one yourself before marking the task
8
+ complete: you hold the plan and cross-task context the reviewer
9
+ lacks. If you confirm an item is a real gap, treat it as a failed spec
10
+ review — it enters the fix loop with the other findings.