Run Reviewable Subtask Loop
Deliver a large change as ordered, recoverable commits on a local integration
branch. Review and verify every subtask before integration, then run focused
aggregate checks and use one agreed aggregate publication path. After the work is
complete, let the user decide whether to run a broader or full local suite.
Use task for the user's complete requested outcome, subtask for one
independently reviewable and recoverable delivery unit, and phase only for an
optional group of related subtasks. Do not use these terms interchangeably.
Enforce consent boundaries
- Apply this workflow only after the explicit opt-in described in the
frontmatter. A routine implementation plan, silence, or a general request to
start coding is not acceptance.
- Treat a subtask as a delivery and recovery boundary, not a delegated worker.
Perform implementation, self-review, verification, and finalization
sequentially in the main conversation by default.
- Do not infer delegation approval from terms such as subtask, phase, review,
reviewer, parallelizable, execute the plan, or use this skill. Before any
delegation, explain why it helps, its usage impact, and the proposed agent
count and scope, maximum concurrency, and roles. Obtain explicit approval and
ask again before expanding the approved count, concurrency, roles, or scope.
- Treat Remote CI as a separate consent boundary. Reading repository workflow
files is always local discovery; triggering remote jobs requires explicit
authorization for the current series and trigger. Read
references/remote-ci.md when Remote CI is required,
requested, or could start automatically.
- Treat planning as read-only except for exact temporary plan artifacts the
user requested or the durable-plan mode selected under the criteria below.
Create branches, commits, merges, pushes, review requests, or branch deletions
only when the user's execution request or repository workflow authorizes them.
Never infer final-merge authorization from permission to implement or publish.
Initialize the series
Before the first edit:
- Read repository instructions, the implementation plan, relevant architecture
and progress docs, workflow files, branch protection, and current Git state.
- Determine the intended base branch, integration branch, required branch
prefix, local verification commands, review-request path, documentation
rules, and merge behavior.
- Fetch configured remotes and explicitly compare the intended base with its
fetched counterpart. If a clean, non-diverged base is behind, update it only
with the repository-approved fast-forward operation. If freshness cannot be
verified, or the base is dirty or diverged, report the exact state and obtain
direction before editing from that base or changing history.
- Create or reuse the series integration branch only after its base is fresh
enough under repository policy. Default to an ephemeral local branch from
the intended protected base; use an established delivery branch only when
required.
- Record the initial base and integration commit SHAs. Confirm the integration
branch is not used by another worktree and starts clean.
- Agree on the subtask ledger, focused verification budget, publication path,
Remote CI decision, and whether cleanup of this series' exact local branches
is authorized. Use the lightweight plan mode unless the user requests durable
artifacts or the work has a concrete multi-session recovery need. Disclose any
push or review-request action that would automatically trigger Remote CI before
taking it.
Use this normal topology:
intended base
└── series integration
└── one current local subtask branch
Keep the integration branch local until aggregate verification passes unless
the user explicitly requests remote backup or collaboration requires it. Do not
push subtask branches or open per-subtask review requests. During normal
execution, keep at most one live subtask branch and start every subtask from the
current verified integration tip.
Choose and maintain the plan artifacts
Before the first source edit, choose the lightest execution mode that preserves
the required recovery boundary:
- Continuous execution (default): keep a compact ordered ledger in the
conversation or an existing repository-owned progress surface and run the
approved subtasks sequentially without creating temporary plan files.
- Durable subtask plans: create the master and subtask plans only when the
user requests persisted plans or the series is expected to cross sessions and
cannot be reconstructed reliably from Git and the existing ledger.
Do not issue a blocking question solely to resolve this choice. Treat
docs/plans as a repository-relative path when durable plans are selected, but
obey a higher-priority repository rule that requires another planning location
or forbids temporary tracked plans.
For durable subtask plans:
- Choose one collision-free task slug and create only these series-owned paths:
docs/plans/<task-slug>-00-master.md and
docs/plans/<task-slug>-NN-<subtask-slug>.md, using zero-padded execution
order for NN. Never overwrite an existing plan to reuse a name.
- Put the agreed requirement baseline, initial base and integration SHAs,
execution mode, subtask order, dependencies, status, branches, commits,
verification, findings, and recovery tip in the master. Put one subtask's
responsibility, acceptance criteria, scope, implementation notes, and
focused checks only in that subtask's file. Record every exact owned path in
the master.
- Once execution and local commits are authorized, preserve the initial plan
set as a dedicated setup checkpoint when repository policy permits. If the
plans remain uncommitted, report that state and do not claim a clean branch.
- Before implementing a subtask, read its exact plan plus the master and work
only from that subtask's accepted scope. Do not preload later subtask plans
unless a dependency or conflict requires them.
- After the subtask is integrated and its integration check passes, update the
master with the evidence and delete that exact subtask plan. Preserve the
update and deletion as a progress checkpoint before starting the next subtask.
Never delete plans by glob, prefix sweep, or directory-wide cleanup.
- After the final subtask, verify that every subtask is complete and only the
master remains. Keep the completed master while review is pending so another
session can reconstruct progress.
When resuming, treat the master as routing metadata, not proof. Reconcile it
with Git, tests, and remaining exact subtask files before trusting its status.
Plan coherent subtasks
Create an ordered ledger before editing. For each planned subtask, record:
- one responsibility and its acceptance criteria;
- files, modules, generated artifacts, or contracts in scope;
- prerequisite subtasks and affected dependents;
- planned branch name and focused local checks;
- documentation impact and the reason the boundary has distinct review, test,
rollout, or recovery value.
As work proceeds, add the actual branch, commit SHA, review findings and fixes,
verification evidence, integration result, last-known-good tip, and cleanup
state. Do not require runtime values before they exist.
Split the work into fast, coherent subtasks at meaningful boundaries without
creating mechanical micro-subtasks. A good subtask should normally fit one
implementation pass, one focused verification pass, and one concise code-review
pass. It:
- implements one complete responsibility without a broken intermediate state;
- tells one coherent review story;
- has checks that can detect failure of that responsibility; and
- would justify an independent keep, revert, or rebuild decision.
If a proposed subtask needs several unrelated implementation passes, multiple
unrelated test surfaces, or a diff that cannot be reviewed as one concise story,
split it before coding. If it is only a mechanical fragment with no independent
review or recovery value, merge it with an adjacent subtask. Do not inflate a
subtask with optional cleanup, speculative hardening, or unrelated refactoring.
Merge adjacent work when the boundary is only a file, route, rename, checklist
row, mechanical edit, or shared verification command. Split work when it mixes
materially different contracts, failure modes, owners, rollout needs, security
or data scopes, migrations, public APIs, deployment boundaries, or unrelated
test surfaces. Keep generated output with its source change and never leave the
integration branch knowingly uncompilable.
When the ledger reaches high single digits, compress it explicitly. More than
roughly 12 subtasks requires a concrete justification for every remaining
boundary. Obtain user approval before materially changing a user-approved plan.
Set the verification budget
Use three proportionate gates:
- Subtask gate: focused tests and checks for the changed responsibility, plus
a cheap integration smoke when shared boundaries changed.
- Phase gate: an occasional focused cross-subtask contract check when several
subtasks change the same boundary.
- Final gate: focused aggregate checks that reliably cover the affected and
contract-connected surfaces on the exact integration tip.
At each Subtask gate, run only the focused commands recorded for that subtask
and any applicable Phase gate. Do not run the Final gate or a repository-wide
suite merely because the subtask changes source, generated files, plans or other
documentation, is about to be committed, has been integrated, or must be marked
last-known-good.
Do not treat repository-wide verification commands described generically as
automatically authorized by this workflow. After implementation and the focused
Final gate are complete, report the available broader or full-suite commands,
their expected value and cost, and ask the user whether to run them. Run them
only after explicit approval, unless a higher-priority repository instruction
already requires them. Do not infer per-subtask cadence from generic verification
descriptions or use low runtime, general caution, or the bare label "required
checks" as sufficient justification.
This cadence rule applies only to verification. Run generators, schema or code
generation, and synchronization commands at the subtask boundary when needed to
keep source changes and their generated artifacts in the same delivery. Use a
focused generated-output check when the repository provides one; offer broader
verification to the user only after the completed implementation is ready.
Do not use lint or formatting alone as evidence for a behavior change. Avoid
repeatedly running a full matrix when focused checks give reliable intermediate
evidence.
Run local checks before Remote CI unless the user explicitly requests a remote-
first exception. Remote checks may cover unavailable platforms, secrets,
infrastructure, or required trusted attestations of checks already run locally.
Do not intentionally trigger Remote CI per subtask.
Bind aggregate evidence to the commit SHA and Git tree SHA. Record exact local
commands and conclusions, unavailable checks and reasons, and authorized remote
evidence when used. Any source, generated-file, conflict-resolution, or merge
change that alters the final tree invalidates the aggregate evidence.
For a series with material UI/UX work, defer the planned manual visual and
screenshot pass until the Final gate. At that gate:
- Use the built-in Browser when available and follow its instructions. Use
Playwright MCP or another interactive browser surface only as a documented
fallback. Keep source-controlled Playwright E2E distinct from manual browser
verification.
- Capture and inspect representative desktop and mobile viewports. Check the
accepted layout, typography, spacing, imagery, interaction states,
responsive behavior, overflow, text fit, and accessibility-relevant states.
- Compare the rendered result directly with the agreed requirements and any
approved screenshot, mockup, or concept. Record screenshot paths, mismatches,
unavailable states, and the verification surface used.
Do not claim visual equivalence when the application could not be rendered.
Use an earlier interactive pass only when the user requests it or when it is
necessary to diagnose a blocker; do not present that pass as the Final gate.
Execute each subtask
Repeat sequentially:
- Switch to the clean integration tip and create the planned, series-unique
subtask branch. Confirm the exact name is unused by another branch, worktree,
session, or series, then record ownership in the ledger.
- Implement the complete subtask with its focused tests, documentation, and
generated artifacts.
- Run its subtask gate and any justified phase gate.
- Perform one focused code-review pass over the complete integration-to-subtask
diff. Check correctness, regressions, affected contracts, authorization and
data safety, validation, tests, documentation, accidental artifacts, and
unrelated changes without expanding into a repository-wide audit.
- Fix every actionable finding and rerun affected checks. Re-inspect the changed
lines and affected contracts; repeat the full subtask review only when a fix
materially changes the subtask's responsibility or review story.
- Commit only when the recorded Subtask gate and any applicable Phase gate pass
and no actionable finding remains. Do not substitute Final-gate commands for
these checks unless the explicit exception above applies. Follow repository
commit conventions and prefer one final commit per subtask; consolidate local
checkpoints when policy permits.
- Return to integration and merge the reviewed commit locally, preferring
fast-forward-only when the branch contains the intended single commit. Do not
start another subtask first. If execution resumed after review, confirm the
exact commit/tree still matches the reviewed diff before integration.
- Verify that the new integration tip contains the reviewed commit and run a
cheap smoke check when shared contracts or build boundaries changed. Do not
rerun the Final gate at this integration boundary unless the explicit
exception above applies. Mark the tip last-known-good after these integration
checks pass.
- Record the commit, checks, findings, fixes, integration result, and recovery
boundary. If cleanup was authorized, read
references/branch-cleanup.md and delete only
the exact merged local subtask branch after its ownership checks pass.
If review reveals a material scope change, stop and request direction. If an
integrated subtask becomes invalid, stop dependent work and read
references/recovery.md before changing history or
rebuilding the suffix.
Complete the series
- Confirm every ledger entry and owning plan item is complete. In durable-plan
mode, confirm that only the exact master plan remains. Review the full base-
to-integration diff, not only the final subtask.
- Fix aggregate findings on a dedicated finalization branch and pass it
through the same review, verification, integration, and cleanup loop.
- Fetch the intended base again and compare it with the recorded base. If it
advanced, use the repository-approved integration method; obtain direction
before an unapproved merge, rebase, or history rewrite. Resolve conflicts and
invalidate prior aggregate evidence before retesting the changed tree.
- Identify the smallest aggregate checks that cover the changed responsibilities
and contract connections on the exact integration tip. Do not inventory or run
every available suite merely because it exists.
- Run that focused final local gate. For material UI/UX work, perform the
relevant desktop/mobile visual pass defined above and keep manual browser
review distinct from automated E2E. After implementation, focused verification,
and aggregate review are complete, list any broader or full-suite commands,
their expected value and cost, and ask the user whether to run them.
- Fix failures with affected checks, then repeat the exact final gate once the
candidate is stable. Record the commit and tree SHAs with the final evidence.
- Fetch again, then review the complete diff against the latest fetched
intended base. When
origin/main exists, also review
origin/main...integration explicitly for bugs, regressions, missing
requirements, accidental artifacts, and unsafe changes. Fix every actionable
finding through the normal finalization loop, rerun affected checks, and
repeat the focused Final gate because the candidate tree changed.
- Re-read the agreed requirement baseline and map every criterion to delivered
behavior and evidence. Report a requirement-fit confidence score from 0
to 100, with deductions and remaining mismatches. Use 100 only when every
agreed criterion is satisfied and verified with no known gap. If a gap is
actionable and in scope, fix it and reassess; otherwise explain why it is
impossible, inadvisable, ambiguous, or too large, propose a bounded next
decision, and do not claim full completion.
- Use the agreed aggregate publication path: either open one integration-to-
base review request or commit and push without opening one. Take either path
only after the final local gate and aggregate review pass and the required
commit, push, or review-request actions are authorized. Summarize subtasks and
SHAs, review findings and fixes, recovery, verification, unavailable checks,
the confidence score, warnings, and unresolved decisions.
For a commit-and-push path without a review request, treat explicit final-push
authorization as acceptance of the candidate. In durable-plan mode, delete
the exact master plan before that final commit and push, verify that no
series-owned plan remains, review the changed candidate, and rerun the
required final evidence because its tree changed. Obtain separate Remote CI
authorization first when the push can trigger it.
- If Remote CI is authorized, follow
references/remote-ci.md and verify that approved
checks tested the current review head. Otherwise report required remote-only
or branch-protection checks as blockers without triggering them.
- Leave the review request open unless final merge is explicitly authorized.
Immediately before an authorized merge, fetch and compare the base again. A
changed candidate tree requires new aggregate evidence.
- When the user explicitly authorizes merge or squash-merge and durable-plan
mode was used, delete the exact master plan before merging. Preserve that
deletion on the review branch, verify that no series-owned plan remains,
review the changed candidate, and rerun the required final evidence because
its tree changed. If updating the branch can trigger Remote CI, obtain that
separate authorization first. Do not delete the master merely because the
implementation is complete or review is open.
- Follow repository merge policy, verify the merged tree matches the validated
candidate, and clean up the integration branch only when authorized and
after the exact ownership checks pass.
Resume safely
On continuation, always inspect the working tree, worktrees, branches,
integration/base tips, and review-request state. In durable-plan mode, reconcile
the master and remaining exact subtask plans with Git and verification evidence.
In continuous-execution mode, reconstruct progress from the conversation or
existing repository-owned ledger, Git, and verification evidence without
expecting plan files. Identify the first incomplete loop step and reuse valid
branches and commits. Never recreate work only because conversation context was
lost.
Before cleanup, rebuild ownership from the ledger. If ownership is missing or
uncertain, treat every existing branch as belonging to someone else and ask the
user which branches belong to this series. Re-fetch the intended base before
reusing final evidence.
Stop conditions
Stop and request direction when:
- overlapping user changes cannot be preserved safely;
- base freshness, permissions, credentials, or branch protection block the
loop;
- required checks conflict with the agreed verification or Remote CI budget;
- a finding materially expands scope;
- repository delivery rules require unapproved promotion or history changes;
- branch ownership or cleanup safety is uncertain; or
- production, deployment, destructive data, DNS, or another separately
authorized action becomes necessary.
Report integrated commits, local verification, review fixes, current branch,
review-request state, authorized Remote CI state when applicable, remaining
subtasks, and the precise blocker. Never claim completion while required work
remains.
1---2name: run-reviewable-subtask-loop3description: Explicit-opt-in delivery specialist for executing a large plan, migration, refactor, or roadmap as sequential reviewable commits on one integration branch. Use only when directly requested or explicitly accepted after a project-development-mindset proposal; never infer activation from size, an internal plan, or the word subtask. Subtasks are not subagents; delegation and Remote CI require separate approval.4---5
6# Run Reviewable Subtask Loop
7
8Deliver a large change as ordered, recoverable commits on a local integration
9branch. Review and verify every subtask before integration, then run focused
10aggregate checks and use one agreed aggregate publication path. After the work is
11complete, let the user decide whether to run a broader or full local suite.
12
13Use **task** for the user's complete requested outcome, **subtask** for one
14independently reviewable and recoverable delivery unit, and **phase** only for an
15optional group of related subtasks. Do not use these terms interchangeably.
16
17## Enforce consent boundaries
18
191. Apply this workflow only after the explicit opt-in described in the
20 frontmatter. A routine implementation plan, silence, or a general request to
21 start coding is not acceptance.
222. Treat a subtask as a delivery and recovery boundary, not a delegated worker.
23 Perform implementation, self-review, verification, and finalization
24 sequentially in the main conversation by default.
253. Do not infer delegation approval from terms such as subtask, phase, review,
26 reviewer, parallelizable, execute the plan, or use this skill. Before any
27 delegation, explain why it helps, its usage impact, and the proposed agent
28 count and scope, maximum concurrency, and roles. Obtain explicit approval and
29 ask again before expanding the approved count, concurrency, roles, or scope.
304. Treat Remote CI as a separate consent boundary. Reading repository workflow
31 files is always local discovery; triggering remote jobs requires explicit
32 authorization for the current series and trigger. Read
33 [references/remote-ci.md](references/remote-ci.md) when Remote CI is required,
34 requested, or could start automatically.
355. Treat planning as read-only except for exact temporary plan artifacts the
36 user requested or the durable-plan mode selected under the criteria below.
37 Create branches, commits, merges, pushes, review requests, or branch deletions
38 only when the user's execution request or repository workflow authorizes them.
39 Never infer final-merge authorization from permission to implement or publish.
40
41## Initialize the series
42
43Before the first edit:
44
451. Read repository instructions, the implementation plan, relevant architecture
46 and progress docs, workflow files, branch protection, and current Git state.
472. Determine the intended base branch, integration branch, required branch
48 prefix, local verification commands, review-request path, documentation
49 rules, and merge behavior.
503. Fetch configured remotes and explicitly compare the intended base with its
51 fetched counterpart. If a clean, non-diverged base is behind, update it only
52 with the repository-approved fast-forward operation. If freshness cannot be
53 verified, or the base is dirty or diverged, report the exact state and obtain
54 direction before editing from that base or changing history.
554. Create or reuse the series integration branch only after its base is fresh
56 enough under repository policy. Default to an ephemeral local branch from
57 the intended protected base; use an established delivery branch only when
58 required.
595. Record the initial base and integration commit SHAs. Confirm the integration
60 branch is not used by another worktree and starts clean.
616. Agree on the subtask ledger, focused verification budget, publication path,
62 Remote CI decision, and whether cleanup of this series' exact local branches
63 is authorized. Use the lightweight plan mode unless the user requests durable
64 artifacts or the work has a concrete multi-session recovery need. Disclose any
65 push or review-request action that would automatically trigger Remote CI before
66 taking it.
67
68Use this normal topology:
69
70```text
71intended base
72└── series integration
73 └── one current local subtask branch
74```
75
76Keep the integration branch local until aggregate verification passes unless
77the user explicitly requests remote backup or collaboration requires it. Do not
78push subtask branches or open per-subtask review requests. During normal
79execution, keep at most one live subtask branch and start every subtask from the
80current verified integration tip.
81
82## Choose and maintain the plan artifacts
83
84Before the first source edit, choose the lightest execution mode that preserves
85the required recovery boundary:
86
87- **Continuous execution (default):** keep a compact ordered ledger in the
88 conversation or an existing repository-owned progress surface and run the
89 approved subtasks sequentially without creating temporary plan files.
90- **Durable subtask plans:** create the master and subtask plans only when the
91 user requests persisted plans or the series is expected to cross sessions and
92 cannot be reconstructed reliably from Git and the existing ledger.
93
94Do not issue a blocking question solely to resolve this choice. Treat
95`docs/plans` as a repository-relative path when durable plans are selected, but
96obey a higher-priority repository rule that requires another planning location
97or forbids temporary tracked plans.
98
99For durable subtask plans:
100
1011. Choose one collision-free task slug and create only these series-owned paths:
102 `docs/plans/<task-slug>-00-master.md` and
103 `docs/plans/<task-slug>-NN-<subtask-slug>.md`, using zero-padded execution
104 order for `NN`. Never overwrite an existing plan to reuse a name.
1052. Put the agreed requirement baseline, initial base and integration SHAs,
106 execution mode, subtask order, dependencies, status, branches, commits,
107 verification, findings, and recovery tip in the master. Put one subtask's
108 responsibility, acceptance criteria, scope, implementation notes, and
109 focused checks only in that subtask's file. Record every exact owned path in
110 the master.
1113. Once execution and local commits are authorized, preserve the initial plan
112 set as a dedicated setup checkpoint when repository policy permits. If the
113 plans remain uncommitted, report that state and do not claim a clean branch.
1144. Before implementing a subtask, read its exact plan plus the master and work
115 only from that subtask's accepted scope. Do not preload later subtask plans
116 unless a dependency or conflict requires them.
1175. After the subtask is integrated and its integration check passes, update the
118 master with the evidence and delete that exact subtask plan. Preserve the
119 update and deletion as a progress checkpoint before starting the next subtask.
120 Never delete plans by glob, prefix sweep, or directory-wide cleanup.
1216. After the final subtask, verify that every subtask is complete and only the
122 master remains. Keep the completed master while review is pending so another
123 session can reconstruct progress.
124
125When resuming, treat the master as routing metadata, not proof. Reconcile it
126with Git, tests, and remaining exact subtask files before trusting its status.
127
128## Plan coherent subtasks
129
130Create an ordered ledger before editing. For each planned subtask, record:
131
132- one responsibility and its acceptance criteria;
133- files, modules, generated artifacts, or contracts in scope;
134- prerequisite subtasks and affected dependents;
135- planned branch name and focused local checks;
136- documentation impact and the reason the boundary has distinct review, test,
137 rollout, or recovery value.
138
139As work proceeds, add the actual branch, commit SHA, review findings and fixes,
140verification evidence, integration result, last-known-good tip, and cleanup
141state. Do not require runtime values before they exist.
142
143Split the work into fast, coherent subtasks at meaningful boundaries without
144creating mechanical micro-subtasks. A good subtask should normally fit one
145implementation pass, one focused verification pass, and one concise code-review
146pass. It:
147
1481. implements one complete responsibility without a broken intermediate state;
1492. tells one coherent review story;
1503. has checks that can detect failure of that responsibility; and
1514. would justify an independent keep, revert, or rebuild decision.
152
153If a proposed subtask needs several unrelated implementation passes, multiple
154unrelated test surfaces, or a diff that cannot be reviewed as one concise story,
155split it before coding. If it is only a mechanical fragment with no independent
156review or recovery value, merge it with an adjacent subtask. Do not inflate a
157subtask with optional cleanup, speculative hardening, or unrelated refactoring.
158
159Merge adjacent work when the boundary is only a file, route, rename, checklist
160row, mechanical edit, or shared verification command. Split work when it mixes
161materially different contracts, failure modes, owners, rollout needs, security
162or data scopes, migrations, public APIs, deployment boundaries, or unrelated
163test surfaces. Keep generated output with its source change and never leave the
164integration branch knowingly uncompilable.
165
166When the ledger reaches high single digits, compress it explicitly. More than
167roughly 12 subtasks requires a concrete justification for every remaining
168boundary. Obtain user approval before materially changing a user-approved plan.
169
170## Set the verification budget
171
172Use three proportionate gates:
173
174- **Subtask gate:** focused tests and checks for the changed responsibility, plus
175 a cheap integration smoke when shared boundaries changed.
176- **Phase gate:** an occasional focused cross-subtask contract check when several
177 subtasks change the same boundary.
178- **Final gate:** focused aggregate checks that reliably cover the affected and
179 contract-connected surfaces on the exact integration tip.
180
181At each Subtask gate, run only the focused commands recorded for that subtask
182and any applicable Phase gate. Do not run the Final gate or a repository-wide
183suite merely because the subtask changes source, generated files, plans or other
184documentation, is about to be committed, has been integrated, or must be marked
185last-known-good.
186
187Do not treat repository-wide verification commands described generically as
188automatically authorized by this workflow. After implementation and the focused
189Final gate are complete, report the available broader or full-suite commands,
190their expected value and cost, and ask the user whether to run them. Run them
191only after explicit approval, unless a higher-priority repository instruction
192already requires them. Do not infer per-subtask cadence from generic verification
193descriptions or use low runtime, general caution, or the bare label "required
194checks" as sufficient justification.
195
196This cadence rule applies only to verification. Run generators, schema or code
197generation, and synchronization commands at the subtask boundary when needed to
198keep source changes and their generated artifacts in the same delivery. Use a
199focused generated-output check when the repository provides one; offer broader
200verification to the user only after the completed implementation is ready.
201
202Do not use lint or formatting alone as evidence for a behavior change. Avoid
203repeatedly running a full matrix when focused checks give reliable intermediate
204evidence.
205
206Run local checks before Remote CI unless the user explicitly requests a remote-
207first exception. Remote checks may cover unavailable platforms, secrets,
208infrastructure, or required trusted attestations of checks already run locally.
209Do not intentionally trigger Remote CI per subtask.
210
211Bind aggregate evidence to the commit SHA and Git tree SHA. Record exact local
212commands and conclusions, unavailable checks and reasons, and authorized remote
213evidence when used. Any source, generated-file, conflict-resolution, or merge
214change that alters the final tree invalidates the aggregate evidence.
215
216For a series with material UI/UX work, defer the planned manual visual and
217screenshot pass until the Final gate. At that gate:
218
2191. Use the built-in Browser when available and follow its instructions. Use
220 Playwright MCP or another interactive browser surface only as a documented
221 fallback. Keep source-controlled Playwright E2E distinct from manual browser
222 verification.
2232. Capture and inspect representative desktop and mobile viewports. Check the
224 accepted layout, typography, spacing, imagery, interaction states,
225 responsive behavior, overflow, text fit, and accessibility-relevant states.
2263. Compare the rendered result directly with the agreed requirements and any
227 approved screenshot, mockup, or concept. Record screenshot paths, mismatches,
228 unavailable states, and the verification surface used.
229
230Do not claim visual equivalence when the application could not be rendered.
231Use an earlier interactive pass only when the user requests it or when it is
232necessary to diagnose a blocker; do not present that pass as the Final gate.
233
234## Execute each subtask
235
236Repeat sequentially:
237
2381. Switch to the clean integration tip and create the planned, series-unique
239 subtask branch. Confirm the exact name is unused by another branch, worktree,
240 session, or series, then record ownership in the ledger.
2412. Implement the complete subtask with its focused tests, documentation, and
242 generated artifacts.
2433. Run its subtask gate and any justified phase gate.
2444. Perform one focused code-review pass over the complete integration-to-subtask
245 diff. Check correctness, regressions, affected contracts, authorization and
246 data safety, validation, tests, documentation, accidental artifacts, and
247 unrelated changes without expanding into a repository-wide audit.
2485. Fix every actionable finding and rerun affected checks. Re-inspect the changed
249 lines and affected contracts; repeat the full subtask review only when a fix
250 materially changes the subtask's responsibility or review story.
2516. Commit only when the recorded Subtask gate and any applicable Phase gate pass
252 and no actionable finding remains. Do not substitute Final-gate commands for
253 these checks unless the explicit exception above applies. Follow repository
254 commit conventions and prefer one final commit per subtask; consolidate local
255 checkpoints when policy permits.
2567. Return to integration and merge the reviewed commit locally, preferring
257 fast-forward-only when the branch contains the intended single commit. Do not
258 start another subtask first. If execution resumed after review, confirm the
259 exact commit/tree still matches the reviewed diff before integration.
2608. Verify that the new integration tip contains the reviewed commit and run a
261 cheap smoke check when shared contracts or build boundaries changed. Do not
262 rerun the Final gate at this integration boundary unless the explicit
263 exception above applies. Mark the tip last-known-good after these integration
264 checks pass.
2659. Record the commit, checks, findings, fixes, integration result, and recovery
266 boundary. If cleanup was authorized, read
267 [references/branch-cleanup.md](references/branch-cleanup.md) and delete only
268 the exact merged local subtask branch after its ownership checks pass.
269
270If review reveals a material scope change, stop and request direction. If an
271integrated subtask becomes invalid, stop dependent work and read
272[references/recovery.md](references/recovery.md) before changing history or
273rebuilding the suffix.
274
275## Complete the series
276
2771. Confirm every ledger entry and owning plan item is complete. In durable-plan
278 mode, confirm that only the exact master plan remains. Review the full base-
279 to-integration diff, not only the final subtask.
2802. Fix aggregate findings on a dedicated finalization branch and pass it
281 through the same review, verification, integration, and cleanup loop.
2823. Fetch the intended base again and compare it with the recorded base. If it
283 advanced, use the repository-approved integration method; obtain direction
284 before an unapproved merge, rebase, or history rewrite. Resolve conflicts and
285 invalidate prior aggregate evidence before retesting the changed tree.
2864. Identify the smallest aggregate checks that cover the changed responsibilities
287 and contract connections on the exact integration tip. Do not inventory or run
288 every available suite merely because it exists.
2895. Run that focused final local gate. For material UI/UX work, perform the
290 relevant desktop/mobile visual pass defined above and keep manual browser
291 review distinct from automated E2E. After implementation, focused verification,
292 and aggregate review are complete, list any broader or full-suite commands,
293 their expected value and cost, and ask the user whether to run them.
2946. Fix failures with affected checks, then repeat the exact final gate once the
295 candidate is stable. Record the commit and tree SHAs with the final evidence.
2967. Fetch again, then review the complete diff against the latest fetched
297 intended base. When `origin/main` exists, also review
298 `origin/main...integration` explicitly for bugs, regressions, missing
299 requirements, accidental artifacts, and unsafe changes. Fix every actionable
300 finding through the normal finalization loop, rerun affected checks, and
301 repeat the focused Final gate because the candidate tree changed.
3028. Re-read the agreed requirement baseline and map every criterion to delivered
303 behavior and evidence. Report a **requirement-fit confidence** score from 0
304 to 100, with deductions and remaining mismatches. Use 100 only when every
305 agreed criterion is satisfied and verified with no known gap. If a gap is
306 actionable and in scope, fix it and reassess; otherwise explain why it is
307 impossible, inadvisable, ambiguous, or too large, propose a bounded next
308 decision, and do not claim full completion.
3099. Use the agreed aggregate publication path: either open one integration-to-
310 base review request or commit and push without opening one. Take either path
311 only after the final local gate and aggregate review pass and the required
312 commit, push, or review-request actions are authorized. Summarize subtasks and
313 SHAs, review findings and fixes, recovery, verification, unavailable checks,
314 the confidence score, warnings, and unresolved decisions.
315 For a commit-and-push path without a review request, treat explicit final-push
316 authorization as acceptance of the candidate. In durable-plan mode, delete
317 the exact master plan before that final commit and push, verify that no
318 series-owned plan remains, review the changed candidate, and rerun the
319 required final evidence because its tree changed. Obtain separate Remote CI
320 authorization first when the push can trigger it.
32110. If Remote CI is authorized, follow
322 [references/remote-ci.md](references/remote-ci.md) and verify that approved
323 checks tested the current review head. Otherwise report required remote-only
324 or branch-protection checks as blockers without triggering them.
32511. Leave the review request open unless final merge is explicitly authorized.
326 Immediately before an authorized merge, fetch and compare the base again. A
327 changed candidate tree requires new aggregate evidence.
32812. When the user explicitly authorizes merge or squash-merge and durable-plan
329 mode was used, delete the exact master plan before merging. Preserve that
330 deletion on the review branch, verify that no series-owned plan remains,
331 review the changed candidate, and rerun the required final evidence because
332 its tree changed. If updating the branch can trigger Remote CI, obtain that
333 separate authorization first. Do not delete the master merely because the
334 implementation is complete or review is open.
33513. Follow repository merge policy, verify the merged tree matches the validated
336 candidate, and clean up the integration branch only when authorized and
337 after the exact ownership checks pass.
338
339## Resume safely
340
341On continuation, always inspect the working tree, worktrees, branches,
342integration/base tips, and review-request state. In durable-plan mode, reconcile
343the master and remaining exact subtask plans with Git and verification evidence.
344In continuous-execution mode, reconstruct progress from the conversation or
345existing repository-owned ledger, Git, and verification evidence without
346expecting plan files. Identify the first incomplete loop step and reuse valid
347branches and commits. Never recreate work only because conversation context was
348lost.
349
350Before cleanup, rebuild ownership from the ledger. If ownership is missing or
351uncertain, treat every existing branch as belonging to someone else and ask the
352user which branches belong to this series. Re-fetch the intended base before
353reusing final evidence.
354
355## Stop conditions
356
357Stop and request direction when:
358
359- overlapping user changes cannot be preserved safely;
360- base freshness, permissions, credentials, or branch protection block the
361 loop;
362- required checks conflict with the agreed verification or Remote CI budget;
363- a finding materially expands scope;
364- repository delivery rules require unapproved promotion or history changes;
365- branch ownership or cleanup safety is uncertain; or
366- production, deployment, destructive data, DNS, or another separately
367 authorized action becomes necessary.
368
369Report integrated commits, local verification, review fixes, current branch,
370review-request state, authorized Remote CI state when applicable, remaining
371subtasks, and the precise blocker. Never claim completion while required work
372remains.