Turn multi-stage work, work with complex dependencies, or work that must survive across sessions into an executable plan (a task graph with dependency edges), opening a track when cross-session recovery is needed. When the user only wants a plan, deliver it and stop; when execution is authorized, keep going. Not for changes that fit in one sentence.
---
name: plan
description: "Turn multi-stage work, work with complex dependencies, or work that must survive across sessions into an executable plan (a task graph with dependency edges), opening a track when cross-session recovery is needed. When the user only wants a plan, deliver it and stop; when execution is authorized, keep going. Not for changes that fit in one sentence."
---
# Executable plan
A plan states what to do, in what order, and how the result is accepted. It reuses the user request, the approved Spec, issues, and existing project records; it does not create another set of requirement materials.
## Process
1. Determine the goal, scope, acceptance, and dependencies from existing evidence. Ask the user only about unresolved trade-offs that affect the outcome; decide routine implementation choices yourself and state any necessary assumptions.
2. Prefer the project's existing planning surface; when there is no convention and a persistent plan is genuinely needed, use `docs/plans/YYYY-MM-DD--<topic>-plan.md`. Short tasks use a conversational plan; a change that can be described in one sentence and has no cross-file dependencies gets no plan file.
3. Write the goal, scope, executable work items, verification approach, and important dependencies or risks. Multi-stage work states a final overall acceptance (`final_integration_claim`), because every step passing on its own does not prove the whole works.
4. Markdown work items use checkboxes; issues or an existing tracker keep their native status. In multi-item plans write dependencies as edges: each item carries `depends: #N` (or "none"), making the plan a task graph: an item whose prerequisites are all done can start, and `ship` dispatches in parallel from it. Slicing rules:
- **Vertical slices**: each item cuts through every layer it needs, is verifiable on its own, and fits in one fresh context window; any needed prefactoring goes first (make the change easy, then make the easy change).
- **Repo-wide mechanical changes** (a rename, a retyped shared symbol that breaks many call sites at once) are not forced into vertical slices; sequence them as **expand–contract**: add the new form without breaking the old → migrate call sites in batches sized by blast radius (one item per batch, each depending on the expand) → delete the old form (depending on every migrate batch).
- **Shared files**: when two items would edit the same shared file (a config registry, a message catalogue, a shared type), add an edge so they run in sequence, or fix the exact names each adds in the plan up front.
5. Recovery surface: create files only for tracks that need cross-session recovery; short tasks create none. If the project already uses another tracker (issues, a board), reuse it instead of adding `.harness/`. When using `.harness/`, open a track: add a row to the `| Track | Status | Entry |` table in `.harness/index.md` (status `active`, entry linking to `tracks/<id>.md`) and create `.harness/tracks/<id>.md` with the six lines `Objective:`, `Status:`, `Entry:`, `Evidence:`, `Next:`, `Limits:`, where `Entry:` points to this plan file. Use relative links, and touch only this track, never other tracks' rows or files. If the project's `AGENTS.md` does not yet point readers to `.harness/index.md`, add one line that does. Format details follow the recovery-surface policy in `writing-for-agents`; if the project has `scripts/harness_lint.py`, run it once before committing.
6. When the user only asked for a plan, deliver it and stop. When implementation is already authorized, keep executing the steps that can advance; writing a plan is not a new approval gate.
## Verification and commits
- When checks are blocked, record the gap, the available evidence, and the claims that cannot be made, and continue with work that does not depend on the gap. Do not turn a temporarily missing tool into a task to rebuild the workbench.
- Do not pass substitute checks off as the original acceptance; changing the agreed acceptance requires the user's consent.
- Commits can mark meaningful milestones; they are not a required part of every plan. Commits follow the project's conventions and the relevant checks; when the project has none, follow the commit rule in `implement`.
- Do not force acceptance_criteria, verification_commands, and success_definition onto every item; clear actions and success conditions are enough.
## Afterwards
- Authorized and changes needed: `implement`; several tickets ready at once: `ship`; unknown root cause: `diagnose`.
- The user asks for a review, or the changes need deep inspection: `review`.
- Plan abandoned or rejected: close the track with `cleanup`.
- Use `harness-builder` only when a real workbench gap needs fixing; for a plan-only request, stop.