- spec-first
- AI development
- Claude Code
Spec first: how to build AI products fast without the chaos
Spec-first AI development in practice: what goes into spec/ and CLAUDE.md, how to write acceptance criteria, and how a clear spec lets an MVP ship in a day.

An AI coding agent writes code fast — fast enough that typing speed stops being the bottleneck and clarity takes its place. That is why almost every repository we work in has a spec/ folder and a CLAUDE.md file. Here is what goes into them and why it pays off.
TL;DR: an agent needs a spec the way a new hire does, except it rereads it in every session.
spec/says what we are building and how to check it;CLAUDE.mdsays how to work in this repository. With both in place an MVP can ship in a day; without them a project drowns in rework.
What goes wrong without a spec
Ask an agent to "build a map of petrol stations". It will. It will pick a map library, invent a data model and design a UI — most likely not the one you had in mind.
Then the loop begins: fix this, explain again, revert, explain differently. Each round is cheap, but there are many, and the context blurs. A couple of days later the codebase holds three approaches to one problem and the chat holds hundreds of messages nobody will reread.
What breaks:
- Scope. The agent adds things nobody asked for and skips things everyone thought were obvious.
- Continuity. Every new session starts from zero; the agreements live in an old chat.
- Acceptance. Nobody knows when a task is done, so it never is.
- Teamwork. A second developer, or a second agent, has no idea what was decided and why.
What lives in spec/
spec/ is a handful of short markdown files that sit next to the code and change with it. Typically:
- Overview. Who the product is for, what problem it solves, what is explicitly out of scope for this version.
- Scenarios. What the user does, step by step, in product language rather than architecture.
- Data model. Entities, fields and relationships.
- Acceptance criteria. Verifiable conditions for every scenario.
- Decisions. Short records: "chose X because Y, rejected Z".
For larger efforts we use spec-kit, a set of templates and commands that takes you from a specification to a plan and a task list. For small ones, three or four files are plenty.
What lives in CLAUDE.md
If spec/ answers "what are we building", CLAUDE.md answers "how do we work here". The agent reads it at the start of every session.
- the stack and versions;
- commands to build, test, lint and run;
- code and folder conventions;
- hard rules: files not to touch, dependencies not to add;
- where the specs are and what to read before starting a task.
A good CLAUDE.md is short: nearly every rule in it exists because the agent once did something else. Ten specific lines beat a page of advice.
Acceptance criteria are the heart of the spec
An acceptance criterion is a condition you can check without debate. "A user-friendly form" is not one. "A request can be submitted with no more than three required fields" is.
A few examples of how we turn wishes into testable conditions:
| Wish | Acceptance criterion |
|---|---|
| A simple form | A request submits with no more than three required fields |
| Fast search | Results appear in under a second across 10,000 records |
| Reliable saving | Entered data survives a page reload |
| Works on mobile | Every scenario passes on a 360 px wide screen |
The agent can turn criteria like these into tests, and we can verify them in a one-minute demo. The "is it done or not" argument disappears.
How a spec gets an MVP out in a day
One of our MVPs is a crowdsourced map: people report what is happening at each location and everyone else sees it on the map. We shipped the first version in one day.
The day did not start with code. It started with the spec: scenarios, data model, acceptance criteria and a list of what the first version would leave out. Then the agent worked through the tasks while we checked each result against the criteria rather than gut feeling. When decisions are made up front, every iteration comes down to "done or not done".
The same approach produced gestura, a gesture-recognition tool, in an evening, and a set of HTML5 games for Yandex Games in a week. The speed comes from clarity, not from rushing.
The template we start from
A minimal set for a new project:
spec/overview.md— goal, audience, scope of this version;spec/scenarios.md— user scenarios, step by step;spec/data-model.md— entities and relationships;spec/acceptance.md— acceptance criteria per scenario;spec/decisions.md— decisions made and the reasons behind them;CLAUDE.md— stack, commands, conventions, hard rules.
Before handing a task to the agent, we run a short checklist:
- The goal fits in one paragraph
- What is out of scope is written down
- Every scenario has verifiable acceptance criteria
-
CLAUDE.mdlists the build and test commands - Open questions are recorded, not kept in someone's head
When a spec is overkill
A spec is a tool, not a ritual. For a one-off script or a throwaway prototype, a paragraph in the prompt is enough. For an experiment that tests a single hypothesis, one file with the goal and the success criterion will do.
The approach has a cost: specs need upkeep. An outdated spec is worse than none, because the agent trusts it. We update spec/ in the same commit as the code and treat any drift between the two as a bug, just like a failing test.
If you have a product idea or a process you want to automate, let's start with the spec together. One working session is usually enough to agree on what goes into the first version and how we will know it is ready.
Questions and answers
What is spec-first development?
It means writing a short specification first — the goal, user scenarios, acceptance criteria and constraints — and only then writing code. With an AI coding agent this matters even more, because the spec becomes the agent's main context.
What should go into CLAUDE.md?
The rules for working in the repository: the stack, build and test commands, code conventions, what not to touch and where the specs live. The agent reads it at the start of every session.
Doesn't writing a spec slow things down?
On a small project a spec takes an hour or two and saves days of rework. We shipped a crowdsourced map MVP in a single day largely because the key decisions were made before the first line of code.
Read next
All posts →
5 min read
AI code review: lessons from 1,700+ reviews
AI code review lessons from 1,700+ real reviews: what models catch and miss, how to cut false positives, what context they need and how to measure real value.
- code review
- AI development
- Claude Code

5 min read
AI agent vs chatbot: what your business actually needs
AI agent vs chatbot: how they differ, when a RAG chatbot is enough, when an agent with tools pays off, and how to weigh autonomy, risk and running cost.
- AI agents
- chatbots
- RAG