Create and maintain PLAN.md files tied to git branches. The plan serves two audiences:
- Agent: determine where things are at and continue from where they left off.
- Human: quickly see the plan, changes, and current status.
Plan Steering
- Always read
PLAN.mdbefore making changes. - On resumed sessions, read the latest Status Updates entry and run
git diff --statto detect drift. - If the user says "continue", use the newest status update to determine what changed last and what to do next.
- Treat
PLAN.mdas a resume log, not a task tracker — keep entries short and factual. - Use checkboxes in the Plan section to track progress.
Workflow
- Determine the current branch:
git rev-parse --abbrev-ref HEAD. - If on the repository's default branch (often
mainormaster):- Ask whether the user wants to create and switch to a feature branch or keep working on the default branch.
- Recommend a new branch for larger, longer-lived, or review-heavy work. For a simple task or a quick planning pass, staying on the default branch can be fine if the user prefers it.
- If the user chooses to create a branch, stop after suggesting a concrete branch name so they can switch first.
- If the user chooses to stay on the default branch, derive a logical plan slug from the request (or ask for one if the topic is ambiguous) and continue as though the work belonged to
feat/<slug>, unlessfix/orchore/is clearly a better fit.
- Derive the plan path:
- If using a real branch and it matches
^(feat|fix|chore)/(.+)$, use prefix = match 1 and feature = match 2. - If using a real branch that does not match that pattern, use prefix =
featand feature = full branch name. - If staying on the default branch, use the chosen logical prefix/slug from step 2.
- Plan path:
docs/plans/<prefix>/<feature>/PLAN.md.
- If using a real branch and it matches
- If PLAN.md does not exist:
- Create directories and create the plan from
references/plan-template.md. - Fill in the Goal and Plan sections based on the user request.
- Create directories and create the plan from
- If PLAN.md exists:
- Do not overwrite. Update checkboxes, append status updates.
Updating PLAN.md
- After meaningful work, append a Status Updates entry (newest first):
- Change: what changed
- State now: what's true after this change
- Validate: one command to verify
- Check off completed items in the Plan section.
- Add Decisions entries for notable tradeoffs.
- Add Discoveries entries for non-obvious findings or gotchas.
Error Protocol
- Three-strike escalation for recurring failures:
- Diagnose and apply a targeted fix.
- Try a different approach (do not repeat the same failing action).
- Re-check assumptions and update the plan.
- After three failed attempts, escalate to the user with what was tried and the best next options.
Validation
- Before claiming completion, run the
Validate:command from the most recent status update.
Resource
- Planning template:
references/plan-template.md