Skill Tracer
Skills › BMAD Method › bmad-build-auto › step-02-plan.md

step-02-plan.md

42 lines · skills/bmad-build-auto/step-02-plan.md at bd70c64

Open on GitHub

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

1# Step 2: Plan
2

Step 2: Plan

Raw lines 1 to 2
3## RULES
4
5- No human interaction: do not ask questions or wait for approval in this step.
6

RULES

  • No human interaction: do not ask questions or wait for approval in this step.
Raw lines 3 to 6
Involves a person wait for approval :5
7## INSTRUCTIONS
8
91. Draft resume check. If `{plan_file}` exists with `status: draft`, read it and capture the verbatim `<intent-contract>...</intent-contract>` block as `preserved_intent_contract`. Otherwise `preserved_intent_contract` is empty.
102. Investigate codebase. _Read the code yourself for narrow, localized tasks. Isolate deep exploration in synchronous subagents: instruct them to give you distilled summaries only, and plan from those summaries._ 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 plan preserves it so it is never re-narrated to the implementer at dispatch time.
12 Treat a codebase research document as evidence for this investigation, read at its `commit`. Before the plan uses a claim from it, re-check it against the current code when the plan rests on it or its cited file changed since that commit (`git diff --stat <commit> -- <path>`). Investigate afresh any claim that no longer holds.
14 Then score the change's `risk` for `{plan_file}` frontmatter: `low`, `medium`, or `high`, the business impact if this change is wrong. For a ticket from the tree, start from `risk` in `tickets.py find`'s output and raise it when the investigation shows more; never go below it.
15{% if workflow.route == "oneshot" or workflow.route == "full" %}
163. The route is `{{ workflow.route }}`; `route_source` is `pinned`.
17{% else %}
183. {{ workflow.route_selection }}
20 `route_source` is `auto`.
21{% endif %}
224. Read `{{ rendered("plan-template.md") }}` fully, preserving all frontmatter fields and resolving `date` to the current system date.
23 - **Oneshot:** set `route: 'oneshot'`.
24 - **Full:** set `route: 'full'`. Put what you learned into `## Code Map`: paths, symbols or lines, what to reuse, and what not to change. The subagent should be able to work from the plan without being told any of it again.
26 Set `route_source` from step 3 and `risk` from step 2.
28 If `{preserved_intent_contract}` is non-empty, substitute it for the `<intent-contract>` block before writing `{plan_file}`. Self-check against the route's READY FOR DEVELOPMENT standard.
295. If intent gaps exist, do not fantasize and do not leave open questions. Multiple defensible readings of the intent that lead to observably different outcomes, with nothing in the intent to select between them, are an intent gap — do not resolve one by picking a reading. HALT with status `blocked`, blocking condition `intent gap`, and include the unanswered questions and evidence gathered.
306. Warning check. If step-01 carried `multiple-goals`, add it to `{plan_file}` frontmatter `warnings`. If `{plan_file}` exceeds 1600 tokens, add `oversized` to frontmatter `warnings`. Continue either way.

INSTRUCTIONS

  1. Draft resume check. If {plan_file} exists with status: draft, read it and capture the verbatim <intent-contract>...</intent-contract> block as preserved_intent_contract. Otherwise preserved_intent_contract is empty.
  2. Investigate codebase. Read the code yourself for narrow, localized tasks. Isolate deep exploration in synchronous subagents: instruct them to give you distilled summaries only, and plan from those summaries. 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 plan preserves it so it is never re-narrated to the implementer at dispatch time.

Treat a codebase research document as evidence for this investigation, read at its commit. Before the plan uses a claim from it, re-check it against the current code when the plan rests on it or its cited file changed since that commit (git diff --stat <commit> -- <path>). Investigate afresh any claim that no longer holds.

Then score the change's risk for {plan_file} frontmatter: low, medium, or high, the business impact if this change is wrong. For a ticket from the tree, start from risk in tickets.py find's output and raise it when the investigation shows more; never go below it. {% if workflow.route == "oneshot" or workflow.route == "full" %}

  1. The route is {{ workflow.route }}; route_source is pinned.

{% else %}

  1. {{ workflow.route_selection }}

route_source is auto. {% endif %}

  1. Read {{ rendered("plan-template.md") }} fully, preserving all frontmatter fields and resolving date to the current system date.
  2. Oneshot: set route: 'oneshot'.
  3. Full: set route: 'full'. Put what you learned into ## Code Map: paths, symbols or lines, what to reuse, and what not to change. The subagent should be able to work from the plan without being told any of it again.

Set route_source from step 3 and risk from step 2.

If {preserved_intent_contract} is non-empty, substitute it for the <intent-contract> block before writing {plan_file}. Self-check against the route's READY FOR DEVELOPMENT standard.

  1. If intent gaps exist, do not fantasize and do not leave open questions. Multiple defensible readings of the intent that lead to observably different outcomes, with nothing in the intent to select between them, are an intent gap — do not resolve one by picking a reading. HALT with status blocked, blocking condition intent gap, and include the unanswered questions and evidence gathered.
  2. Warning check. If step-01 carried multiple-goals, add it to {plan_file} frontmatter warnings. If {plan_file} exceeds 1600 tokens, add oversized to frontmatter warnings. Continue either way.
Raw lines 7 to 31
Starts an agent subagents :10
Starts an agent dispatch :10
Starts an agent subagent :24
32### READY-FOR-DEVELOPMENT GATE
34Re-read `{{ rendered("workflow.md") }}`, then re-read `{plan_file}` from disk and verify the plan meets the READY FOR DEVELOPMENT standard.
36- **If the file is missing:** HALT with status `blocked` and blocking condition `plan file disappeared before implementation`.
37- **If the plan meets the standard:** set `{plan_file}` frontmatter status to `ready-for-dev`. If the invocation prompt directs a halt after planning (standard phrasing: `Halt after planning.` — accept any clear equivalent), HALT with status `ready-for-dev`; otherwise continue to step 3.
38- **If the plan does not meet the standard:** repair it once, then re-read it from disk and verify again. If it now meets the standard, apply the **If the plan meets the standard** handling above, including the halt-after-planning check. If it still does not meet the standard, HALT with status `blocked`, blocking condition `plan failed ready-for-development standard`, and include the failing criteria and evidence gathered.

READY-FOR-DEVELOPMENT GATE

Re-read {{ rendered("workflow.md") }}, then re-read {plan_file} from disk and verify the plan meets the READY FOR DEVELOPMENT standard.

  • If the file is missing: HALT with status blocked and blocking condition plan file disappeared before implementation.
  • If the plan meets the standard: set {plan_file} frontmatter status to ready-for-dev. If the invocation prompt directs a halt after planning (standard phrasing: Halt after planning. — accept any clear equivalent), HALT with status ready-for-dev; otherwise continue to step 3.
  • If the plan does not meet the standard: repair it once, then re-read it from disk and verify again. If it now meets the standard, apply the If the plan meets the standard handling above, including the halt-after-planning check. If it still does not meet the standard, HALT with status blocked, blocking condition plan failed ready-for-development standard, and include the failing criteria and evidence gathered.
Raw lines 32 to 39
40## NEXT
42Read fully and follow `{{ rendered("step-03-implement.md") }}`

NEXT

Read fully and follow {{ rendered("step-03-implement.md") }}

Raw lines 40 to 42