Most broken AI code comes from prompts like “make me a todo app”. The model fills every gap with a guess, and you spend the session correcting guesses instead of building.
The one-paragraph contract
Treat your first prompt as a contract. Before any code, it should state:
- What you are building, in one sentence.
- Stack — framework, language, versions if they matter.
- Constraints — no external APIs, mobile-first, keep bundle small.
- Definition of done — two or three checkable criteria.
- A pause clause — ask the model to list assumptions before coding.
That last point is the trick. Forcing the model to surface its assumptions turns silent guesses into a checklist you can correct in seconds.
Why it works
Every missing detail becomes a branch the model picks for you. A spec collapses those branches before they exist. You are not writing documentation — you are removing the space where bad decisions grow.
Common failure
Writing the spec after the first generation, as corrections. That is the expensive order. Corrections fight momentum; specs prevent it.