your coding agent needs a spec, not another prompt.
your coding agent needs a spec, not another prompt.
AI can write hundreds of lines of code in minutes.
But does it know what you're actually trying to build?
Not always.
Without clear instructions, your coding agent makes assumptions. It might choose the wrong database, ignore a requirement, or implement a feature that conflicts with an earlier decision.
You correct it. It tries again. Something else breaks.
The problem isn't necessarily the code. It's the missing context.
1. vibe coding vs. spec-driven development
Vibe coding: Prompt → generate code → fix mistakes → repeat.
Spec-driven development: Define what you want → document decisions → generate code → verify the result.
Vibe coding works well for quick experiments. Spec-driven development helps when building software that needs to evolve without becoming a mess.
2. a spec is your project's memory
AI coding agents don't automatically retain every decision across sessions.
A specification stores the important context in files that survive beyond a conversation.
Instead of repeatedly explaining your requirements, document them once and keep them updated.
The goal isn't to tell the agent every line of code to write. It's to tell it what matters and why.
3. what goes into a spec?
Three things:
- →Constitution: Why the project exists, its tech stack, and its engineering rules.
- →Feature spec: What a specific feature must do, its requirements, and its constraints.
- →Roadmap: What to build next and in what order.
The constitution guides the whole project. The feature spec guides one piece of work. The roadmap keeps development organized.
4. the workflow
Repeat these three steps for every feature.
Plan → Implement → Verify
- 1.Plan: Discuss requirements with the agent. Resolve important decisions. Write and review the feature spec.
- 2.Implement: Let the agent build from the approved spec. Work in small chunks and commit changes.
- 3.Verify: Run tests, inspect the result, and compare the implementation against the requirements.
If the implementation is wrong because the spec was unclear, fix both. Otherwise, the same mistake can happen again.
5. what about existing projects?
You don't need to start from scratch.
Ask the agent to inspect your existing codebase, README, and task lists. Use that information to draft the project's constitution and roadmap.
Review the result. The agent can discover what exists, but it may not know why every decision was made.
6. automate repetitive work
Once the workflow is clear, use agent skills to automate repeatable tasks, such as creating feature specs, running tests, or updating changelogs.
You don't need a special framework to start. Markdown files and Git are enough.
the takeaway
The spec is the contract. The agent writes the code. Tests and human review verify the result.
AI makes implementation faster. It doesn't eliminate the need to make good engineering decisions.
For a tiny experiment, a prompt might be enough.
For a serious project, spend a few minutes defining what you want before letting an agent spend 30 minutes building it.
Write down what matters. Keep it updated. Build in small steps.
The best code starts with a clear spec.