What Is Spec-Driven Development? How to Write Specs AI Agents Can Build From

5 min Read

Spec-driven development is a way of building software where a written specification, not a chat prompt or a one-line ticket, is the input to every change. The spec says what the change should do, what it shouldn't do and how you'll know it works. A person approves it before the build starts, and the finished work gets checked against it before it ships.

The idea isn't new. What's new is who reads the spec. When an AI agent does the building, it takes your ticket literally and fills every gap with a guess. A clear spec is how you control what those guesses are.

Why does spec-driven development matter now?

A senior engineer can work from a vague ticket because they know the system, the customers and the unwritten rules. An agent knows none of that. Give it "add export to the transactions page" and it will ship something, quickly, but probably not what you meant.

Teams that run agents well have noticed. In the latest CNCF and SlashData survey, cloud native developers were more likely than other developers to write a spec and have AI build against it, as we covered in our post on how cloud native teams supervise agents. The tools are moving the same way. GitHub released Spec Kit, an open-source toolkit for spec-driven work with coding agents, and AWS's Kiro IDE organizes features into requirements, design and task files before any code is written.

What goes in a spec?

A good spec is short. For most changes it fits on one page. It answers six questions:

  1. The problem. Who has it, and what happens today?
  2. The outcome. What should be true when this ships?
  3. Scope. What's included, and just as important, what isn't.
  4. Acceptance criteria. The specific behaviors someone can test, including what happens when things go wrong.
  5. Constraints. Security, data handling, performance and compliance rules the change has to follow.
  6. How you'll measure it. The signal after release that tells you it worked.

Notice what's missing: how to build it. A spec describes behavior, not implementation. Leave the design to the engineer or agent, and judge the result by whether it meets the criteria.

Example: turning a vague ticket into a spec

Here's a ticket you've probably seen some version of:

"Add CSV export to the transactions page."

An agent can build that in minutes. It will also have to decide, on its own, which columns to include, whether to export every transaction or only the filtered ones, what happens with 200,000 rows, and who's allowed to export at all. Each of those is a business decision hiding inside a technical task.

Here's the same request as a spec:

Problem: Account managers rebuild transaction reports by hand for client reviews, which takes about an hour per client.

Outcome: An account manager can download the transactions they're viewing as a CSV in one click.

In scope: Export of the currently filtered view, up to 100,000 rows. Columns: date, description, amount, currency, status, account ID.

Out of scope: Scheduled exports, Excel format, exports across multiple accounts.

Acceptance criteria:

  • Given a filtered view of fewer than 100,000 rows, when the user clicks Export, a CSV with exactly those rows downloads within 10 seconds.
  • Given a view of more than 100,000 rows, the Export button is disabled and a message tells the user to narrow the filter.
  • Given a user without the "export data" permission, the Export button doesn't appear.
  • Every export is written to the audit log with user, timestamp and filter used.

Constraints: Full card numbers and account numbers are never included. Exports follow existing data retention rules.

Measure: Time spent preparing client reports, checked with account managers 30 days after release.

That took maybe 20 minutes to write. It also caught a permissions question and a data-masking rule that the original ticket left to chance.

What makes acceptance criteria usable?

Acceptance criteria are the part of the spec that does the most work, and the part teams most often get wrong. Usable criteria share four traits:

  • They're testable. "Fast" isn't a criterion. "Downloads within 10 seconds" is.
  • They cover failure, not just success. What happens with no data, too much data, the wrong user or a timeout?
  • Each one checks a single behavior, so a failed test points straight at the problem.
  • They use the business's words. If the people who approve the spec can't read the criteria, they can't really approve them.

The Given / When / Then format in the example above isn't required, but it helps. It forces you to name the starting condition, the action and the expected result, and it translates directly into automated tests.

Who should write and approve the spec?

The person who owns the problem writes the first draft: usually a product manager, sometimes a business analyst or the requesting team. An engineer adds the constraints and edge cases they know about. An AI assistant can help draft and tighten the language, and it's good at spotting missing failure cases.

Approval is where a human has to stay in charge. Someone with authority over the outcome signs off before the build starts. After the build, someone checks the result against the criteria before it ships. Those two checkpoints are what make agent-built work trustworthy, and they're the points we described in AI-Assisted Development vs. Agentic Engineering.

Keep specs in the same repository as the code, versioned with it. When a change ships, its spec should be easy to find next to it, which also gives auditors and new team members a plain-language record of why the system works the way it does.

Common mistakes to avoid

  • Writing a novel. A ten-page spec for a small change slows everyone down and still won't get read closely. Match length to risk.
  • Specifying the implementation. "Use a background job and write to S3" is a design choice. State the behavior you need and let the builder choose.
  • Skipping "out of scope." Agents are eager. If you don't rule something out, expect it to show up in the pull request.
  • Writing the spec after the build. A spec written to describe finished code is documentation, not a spec. It can't catch the questions the build answered by accident.
  • Letting specs drift. When requirements change mid-build, update the spec first, then the code.

Where specs fit in your platform

Spec-driven development works best when the platform supports it instead of relying on everyone's discipline. A spec template in every new repository, a pipeline step that confirms each acceptance criterion has a matching test, and a pull request check that links the change to its approved spec all make the right way the easy way. That's the same thinking behind a golden path, applied to requirements instead of infrastructure.

Frequently asked questions

Is spec-driven development just waterfall again?

No. Waterfall writes one large specification for an entire project up front. Spec-driven development writes a short spec for each change, often several a week. The loop stays fast; it just starts with a clear request instead of a vague one.

Do you need special tools for spec-driven development?

No. A Markdown file in the repository works. Tools like GitHub Spec Kit and Kiro add templates and connect specs to coding agents, which helps once you're running many specs at once.

How long should a spec be?

As short as possible while still answering the six questions. Most changes fit on a page. Changes that touch money movement, customer data or security deserve more detail.

Can AI write the spec?

AI can draft one and is useful for finding gaps. A person who owns the outcome still needs to review and approve it, because the spec is where business decisions get made.

Find out how ready your delivery process is

Specs live in the part of agentic engineering most teams skip: the delivery process and the business requirements that feed it. Tensure's agentic engineering maturity assessment scores your platform, your delivery process and your business requirements, and shows which one is holding you back. To see how we help teams put spec-driven delivery into practice, visit our agentic engineering page or get in touch.

‍

TOPICS:
Blogs
BY
Dan Rye
Your AI agent kill switch has never been tested
Dan Rye

Your AI agent kill switch has never been tested

Auditors will soon ask what your AI agents did and how fast you can stop them. Here's how platform teams make agent actions traceable and safe to halt.

BY
Lesley Mackie
The Teams Most Ready for AI Agents Are the Least Likely to Let Them Run Alone
Lesley Mackie

The Teams Most Ready for AI Agents Are the Least Likely to Let Them Run Alone

New CNCF and SlashData data shows cloud native teams adopt AI faster but hand less work to autonomous agents. What that means for governing agents in production.

BY
Dan Rye
How to Cut Observability Costs Without Losing Visibility
Dan Rye

How to Cut Observability Costs Without Losing Visibility

Observability bills grow with consumption, not value. Here's where the spend comes from and how Tensure helped Pindrop save $1M a year without losing visibility.

Smooth shipping is a few steps away

Let's see how we can help your team move faster. From developer platforms to cloud infrastructure and AI solutions that get your developers shipping again.