AI Development

Spec-Driven Development: why I spent a 90-minute AI agents consultation writing almost nothing but a spec

An AI agent works from what it finds written down: if the spec has gaps, it fills them by guessing. That’s why I spent a 90-minute consultation on one spec.

Luca Di Domenico

Luca Di Domenico

· 4 min read

In short

In a 90-minute one-on-one consultation on AI agents with Claude Code, most of the time went into rewriting the project’s spec from scratch with Spec-Driven Development. Sub-agents and adversarial review came only at the end. The reason: the agent works from what it finds written down, and where the spec has gaps it guesses with confidence, producing code that looks correct even when it solves the wrong problem.

In a 90-minute one-on-one consultation on AI agents, I spent almost all the time writing a single spec. The reason is simple: an AI agent like Claude Code works from what it finds written down. If the spec is clear, the agent does good work. If the spec leaves gaps, the agent fills them on its own and guesses.

How did the AI agents consultation go?

A few days ago I ran a one-on-one consultation with Rosario Martone, a software engineer at a bank. Rosario brought one of his personal projects, a real one, and we worked on it together with Claude Code.

You’d expect a session on AI agents to be mostly about agents. We did get there: sub-agents, adversarial review to stress-test the code and the design choices, and much more. But only at the end.

First we rewrote the project’s specifications from scratch with Spec-Driven Development. That’s where most of the 90 minutes went.

What is a spec?

A spec is the document that describes what the software has to do. It covers the rules, the edge cases and what happens when something goes wrong. I’m simplifying, but that’s the core: a spec puts decisions in writing before anyone writes the code.

Spec-Driven Development is the method built on that. You write the spec first, then the AI agent implements by following it. The code becomes the result of decisions already made, instead of the place where decisions get made by accident.

Why does the spec matter so much with an AI agent?

I spent most of the consultation on the spec because of a precise chain of cause and effect:

  1. the AI agent works from what it finds written down;
  2. if the spec is clear, the agent does good work;
  3. if the spec leaves gaps, the agent fills them on its own and guesses;
  4. the agent guesses with confidence, so the code looks correct even when it solves the wrong problem.

The fourth point does the most damage. An obvious bug gets caught right away. Clean code that passes the checks and solves the wrong problem gets caught late.

What does an AI agent lack compared to an experienced developer?

Context. An experienced developer fills the gaps in a specification with the context in their head: they know the domain, they remember the conversations with the client, they know which edge cases have already come up.

An AI agent doesn’t have that context until someone writes it down. For Claude Code, a rule that lives only in the head of whoever designed the software simply doesn’t exist. That’s why writing the spec is the work that makes everything else useful.

What about sub-agents and adversarial review?

Sub-agents and adversarial review came at the end of the session, and that order makes sense. Sub-agents split the work across several agents, each with its own task. Adversarial review uses an agent to attack the code and the design choices, looking for what doesn’t hold up.

Both work better on top of a solid spec. A reviewer needs to know what the software should do to judge whether it does it. Without a spec, the review is guessing too. I wrote about when you really need multiple agents in the article on dynamic workflows in Claude Code.

What should anyone working with AI agents take away?

At the end of the session Rosario told me he walked away with "a clear method". To me that’s the best compliment, because a method still holds when models and tools change.

If you already use Claude Code or another AI agent, the move with the biggest payoff is also the least flashy one: before asking for code, write down what the software has to do, the edge cases and what happens when something goes wrong. Your agent will only be as good as the spec you give it.

Want to know what this means for your product?

If you're building software with AI and want a second opinion on how you're working, tell me about your project.

Tell me about your project
AI AgentsClaude CodeSpec-Driven DevelopmentAI Development

Follow the blog

One email for every new article

I only write when an article is out: title, summary and link. You can unsubscribe with one click from any email.

RSS feed

An RSS feed is the up-to-date list of articles: add it to a reader app like Feedly or Inoreader and new articles show up there, no email needed.

lucadidomenico.studio/en/blog/rss.xml