Plan-first workflow for any non-trivial coding task in any repo or language — new feature, change request, refactor, migration, integration or multi-file bug fix. Understands the requirement, reads th
A repeatable path from "here's a requirement" to "here's working, verified, documented
code". Works in any language, framework, repo size and coding agent (Claude Code, Codex,
Cursor, …). Follow the phases in order. The plan in Phase 4 is the only approval gate;
after it, execute without asking again — re-asking after approval is the most common way
this workflow wastes the user's time.
Skip this workflow for a typo, a one-line/obvious fix, a single-constant change or a
pure question — just do it.
Scale it to the work. The phases are a checklist, not a ceremony:
| Size | Looks like | How much of the workflow |
|---|---|---|
| Small | 2-3 files, one layer, no open decisions | Phases 1-4 in one short message (restate + plan), then execute; verification still mandatory |
| Medium | several files/layers, a decision or two | Full workflow |
| Large | many layers, schema changes, > 5 natural tasks | Propose splitting into separate features first; plan only the first one |
Plan-only mode. If the user asks for a plan, estimate or breakdown ("just plan it",
"don't code yet"), stop after Phase 4 and say what approval would kick off.
Without agent extras. Subagents, task lists and question UIs are accelerators, not
requirements. Where they're missing, do the same steps sequentially and ask questions as a
plain numbered list.
The repo always wins. Wherever this skill and the project's own instructions
(CLAUDE.md, AGENTS.md, CONTRIBUTING.md, rules files, a team playbook) disagree, follow
the project. This skill gives the shape; the project gives the specifics.
---
Any input works: a plain-language description of a task or feature ("add CSV export to
the reports page"), a few bullet points, a pasted ticket/spec/user story, or a link. A
ticket ID, issue number or formal spec is never required — do not ask for one or wait
on one. If a ticket reference is given, use it (fetch it when a tool allows, use it in the
branch name); if not, work from the description and fill gaps through Phase 3 questions.
Restate the requirement in a few lines:
infrastructure, docs, public interfaces other teams depend on.
Never plan from how the code "probably" works. Read what applies:
| Need | Look for |
|---|---|
| Agent / contributor instructions | CLAUDE.md, AGENTS.md, .cursorrules, .github/copilot-instructions.md, CONTRIBUTING.md, .claude/rules/, docs/adr/ |
| Architecture and flows | README.md, docs/, ARCHITECTURE.md, diagrams |
| How to build, test, lint, run | package.json scripts, Makefile, justfile, pyproject.toml, Cargo.toml, go.mod, Taskfile, CI config (.github/workflows/, Jenkinsfile, .gitlab-ci.yml) |
| Conventions in practice | 2-3 neighbouring files of the kind you will write, and their tests |
| History of the area | git log --oneline -- <path>, recent PRs, any memory/notes folder the project keeps |
| The code itself | modules you will change, their callers, and their tests |
Note the project's test, lint, typecheck and run commands — Phase 6 and 7 need them.
If none are documented, infer from CI config and say so.
Research in parallel when you can. If your environment supports subagents, split the
recall into independent questions ("how does auth work here", "where are jobs enqueued",
"what does library X actually support") and launch one read-only agent per question in a
single message. Keep only their conclusions (file:line references, facts, open questions),
not file dumps. If subagents aren't available, do the same reads yourself, one question at
a time.
Before any plan, post:
existing rule or convention.
Ask only about decisions that are genuinely the user's (product behaviour, trade-offs,
scope). Put the recommended option first. Pick conventional defaults yourself and state
them. Wait for answers before planning.
When a decision needs evidence (compare two libraries, probe what an API really returns,
weigh two designs), investigate each option separately — in parallel subagents if
available — and recommend one, rather than presenting a survey.
Present the plan in this shape:
## Plan: <feature>
Approach: <2-4 sentences>
Changes:
- <area/layer>: <files / modules / endpoints / components>
- <area/layer>: …
- schema/data: <migration name + what it adds> (or "none")
- config/env: <new settings> (or "none")
- docs: <README / docs / instructions files / diagrams to update>
Tests: <unit / integration / e2e / manual>
Risks: <breaking changes, data, performance, security>
Tasks (3-5):
1. <task> — verify by <…> — owner: main | subagent — depends on: none | N
2. …
Waves (tasks with no unmet dependency run together):
Wave 0 (main, inline): shared contract — types/schemas, constants, migration, interfaces
Wave 1 (parallel): tasks 2, 3, 4 — files owned: <task → files, disjoint>
Wave 2 (parallel): task 5 + review
output or they share a file.
feature/<slug> or the project's naming) from the current base.With no ticket ID, derive the slug from the description (feature/csv-export-reports);
if the project's naming demands an ID, name it without one and mention it, don't block.
Creating a branch needs no approval; working directly on a shared/protected branch does.
After the user approves, do not ask again unless the plan must change materially.
When reality disagrees with the plan (an API doesn't support what was assumed, a task
turns out twice as big): small deviations — adjust and mention it in the next update.
Material ones (scope, behaviour the user sees, data, a new dependency) — stop, explain what
you found, propose the revised plan, and get approval for the change only.
Resuming. If a session is interrupted or picked up later, re-read the plan and the
branch's diff, post which tasks are done, and continue from the first unfinished one —
don't restart from Phase 1.
Update, as part of the same change:
CLAUDE.md, AGENTS.md, rules) when aconvention, command or gotcha changed.
README / docs/ / API reference for new behaviour, endpoints, settings, env vars.hand-over — never skip silently).
A doc or rule the change contradicts is fixed in the same change.
schemas, interfaces, shared constants, the migration. Nothing fans out until this exists.
message so they run concurrently; each brief names the files it owns (disjoint across the
wave) and the files it must not touch. Without subagents: do the wave's tasks one by one.
While agents run, the main session does only non-overlapping work (docs, test plans).
failed task goes back to the same agent with the specifics.
all touched files) once the wave is joined, then start the next.
Each task:
comment density and idioms. No mock data, no TODO stubs passed off as done, no secrets in
code or logs, no magic values the project would put in a constant or config.
covering the changed modules. Never the whole suite per task; that runs once in Phase 7.
Lint/format/typecheck the files you touched (explicit paths — don't reformat untouched
files).
✅ Task N/M done — <title>
Changed: <files>
Verified: <commands + result>
Next: <task N+1>
A failing check blocks the next wave until fixed. A failure you believe is pre-existing
must be proven pre-existing (run it on a clean checkout of the base, e.g. agit worktree) and reported — never just ignored.
create/edit and files not to touch, the contract it codes against (signatures, types,
response shapes), the project conventions that apply, the test command, and the report
shape you want (files changed, tests run, anything unfinished).
modules/components/tests; a reviewer for the final diff.
files. If two units must touch one file, run them sequentially. Use an isolated worktree
for a risky or large parallel unit.
B if it's still running). For long multi-agent work keep one scratch notes file of shared
decisions and file ownership.
Keep risky operations (migrations, deploys, anything touching real data or external
systems) in the main session.
costs more than it saves.
Run independent checks concurrently where possible:
surface.
the page, run the CLI) — tests passing is not the same as the feature working.
bugs, security, edge cases, leftover debug code.
git status / git diff --stat — only intended files changed; no stray scratch files,no unrelated formatting churn.
## Done: <feature> (branch <name>, uncommitted)
What changed: <grouped by area>
Verified: <suites, lint, build, live checks — with results>
Known limits / follow-ups: <…>
### Test it manually
1. <page / endpoint / command> → <action> → expect <result>
2. …
Negative cases:
- <bad input / unauthorized / edge case> → expect <error / refusal>
If the project keeps session notes or a decisions log, add an entry for decisions and
gotchas worth keeping.
not that ask; an earlier approval doesn't carry over to later changes.
destructive migrations or force-pushes to make something pass. Fix forward, back up
before risky steps, experiment on a scratch copy. If loss looks unavoidable, stop and ask.
systems, messages to external services) without explicit confirmation.
main, master, develop, releasebranches) unless the project says to.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.