Implementation Planning skill for Codex

A plan grounded in real files, approved before coding. Codex reads the relevant code first, then writes a plan that cites real files: the goal with a done-when test, non-goals, blocking questions asked in one batch, small steps that each leave the system working and carry their own check, plus risks, rollout and rollback. It waits for approval, tracks progress in the plan, and stops to update it when an assumption turns out wrong.

  • Engineering Workflow
  • $implementation-planning
  • 176 lines
  • 2 files
  • ~1,850 tokens
  • MIT
  • Updated

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- implementation-planning

Installs to ~/.agents/skills/implementation-planning/ for every project on this machine.

104-line POSIX script. No sudo, no telemetry. Read install.sh

Use it in Codex

Start a prompt with $implementation-planning, or pick it from /skills. You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.

What Codex reads before loading it

Turns a feature request, ticket or bug report into a written implementation plan before any code changes - restated goal and non-goals, open questions, the code it touches with file paths, a sequence of small independently verifiable steps, risks with mitigations, rollout and rollback, and a test plan - then stops for approval and tracks progress against the plan. Use when asked to plan a feature or change, "make a plan first", estimate scope, break down a ticket, decide an approach before coding, or when a request is large, ambiguous, risky or touches data, auth, payments or public APIs.

Use it when

  • A request is large, ambiguous or touches several modules
  • The change involves data migrations, auth, payments or public APIs
  • You want to agree on an approach before any code is written
  • Work will span several sessions or PRs and needs a tracked plan

Use something else when

How to check the result

Each step in the plan has a check that can pass or fail, every blocking question is answered or agreed as an assumption, and the done-when criteria are demonstrated at the end.

The mistake it prevents

Writing the plan before reading the code, producing generic steps like update the service layer that collapse on the first real file.

~/.agents/skills/implementation-planning/SKILL.md

--- name: implementation-planning description: Turns a feature request, ticket or bug report into a written implementation plan before any code changes - restated goal and non-goals, open… license: MIT ---

A plan is good when someone else could execute it without asking what you meant, every step leaves the system working and has its own check, the risky parts are named with a mitigation, and the user approved the approach before code was written. The plan is grounded in the actual code: it cites files and functions, not hypothetical layers.

When to plan (and when not to)

RequestPlan?
One-file fix with an obvious cause and a testNo; just do it and report
Touches more than ~3 files, or several modulesShort plan (goal, steps, checks)
Ambiguous requirements, or more than one reasonable approachPlan with options and a recommendation; ask before building
Data migrations, auth, payments, public API, infraFull plan with risks, rollout and rollback; explicit approval
Spans days or several PRsFull plan, saved to a file and updated as you go

If the user said “just do it”, keep the plan to a few lines in chat, but still name any destructive or irreversible step and ask before it.

Workflow

- [ ] 1. Restate the goal, success criteria and non-goals in your own words
- [ ] 2. Read AGENTS.md and the code involved; record file paths and current behaviour
- [ ] 3. List open questions; ask the ones that change the approach
- [ ] 4. Choose an approach (compare 2-3 only if they differ materially)
- [ ] 5. Break into small steps, each with a verification
- [ ] 6. Identify risks, rollout and rollback
- [ ] 7. Write the plan (template below) and ask for approval
- [ ] 8. Execute step by step; update the plan when reality differs

Step 1: restate

Write the goal as an observable outcome: “Admins can export invoices for a date range as CSV from the billing page; exports over 50k rows are emailed.” Then non-goals: “No PDF export; no changes to invoice generation.” Non-goals prevent the scope creep that wrecks estimates.

Step 2: ground it in the code

Read before planning. Find the entry points, the data model, similar existing features to copy, and the tests that cover the area:

rg -n "invoice" --type py -l | head -30
rg -n "def export_|class .*Export" -t py
git log --oneline -10 -- src/billing/          # recent changes and their authors

Record current behaviour with file:line references. A plan that says “update the service layer” without naming the file has not been grounded.

Step 3: questions

Separate questions into:

  • Blocking: answers change the design (e.g. “Must exports respect row-level permissions per region?”). Ask before going further.
  • Assumable: pick a sensible default, write it in the plan as an assumption, and let the user correct it.

Ask blocking questions in one batch, not one at a time.

Step 4: approach

Default to the approach that matches existing patterns in the codebase. Present alternatives only when they differ in cost, risk or capability:

| Option | Pros | Cons | Effort |
|---|---|---|---|
| A. Sync CSV stream from API (recommended) | Reuses streaming helper in api/streaming.py; no new infra | Long requests for big ranges | S |
| B. Background job + email link | Handles any size | Needs job queue setup, storage, expiry | M |

Step 5: steps that can be verified

Rules for steps:

  • Each step is small enough to review in one sitting and ends with the system working.
  • Each step has a concrete check: a test name, a command, an observable behaviour.
  • Order steps to retire risk early: spike the unknown part first, then build around it.
  • Prefer additive steps (new code path behind a flag, new column nullable) before switching behaviour, then cleanup steps last.
  • Mark which steps are separate commits or PRs.

Step 6: risks, rollout, rollback

For each risk: likelihood, impact, mitigation, and how you will detect it. Typical sources: data migrations on large tables, concurrency, permissions, performance on real volumes, third-party limits, backward compatibility of APIs and stored data.

Plan template

Save as docs/plans/<date>-<slug>.md or PLAN.md if the work spans sessions and the user agrees; otherwise post it in chat.

# Plan: Invoice CSV export

## Goal
Admins export invoices for a date range as CSV from Billing > Invoices.
**Done when:** export of 10k invoices downloads in < 10 s and matches the on-screen totals.
**Non-goals:** PDF export; changes to invoice numbering.

## Current state
- Invoices listed by `InvoiceListView` (src/billing/views.py:120), query in `InvoiceRepo.search` (src/billing/repo.py:45)
- Streaming helper exists: `stream_csv` (src/api/streaming.py:10), used by orders export

## Assumptions and open questions
- Assumed: admins only (existing `billing.view_all` permission)
- **Blocking:** should amounts be in invoice currency or converted to EUR?

## Approach
Option A (sync streaming); B considered and rejected for now (see table).

## Steps
1. Add `InvoiceRepo.iter_for_export(range)` using server-side cursor. Check: unit test with 3 fixtures; `EXPLAIN` uses `invoices_created_at_idx`.
2. Add `GET /billing/invoices/export.csv` behind flag `billing-invoice-export`. Check: API test for headers, auth (403 for non-admin), CSV columns.
3. Add Export button in UI behind same flag. Check: component test; manual check in dev.
4. Load test with 50k rows in staging. Check: < 10 s, memory flat.
5. Enable flag for internal admins, then all. Check: error rate, request duration.
6. Remove flag after one release. Check: rg finds no flag references.

## Risks
| Risk | Impact | Mitigation | Detection |
|---|---|---|---|
| Long query locks or slows primary | High | Read replica; statement timeout 30 s | DB dashboard during step 4 |
| Exposes invoices across tenants | Critical | Reuse tenant-scoped repo method; explicit test | Test in step 2 |

## Rollout and rollback
Flag-gated; rollback = flag off. No schema changes.

## Test plan
Unit (repo), API (auth, format), component (button), load (50k rows), manual check of totals.

## Progress
- [ ] Step 1 ...

Executing the plan

  • Get approval before step 1. Approval of the plan is not approval for destructive actions inside it; confirm those again when you reach them (migrations on shared data, deploys, deleting data, sending messages).
  • After each step, run its check, tick it in the plan, and note surprises.
  • When reality contradicts the plan (an assumption was wrong, a step is twice as big), stop, update the plan, and tell the user what changed before continuing. Silent deviation is how plans lose trust.
  • For long tasks, keep the plan file as the source of truth so work survives a context reset or handoff.

Gotchas

  • Plans written before reading the code are guesses with headings. Ground every step in real files.
  • Ten-step plans where step 9 is “integrate everything” hide the risk at the end. Integrate early with a thin end-to-end slice.
  • Estimates without the riskiest unknown spiked are optimistic by default; say so.
  • Do not pad plans with generic steps (“write clean code”, “add tests”). Name which tests.
  • Overlong plans go unread. Keep steps to one or two lines each; detail goes into the PRs.

Verification

  • Every step has a check that can pass or fail.
  • Every blocking question is answered or explicitly assumed with the user’s agreement.
  • At the end, the “Done when” criteria are demonstrated, and the plan’s progress section matches what was actually done.

What the zip contains

SKILL.md plus the interface file below. Nothing runs on install.

agents/openai.yamlgenerated from this page

Gives the Codex app a display name, a one-line description and a starter prompt for this skill.

interface:
  display_name: "Implementation Planning"
  short_description: "A plan grounded in real files, approved before coding"
  default_prompt: "$implementation-planning Before writing any code, make a plan for adding invoice CSV export"

About this skill

Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.

esc