On this page
Planning and phases
How a request becomes a roadmap, phase specs, ownership and source-of-truth notes, and acceptance checks.
The plan has to survive outside the chat.
The planner writes a roadmap and phase files so another reader can see:
- what the agent promised
- why it belongs there
- which checks prove it
- what happens if a phase cannot close.
Planning depth
Small tasks can use a compact plan.
Larger or riskier tasks need a deeper plan before dispatch.
The purpose is bounded work and evidence, not ceremony.
The planner loop frames the request, writes the roadmap, self-critiques, and only then dispatches phase work.
Phase spec anatomy
A phase spec names:
- the work
- why it exists
- acceptance criteria
- mandatory commands
- evidence required in transcript
- rollback/defer path
- optional sidecar status
- cleanliness notes.
The phase spec is a file the agent can reopen from disk; it is not just a chat summary.
Owner/source discipline
Each change needs an owner and source of truth.
If a generated file is involved, the phase should identify the generator rather than hand-editing stale output.
Source surfaces
skills/implementaudit/references/planning-depth.md, skills/implementaudit/references/phase-design.md, skills/implementaudit/templates/ROADMAP.md, and skills/implementaudit/templates/phase-goal.txt.
Phase file responsibilities
A phase file should be reopenable evidence.
It should name:
- work
- owner/source
- route
- acceptance criteria
- mandatory checks
- before evidence
- after evidence
- rollback or defer path
- sidecar status if relevant.
Before dispatch
The planner should self-critique phase atomicity and criteria falsifiability.
A preflight failure is PREFLIGHT_RED, not a bypass.
It must be classified before dispatch continues.
After plan review, the planner can offer owner-choice handoff options: Start now, Adjust assumption, Tweak a phase, Restructure phases, or Abort.
Those are planner handoff and owner-decision options only; they do not authorize execution, install, release, publication, or provenance by themselves.
Stage 7 prints ready-to-paste handoff text only.
Slash commands fire only when the user submits or pastes the printed line.
Dispatch prep should leave inspectable evidence:
STATE.mdis set toREADY_TO_DISPATCHwithCurrent phase: 1.- The baseline reference is recorded before mutation.
PROTOCOL.mdis copied into the run folder.- The path and SHA256 of
${IMPLEMENTAUDIT_SKILL_DIR:-skills/implementaudit}/scripts/repo-state.share recorded inTHINKING.mdbefore dispatch. - Every phase spec exists and validates before dispatch.
- Mandatory commands are deduplicated so the run checks evidence, not ceremony.
Per-phase execution loop
Each phase repeats the same evidence shape before the run advances.
- Open the phase spec from disk.
- Validate the phase with
validate-phase.shwhen available. - Record before evidence (Smoke A).
- Edit only the owner/source files for the phase.
- Record after evidence (Smoke B).
- Check cleanliness and unrelated mutations.
- Record
CONTINUITY_DECISIONandAGENTS_UPDATE_DECISIONif relevant. - Advance
STATE.mdor hand off with the blocker.
Goal synthesis stages
When the input is not already a bounded audit target, the planner uses a native Stage 0-7 contract before it hands off or dispatches work.
These stages are for creating a safe work record, not for adding ceremony.
| Stage | Plain purpose | Evidence or marker |
|---|---|---|
| 0 | Context/tool/memory detection: detect context, tools, repo state, and applicable instructions. | context.md and tools.md |
| 1 | Intake: normalize the request and ask only necessary intake questions. | bounded audit object |
| 2 | Recon / Gemba: inspect real files before promising a plan. | owner/source notes |
| 3 | Deep think: choose repair/design/mixed route and evidence needs. | route note |
| 4 | Phase decomposition: draft the roadmap and phase checklist. | ROADMAP.md, phase spec |
| 5 | Write run-root artifacts: check scope, rollback, sidecars, and generated-artifact ownership. | STATE.md, PROTOCOL.md, constraints and rollback notes |
| 6 | Plan review + self-critique: check atomicity and falsifiable criteria, then surface owner-choice handoff options. | Self-critique: and owner choice |
| 6.i | Independent cold review: a fresh-context reviewer evaluates executor-facing artifacts. | PASS, GAP-REVISE, BLOCKED, or OWNER DECISION |
| 6.ii | Pre-flight smoke check: run deduplicated mandatory checks before dispatch. | PREFLIGHT_GREEN or PREFLIGHT_RED |
| 7 | Print one ready-to-paste handoff only when dispatch is safe; it does not automatically dispatch, and the user must paste a /goal line for it to run. | ready-to-paste goal or audited handoff |
Preflight red is not permission to wing it
PREFLIGHT_RED re-enters planning.
Dispatch may continue only when the broken baseline is the phase target and the owner accepts that risk.
Unrelated or unclear baseline failures require stop-the-line handling or an owner decision.