Planned Execution
The midweight lane: a spec becomes a plan an engineer with zero context could
execute cold, and the plan becomes working software through a loop of fresh
implementer subagents and two-stage review. Below this lane, implement
directly with test-driven-development; above it, a governed series (keel,
convoy) owns the work.
This is a rigid skill: the plan contract and the review-loop order are
bright lines, because the failure mode of plan-then-execute work is
self-granted shortcuts — placeholder steps, skipped re-reviews, "close
enough" spec compliance.
The plan contract
Write the plan assuming a skilled engineer who knows nothing about this
codebase or problem domain. Save it where the project keeps plans (user
preference wins; a dated file under the repo's plans convention is a sensible
default).
- Map the file structure first. Which files are created or modified and
what each is responsible for — decomposition gets locked in here. One
clear responsibility per file; follow existing codebase patterns.
- Bite-sized steps, one action each (2–5 minutes): write the failing
test — run it and watch it fail — write the minimal implementation — run
to green — commit. The task granularity of test-driven-development,
written down.
- Exact everything. Exact file paths (
src/path/file.py:123-145 for
modifications), complete code in every code step, exact commands with
their expected output.
- No placeholders. These are plan failures, not shorthand: "TBD",
"implement later", "add appropriate error handling", "write tests for the
above" without the test code, "similar to Task N" instead of repeating
the code, references to types or functions no task defines.
- Header: goal in one sentence, architecture in two or three,
tech stack, and the execution mode (this skill's loop, or inline).
- Self-review before execution: every spec requirement maps to a task;
no placeholder patterns survive; names and signatures used in later tasks
match their definitions in earlier tasks; every config field, limit, or
flag the plan introduces is consumed by a task, not merely declared. Fix
inline and move on.
The execution loop
Read the plan once, extract every task with its full text and context, and
track them (one tracked item per task). Then, per task:
- Dispatch a fresh implementer subagent with the complete task text and
scene-setting context — where this task fits, what came before. Never
make a subagent read the plan file; the controller curates exactly what
it needs. Answer its questions before it starts, not after it guesses.
- The implementer implements, tests, commits, and self-reviews, then
reports a status:
- DONE → proceed to review.
- DONE_WITH_CONCERNS → read the concerns; correctness or scope
concerns get addressed before review, observations get noted.
- NEEDS_CONTEXT → provide the missing context, re-dispatch.
- BLOCKED → change something before re-dispatching: more context, a
more capable model, a smaller task split — or escalate to the user if
the plan itself is wrong. Re-dispatching unchanged is not a strategy.
- Spec-compliance review by a fresh subagent: does the code match the
task's requirements — nothing missing, nothing extra? Issues go back to
the implementer, then re-review. "Close enough" is a finding, not a pass.
- Code-quality review by a fresh subagent, only after spec compliance
passes: is it well built? Same fix-and-re-review loop.
- Mark the task complete; next task. Don't pause to ask "should I
continue?" between tasks — the user asked for the plan to be executed.
Stop only for BLOCKED-beyond-recovery, genuine ambiguity, or completion.
After the last task: one final review subagent over the whole implementation
against the whole plan — including an integration trace: follow every
config field, limit, flag, or option the plan introduced (task fields,
scenario fields, CLI options) to a consumer, confirming each is actually
read end-to-end, not merely declared. Plan-fidelity review is blind here by
construction — a declared-but-unconsumed limit passes both code-matches-plan
and code-is-well-built while doing nothing, surfacing only at runtime. Then
hand the completion claim to
verification-before-completion — its evidence rules govern the "done".
Authoring and dispatch notes
Environment hazards that bite a delegated step — format-on-save hooks
rewriting the bytes you just wrote, an isolated worktree breaking ../ sibling
paths, per-phase commits under a stashing pre-commit, and a backgrounded gate
that ends a subagent's turn for good: references/dispatch-hazards.md.
Task granularity vs dispatch economics. "Bite-sized" means one clear action
per step, not one subagent per step. When several small steps form one
tightly-coupled responsibility, batching them into a single coherent unit —
still running the full implementer + two-stage review loop — is a valid reading,
and often the right one: a dozen two-line steps don't each need three subagents.
Batch by responsibility, never to skip a review.
Model selection per role
Mechanical implementation with a complete spec → the cheapest capable model;
multi-file integration → a standard model; design judgment and review → the
most capable available. The sibling choosing-models skill owns this call when
present; these heuristics are the standalone-install fallback.
Without subagents
In a context without subagent support, the same plan executes inline:
tracked tasks, steps followed exactly, verification at every checkpoint the
plan specifies, and a stop — not a guess — at the first blocker or unclear
instruction.
Dispatch prompts
subagent-prompts.md carries condensed templates for
the implementer, spec reviewer, and code-quality reviewer, including the
status protocol.
Boundaries
- brainstorming owns the step before this one — if what to build isn't
agreed yet, no plan contract can fix that.
- keel / convoy own governed work: multi-PR series, dependency DAGs,
Definition-of-Ready gates, deterministic quality gates. The moment the
work wants those, hand it off — this skill is deliberately lighter.
- test-driven-development alone covers a single-loop change; a plan
document for a one-test fix is ceremony.
- context-handoff owns briefs that cross a boundary the harness will not
bridge — a fresh session, a human, a ticket. What an in-session subagent is
told is this skill's, in
subagent-prompts.md: the two skills do not overlap,
and the operational rules a spawned agent needs belong with the template it
inherits.
- Harness plan mode complements this skill: its approved plan is a valid
input; the contract above is what makes the artifact executable cold.
1---2name: planned-execution3description: Turn an agreed design or spec into a complete implementation plan and execute it task by task with fresh subagents and two-stage review — the midweight lane between direct implementation and a governed PR series. Use when a feature needs a multi-step plan with review checkpoints but not series machinery: 'write the implementation plan for this spec', 'execute this plan task by task', 'plan then build this', 'run docs/plans/<file>', or when work has outgrown a single TDD loop but doesn't warrant keel or convoy. The plan contract is firm: bite-sized steps with exact paths, complete code, exact commands with expected output, and no placeholders — a zero-context engineer could execute it cold. The loop is firm too: per task, a fresh implementer subagent, then spec-compliance review, then code-quality review, re-reviewing after each fix. Not for deciding what to build (brainstorming comes first), not for governed multi-PR series with gates and dependency DAGs (keel and convoy own that), and not for small single-lo4---56# Planned Execution78The midweight lane: a spec becomes a plan an engineer with zero context could9execute cold, and the plan becomes working software through a loop of fresh10implementer subagents and two-stage review. Below this lane, implement11directly with test-driven-development; above it, a governed series (keel,12convoy) owns the work.1314This is a **rigid** skill: the plan contract and the review-loop order are15bright lines, because the failure mode of plan-then-execute work is16self-granted shortcuts — placeholder steps, skipped re-reviews, "close17enough" spec compliance.1819## The plan contract2021Write the plan assuming a skilled engineer who knows nothing about this22codebase or problem domain. Save it where the project keeps plans (user23preference wins; a dated file under the repo's plans convention is a sensible24default).25261. **Map the file structure first.** Which files are created or modified and27 what each is responsible for — decomposition gets locked in here. One28 clear responsibility per file; follow existing codebase patterns.292. **Bite-sized steps, one action each** (2–5 minutes): write the failing30 test — run it and watch it fail — write the minimal implementation — run31 to green — commit. The task granularity of test-driven-development,32 written down.333. **Exact everything.** Exact file paths (`src/path/file.py:123-145` for34 modifications), complete code in every code step, exact commands with35 their expected output.364. **No placeholders.** These are plan failures, not shorthand: "TBD",37 "implement later", "add appropriate error handling", "write tests for the38 above" without the test code, "similar to Task N" instead of repeating39 the code, references to types or functions no task defines.405. **Header**: goal in one sentence, architecture in two or three,41 tech stack, and the execution mode (this skill's loop, or inline).426. **Self-review before execution**: every spec requirement maps to a task;43 no placeholder patterns survive; names and signatures used in later tasks44 match their definitions in earlier tasks; every config field, limit, or45 flag the plan introduces is consumed by a task, not merely declared. Fix46 inline and move on.4748## The execution loop4950Read the plan once, extract every task with its full text and context, and51track them (one tracked item per task). Then, per task:52531. **Dispatch a fresh implementer subagent** with the complete task text and54 scene-setting context — where this task fits, what came before. Never55 make a subagent read the plan file; the controller curates exactly what56 it needs. Answer its questions before it starts, not after it guesses.572. The implementer implements, tests, commits, and self-reviews, then58 reports a status:59 - **DONE** → proceed to review.60 - **DONE_WITH_CONCERNS** → read the concerns; correctness or scope61 concerns get addressed before review, observations get noted.62 - **NEEDS_CONTEXT** → provide the missing context, re-dispatch.63 - **BLOCKED** → change something before re-dispatching: more context, a64 more capable model, a smaller task split — or escalate to the user if65 the plan itself is wrong. Re-dispatching unchanged is not a strategy.663. **Spec-compliance review** by a fresh subagent: does the code match the67 task's requirements — nothing missing, nothing extra? Issues go back to68 the implementer, then re-review. "Close enough" is a finding, not a pass.694. **Code-quality review** by a fresh subagent, only after spec compliance70 passes: is it well built? Same fix-and-re-review loop.715. Mark the task complete; next task. Don't pause to ask "should I72 continue?" between tasks — the user asked for the plan to be executed.73 Stop only for BLOCKED-beyond-recovery, genuine ambiguity, or completion.7475After the last task: one final review subagent over the whole implementation76against the whole plan — including an **integration trace**: follow every77config field, limit, flag, or option the plan introduced (task fields,78scenario fields, CLI options) to a consumer, confirming each is actually79read end-to-end, not merely declared. Plan-fidelity review is blind here by80construction — a declared-but-unconsumed limit passes both code-matches-plan81and code-is-well-built while doing nothing, surfacing only at runtime. Then82hand the completion claim to83verification-before-completion — its evidence rules govern the "done".8485## Authoring and dispatch notes8687**Environment hazards that bite a delegated step** — format-on-save hooks88rewriting the bytes you just wrote, an isolated worktree breaking `../` sibling89paths, per-phase commits under a stashing pre-commit, and a backgrounded gate90that ends a subagent's turn for good: [`references/dispatch-hazards.md`](references/dispatch-hazards.md).9192**Task granularity vs dispatch economics.** "Bite-sized" means one clear action93per step, not one subagent per step. When several small steps form one94tightly-coupled responsibility, batching them into a single coherent *unit* —95still running the full implementer + two-stage review loop — is a valid reading,96and often the right one: a dozen two-line steps don't each need three subagents.97Batch by responsibility, never to skip a review.9899## Model selection per role100101Mechanical implementation with a complete spec → the cheapest capable model;102multi-file integration → a standard model; design judgment and review → the103most capable available. The sibling choosing-models skill owns this call when104present; these heuristics are the standalone-install fallback.105106## Without subagents107108In a context without subagent support, the same plan executes inline:109tracked tasks, steps followed exactly, verification at every checkpoint the110plan specifies, and a stop — not a guess — at the first blocker or unclear111instruction.112113## Dispatch prompts114115[subagent-prompts.md](subagent-prompts.md) carries condensed templates for116the implementer, spec reviewer, and code-quality reviewer, including the117status protocol.118119## Boundaries120121- **brainstorming** owns the step before this one — if what to build isn't122 agreed yet, no plan contract can fix that.123- **keel / convoy** own governed work: multi-PR series, dependency DAGs,124 Definition-of-Ready gates, deterministic quality gates. The moment the125 work wants those, hand it off — this skill is deliberately lighter.126- **test-driven-development** alone covers a single-loop change; a plan127 document for a one-test fix is ceremony.128- **context-handoff** owns briefs that cross a boundary the harness will not129 bridge — a fresh session, a human, a ticket. What an *in-session* subagent is130 told is this skill's, in `subagent-prompts.md`: the two skills do not overlap,131 and the operational rules a spawned agent needs belong with the template it132 inherits.133- Harness plan mode complements this skill: its approved plan is a valid134 input; the contract above is what makes the artifact executable cold.