3.6 KiB
Step Auto-Finalize (automation mode only)
Terminal step when {auto_mode} is set. The orchestrator creates the commit
itself.
- Default (
$BMAD_AUTO_SKIP_REVIEWunset): replaces step-04-review and step-05-present — the orchestrator runs code review in a separate fresh-context session, so this step finalizes the spec atin-review. - Skip-review (
$BMAD_AUTO_SKIP_REVIEW=1): the orchestrator runs no separate review session. You have already run step-04-review's internal triple-review, so this step finalizes the spec straight todone.
RULES
- No commit. No push. No editor.
- Default mode: no review subagents (review is the orchestrator's job). In skip-review mode the triple-review already ran in step-04-review — do not re-run it here.
- Do not generate a Suggested Review Order.
INSTRUCTIONS
-
Verify every task in the
## Tasks & Acceptancesection of{spec_file}is marked[x]. If any are not done, go back and finish them first — an incomplete task list fails the orchestrator's verification and burns a retry. -
Run the spec's
## Verificationcommands. Execute every command listed there (skip this instruction only if the spec has no Verification section). A checked-off task list is a claim; passing commands are evidence — the orchestrator runs its own deterministic gates next, so a failure you skip here just burns a retry. If a command fails: fix the code and re-run until it passes. If you cannot make it pass without violating the frozen intent, escalateCRITICAL(type: verification-failure) instead of finalizing. -
Change
{spec_file}status in the frontmatter. If$BMAD_AUTO_SKIP_REVIEWis set, usedone(no review session follows); otherwise usein-review. -
Follow
./sync-sprint-status.mdwith{target_status}=donewhen$BMAD_AUTO_SKIP_REVIEWis set, elsereview. Bundle mode ({story_key}starts withdw-): bundles have no sprint-status entry — skip the sync. Instead, update the deferred-work file: for EACH dw id listed in the bundle file, set its entry'sstatus:todone <today's date>and addresolution: <one line: what was built>directly after it (see./deferred-work-format.md). The orchestrator verifies these on disk after review — an unmarked entry fails the gate and burns a repair session. -
Write
$BMAD_AUTO_RUN_DIR/tasks/$BMAD_AUTO_TASK_ID/result.json:{ "workflow": "quick-dev", "story_key": "<{story_key}, or null if unset>", "spec_file": "<absolute path to {spec_file}>", "baseline_commit": "<baseline_commit from {spec_file} frontmatter>", "tasks_total": <count of tasks in the spec>, "tasks_done": <count of tasks marked [x]>, "verification": [<one {"command": "<cmd>", "ok": <bool>} per Verification command run in instruction 2, else empty>], "escalations": [<contents of any escalations raised this run, else empty>] }Bundle mode: additionally include
"dw_ids": [<the bundle file's dw ids, verbatim>]— the orchestrator rejects the result when the list does not match the bundle. -
State in one line what was implemented and end your turn. Do not ask questions, offer next steps, or wait for anything.
There is no ## On Complete step here: this step runs only under automation,
where writing result.json (instruction 5) is the LAST action of the run (see
./automation-mode.md) and the orchestrator owns everything after it. The
interactive workflow.on_complete customization hook lives in
./step-05-present.md.