This is what I run for most non-trivial features. Not the fastest path to working code — the path that produces code I'm comfortable shipping. The extra steps (planning, review, explicit test generation) catch the bugs that are hardest to find in code review.
Not sure this is the right workflow for your task? Use the finder to get a recommendation in a few clicks.
Workflow Recipe
Copy-pasteable flows and guided workflow finder
Pick a workflow
Prompt
I need to build [feature]. Here’s the spec: inputs, outputs, edge cases, constraints. Produce a plan before writing any code.
Steps
Spec
Write a developer spec with inputs, outputs, edge cases, and constraints.
Plan
Ask the model to produce a plan — files to create/modify, key decisions. Review before coding.
Code
Implement against the plan. One feature, one PR. Pull the model back if it goes out of scope.
Review
Ask the model to review its own code: "What edge cases might this miss? What would break this?"
Tests
Generate tests from the review’s edge cases: "Write tests for the edge cases you identified."
PR description
Generate the PR description from the spec and the diff. Full context produces clear descriptions.
Tools
Guardrails
- One feature, one PR — keep scope tight
- Review the plan before writing code
- Don’t let the model touch files outside scope
- Ask before refactoring adjacent code
Expected output
Working PR with passing CI, clear description, and tests covering the identified edge cases.
Paste into CLAUDE.md, .cursor/rules/, or your workflow docs
What are you trying to do?
What are you trying to do?
The full flow
Step 1: Spec. Write a clear description of what you're building. Not a user story — a developer spec. Inputs, outputs, edge cases, constraints. The more specific, the better the plan.
A weak spec: "Add a search feature to the products page."
A useful spec: "Add a search input to the products page that filters the visible product list client-side. The input should debounce at 300ms. Filtering should match against product name and SKU. Empty query shows all products. No server requests — filter the already-loaded list."
The difference isn't length — it's specificity. The second spec tells the model what data is available, what the performance expectation is, and what's out of scope (server requests). That's what prevents a wrong plan.
Step 2: Plan. Ask the model to produce a plan before writing any code:
Given this spec, what files will you create or modify, and what are the key implementation decisions?
Review the plan. This is where you catch misunderstandings before they become code. If the plan mentions files you didn't expect, or skips something you care about, correct it here.
Step 3: Code. Implement against the plan. Keep the scope tight — one feature, one PR. If the model starts touching things outside the scope, pull it back:
Implement step 1 from the plan only. Don't touch anything outside the files you listed.
Step 4: Review. Ask the model to review its own code:
Review this implementation. What edge cases might it miss? What inputs would cause it to fail?
This sounds redundant but it works — the model often catches things in review mode that it missed in generation mode. Different prompt, different output.
Step 5: Tests. Generate tests explicitly, not as an afterthought:
Write tests for the edge cases you identified in the review.
This produces better tests than "add tests to this code" because it's targeting the specific failure modes, not just exercising the happy path.
Step 6: PR description. Ask the model to write the PR description from the spec and the diff. It produces better descriptions than most humans write because it has the full context.
Why the plan step matters
Most common failure mode: skipping the plan and going straight to code. The model produces something that works for the happy path but misses the constraints you had in mind. Then you're correcting code instead of reviewing a plan — much slower.
The plan step also surfaces ambiguities in your spec. If the model asks a clarifying question during planning, that's a question you'd have had to answer anyway — better to answer it before code is written.
One way to make this explicit: before asking for the plan, add "If anything in the spec is unclear or leaves room for multiple interpretations, ask me before planning." Turns it into a two-pass process (clarify, then plan) and consistently produces tighter output.
Model strategy
Different steps benefit from different models. Planning and review are where reasoning models earn their cost. Code generation and test writing? Fast models are often sufficient.
Model Mixer
Assign models to steps and compare workflow cost assumptions
Pick a task
Review a medium-sized file and get structured feedback on issues and improvements.
~4k in / ~1.5k outHow often?
600 runs / 30-day month · 4,000 input + 1,500 output tokens per run
GPT-6 Luna is 99% cheaper than Claude Fable 5 at these token assumptions — $0.690 vs $69.00/mo
A fast model catches obvious issues. A stronger model finds subtle logic bugs and gives more actionable feedback — fewer missed problems means less rework later.
Full registry checked 2026-10-05; Mistral checked separately 2026-10-07. Monthly estimates hold the current rate constant. Mistral · Anthropic · OpenAI · Google · DeepSeek · Moonshot AI · Z.ai · Cursor
Pricing assumptions and capacity limits
Standard uncached text-token estimates. Excludes cache writes/reads, tool fees, taxes, and platform-specific charges. Reasoning tokens count as output. Mistral Large 4 checked separately on 2026-10-07: public preview, $1.36/$4.18 standard input/output; $0.68/$2.09 launch rates. The two-week offer is interpreted as October 6–19 inclusive. Other models retain the full-registry verification date above. Claude Opus 5.5 is $4/$20 and Sonnet 5.5 is $2/$10. Opus 5 and Opus 4.8 remain available at $5/$25 and appear only in historical examples. Opus 5.5 fast mode is $8/$40. GPT-6.1 Sol is $2/$10 and GPT-6 Luna is $0.10/$0.50. GPT-5.6 Luna, Terra, and Sol remain $0.20/$1.20, $2/$12, and $4/$20; OpenAI calls the Sol rate promotional through at least November 21, 2026. GLM-5.3 uses Z.ai API list rates ($1.40/$4.40). GLM-5.3-Flash ($0.15/$0.50) is not in the calculators. Gemini 3.8 Flash is $0.75/$3.75 through December 31, 2026, then $1.50/$7.50. Google API rates are used; Cursor currently lists a different output rate. DeepSeek-V4.1-Flash estimates use peak uncached rates ($0.30/$1.20). Off-peak rates are half. Retired V4-Flash rates are historical only. OpenAI requests above 272K input tokens use 2× input and 1.5× output rates. Gemini 3.1 Pro applies those multipliers above 200K. Context windows describe provider API capacity, not a universal Cursor default. Availability and limits vary by platform. These are cost estimates, not a capacity check. Verify context and output limits for large requests.
1. Scaffold
Component structure, boilerplate, file setup
2. Business logic
Core feature logic, edge cases, state
3. Code review
Architecture, patterns, security concerns
4. Tests
Unit tests, edge case coverage
Estimated cost per completed workflow
Each attempt repeats the full token budget. Model choice does not guarantee first-attempt success. Adjust both assumptions to reflect your experience.
Provider API estimates. Full registry checked 2026-10-05; Mistral checked separately 2026-10-07. Mistral’s 50% launch offer is interpreted as October 6–19 inclusive. Excludes subscription allowances, caching, and tool fees.
The full recipe
Workflow Recipe
Copy-pasteable flows and guided workflow finder
Pick a workflow
Prompt
I need to build [feature]. Here’s the spec: inputs, outputs, edge cases, constraints. Produce a plan before writing any code.
Steps
Spec
Write a developer spec with inputs, outputs, edge cases, and constraints.
Plan
Ask the model to produce a plan — files to create/modify, key decisions. Review before coding.
Code
Implement against the plan. One feature, one PR. Pull the model back if it goes out of scope.
Review
Ask the model to review its own code: "What edge cases might this miss? What would break this?"
Tests
Generate tests from the review’s edge cases: "Write tests for the edge cases you identified."
PR description
Generate the PR description from the spec and the diff. Full context produces clear descriptions.
Tools
Guardrails
- One feature, one PR — keep scope tight
- Review the plan before writing code
- Don’t let the model touch files outside scope
- Ask before refactoring adjacent code
Expected output
Working PR with passing CI, clear description, and tests covering the identified edge cases.
Paste into CLAUDE.md, .cursor/rules/, or your workflow docs
What are you trying to do?
What are you trying to do?