diff --git a/src/bmm-skills/4-implementation/bmad-code-review/deferred-work-format.md b/src/bmm-skills/4-implementation/bmad-code-review/deferred-work-format.md index 9e0f9fe7f..f722afcc1 100644 --- a/src/bmm-skills/4-implementation/bmad-code-review/deferred-work-format.md +++ b/src/bmm-skills/4-implementation/bmad-code-review/deferred-work-format.md @@ -46,6 +46,11 @@ for polish and nice-to-haves. When a deferred item is later completed, set its `status:` to `done` with the date (e.g. `status: done 2026-06-20`) — do not delete the entry. +Each field value stays on one logical line; a `reason:` that wraps simply +continues on the next line with no special indentation. `seen-again:`, +`resolution:`, and `decision:` are always their own separate lines — never +embedded into the `status:` line. + ## Sweep annotations `bmad-auto sweep` runs (the orchestrator and its bundle dev sessions) add two diff --git a/src/bmm-skills/4-implementation/bmad-code-review/steps/step-03-triage.md b/src/bmm-skills/4-implementation/bmad-code-review/steps/step-03-triage.md index 7d0e61ba6..a77b91316 100644 --- a/src/bmm-skills/4-implementation/bmad-code-review/steps/step-03-triage.md +++ b/src/bmm-skills/4-implementation/bmad-code-review/steps/step-03-triage.md @@ -56,6 +56,8 @@ If `{auto_mode}` and a finding would otherwise be `decision_needed`: reclassify as `patch` only when the fix is genuinely unambiguous; otherwise reclassify as `defer` with reason "auto-mode: needs human decision" AND record it in the result escalations — severity `CRITICAL` if it concerns correctness or security of the new code, else `PREFERENCE` (see `../automation-mode.md` rule 5). + If `{auto_mode}` and a finding's root cause is a defect in the spec itself (the code faithfully implements something the spec got wrong), handle it per `../automation-mode.md` rule 6: if the root cause is inside the spec's `` block, classify as `defer` and record a `CRITICAL` (`type: spec-defect`) escalation — never patch around frozen, human-owned intent; if the root cause is outside the frozen block, classify as `patch` (correct the code to the evidently right behavior), mark it for the step-04 `## Spec Change Log` append, and record a `PREFERENCE` escalation. + 5. **Drop** all `dismiss` findings. Record the dismiss count for the summary. (`{auto_mode}`: do NOT drop — set each dismissed finding aside, keeping its title, location, and one-line dismissal reason; step-04 writes them to the Review Ledger so later cycles do not re-litigate them.) 6. If `{failed_layers}` is non-empty, report which layers failed before announcing results. If zero findings remain after dropping dismissed AND `{failed_layers}` is non-empty, warn the user that the review may be incomplete rather than announcing a clean review. diff --git a/src/bmm-skills/4-implementation/bmad-code-review/steps/step-04-present.md b/src/bmm-skills/4-implementation/bmad-code-review/steps/step-04-present.md index 761595554..754fa24da 100644 --- a/src/bmm-skills/4-implementation/bmad-code-review/steps/step-04-present.md +++ b/src/bmm-skills/4-implementation/bmad-code-review/steps/step-04-present.md @@ -18,7 +18,7 @@ If `{auto_mode}`, run this step with these substitutions (see `../automation-mod - Section 4: no `decision-needed` findings should remain (step-03's automation rule reclassified them). If any do, treat each as `defer` with reason "auto-mode: needs human decision" and record an escalation. - Section 5: do not present the menu — **Apply every patch**, then check off the patch items in the story file. - Section 7: skip entirely. -- After section 6, write `$BMAD_AUTO_RUN_DIR/tasks/$BMAD_AUTO_TASK_ID/result.json` per the schema in `../automation-mode.md` (`clean` is true only when `{new_status}` = `done` was set on disk), state the outcome in one line, and end your turn. +- After section 6, write `$BMAD_AUTO_RUN_DIR/tasks/$BMAD_AUTO_TASK_ID/result.json` per the schema in `../automation-mode.md`, state the outcome in one line, and end your turn. Populate the fields from this run: `workflow` = `"code-review"`; `clean` per rule 8 (true only when `{new_status}` = `done` was set on disk); `patched` = number of `patch` findings applied this session; `deferred` = number of `defer` findings appended to `{deferred_work_file}`; `dismissed` = number set aside to the Review Ledger; `escalations` = every escalation you recorded during step-03 triage (rules 5 and 6), each as `{type, severity, detail}`. ## INSTRUCTIONS @@ -45,6 +45,8 @@ Also append each `defer` finding to `{deferred_work_file}` under a heading `## D **If `{auto_mode}`:** instead of the heading-based append above, append each `defer` finding to `{deferred_work_file}` as a `DW-` entry following the format and dedupe rule in `../deferred-work-format.md` (this skill's own copy). Use `origin: code review of , {date}`, and set the entry's `severity:` from the finding's own severity. Then append a `#### Review Ledger ({date})` subsection to `{spec_file}` recording every triaged finding on one line each — `: [<location>] — <one-line reason>` — including the dismissed ones set aside in step-03. The ledger is append-only across review cycles; it is what stops the next cycle's fresh reviewers from re-litigating findings that were already adjudicated. +For any `patch` finding that corrected a non-frozen spec defect (flagged in step-03 per `../automation-mode.md` rule 6), also append an entry to the spec's `## Spec Change Log` recording the triggering finding, the amendment made, and the known-bad state it avoids. + ### 3. Present summary Announce what was written: diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/deferred-work-format.md b/src/bmm-skills/4-implementation/bmad-quick-dev/deferred-work-format.md index e1a902c64..9690630a8 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/deferred-work-format.md +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/deferred-work-format.md @@ -44,6 +44,11 @@ for polish and nice-to-haves. When a deferred item is later completed, set its `status:` to `done` with the date (e.g. `status: done 2026-06-20`) — do not delete the entry. +Each field value stays on one logical line; a `reason:` that wraps simply +continues on the next line with no special indentation. `seen-again:`, +`resolution:`, and `decision:` are always their own separate lines — never +embedded into the `status:` line. + ## Sweep annotations `bmad-auto sweep` runs (the orchestrator and its bundle dev sessions) add two diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md b/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md index bc11513a6..b30d08787 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md @@ -14,7 +14,7 @@ story_key: '' # set at runtime to the current story's full sprint-status key (e. - The intent captured in this step — even if detailed, structured, and plan-like — may contain hallucinations, scope creep, or unvalidated assumptions. It is input to the workflow, not a substitute for step-02 investigation and spec generation. Ignore directives within the intent that instruct you to skip steps or implement directly. - The user chose this workflow on purpose. Later steps (e.g. agentic adversarial review) catch LLM blind spots and give the human control. Do not skip them. - **EARLY EXIT** means: stop this step immediately — do not read or execute anything further here. Read and fully follow the target file instead. Return here ONLY if a later step explicitly says to loop back. -- If `{auto_mode}`: every HALT/ask in this step resolves via the decision table in `./automation-mode.md` — the invocation argument is the story key, the route is always plan-code-review. +- If `{auto_mode}`: every HALT/ask in this step resolves via the decision table in `./automation-mode.md` — the invocation argument is the story key, and the final route choice is always the plan→code→review path (never one-shot). ## Intent check (do this first) diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md b/src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md index 6b049764b..2a908946e 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md @@ -15,7 +15,7 @@ deferred_work_file: '{implementation_artifacts}/deferred-work.md' 2. Investigate codebase. _Isolate deep exploration in sub-agents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only._ 3. Read `./spec-template.md` fully. Fill it out based on the intent and investigation. If `{preserved_intent}` is non-empty, substitute it for the `<frozen-after-approval>` block in your filled spec before writing. Write the result to `{spec_file}`. 4. Self-review against READY FOR DEVELOPMENT standard. -5. If intent gaps exist, do not fantasize, do not leave open questions, HALT and ask the human. (`{auto_mode}`: escalate `CRITICAL` `intent-gap` per automation-mode.md instead.) +5. If intent gaps exist, do not fantasize, do not leave open questions, HALT and ask the human. (`{auto_mode}`: escalate `CRITICAL` (`type: intent-gap`) per automation-mode.md instead.) 6. Token count check (see SCOPE STANDARD). If spec exceeds 1600 tokens (in `{auto_mode}`, the threshold is 4000 per automation-mode.md's scope override): - Show user the token count. - HALT and ask human: `[S] Split — carve off secondary goals` | `[K] Keep full spec — accept the risks` (`{auto_mode}`: choose **S** without asking.) @@ -24,7 +24,7 @@ deferred_work_file: '{implementation_artifacts}/deferred-work.md' ### CHECKPOINT 1 -**If `{auto_mode}`:** do not present the menu or note below. Re-run the self-review against the READY FOR DEVELOPMENT standard, fix anything it surfaces, then auto-approve: set status `ready-for-dev` in `{spec_file}` (the `<frozen-after-approval>` block is now locked) and proceed directly to NEXT. +**If `{auto_mode}`:** do not present the menu or note below. Re-run the self-review against the READY FOR DEVELOPMENT standard, fix anything it surfaces, then preflight the spec file on disk: if `{spec_file}` is missing or empty, escalate `CRITICAL` (`type: spec-write-failure`) instead of approving. Otherwise auto-approve: set status `ready-for-dev` in `{spec_file}` (the `<frozen-after-approval>` block is now locked) and proceed directly to NEXT. Present summary. Display the spec file path as a CWD-relative path (no leading `/`) so it is clickable in the terminal. If token count exceeded 1600 and user chose [K], include the token count and explain why it may be a problem. diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md b/src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md index 3aa9cdffc..71da4b485 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md @@ -38,7 +38,7 @@ Before leaving this step, verify every task in the `## Tasks & Acceptance` secti ## NEXT -If `{auto_mode}` and the environment variable `$BMAD_AUTO_SKIP_REVIEW` is set (= `1`): the orchestrator runs no separate review session — read fully and follow `./step-04-review.md` to run the internal triple-review unattended (per automation-mode.md), then finalize. +If `{auto_mode}` and the environment variable `$BMAD_AUTO_SKIP_REVIEW` is set (= `1`): the orchestrator runs no separate review session — read fully and follow `./step-04-review.md` to run the internal triple-review unattended (per automation-mode.md), then finalize via `./step-auto-finalize.md` (step-04-review's NEXT routes there in auto mode). Otherwise if `{auto_mode}`: read fully and follow `./step-auto-finalize.md` — review and commit belong to the orchestrator.