name: execplan-builder description: Build, revise, or audit rigorous Codex ExecPlans for complex engineering work. Use when the user asks for an ExecPlan, PLANS.md, long-task plan, implementation plan, recovery-ready plan, multi-hour coding plan, agent/harness plan, multi-agent app plan, or wants a plan that is self-contained, executable, verifiable, reviewable, and resumable. Also use for high-risk work involving multiple modules, APIs, databases, side effects, paid calls, remote jobs, experiments, or public contracts.
ExecPlan Builder
Core Standard
Treat an ExecPlan as an executable contract for long-running work, not as a TODO list. It must let a future implementer continue from the current repository state and the plan alone, without chat history.
Match the OpenAI PLANS.md contract by default: every ExecPlan must be self-contained, living, novice-guiding, outcome-focused, and plain-language. It must produce demonstrably working behavior, not just code that satisfies a narrow implementation definition.
Every ExecPlan must optimize for three tests:
- Handoff: a new implementer can understand the goal, context, boundaries, and next step.
- Acceptance: success can be proven by observable behavior, commands, traces, artifacts, or reports.
- Recovery: interruption does not lose state or repeat risky side effects.
If a full template or rubric is needed, read references/execplan-content-contract.md.
Workflow
Decide whether an ExecPlan is appropriate.
- Use a full ExecPlan for multi-hour, multi-module, high-risk, agentic, experimental, API/database, public contract, or pause/resume work.
- For a tiny single-file fix or simple answer, give a lightweight plan unless the user explicitly asks for an ExecPlan.
Gather current-state evidence before drafting.
- Inspect existing repo conventions such as
AGENTS.md,.agent/PLANS.md,docs/, existing plans, tests, CI, scripts, and package commands. - If a
PLANS.mdfile is checked into the repo, reference its repository-relative path and state that the ExecPlan must be maintained in accordance with it. - Record concrete paths, entry points, module responsibilities, existing tests, known gaps, and dirty worktree risks.
- If referencing external docs, summarize the constraints inside the plan. Do not make a link the only source of a critical requirement.
- If the plan builds on a prior checked-in ExecPlan, incorporate it by path and summarize the relevant context; if it is not checked in, include the required context directly.
- If repository access is unavailable, mark the plan as a draft and list assumptions that must be verified before execution.
- Inspect existing repo conventions such as
Start from the user-visible outcome.
- State what the user/system can do after completion.
- Write proof in behavior terms: CLI output, API response, UI workflow, report contents, trace fields, generated artifacts, or test results.
- Do not use internal implementation alone as acceptance.
- Resolve ambiguities in the plan when a conservative choice is possible, and explain why that path was chosen.
Write boundaries and invariants.
- Include
Scope,Non-Goals, andNon-Negotiable Rules. - For public APIs, schemas, tools, MCP interfaces, database shape, or external contracts, specify additive vs breaking change policy.
- For destructive, paid, remote, messaging, deployment, PR, or production-data actions, require explicit approval, dry-run, audit logs, and rollback.
- Include
Define authority and evidence for state transitions.
- Identify the one direct authority for each completion or workflow transition.
- Label raw logs, summaries, scorecards, reviewer comments, and diagnostics as evidence unless they directly own state.
- Avoid plans where several artifacts can independently claim
completed.
Break the work into verifiable phases.
- Each phase must include goal, edit scope, validation, risks, and artifacts.
- Write milestones in prose as goal, work, result, and proof. Use checklists for
Progress, not as a substitute for milestone explanation. - Prefer minimal working slices over layers such as "backend then frontend" when the layer cannot be accepted independently.
- For challenging unknowns, add explicit prototype, toy implementation, spike, or parallel-implementation milestones that are additive, testable, and disposable.
- Include commands with working directory and expected success criteria.
Add recovery and rollback.
- Specify idempotent commands, checkpoint/ledger/manifest paths, resume commands, duplicate-skip rules, and cleanup steps.
- Mark actions that must not be retried automatically.
- Include a rollback path for risky file, schema, data, provider, or deployment changes.
Add living-document sections.
- Required:
Progress,Surprises & Discoveries,Decision Log,Outcomes & Retrospective, plus the skeleton sectionsArtifacts and NotesandInterfaces and Dependencies. - Instruct implementers to update these sections during execution, especially after failures, changed assumptions, and route changes.
- Instruct implementers to proceed milestone by milestone without asking for generic "next steps" unless they are blocked by a missing decision, missing permission, or unsafe side effect.
- Record decisions as
Decision,Rationale, andDate/Authorwhere possible. - When revising an existing ExecPlan, add a bottom note that explains what changed and why.
- Required:
Audit before delivering.
- Score the plan with the 20-point rubric in the reference file.
- Revise until it scores at least 16/20.
- Do not allow a zero in user-visible outcome, current state, validation/acceptance, or recovery.
- For multi-agent, database, API, paid, production, or external side-effect work, require full marks on risk control.
Required Sections
Use these headings unless the repository already has a compatible PLANS.md standard:
# <Short, action-oriented description> ExecPlan
Created:
Updated:
Target repository:
Target branch / worktree:
Related docs:
This ExecPlan is a living document. Future implementers must be able to
continue from the current repository state and this file without relying on
chat history.
If `PLANS.md` is present in the repository, reference it here by repository-relative path and maintain this document in accordance with it.
## Purpose / Big Picture
## Progress
## Surprises & Discoveries
## Decision Log
## Outcomes & Retrospective
## Context and Orientation
## Plan of Work
## Concrete Steps
## Validation and Acceptance
## Idempotence and Recovery
## Artifacts and Notes
## Interfaces and Dependencies
For complex or high-risk tasks, add Current State Snapshot, Scope, Non-Goals, Non-Negotiable Rules, Authority / Evidence Model, Implementation Slices, and Risks and Rollback as separate sections or as clearly labeled subsections inside the official skeleton. Do not remove the living-document sections.
Multi-Agent Addendum
For multi-agent apps, agent workflows, tool orchestration, or harness engineering tasks, add these constraints:
- Write an
Agent Contractfor each agent: purpose, owns, does not own, inputs, outputs, tools, guardrails, and eval cases. - Write a
Tool Contractfor each nontrivial tool: capability, input schema, side effects, idempotency, error model, audit artifacts, and mock/eval plan. - State the orchestration pattern: handoff, agent-as-tool, pipeline/DAG, reviewer/critic, or human approval.
- Define state locations: model context, run context, persistent state, and what is forbidden in each.
- Define trace/eval acceptance: correct routing, correct tool use, guardrail trigger, handoff context, reviewer findings, and regression dataset updates.
- Prefer one controlling owner for final user-visible state.
Writing Rules
- Preserve the user's requested language for the final ExecPlan.
- If returning an ExecPlan in chat, wrap the whole plan in one
mdfenced code block and do not nest triple-backtick fences inside it; indent commands, transcripts, diffs, or code examples instead. If writing the ExecPlan as the whole contents of a Markdown file, omit the outer fence. - Write narrative sections prose-first. Avoid tables and long enumerations unless they materially improve clarity. Checklists are mandatory only in
Progress. - Prefer absolute paths or repo-relative paths that are unambiguous.
- Convert vague requirements into measurable outcomes; if impossible, name the missing decision explicitly.
- Treat failures as plan material: record symptom, evidence, likely cause, next action, and whether the harness needs a new test, lint, doc, skill, or runbook.
- Keep source links as supporting references, not as required reading for key constraints.
- If asked to create or update a plan file, follow the repository's existing location and naming convention; otherwise suggest
.agent/plans/<date>-<slug>.mdorplans/<date>-<slug>.md.