ControlFlow Planning
Overview
Create a durable, execution-ready Codex plan. Keep the contract local: the saved artifact defines scope, risks, files, phases, validation, review route, and handoff without depending on VS Code agent mode.
Local Contract
- Read the repository before phase decomposition; keep verified facts separate from assumptions.
- Use references/plan-template.md as the plan contract, not a loose outline.
- Apply references/llm-behavior-guidelines.md for generic assumption, simplicity, scope, and verification discipline.
- Keep Codex portable: ask the user directly when a requirement changes scope, or record a bounded assumption when it does not.
Workflow
- Create a saved plan when the user asks for one or when work is
SMALL, MEDIUM, or LARGE; skip it only for truly TRIVIAL work.
- Save to
plans/<task-slug>-plan.md unless the user names another path.
- Clarify only when the answer changes file scope, user-visible behavior, architecture, or destructive-risk handling.
- Map likely files, tests, commands, dependencies, and change boundaries before phase decomposition.
- Read references/complexity-tiers.md and references/semantic-risk-taxonomy.md; assign one tier and fill all seven risk categories.
- Write the artifact using references/plan-template.md.
- For non-trivial Codex plans (
SMALL, MEDIUM, LARGE), include the five fixed lifecycle sections in this exact order and with these exact headings: ## Progress, ## Discoveries, ## Decision Log, ## Outcomes, ## Idempotence & Recovery. These headings are required by ../../scripts/validate-strict-artifacts.ps1 and must match the template and fixtures exactly.
- Use
ABSTAIN or REPLAN_REQUIRED when confidence is below 0.9 or evidence is insufficient.
- Add research or spike phases before implementation when a
HIGH-impact risk is unresolved.
- Keep phases incremental, testable, and explicit about files, dependencies, quality gates, and failure expectations.
- Route non-trivial plans through strict review:
SMALL -> controlflow-plan-audit; MEDIUM/LARGE -> add controlflow-assumption-verifier; unresolved HIGH risk -> include controlflow-assumption-verifier regardless of size.
- Check references/controlflow-portability.md before handoff.
Spec Capture Handoff
When requirements, acceptance criteria, boundaries, or verification gates are not explicit, use controlflow-spec first. Carry its spec_path, scope, acceptance criteria, constraints, success metrics, and open risks into the plan. If spec capture is unnecessary, state why the request is already clear enough.
Planning-Specific Failure Checks
- Do not plan from chat memory when a spec is required; cite the spec artifact or create one.
- Do not skip semantic risk review because the tier feels low; fill every category.
- Do not decompose phases before reading the repository and mapping likely files/tests.
- Do not mark
READY_FOR_EXECUTION without a strict review route and artifact destination.
- Generic anti-rationalization rules live in references/llm-behavior-guidelines.md.
Mandatory Output Contract
- Prefer structured text over raw JSON.
- Default plan file path:
plans/<task-slug>-plan.md.
- Use the ControlFlow-style header and section order from references/plan-template.md.
- Write
Agent: Planner in the artifact so the document matches the original conceptual role even though the implementation is a Codex skill.
- Record assumptions separately from verified facts.
- For
READY_FOR_EXECUTION plans, include a clear handoff section that points execution to orchestration.
References
references/plan-template.md
references/complexity-tiers.md
references/semantic-risk-taxonomy.md
references/controlflow-portability.md
references/planner-output-contract.md
references/llm-behavior-guidelines.md
1---2name: controlflow-planning3description: Use when a repository task needs a strict ControlFlow-style implementation plan before coding, especially for small, medium, or large scope, cross-file edits, risky migrations, architectural uncertainty, or any work that should produce a saved Markdown plan artifact in plans/.4---5
6# ControlFlow Planning
7
8## Overview
9
10Create a durable, execution-ready Codex plan. Keep the contract local: the saved artifact defines scope, risks, files, phases, validation, review route, and handoff without depending on VS Code agent mode.
11
12## Local Contract
13
14- Read the repository before phase decomposition; keep verified facts separate from assumptions.
15- Use [references/plan-template.md](references/plan-template.md) as the plan contract, not a loose outline.
16- Apply [references/llm-behavior-guidelines.md](references/llm-behavior-guidelines.md) for generic assumption, simplicity, scope, and verification discipline.
17- Keep Codex portable: ask the user directly when a requirement changes scope, or record a bounded assumption when it does not.
18
19## Workflow
20
211. Create a saved plan when the user asks for one or when work is `SMALL`, `MEDIUM`, or `LARGE`; skip it only for truly `TRIVIAL` work.
222. Save to `plans/<task-slug>-plan.md` unless the user names another path.
233. Clarify only when the answer changes file scope, user-visible behavior, architecture, or destructive-risk handling.
244. Map likely files, tests, commands, dependencies, and change boundaries before phase decomposition.
255. Read [references/complexity-tiers.md](references/complexity-tiers.md) and [references/semantic-risk-taxonomy.md](references/semantic-risk-taxonomy.md); assign one tier and fill all seven risk categories.
266. Write the artifact using [references/plan-template.md](references/plan-template.md).
277. For non-trivial Codex plans (`SMALL`, `MEDIUM`, `LARGE`), include the five fixed lifecycle sections in this exact order and with these exact headings: `## Progress`, `## Discoveries`, `## Decision Log`, `## Outcomes`, `## Idempotence & Recovery`. These headings are required by [../../scripts/validate-strict-artifacts.ps1](../../scripts/validate-strict-artifacts.ps1) and must match the template and fixtures exactly.
288. Use `ABSTAIN` or `REPLAN_REQUIRED` when confidence is below `0.9` or evidence is insufficient.
299. Add research or spike phases before implementation when a `HIGH`-impact risk is unresolved.
3010. Keep phases incremental, testable, and explicit about files, dependencies, quality gates, and failure expectations.
3111. Route non-trivial plans through strict review: `SMALL` -> `controlflow-plan-audit`; `MEDIUM`/`LARGE` -> add `controlflow-assumption-verifier`; unresolved `HIGH` risk -> include `controlflow-assumption-verifier` regardless of size.
3212. Check [references/controlflow-portability.md](references/controlflow-portability.md) before handoff.
33
34## Spec Capture Handoff
35
36When requirements, acceptance criteria, boundaries, or verification gates are not explicit, use `controlflow-spec` first. Carry its `spec_path`, scope, acceptance criteria, constraints, success metrics, and open risks into the plan. If spec capture is unnecessary, state why the request is already clear enough.
37
38## Planning-Specific Failure Checks
39
40- Do not plan from chat memory when a spec is required; cite the spec artifact or create one.
41- Do not skip semantic risk review because the tier feels low; fill every category.
42- Do not decompose phases before reading the repository and mapping likely files/tests.
43- Do not mark `READY_FOR_EXECUTION` without a strict review route and artifact destination.
44- Generic anti-rationalization rules live in [references/llm-behavior-guidelines.md](references/llm-behavior-guidelines.md).
45
46## Mandatory Output Contract
47
48- Prefer structured text over raw JSON.
49- Default plan file path: `plans/<task-slug>-plan.md`.
50- Use the ControlFlow-style header and section order from [references/plan-template.md](references/plan-template.md).
51- Write `Agent: Planner` in the artifact so the document matches the original conceptual role even though the implementation is a Codex skill.
52- Record assumptions separately from verified facts.
53- For `READY_FOR_EXECUTION` plans, include a clear handoff section that points execution to orchestration.
54
55## References
56
57- `references/plan-template.md`
58- `references/complexity-tiers.md`
59- `references/semantic-risk-taxonomy.md`
60- `references/controlflow-portability.md`
61- `references/planner-output-contract.md`
62- `references/llm-behavior-guidelines.md`