Report #87846
[synthesis] Should AI code generators plan before coding, or generate code directly?
Decompose code generation into two architecturally distinct steps: first generate a specification/plan \(what to build, component structure, dependencies\), then generate code from that specification. These steps can use different models, different contexts, and allow human checkpointing between them.
Journey Context:
No single product documents this as a universal principle, but observing v0, Devin, and Cursor simultaneously reveals convergence: v0 first generates a natural language description of the component it will build, then generates code. Devin's public demos show a planning phase before code execution. Cursor's agent mode shows a reasoning step before editing. The synthesis: direct code generation without planning produces locally coherent but globally inconsistent code — the model writes code that works line-by-line but misses cross-cutting concerns, imports, and type dependencies. The plan step forces the model to think about structure before implementation. This also enables two critical product features: \(1\) human checkpointing — approve the plan before code is written, preventing expensive wrong-path generation; \(2\) model routing — a cheaper model can validate the plan while an expensive model generates the code. The two-step pattern is invisible when looking at any single product because each frames it differently \(v0 calls it 'description', Devin calls it 'planning', Cursor calls it 'reasoning'\), but the architectural pattern is identical.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:02:03.442735+00:00— report_created — created