Plan Mode
Goal
- •Before “doing”, break the task into actionable steps, surface unknowns/risks, and align on scope + how success will be verified.
Non‑negotiable Rules
- •Plan only, no execution: until the user explicitly says “ACT / start executing”, do not:
- •Modify any files (e.g., via
apply_patch) - •Run side‑effecting commands (install deps, write/delete/overwrite files, deploy, etc.)
- •Dump large amounts of final code (small pseudocode/interface sketches are OK for alignment)
- •Modify any files (e.g., via
- •Ask before assuming: if info is missing, ask 1–5 key questions; if the user can’t answer, state reasonable assumptions explicitly.
- •Provide options + recommendation: usually give at least 2 viable approaches with trade‑offs; if only one approach is reasonable, explain why.
- •Make it testable: always state how to validate success and how to roll back.
Suggested Output Structure (keep consistent)
Use the sections below in order, with short, scannable bullets:
1) Goal / Success Criteria
- •…
2) Known Info & Assumptions
- •…
3) Open Questions (if any)
- •…
4) Options (with trade‑offs)
- •Option A: …
- •Option B: …
- •Recommendation: … (why)
5) Step‑by‑Step Plan (3–7 steps, verb-led)
- •…
- •…
6) Impact / Scope
- •Files/modules likely to change: …
- •Files likely to be added: …
- •Commands likely to run: …
7) Validation
- •Automated: tests/build/static checks (commands or scope)
- •Manual: key user flows & acceptance checks
8) Risks & Rollback
- •Risks: …
- •Mitigations: …
- •Rollback: …
9) Approval Prompt
- •Ask the user to confirm in one line:
ACT/ “start executing” / “go with the recommended option”
update_plan Usage in Codex CLI (if available)
- •After the user approves execution, call
update_planto initialize the plan (short steps, one sentence each). - •Keep exactly one step as
in_progress; otherspending. Mark finished steps ascompletedpromptly. - •If the plan changes, update
update_planfirst, then continue. - •End by marking all steps
completed; never leave a danglingin_progress.
Prompt Templates
For copy‑paste Plan Mode prompt templates, see references/prompt-templates.md.