@loneexile/omp-superpowers 7.0.0-omp.2 → 7.0.0-omp.4

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.
@@ -5,11 +5,11 @@ description: Use when executing implementation plans with independent tasks in t
5
5
 
6
6
  # Subagent-Driven Development
7
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.
8
+ Execute a plan by dispatching a fresh implementer subagent per task — independent tasks in parallel waves, each in its own worktree — with a task review (spec compliance + code quality) for each task on the review list, and one broad whole-branch review at the end that also does the task review's work for every other task.
9
9
 
10
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
11
 
12
- **Core principle:** Fresh subagent per task + task review (spec + quality) + broad final review = high quality, fast iteration
12
+ **Core principle:** Fresh subagent per task + parallel waves for independent tasks + a task review where risk earns it + one broad final review = high quality, fast iteration
13
13
 
14
14
  **Narration:** between tool calls, narrate at most one short line — the
15
15
  ledger and the tool results carry the record.
@@ -28,7 +28,10 @@ Four things stop you, and only these: an irreversible or destructive
28
28
  operation; a security-sensitive action; a side effect outside this worktree
29
29
  that norms say you ask about first (a merge, a push to a shared branch, a
30
30
  publish); and a plan so broken that every path forward is a guess. For those,
31
- stop and ask.
31
+ stop and ask. This skill's own wave merges into the plan branch, and the task
32
+ worktrees it creates and removes, are not among them. It adds two stops of
33
+ its own: a wave task that still will not merge after its rounds (`merge
34
+ stuck`), and a wave suite still red after its one fix.
32
35
 
33
36
  **On omp in vibe mode** (your tools include `vibe_spawn` but not `task`)
34
37
  you are the director, and this loop cannot run in your session: you have
@@ -54,24 +57,25 @@ limits are in "Vibe mode" in
54
57
  digraph when_to_use {
55
58
  "Have implementation plan?" [shape=diamond];
56
59
  "Tasks mostly independent?" [shape=diamond];
57
- "Partner chose inline, or no subagent tool?" [shape=diamond];
60
+ "Inline approved at the handoff, or no subagent tool?" [shape=diamond];
58
61
  "subagent-driven-development" [shape=box];
59
62
  "executing-plans" [shape=box];
60
63
  "Manual execution or brainstorm first" [shape=box];
61
64
 
62
65
  "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
63
66
  "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
64
- "Tasks mostly independent?" -> "Partner chose inline, or no subagent tool?" [label="yes"];
67
+ "Tasks mostly independent?" -> "Inline approved at the handoff, or no subagent tool?" [label="yes"];
65
68
  "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
66
- "Partner chose inline, or no subagent tool?" -> "executing-plans" [label="yes"];
67
- "Partner chose inline, or no subagent tool?" -> "subagent-driven-development" [label="no"];
69
+ "Inline approved at the handoff, or no subagent tool?" -> "executing-plans" [label="yes"];
70
+ "Inline approved at the handoff, or no subagent tool?" -> "subagent-driven-development" [label="no"];
68
71
  }
69
72
  ```
70
73
 
71
74
  **vs. Executing Plans (inline):**
72
75
  - Fresh subagent per task (no context pollution) instead of one context doing every task
73
- - Review after each task (spec compliance + code quality) instead of only at the end
74
- - Costs a fresh context per task and per review; inline costs one context plus one final reviewer
76
+ - Independent tasks run in parallel; inline runs every task in turn
77
+ - A task review (spec compliance + code quality) for each high-risk task, plus the final review; inline has only the final review
78
+ - Costs a fresh context per task and per task review; inline costs one context plus one final reviewer
75
79
  - Both run in this session, share the same plan workspace and ledger, and never pause between tasks
76
80
 
77
81
  ## The Process
@@ -81,11 +85,14 @@ digraph process {
81
85
  rankdir=TB;
82
86
 
83
87
  subgraph cluster_per_task {
84
- label="Per Task";
88
+ label="Per Task (every task of a wave at once)";
85
89
  "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
86
90
  "Implementer asks questions?" [shape=diamond];
87
91
  "Answer questions, provide context" [shape=box];
88
92
  "Implementer implements, tests, commits, self-reviews" [shape=box];
93
+ "On the review list?" [shape=diamond];
94
+ "Run the brief's covering tests yourself" [shape=box];
95
+ "Resume implementer with the failure" [shape=box];
89
96
  "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" [shape=box];
90
97
  "Spec ✅ and quality approved?" [shape=diamond];
91
98
  "Finding conflicts with plan text?" [shape=diamond];
@@ -98,42 +105,49 @@ digraph process {
98
105
  "Any load-bearing finding?" [shape=diamond];
99
106
  "Rule and continue; stop only if every path forward is a guess" [shape=box];
100
107
  "Park findings in ledger with rulings" [shape=box];
101
- "Append completion to ledger, mark todo complete" [shape=box];
108
+ "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete" [shape=box];
102
109
  }
103
110
 
104
- "Setup: worktree, ledger check, read plan, pre-flight review" [shape=box];
105
- "More tasks remain?" [shape=diamond];
106
- "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines; its agent file governs the output)" [shape=box];
111
+ "Setup: worktree, ledger check, read plan, pre-flight scan: review list + waves" [shape=box];
112
+ "Start the next wave: a worktree per task when it has 2+" [shape=box];
113
+ "More waves remain?" [shape=diamond];
114
+ "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines + the tasks left to it; its agent file governs the output)" [shape=box];
107
115
  "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals" [shape=box];
108
116
  "Final review clean: delete this plan's workspace" [shape=box];
109
117
  "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
110
118
 
111
- "Setup: worktree, ledger check, read plan, pre-flight review" -> "Dispatch implementer subagent (./implementer-prompt.md)";
119
+ "Setup: worktree, ledger check, read plan, pre-flight scan: review list + waves" -> "Start the next wave: a worktree per task when it has 2+";
120
+ "Start the next wave: a worktree per task when it has 2+" -> "Dispatch implementer subagent (./implementer-prompt.md)";
112
121
  "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer asks questions?";
113
122
  "Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
114
123
  "Answer questions, provide context" -> "Implementer implements, tests, commits, self-reviews";
115
124
  "Implementer asks questions?" -> "Implementer implements, tests, commits, self-reviews" [label="no"];
116
- "Implementer implements, tests, commits, self-reviews" -> "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)";
125
+ "Implementer implements, tests, commits, self-reviews" -> "On the review list?";
126
+ "On the review list?" -> "Run the brief's covering tests yourself" [label="no - review at final"];
127
+ "Run the brief's covering tests yourself" -> "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete" [label="pass"];
128
+ "Run the brief's covering tests yourself" -> "Resume implementer with the failure" [label="fail"];
129
+ "Resume implementer with the failure" -> "Run the brief's covering tests yourself";
130
+ "On the review list?" -> "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" [label="yes"];
117
131
  "Generate review package, dispatch task reviewer (./task-reviewer-prompt.md)" -> "Spec ✅ and quality approved?";
118
- "Spec ✅ and quality approved?" -> "Append completion to ledger, mark todo complete" [label="yes"];
132
+ "Spec ✅ and quality approved?" -> "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete" [label="yes"];
119
133
  "Spec ✅ and quality approved?" -> "Finding conflicts with plan text?" [label="no"];
120
134
  "Finding conflicts with plan text?" -> "Rule on the conflict, ledger the ruling" [label="yes"];
121
135
  "Rule on the conflict, ledger the ruling" -> "Fix round R of 3: R≤2 resume implementer; R=3 fresh sdd-escalation-implementer";
122
136
  "Finding conflicts with plan text?" -> "Fix round R of 3: R≤2 resume implementer; R=3 fresh sdd-escalation-implementer" [label="no"];
123
137
  "Fix round R of 3: R≤2 resume implementer; R=3 fresh sdd-escalation-implementer" -> "Dispatch scoped re-review (./re-review-prompt.md)";
124
138
  "Dispatch scoped re-review (./re-review-prompt.md)" -> "All findings addressed?";
125
- "All findings addressed?" -> "Append completion to ledger, mark todo complete" [label="yes"];
139
+ "All findings addressed?" -> "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete" [label="yes"];
126
140
  "All findings addressed?" -> "R = 3?" [label="no"];
127
141
  "R = 3?" -> "Fix round R of 3: R≤2 resume implementer; R=3 fresh sdd-escalation-implementer" [label="no - next round"];
128
142
  "R = 3?" -> "Adjudicate each open finding" [label="yes - breaker trips"];
129
143
  "Adjudicate each open finding" -> "Any load-bearing finding?";
130
144
  "Any load-bearing finding?" -> "Rule and continue; stop only if every path forward is a guess" [label="yes"];
131
145
  "Any load-bearing finding?" -> "Park findings in ledger with rulings" [label="no"];
132
- "Park findings in ledger with rulings" -> "Append completion to ledger, mark todo complete";
133
- "Append completion to ledger, mark todo complete" -> "More tasks remain?";
134
- "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
135
- "More tasks remain?" -> "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines; its agent file governs the output)" [label="no"];
136
- "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines; its agent file governs the output)" -> "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals";
146
+ "Park findings in ledger with rulings" -> "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete";
147
+ "Merge the task branch (wave of 2+), append completion to ledger, mark todo complete" -> "More waves remain?" [label="after the wave's last task"];
148
+ "More waves remain?" -> "Start the next wave: a worktree per task when it has 2+" [label="yes"];
149
+ "More waves remain?" -> "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines + the tasks left to it; its agent file governs the output)" [label="no"];
150
+ "Dispatch final reviewer: sdd-final-reviewer (package + ledger lines + the tasks left to it; its agent file governs the output)" -> "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals";
137
151
  "Final findings? ONE fix dispatch, one scoped re-review, adjudicate residuals" -> "Final review clean: delete this plan's workspace";
138
152
  "Final review clean: delete this plan's workspace" -> "Use superpowers:finishing-a-development-branch";
139
153
  }
@@ -141,12 +155,29 @@ digraph process {
141
155
 
142
156
  ## Setup
143
157
 
144
- Ensure the work happens in an isolated workspace: use
145
- superpowers:using-git-worktrees to create one or verify the existing one.
146
- Never start implementation on a main/master branch without your human
147
- partner's explicit consent.
148
-
149
- **On omp, the session must be in the worktree before you dispatch.** A
158
+ Ensure the work happens in an isolated workspace. If the plan's approval
159
+ named a new branch in this checkout (writing-plans' default), that approval
160
+ was your human partner's answer to superpowers:using-git-worktrees' consent
161
+ question: work in place, with no worktree and no `/move`.
162
+
163
+ - **A ledger for this plan exists** (below): `git switch` to the branch its
164
+ `Setup:` line names, and resume from the ledger. Run nothing else here.
165
+ - **First run:** run `git status --porcelain`. If it lists a change to a
166
+ tracked file, or anything staged, ask your human partner to commit or
167
+ stash it first: a run in place commits from this index and tests this
168
+ working tree, so their uncommitted work would land in task commits and in
169
+ every test result. Untracked files may stay; note them, and they stay out
170
+ of every commit. If a branch with the approved name already exists, ask,
171
+ or name another. Then `git switch -c <branch>`, run
172
+ using-git-worktrees' Step 2 (project setup) and Step 3 (baseline tests)
173
+ here, and, once the ledger exists, ledger `Setup: branch <branch> in this
174
+ checkout; untracked before start: <paths | none>`.
175
+
176
+ Otherwise use superpowers:using-git-worktrees to create a worktree or
177
+ verify the existing one. Never start implementation on a main/master branch
178
+ without your human partner's explicit consent.
179
+
180
+ **On omp, a session worktree needs `/move` before you dispatch.** A
150
181
  subagent starts in the session's cwd (the `task` tool has no `cwd`
151
182
  argument), so after `omp worktree add` every SDD subagent still works in the
152
183
  ORIGINAL checkout until your human partner runs `/move <path>`. Get `/move`
@@ -181,13 +212,43 @@ a ledger file, not only in todos.
181
212
  working directory at the repo root — the scripts call `git rev-parse`.
182
213
  The invocation lines in this skill stay as upstream wrote them.
183
214
  - Check for this plan's ledger at `<workspace>/progress.md`. If its first
184
- line names your plan file, tasks with a `Task <N>: complete` line are DONE
185
- — do not re-dispatch them; resume at the first task without one. A task
186
- whose last line is `dispatched` or `re-dispatched` is mid-implementation:
187
- check `git log` from its BASE and read `agent://<id>` before you dispatch
188
- anything. A task
189
- whose last line is a fix round is mid-loop: resume the loop at the next
190
- round. A ledger whose first line names a different plan file — or a stray
215
+ line names your plan file, first find wave tasks that merged before the
216
+ ledger caught up: for every wave task whose branch still exists and that
217
+ has no `merged` line, whatever its last line, the merge happened when the
218
+ branch has commits past its BASE (`git rev-list --count <BASE>..<branch>`
219
+ is 1 or more) AND its tip is an ancestor of the plan branch (`git
220
+ merge-base --is-ancestor <branch> HEAD`); ledger `merged` for it. A
221
+ branch with no commits past BASE also passes the ancestor test; it is an
222
+ unstarted or lost task, never a merged one. Then take each task by its
223
+ last ledger line:
224
+ - `complete`: DONE — do not re-dispatch it; resume at the first task
225
+ without one.
226
+ - `merged`: clean up its worktree and branch (Complete the task) and
227
+ write its `complete` line.
228
+ - `dispatched` or `re-dispatched`: mid-implementation. Check `git log`
229
+ from its BASE (on its task branch, for a wave task whose line names a
230
+ worktree) and read `agent://<id>` before you dispatch anything.
231
+ - `fix round` or `rebased`: read `agent://<id>` first, and wait for a
232
+ round still running. A `rebased` round that reported goes back to its
233
+ merge; a `fix round` line with findings open goes to the next round,
234
+ and one with none open completes the task. The two kinds of line
235
+ together count toward the task's three rounds.
236
+ - `review per-task — <class or reason>`: with no `dispatched` line before
237
+ it, the task has not started; after one, the task reported and awaits
238
+ that review.
239
+ - `merge stuck`: the run is stopped; wait for your human partner.
240
+ - A worktree that exists for a task with no `dispatched` line is reused,
241
+ not added again, and gets the install step and its check again
242
+ (Dispatch the implementer).
243
+
244
+ Then check the plan checkout. A merge in progress (`git rev-parse -q
245
+ --verify MERGE_HEAD` prints a commit) was interrupted: run `git merge
246
+ --abort` and redo that task's merge (Complete the task). A wave of two or
247
+ more whose tasks are all complete still needs its suite run, or its fix
248
+ and rerun, before the next wave or the final review unless its last
249
+ `Wave <K>:` line is `suite pass`.
250
+
251
+ A ledger whose first line names a different plan file — or a stray
191
252
  ledger at the old flat path `.superpowers/sdd/progress.md` — is another
192
253
  plan's progress: leave it in place and start your own, fresh.
193
254
  - Create the ledger with its identity as the first line:
@@ -222,9 +283,35 @@ Write the table to the ledger. Rule on everything you find before execution
222
283
  begins — each finding against the plan text that mandates it — and record
223
284
  each ruling in the ledger. If the scan is clean, proceed without comment.
224
285
  Rule on each conflict it surfaces — the spec is the binding authority, the
225
- plan is its argument — record the ruling beside its row, and dispatch
226
- Task 1. The review loop remains the net for conflicts that only emerge from
227
- implementation.
286
+ plan is its argument — and record the ruling beside its row. Clean or not,
287
+ the same table then gives you the two ledger blocks below; write both before
288
+ the first dispatch. The review loop remains the net for conflicts that only
289
+ emerge from implementation.
290
+
291
+ **The review list.** A task gets its own task review when the plan marks it
292
+ `**Review:** per-task`, or when you rule it high-risk: security or
293
+ authentication, concurrency, a data migration or persisted format, money, a
294
+ destructive operation, or an interface two or more later tasks consume. A
295
+ batch (below) counts as one task. Ledger one line per task, `Task <N>:
296
+ review per-task — <class>` or `Task <N>: review at final`. The final
297
+ whole-branch review does the task review's work for every `review at final`
298
+ task. A task joins the list mid-run, ledgered as `Task <N>: review per-task
299
+ — <reason>`, when its report is DONE_WITH_CONCERNS about correctness or
300
+ scope, it went BLOCKED, or its implementer needed 100+ turns.
301
+
302
+ **The waves.** Tasks with no row between them in the scan table (no shared
303
+ file, no shared interface), whose `Consumes` all come from earlier waves,
304
+ form one wave: take them in plan order, at most three to a wave. A task that
305
+ consumes another's interface waits for the wave that produces it. Files
306
+ every task tends to touch (a lockfile, a manifest, a CHANGELOG, an index or
307
+ barrel file) count as shared, and so does anything the tests hold at run
308
+ time (a fixed port, a database, a cache directory). Ledger
309
+ `Wave <K>: tasks <N>, <N>, <N>` for each wave, then start Wave 1. A plan that
310
+ is one long chain gets one task per wave and runs in sequence, and so does
311
+ every plan whose checkout has uncommitted changes to tracked files
312
+ (`git status --porcelain --untracked-files=no` not empty): a merge needs
313
+ them committed or stashed. Untracked files keep waves on, but git refuses
314
+ to start a merge that would overwrite one (Complete the task).
228
315
 
229
316
  ## Agent Selection
230
317
 
@@ -346,13 +433,12 @@ needs 100+ turns, or a re-review that wanders, is the signal to rule that
346
433
  task onto the escalation seat. Re-reviews are verdict-only work over a small
347
434
  diff — `low` reasoning is correct for them, not a compromise.
348
435
 
349
- **Scale the task review to the diff's risk.** The reviewer seat is fixed, but
350
- a small mechanical diff does not need the deepest reasoning and a subtle one
351
- (concurrency, security, a data migration) does. When `task.enableEffort` is
352
- on (it is off by default — `omp config get task.enableEffort`), dispatch the
353
- reviewer for such a diff with `effort: "hi"`: that selects the resolved
354
- model's top thinking level, capped by `task.maxEffort`. When it is off, ledger
355
- the risk — `Task <N>: high-risk diff — <class>` — and name that class in the
436
+ **Scale the task review to the diff's risk.** Every task on the review list
437
+ is there for its risk class or a trouble signal (Setup), so its reviewer needs the deepest
438
+ reasoning the seat has. When `task.enableEffort` is on (it is off by
439
+ default — `omp config get task.enableEffort`), dispatch that reviewer with
440
+ `effort: "hi"`: that selects the resolved model's top thinking level,
441
+ capped by `task.maxEffort`. Either way, name each listed task's class in the
356
442
  final review dispatch.
357
443
 
358
444
  **Escalation (fix round 3):** the implementer that got stuck cannot see its
@@ -406,8 +492,9 @@ judge, and **Mergeable:** come last.
406
492
 
407
493
  ### 1. Dispatch the implementer
408
494
 
409
- Record BASE (`git rev-parse HEAD`) before dispatching — the review package
410
- and fix-round diffs need it.
495
+ Record BASE (`git rev-parse HEAD` in the plan checkout) before dispatching —
496
+ the review package and fix-round diffs need it. Every task in a wave shares
497
+ the wave's BASE.
411
498
 
412
499
  - **Task brief:** before dispatching an implementer, run this skill's
413
500
  `bash scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
@@ -440,7 +527,8 @@ and fix-round diffs need it.
440
527
  a pointer to that ledger entry in the dispatch.
441
528
  - Record the implementer's agent identity from the dispatch result —
442
529
  fix-loop rounds 1-2 resume this agent.
443
- - Never dispatch multiple implementation subagents in parallel (conflicts).
530
+ - Dispatch a wave's implementers together: ONE `task` call with one item per
531
+ task. A task runs only in the wave the ledger gave it.
444
532
  - **On omp, the agent id is the handle and resume is a message.** The
445
533
  `<task-result id="X" …>` envelope (inline, or delivered as a notice)
446
534
  reports the agent id and says the agent is now idle. Use that id exactly
@@ -448,7 +536,8 @@ and fix-round diffs need it.
448
536
  that was already taken (`Name-2`), and calls a follow-up turn's job
449
537
  `<id>-2` — the job id is not the agent id. Ledger the dispatch the moment
450
538
  you have the id, together with BASE, so both survive compaction:
451
- `Task <N>: dispatched (BASE <base7>, implementer <id>)`. Fix rounds 1-2
539
+ `Task <N>: dispatched (BASE <base7>, implementer <id>[, worktree <absolute path>])`,
540
+ the worktree part for a wave task only. Fix rounds 1-2
452
541
  and the answer to a NEEDS_CONTEXT then go to that agent with
453
542
  `write agent://<id>`.
454
543
  - **The write has two success answers; only an error means "dispatch
@@ -461,14 +550,67 @@ and fix-round diffs need it.
461
550
  next result arrives as a notice either way. Only an error answer (`Failed:
462
551
  …`, or a write error) means dispatch a fresh `sdd-implementer`. That
463
552
  dispatch gets a new id, which omp may suffix (`Name-2`) because the old id is
464
- taken: ledger it — `Task <N>: re-dispatched (implementer <new id>)` — and use
553
+ taken: ledger it — `Task <N>: re-dispatched (implementer <new id>[, worktree <absolute path>])` — and use
465
554
  it from then on.
466
- - **One implementer at a time, no isolation.** On omp, SDD dispatches
467
- implementers one at a time, in plan order, in the shared checkout, and does
468
- not use `task.isolation.enabled`: under the default
469
- `task.isolation.merge: patch` an isolated run's work lands as an applied but
470
- uncommitted diff, so a review package has no commit range to cut, and an
471
- isolated agent cannot be resumed or messaged, which fix rounds 1-2 need.
555
+ - **A wave of two or more: one git worktree per task, not omp isolation.**
556
+ Implementers sharing one checkout overwrite each other, and
557
+ `task.isolation.enabled` does not fit SDD. Under the default
558
+ `task.isolation.merge: patch` an isolated run's work lands as an applied
559
+ but uncommitted diff, so a review package has no commit range to cut.
560
+ `merge: branch` keeps the commits, but omp cherry-picks them onto the plan
561
+ branch the moment the task ends, before any review, under new commit ids,
562
+ and deletes the task branch. And fix rounds 1-2 resume the implementer,
563
+ which an isolated agent cannot take. Measured on omp 18.11.0: a `write
564
+ agent://<id>` to an isolated agent answers `Delivered`, the agent commits
565
+ its fix in its own copy, and the fix never reaches the plan branch while
566
+ the session runs; after the session ended it sat on a leftover
567
+ `omp/task/<id>` branch that also repeats the already-merged commit.
568
+ Before dispatching the wave, from the plan checkout, add one
569
+ worktree per task at the plan branch's head:
570
+
571
+ ```bash
572
+ repo=$(basename "$(git rev-parse --show-toplevel)")
573
+ omp worktree add -b "sdd/<plan>/task-<N>" ~/.omp/wt/"$repo-<plan>-task-<N>"
574
+ ```
575
+
576
+ `<plan>` is the plan file's name without `.md`;
577
+ superpowers:using-git-worktrees says why `omp worktree add` and
578
+ `~/.omp/wt/`. Then, in each new worktree and before dispatching, run the
579
+ project's install step there (`npm ci`, `uv sync`, the plan's setup
580
+ command), even when the clone succeeded. A clone that fell back to a
581
+ plain checkout has no `node_modules` or other build output at all, and a
582
+ successful clone copies an in-project virtualenv (`.venv`) that keeps
583
+ absolute paths into the plan checkout — its scripts' interpreter, any
584
+ editable install — so tests run with it would run the plan checkout's
585
+ code. Remove a cloned in-project virtualenv before the install step
586
+ recreates it (`uv sync`, or `python3 -m venv .venv` and `.venv/bin/python
587
+ -m pip install -e .` — the venv's own pip, not the one on `PATH`). Then
588
+ check that the code resolves in the worktree, with `cwd` outside it (`/`)
589
+ so the current directory is not on the import path: for Python,
590
+ `<worktree>/.venv/bin/python -c 'import <package>;
591
+ print(<package>.__file__)'` must print a path under the worktree. Record
592
+ `git -C <worktree> status --porcelain` after the install: files the
593
+ install wrote are not the implementer's (DONE compares against this). A
594
+ wave of one runs in the plan checkout, with no extra worktree.
595
+
596
+ **Until it merges, a wave task lives in its worktree, not in yours.** The
597
+ `task` tool has no `cwd`, so every subagent starts in your checkout, which
598
+ does not have the task's commits yet. So every dispatch for the task —
599
+ implementer, re-dispatch, escalation, reviewer, re-reviewer — carries its
600
+ worktree's absolute path: the implementer template's `Work from:` line
601
+ and its wave line (in a wave of two or more, the implementer runs only
602
+ the covering tests before committing; you run the full suite after the
603
+ wave merges), and for a reviewer a `Checkout: <path>` line saying to
604
+ read the changed files and their call sites there. Every command you
605
+ run for the task (its tests, a proven-trivial fix and its commit) runs
606
+ with the `bash` tool's `cwd` set to that path, and its branch
607
+ `sdd/<plan>/task-<N>` stands
608
+ in for HEAD in every review-package command for it. The skill's scripts
609
+ (`task-brief`, `review-package`) still run from the plan checkout, never
610
+ from a task worktree: they write into the workspace of the checkout they
611
+ run in, and a task worktree's copy is deleted with it. If the session
612
+ never got `/move`d into the plan's worktree (Setup), run every git command
613
+ that touches the plan branch with `cwd` set to the plan checkout, too.
472
614
 
473
615
  Template: [implementer-prompt.md](implementer-prompt.md)
474
616
 
@@ -476,9 +618,19 @@ Template: [implementer-prompt.md](implementer-prompt.md)
476
618
 
477
619
  Implementer subagents report one of four statuses. Handle each appropriately:
478
620
 
479
- **DONE:** Generate the review package (`bash 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 `sdd-reviewer` with the printed path.
621
+ **DONE:** For a wave task, first check it worked where it should: its
622
+ worktree has commits past BASE (`git -C <worktree> rev-list --count
623
+ BASE..HEAD` is 1 or more), its worktree is clean (`git -C <worktree> status
624
+ --porcelain` lists nothing beyond what it listed after the install; other
625
+ untracked leftovers go back to the implementer), and
626
+ your own checkout gained no changes. A task that wrote into your checkout
627
+ goes back to its implementer with the paths. Then check the task's line in
628
+ the review list.
629
+
630
+ - **`review per-task`:** generate the review package (`bash 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; for a wave task, its branch `sdd/<plan>/task-<N>` stands in for HEAD), then dispatch `sdd-reviewer` with the printed path.
631
+ - **`review at final`:** run the covering test command from the brief yourself, once, in the task's checkout, with its output redirected to a file in the plan's workspace; read the tail. A brief that names no test (docs, configuration) gets the cheapest check that can fail instead (a build, a lint, a parse), or goes on the review list. That run is the only check this task gets before the final review, so never take the implementer's report in its place. A pass completes the task (step 5). A failure goes back to the implementer with the output file's path: rounds 1-2 resume it, round 3 is a fresh `sdd-escalation-implementer`, as in the fix loop, and each round ends when your rerun passes, with no re-review. A failure after round 3 is a plan the tests disagree with: stop and ask.
480
632
 
481
- **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.
633
+ **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, and put a `review at final` task on the review list (`Task <N>: review per-task — <concern>`). A wave task that changed a file outside its brief's Files list broke its wave's independence: merge it after its wave's other tasks, and run their covering tests too on the merged tree. If the concerns are observations (e.g., "this file is getting large"), note them and proceed.
482
634
 
483
635
  **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch. On omp, message the idle agent instead (`write agent://<id>`, the id from the ledger's `dispatched` line): it keeps its context and yields again. Only a write error means re-dispatch, with the context carried in the brief.
484
636
 
@@ -505,11 +657,13 @@ rush it into implementation.
505
657
 
506
658
  ### 3. Review the task
507
659
 
508
- Per-task reviews are task-scoped gates. The broad review happens once, at the
509
- final whole-branch review. Never skip the task review, and never accept a
510
- report missing either verdict — spec compliance AND task quality are both
511
- required. Implementer self-review never replaces the task review; both are
512
- needed.
660
+ Task reviews run for the tasks on the review list (Setup); every other task
661
+ gets its review from the final whole-branch review. Per-task reviews are
662
+ task-scoped gates; the broad review happens once, at the end. For a task on
663
+ the list, never skip the review, and never accept a report missing either
664
+ verdict — spec compliance AND task quality are both required. Implementer
665
+ self-review never replaces a review: for a listed task the task review is
666
+ it, for any other the final review is.
513
667
 
514
668
  - Hand the reviewer its diff as a file: run this skill's
515
669
  `bash scripts/review-package PLAN_FILE BASE HEAD` and pass the reviewer the file path
@@ -527,7 +681,8 @@ needed.
527
681
  dispatch a task reviewer without a diff file.
528
682
  - **Reviewer inputs:** the task reviewer gets three paths — the same brief
529
683
  file, the report file, and the review package — plus the global
530
- constraints that bind the task.
684
+ constraints that bind the task, and for a wave task a `Checkout:` line with
685
+ its worktree's absolute path (the re-reviewer gets the same line).
531
686
  - The global-constraints block you hand the reviewer is its attention
532
687
  lens. Copy the binding requirements verbatim from the plan's Global
533
688
  Constraints section or the spec: exact values, exact formats, and the
@@ -647,7 +802,9 @@ covering test files in the fix message — a one-line fix does not need the
647
802
  whole suite.
648
803
 
649
804
  **The re-review is scoped.** Run `bash scripts/review-package PLAN_FILE FIX_BASE HEAD`
650
- where FIX_BASE is the head the previous review saw, and dispatch
805
+ where FIX_BASE is the head the previous review saw, as a commit SHA (for a
806
+ wave task, its branch tip then: `git rev-parse sdd/<plan>/task-<N>`; never
807
+ the branch name, which moves with the fix), and dispatch
651
808
  `sdd-rereviewer` with [re-review-prompt.md](re-review-prompt.md): the
652
809
  findings list, the brief, the report file, and the printed diff path. It
653
810
  has no bash, edit, or file-write tool and a four-call working budget plus its
@@ -693,17 +850,90 @@ a silent discard is forbidden.
693
850
 
694
851
  ### 5. Complete the task
695
852
 
696
- When the review comes back clean — or every open finding is parked with a
697
- ruling at the cap — append the completion line to the ledger in the same
698
- message as your other bookkeeping:
853
+ A task is done when its review comes back clean, when every open finding is
854
+ parked with a ruling at the cap, or, for a `review at final` task, when your
855
+ own run of its covering tests passes.
856
+
857
+ **A wave task merges first, and its tests run before the merge commits.**
858
+ From the plan checkout, as soon as the task is done (wave tasks are
859
+ independent, so their order does not matter):
860
+
861
+ ```bash
862
+ git merge --no-ff --no-commit "sdd/<plan>/task-<N>"
863
+ # run the task's covering tests on the merged tree, output to a workspace file
864
+ git commit --no-edit
865
+ ```
866
+
867
+ If git refuses to start the merge (`untracked working tree files would be
868
+ overwritten`, or local changes to a file the merge touches), no merge is
869
+ in progress, so `git merge --abort` has nothing to abort, and the fault is
870
+ in your checkout, not the task: move the named untracked file out of the
871
+ way (it is yours if setup or a script made it; otherwise ask), or commit or
872
+ stash a tracked change of yours, then merge again. That costs the task no
873
+ round.
874
+
875
+ If the merge stops on a conflict, or the covering tests fail on the merged
876
+ tree, run `git merge --abort` and send the task back to its implementer
877
+ (`write agent://<id>`) with the plan branch's name and, for a failure, the
878
+ output file's path: rebase onto the plan branch, fix what the merge
879
+ exposed, re-run its covering tests, report again. Each such round counts
880
+ toward the task's three rounds, with the fix loop's seats: round 3 is a
881
+ fresh `sdd-escalation-implementer` whose dispatch names the plan branch,
882
+ the worktree, and the conflict or the failing output file, framed as
883
+ "rebase this task's branch onto the plan branch and make its covering
884
+ tests pass on the result". A task whose three rounds were already spent in
885
+ its review loop still gets one merge round, on that seat. Ledger each round
886
+ as `Task <N>: rebased (<conflict | failing test>)`. A task that still
887
+ conflicts or fails after its last round is never parked and never merged:
888
+ ledger `Task <N>: merge stuck (<conflict | failing test>)`, merge the wave's
889
+ other tasks, start no new wave, and stop and ask. A `review per-task` task
890
+ whose rebase changed code gets its task review again, not a scoped
891
+ re-review (there are no open findings to check, and the rebase may have
892
+ changed anything): `review-package PLAN_FILE "$(git merge-base
893
+ <plan-branch> sdd/<plan>/task-<N>)" sdd/<plan>/task-<N>` — a SHA, since the
894
+ plan branch moves when a sibling merges — then `sdd-reviewer`, at `effort:
895
+ "hi"` when `task.enableEffort` is on. A failure that belongs to a task
896
+ already merged, not to this one: abort this merge, get a fix on the plan
897
+ checkout (below), then merge this one.
898
+
899
+ Right after the merge commit, ledger `Task <N>: merged (<sha7>)`, then
900
+ remove the task's worktree and branch: `git worktree remove <path>`, then
901
+ `git branch -d "sdd/<plan>/task-<N>"`. If the removal refuses, read
902
+ `git -C <path> status --short`: use `--force` only when nothing it lists is
903
+ missing from the merge; otherwise ledger it and leave it for Finish.
904
+
905
+ After the last task of a wave of two or more merges, run the full suite once
906
+ in the plan checkout, output to a workspace file, and ledger `Wave <K>:
907
+ suite pass` or `Wave <K>: suite fail (<failing tests>)`. Implementers ran
908
+ only their covering tests, in worktrees without their siblings, so this is
909
+ the first full run on the combined tree. Any failure here gets a fix on the
910
+ plan checkout before the next wave or the final review — the last wave's
911
+ suite runs too.
912
+
913
+ **A fix on the plan checkout:** write a brief,
914
+ `<workspace>/wave-<K>-fix-brief.md`: the failing tests, the output file, the
915
+ test command to make pass, and the wave's merge commits; when one merged
916
+ task owns the failure, that task's brief and report paths. Dispatch a fresh
917
+ `sdd-implementer` with the implementer template, task `Wave <K> fix`,
918
+ `Work from:` the plan checkout, that brief, and
919
+ `<workspace>/wave-<K>-fix-report.md` as its report file, and ledger `Wave
920
+ <K>: fix dispatched (implementer <id>)`. Merge nothing else while it works.
921
+ When it reports, run the full suite yourself and ledger `Wave <K>: fix
922
+ (<failing tests>; commits <a7>..<b7>)`, then `Wave <K>: suite pass`, or
923
+ `Wave <K>: suite fail (after fix: <failing tests>)` and stop and ask.
924
+
925
+ Then append the completion line to the ledger in the same message as your
926
+ other bookkeeping:
699
927
 
700
928
  - `Task <N>: complete (commits <base7>..<head7>, review clean)`
701
929
  - `Task <N>: complete (commits <base7>..<head7>, <K> parked)` after a
702
930
  tripped breaker
931
+ - `Task <N>: complete (commits <base7>..<head7>, review at final — tests: <command>, pass)`
703
932
 
704
- Then mark the todo complete and move on. Never move to the next task while
705
- the review has open Critical/Important issues that are neither fixed nor
706
- parked-with-ruling at the cap.
933
+ Then mark the todo complete. Start the next wave only when every task of
934
+ this one is complete and merged; never start it while a task has open
935
+ Critical/Important issues that are neither fixed nor parked-with-ruling at
936
+ the cap.
707
937
 
708
938
  ## Final Review
709
939
 
@@ -713,13 +943,15 @@ branch started from, e.g. `git merge-base main HEAD`) and include the
713
943
  printed path in the final review dispatch, so the final reviewer reads
714
944
  one file instead of re-deriving the branch diff with git commands. Dispatch
715
945
  `sdd-final-reviewer` (the deepest seat, once per plan — see Agent
716
- Selection) with a `task` that says the plan ran subagent-driven — every
717
- task went through its task review, except the fixes you applied yourself on
718
- the proven-trivial route, which skipped the re-review — and names: the
719
- package path, the plan/spec paths, and the ledger's deferred-minor and
720
- parked-with-ruling lines verbatim, plus every `Task <N>: applied … proof:`
721
- line (the reviewer checks those fixes as if unreviewed) and any
722
- `high-risk diff` line (so the last review spends its depth there). Do not
946
+ Selection) with a `task` that says the plan ran subagent-driven and names:
947
+ the package path; the plan/spec paths; every `review per-task` task with its
948
+ class, which had its own task review (so the last review spends its depth
949
+ on the seams around them); every `review at final` task, which had none, so
950
+ the final reviewer does the task review's work on it first; the ledger's
951
+ deferred-minor and parked-with-ruling lines verbatim; every `rebased` and
952
+ `Wave <K>: fix` line (code no task review saw); and every `Task <N>:
953
+ applied … proof:` line, a fix you applied yourself on the proven-trivial
954
+ route without a re-review (the reviewer checks those as if unreviewed). Do not
723
955
  paste requesting-code-review's `code-reviewer.md` into the dispatch — that
724
956
  template asks a prose "Ready to merge?" and has no slot for the package or
725
957
  the ledger; the agent reads that file's review rubric itself. The agent
@@ -757,6 +989,11 @@ took on your human partner's behalf reach them — they read it and rework
757
989
  whatever you got wrong. A ruling that dies with the workspace was a decision
758
990
  made in secret.
759
991
 
992
+ Check that no wave left anything behind: `git worktree list` shows none of
993
+ this plan's task worktrees, and `git branch --list 'sdd/<plan>/*'` is empty.
994
+ Remove a leftover as in Complete the task, or name it in your final message
995
+ if it holds work the merge does not.
996
+
760
997
  When the final whole-branch review is clean and its fixes are merged,
761
998
  delete this plan's workspace (`rm -rf <workspace>`) — the git history is
762
999
  the record now. Sibling directories belong to other plans; leave them
@@ -774,7 +1011,9 @@ Use superpowers:finishing-a-development-branch.
774
1011
  | "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. |
775
1012
  | "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. |
776
1013
  | "The fix was small, skip the re-review" | Small is not the test — proven is. If you cannot run one command that proves the exact property (and ledger it), the round ends with a scoped re-review. |
777
- | "Reviews slow the loop down" | The loop without reviews is just unverified churn. Reviews are the loop's brakes and steering. |
1014
+ | "This auth change is one line — review it at final" | Risk class, not size, puts a task on the review list. One line of auth gets its own review. |
1015
+ | "The report says the tests pass, skip my run" | For a `review at final` task, your run is the only check before the merge. Run it. |
1016
+ | "These two tasks barely touch — same wave" | A shared file or a Consumes/Produces link means separate waves. A conflict costs a rebase round; a silent clash between them costs the final review. |
778
1017
  | "Ledger bookkeeping is overhead" | The ledger is what survives compaction. Controllers without one have re-dispatched entire completed task sequences. |
779
1018
  | "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. |
780
1019
 
@@ -783,16 +1022,18 @@ Use superpowers:finishing-a-development-branch.
783
1022
  ```
784
1023
  You: I'm using Subagent-Driven Development to execute this plan.
785
1024
 
786
- [Setup: worktree verified; on omp, session moved into it with /move]
1025
+ [Setup: the approval named a new branch feat/hooks in this checkout — git switch -c feat/hooks, project setup and baseline tests in place, no worktree, no /move]
787
1026
  [Read plan file once: docs/plans/feature-plan.md]
788
1027
  [Resolve workspace: bash scripts/sdd-workspace docs/plans/feature-plan.md — no ledger inside, fresh start]
789
1028
  [On omp: scripts dir resolved with realpath skill://subagent-driven-development/scripts and added to the ledger as "SDD scripts: <dir>"; each script runs as bash <dir>/<name>]
790
1029
  [Create todos for all tasks]
1030
+ [Pre-flight scan → ledger: Tasks 1, 3, 4: review at final · Task 2: review per-task — persisted data (repair rewrites stored records) · Wave 1: tasks 1, 3 · Wave 2: tasks 2, 4]
791
1031
 
792
- Task 1: Hook installation script
1032
+ Wave 1: Task 1 (hook installation script) and Task 3 (help text)
793
1033
 
794
- [Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
795
- [Ledger: Task 1: dispatched (BASE a1b2c3d, implementer Impl1)]
1034
+ [Two worktrees: omp worktree add -b sdd/feature-plan/task-1 …, and task-3; npm ci in each, and a check that the code resolves in the worktree]
1035
+ [Run task-brief for Tasks 1 and 3; ONE task call with two implementer items, each naming its worktree]
1036
+ [Ledger: Task 1: dispatched (BASE a1b2c3d, implementer Impl1, worktree /home/me/.omp/wt/app-feature-plan-task-1)]
796
1037
 
797
1038
  Implementer: "Before I begin - should the hook be installed at user or system level?"
798
1039
 
@@ -804,23 +1045,23 @@ Implementer: [Later]
804
1045
  - Self-review: Found I missed --force flag, added it
805
1046
  - Committed
806
1047
 
807
- [Run review-package PLAN_FILE BASE HEAD; dispatch sdd-reviewer with the printed path]
808
- sdd-reviewer: spec_compliance: compliant · task_quality: approved
809
- strengths: ["Good test coverage", "clean"] · findings: []
810
-
811
- [Ledger: Task 1: complete (commits a1b2c3d..d4e5f6a, review clean)]
1048
+ [Task 1 is review at final: run the brief's covering test in its worktree — npm test test/install.test.js: 5/5 passing]
1049
+ [git merge --no-ff --no-commit sdd/feature-plan/task-1; covering test on the merged tree passes; git commit --no-edit]
1050
+ [Ledger: Task 1: merged (9a8b7c6); worktree and branch removed]
1051
+ [Ledger: Task 1: complete (commits a1b2c3d..d4e5f6a, review at final — tests: npm test test/install.test.js, pass)]
1052
+ [Task 3 likewise; its merge was the wave's last, so the full suite runs once in the plan checkout — Ledger: Wave 1: suite pass]
812
1053
 
813
- Task 2: Recovery modes
1054
+ Wave 2: Task 2 (recovery modes, review per-task) and Task 4
814
1055
 
815
1056
  [Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
816
- [Ledger: Task 2: dispatched (BASE d4e5f6a, implementer Impl2)]
1057
+ [Ledger: Task 2: dispatched (BASE e5f6a7b, implementer Impl2, worktree /home/me/.omp/wt/app-feature-plan-task-2)]
817
1058
 
818
1059
  Implementer: [No questions]
819
1060
  - Added verify/repair modes
820
1061
  - 8/8 tests passing
821
1062
  - Committed
822
1063
 
823
- [Run review-package PLAN_FILE BASE HEAD; dispatch sdd-reviewer with the printed path]
1064
+ [Run review-package PLAN_FILE BASE sdd/feature-plan/task-2; dispatch sdd-reviewer with the printed path]
824
1065
  sdd-reviewer: spec_compliance: issues · task_quality: needs_fixes
825
1066
  spec_issues: ["Missing: progress reporting (spec says 'report every 100 items')"]
826
1067
  findings: [{severity: Important, location: src/recovery.js:7, body: "Magic number (100)"}]
@@ -829,19 +1070,20 @@ sdd-reviewer: spec_compliance: issues · task_quality: needs_fixes
829
1070
  Implementer: Added progress reporting, extracted PROGRESS_INTERVAL constant.
830
1071
  Re-ran test/recovery.test.js — 10/10 passing. Fix report appended.
831
1072
 
832
- [Run review-package PLAN_FILE FIX_BASE HEAD; dispatch sdd-rereviewer]
1073
+ [Run review-package PLAN_FILE FIX_BASE sdd/feature-plan/task-2; dispatch sdd-rereviewer]
833
1074
  sdd-rereviewer: round_verdict: all_addressed
834
1075
  finding_verdicts: [{Missing progress reporting: ADDRESSED, src/recovery.js:41},
835
1076
  {Magic number: ADDRESSED, src/recovery.js:7}]
836
1077
  new_breakage: [] · out_of_scope: []
837
1078
 
838
- [Ledger: Task 2: fix round 1/3 (2 addressed, 0 open; commits d4e5f6a..b7c8d9e)]
839
- [Ledger: Task 2: complete (commits d4e5f6a..b7c8d9e, review clean)]
1079
+ [Ledger: Task 2: fix round 1/3 (2 addressed, 0 open; commits e5f6a7b..b7c8d9e)]
1080
+ [Merge sdd/feature-plan/task-2 the same way; Ledger: Task 2: merged (c3d4e5f)]
1081
+ [Ledger: Task 2: complete (commits e5f6a7b..b7c8d9e, review clean)]
840
1082
 
841
1083
  ...
842
1084
 
843
- [After all tasks]
844
- [Run review-package PLAN_FILE MERGE_BASE HEAD; dispatch sdd-final-reviewer]
1085
+ [After the last wave]
1086
+ [Run review-package PLAN_FILE MERGE_BASE HEAD; dispatch sdd-final-reviewer naming Task 2's class, and Tasks 1, 3, 4 as review at final]
845
1087
  [Read the full result at agent://<id>]
846
1088
  sdd-final-reviewer: Ledger triage: deferred minors — none block merge. **Mergeable:** yes
847
1089