Write the spec before touching the code

You want Claude to code the right thing on the first pass instead of iterating 5 times. Spec-First Development to set the exact frame before launching Claude, RPI Pattern to enforce the Research → Plan phase before implementation, RPI Commands to install the /rpi/research + /rpi/plan + /rpi/implement trio in .claude/commands/ with one clone.

Why

The agent codes fast. And it codes garbage if you've decided nothing.

Classic scenario: you prompt "add a favorites system", the agent runs for 30 minutes, comes back with 12 files modified, a Supabase table, a custom hook, passing tests. Except the data model doesn't match what exists, the UX breaks onboarding, and you're deciding after the fact. You saved an hour, you'll lose six gluing it back together.

This kit installs the opposite discipline: nothing gets coded until the spec is written. You split Research → Plan → Implement, each phase forks a dedicated sub-agent with fresh context. The spec becomes the artifact you review, not the code. You decide on text, execute on code. That inversion cuts rollbacks by 3x.

Fast code you throw away costs more than slow spec you follow.

When

Framing phase before any non-trivial feature, for a dev/PM/tech-lead who's already eaten a vibe-code-rollback and won't do it again.

✅ You know it's your kit when

❌ Not for this kit

Common confusion with Reach Claude Code power-user level: mastering = tooling the runtime. Spec-first = enforcing a step before the runtime.

How

Three phases, three fresh contexts, and a gate in the middle: you. The Constitution feeds each one, but it is the reviewed spec that separates deciding from executing.

The spec's gatekeeper: out of scope. A spec that does not say what you are not building is not finished. As long as that answer is missing, you are still brainstorming: go back there instead of launching Plan. And the scaffold (folder tree, dependencies, commands) is only the first task of the plan, never a prerequisite: no line of code before it. The full order is in Order of an AI project: no scaffold without a spec.

Mental loop: read before writing, write the spec before the code, review the spec before the implementation.

Tools included

Related concepts

Related kits

Mentioned in the journal

View on Coeurdar