Skill Tracer
Skills › Superpowers › subagent-driven-development › fix-loop.md

fix-loop.md

77 lines · skills/subagent-driven-development/references/fix-loop.md at 2ce8aa1

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# The Fix Loop
2
3Part of superpowers:subagent-driven-development. The task review reported
4spec ❌, a Critical or Important finding, or a ⚠️ item you confirmed as a real
5gap.
6
7Before the loop starts, two routes leave it immediately:
8
9- Record Minor findings in the progress ledger as you go
10 (`Task <N>: minor (deferred): <one-liner>`), and point the final
11 whole-branch review at that list so it can triage which must be fixed
12 before merge. A roll-up nobody reads is a silent discard. Minor findings
13 never enter the loop.
14- A finding labeled plan-mandated — or any finding that conflicts with
15 what the plan's text requires — is yours to rule on: weigh the finding
16 against the plan text, decide with the spec as the binding authority, and
17 ledger the ruling before you act on it. Do not dismiss the finding because
18 the plan mandates it, and do not dispatch a fix that contradicts the plan
19 without a recorded ruling.
20Everything else enters the loop. A fix round is one fix dispatch plus one
21scoped re-review. Five rounds maximum per task:
23**Rounds 1-3 — resume the original implementer.** Send it the open findings
24verbatim. Its context is intact: it knows the task, the code, and its own
25choices. If your harness cannot send another message to a live subagent,
26dispatch a fresh implementer carrying the brief path, the report-file path,
27and the findings — the report file is the persistent memory either way.
29**Rounds 4-5 — dispatch a fresh implementer on a more capable model** (per
30SKILL.md's Model Selection), with the brief path, the report-file path, the open
31findings, and this framing: "A prior implementer attempted this task
32[N] times; you own it now. Read the report file for what was tried." A loop
33that survives three resumes usually means the implementer cannot see its
34own problem — fresh eyes and a capability bump in one move.
36**Every round, either way:** the implementer fixes, re-runs the tests
37covering the amended code, appends its fix report to the same report file,
38and returns the short contract. Before re-dispatching the reviewer, confirm
39the fix report contains the covering tests, the command run, and the
40output; dispatch the re-review once all three are present. Name the
41covering test files in the fix message — a one-line fix does not need the
42whole suite.
44**The re-review is scoped.** Run `bash scripts/review-package PLAN_FILE FIX_BASE HEAD`
45where FIX_BASE is the head the previous review saw, and dispatch
46[re-review-prompt.md](../re-review-prompt.md) with the findings list, the
47brief, the report file, and the printed diff path. The re-reviewer verdicts
48each finding ADDRESSED or NOT ADDRESSED and flags new breakage in the fix
49diff only. New Critical/Important breakage in the fix diff joins the open
50findings list. Out-of-scope observations go to the ledger as deferred
51minors — they never extend the loop.
53**After each round,** append to the ledger:
54`Task <N>: fix round <R>/5 (<X> addressed, <Y> open — <finding one-liners>; commits <a7>..<b7>)`
56Never fix findings yourself in the controller session — your context stays
57clean for coordination, and controller fixes skip review.
59**The breaker.** When round 5's re-review still leaves findings open, stop
60dispatching. Adjudicate each open finding yourself — you hold the plan and
61the cross-task context the reviewer lacks:
63- **The reviewer is wrong, or the point is contestable:** park it —
64 `Task <N>: parked — <finding> — Ruling: <why the code stands>`. The final
65 review sees both sides.
66- **Real, but nothing downstream builds on it:** park it the same way, with
67 a ruling that says it's real and deferred.
68- **Real and load-bearing** — a later task builds on it, or it reveals a
69 plan defect: rule on the smallest change that unblocks the dependent work,
70 ledger it as `Task <N>: Ruling: <finding> — <what you decided and why>`,
71 and carry it into the next task's dispatch. Parking a structural failure
72 silently lets every dependent task build on it. Stop only when the defect
73 leaves every path forward a guess.
75Adjudicate only at the cap. Adjudicating earlier to end a loop is
76pre-judging with a different name. Every adjudication is a ledger entry —
77a silent discard is forbidden.

The Fix Loop

Part of superpowers:subagent-driven-development. The task review reported spec ❌, a Critical or Important finding, or a ⚠️ item you confirmed as a real gap.

Before the loop starts, two routes leave it immediately:

  • Record Minor findings in the progress ledger as you go (Task <N>: minor (deferred): <one-liner>), and point the final whole-branch review at that list so it can triage which must be fixed before merge. A roll-up nobody reads is a silent discard. Minor findings never enter the loop.
  • A finding labeled plan-mandated — or any finding that conflicts with what the plan's text requires — is yours to rule on: weigh the finding against the plan text, decide with the spec as the binding authority, and ledger the ruling before you act on it. Do not dismiss the finding because the plan mandates it, and do not dispatch a fix that contradicts the plan without a recorded ruling.

Everything else enters the loop. A fix round is one fix dispatch plus one scoped re-review. Five rounds maximum per task:

Rounds 1-3 — resume the original implementer. Send it the open findings verbatim. Its context is intact: it knows the task, the code, and its own choices. If your harness cannot send another message to a live subagent, dispatch a fresh implementer carrying the brief path, the report-file path, and the findings — the report file is the persistent memory either way.

Rounds 4-5 — dispatch a fresh implementer on a more capable model (per SKILL.md's Model Selection), with the brief path, the report-file path, the open findings, and this framing: "A prior implementer attempted this task [N] times; you own it now. Read the report file for what was tried." A loop that survives three resumes usually means the implementer cannot see its own problem — fresh eyes and a capability bump in one move.

Every round, either way: the implementer fixes, re-runs the tests covering the amended code, appends its fix report to the same report file, and returns the short contract. Before re-dispatching the reviewer, confirm the fix report contains the covering tests, the command run, and the output; dispatch the re-review once all three are present. Name the covering test files in the fix message — a one-line fix does not need the whole suite.

The re-review is scoped. Run bash scripts/review-package PLAN_FILE FIX_BASE HEAD where FIX_BASE is the head the previous review saw, and dispatch re-review-prompt.md with the findings list, the brief, the report file, and the printed diff path. The re-reviewer verdicts each finding ADDRESSED or NOT ADDRESSED and flags new breakage in the fix diff only. New Critical/Important breakage in the fix diff joins the open findings list. Out-of-scope observations go to the ledger as deferred minors — they never extend the loop.

After each round, append to the ledger: Task <N>: fix round <R>/5 (<X> addressed, <Y> open — <finding one-liners>; commits <a7>..<b7>)

Never fix findings yourself in the controller session — your context stays clean for coordination, and controller fixes skip review.

The breaker. When round 5's re-review still leaves findings open, stop dispatching. Adjudicate each open finding yourself — you hold the plan and the cross-task context the reviewer lacks:

  • The reviewer is wrong, or the point is contestable: park it — Task <N>: parked — <finding> — Ruling: <why the code stands>. The final review sees both sides.
  • Real, but nothing downstream builds on it: park it the same way, with a ruling that says it's real and deferred.
  • Real and load-bearing — a later task builds on it, or it reveals a plan defect: rule on the smallest change that unblocks the dependent work, ledger it as Task <N>: Ruling: <finding> — <what you decided and why>, and carry it into the next task's dispatch. Parking a structural failure silently lets every dependent task build on it. Stop only when the defect leaves every path forward a guess.

Adjudicate only at the cap. Adjudicating earlier to end a loop is pre-judging with a different name. Every adjudication is a ledger entry — a silent discard is forbidden.

Raw lines 1 to 77
Starts an agent subagent :3
Starts an agent dispatch :18
Starts an agent dispatching :38
Runs code scripts/review-package :44