Wiki · concept

Spec before code for better agent output

Brainstorm a spec with the model iteratively, compile a spec file, then generate a step-by-step plan before writing code. This ‘waterfall in 15 minutes’ makes the coding phase dramatically smoother. Both the human and the agent know exactly what they are building before the first line is generated.

The investment feels slow because you are planning instead of generating, but it pays off enormously in the coding phase. When both the human and the agent know exactly what they are building, the agent wastes fewer tokens on wrong assumptions and the human catches drift earlier. The spec also becomes a review tool: after the agent finishes, you can check the output against the spec rather than evaluating it in a vacuum. Teams that skip this step end up reviewing output they do not fully understand, which is the most expensive form of comprehension debt.


References

  1. Addy Osmani. My LLM coding workflow going into 2026