3.8 KiB
3.8 KiB
Step 2: Plan
RULES
- Language — Speak in
{{.communication_language}}. Write any file output in{{.document_output_language}}. - No intermediate approvals.
INSTRUCTIONS
- Draft resume check. If
{spec_file}exists withstatus: draft, read it and capture the verbatim<frozen-after-approval>...</frozen-after-approval>block aspreserved_intent. Otherwisepreserved_intentis empty. - Investigate codebase. Isolate deep exploration in synchronous subagents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only. Decide which findings actually matter for execution — the specific files, symbols/lines, reuse points, and read-only constraints — and carry those forward for the Code Map. This is where the investigation lands: the spec preserves it so it is never re-narrated to the implementer at dispatch time.
- Read
[[bmad-snapshot:spec-template.md]]fully. Fill it out based on the intent and investigation, resolving the template'sdatefield to the current system date. Drain the investigation into the## Code Mapsection — annotated paths, symbol/line anchors, reuse pointers, and read-only evidence — so the spec is the implementer's investigation map and the step-03 handoff need only point at it. Ifpreserved_intentis non-empty, replace the<frozen-after-approval>block in the spec you just filled out withpreserved_intent, before writing. Write the result to{spec_file}. - Self-review against READY FOR DEVELOPMENT standard.
- If intent gaps exist, do not fantasize, do not leave open questions, HALT and ask the human.
- Token count check (see SCOPE STANDARD). If spec exceeds 1600 tokens:
- Show user the token count.
- HALT and ask human:
[S] Split — carve off secondary goals|[K] Keep full spec — accept the risks - On S: Propose the split — name each secondary goal. For each deferred goal, append one new entry to
{{.implementation_artifacts}}/deferred-work.mdusing this format. Do not modify existing entries or look for duplicates. Rewrite the current spec to cover only the main goal — do not surgically carve sections out; regenerate the spec for the narrowed scope. Continue to checkpoint.- source_spec: `{spec_file}` summary: <one sentence naming the deferred goal> evidence: <why this was split from the current spec> - On K: Continue to checkpoint with full spec.
CHECKPOINT 1
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.
After presenting the summary, display this note:
Before approving, you can open the spec file in an editor or ask me questions and tell me what to change. You can also use bmad-advanced-elicitation, bmad-party-mode, or bmad-code-review skills, ideally in another session to avoid context bloat.
HALT and ask human: [A] Approve | [E] Edit
- A: Re-read
{spec_file}from disk.- If the file is missing: HALT. Tell the user the spec file is gone and STOP — do not write anything to
{spec_file}, do not set status, do not proceed to Step 3. Nothing below this point runs. - If the file exists: Compare the content to what you wrote. If it has changed since you wrote it, acknowledge the external edits — show a brief summary of what changed — and proceed with the updated version. Then set status
ready-for-devin{spec_file}. Everything inside<frozen-after-approval>is now locked — only the human can change it. → Step 3.
- If the file is missing: HALT. Tell the user the spec file is gone and STOP — do not write anything to
- E: Apply changes, then return to CHECKPOINT 1.
NEXT
Read fully and follow [[bmad-snapshot:step-03-implement.md]]