Released December 10, 2026
A new way to build software with AI agents

Spec Driven

A hands-on guide for agentic engineers

Generating code faster isn’t enough. The bottleneck is no longer writing code. It’s understanding what needs to be built, and having the confidence to ship it.

Book cover: Spec Driven – A hands-on guide for agentic engineers by Martin Dilger

Why this book?

AI agents can generate thousands of lines of code in minutes. Give them a specification that describes the wrong problem, and they will build the wrong solution — potentially faster and more convincingly than ever before.

This book follows one real-world scenario step by step: a city commissions a modern parking management system to replace an outdated, buggy one. Small team. Tight deadline. Limited budget. And a stakeholder who has been burned by unreliable software for years.

Along the way we run into the typical problems every software project faces sooner or later, with or without AI — and solve them one by one.

85% problems.
15% building.

We spend 85% of our time discussing problems and requirements, and only 15% building what we’ve discussed. That’s precisely the point.

Start with the Why

Three questions, answered in exactly this order.

1Why?Why do we need this new system?
2What?What exactly must the system do?
3How?How should the system do it?

Talking about the “How” without understanding the “What” is pointless. Discussing the “What” without being clear about the “Why” is equally pointless. You cannot write a good specification without thoroughly understanding the problem you’re trying to solve.

What you will learn

Uncover real requirements

Use Event Modeling to make behavior visible and get the knowledge out of people’s heads, like Mike’s, and into the spec.

Build your Agent Harness

The tools, instructions and guardrails an AI agent uses to build the system reliably.

Work in Slices

Tiny, independently verifiable increments, delivered continuously to a simulated environment stakeholders can play with.

Quality built into the pipeline

Automated tests, clear specifications, independent verification and guardrails instead of endless manual code reviews.

Deliver with confidence

Safely automate implementation and delivery without inspecting every generated line.

Rewrite without the fear

Deal with unknown unknowns early, before they make a second rewrite necessary.

The scenario

A city wants to replace the system of one of its public parking garages. It should support traditional tickets and modern, ticketless parking, and explore how AI can reduce costs and bureaucracy.

The existing system is buggy: someone spends almost half their working week handling complaints. And it blocks new revenue, like renting spaces to companies.

The source code is inaccessible. We rewrite from scratch.

Initial requirements

  • Ticketless parking
  • EV charging
  • Fleet management with discounts
  • Subscriptions
  • AI-assisted parking
  • Adaptability to other locations
  • And, of course, a price tag

Read a preview

Chapter 1 · Excerpt

The Hidden Requirements

Anyone who has spent a few years in the software industry knows that rewrites come with considerable risks. You can spend months building a new system, only to discover that the famous “unknown unknowns” make the entire project fail.

Fortunately, we have Mike.

Mike has been responsible for this parking garage for the last few years. He knows the existing system and all its quirks, and all the workarounds people have developed to get things done. Mike isn’t an engineer, but he’s probably the most important person in this entire project. Actually, Mike was holding this whole system together.

We need to get that knowledge out of Mike’s head and into our requirements.

The Process

Instead of disappearing for months and returning with a “finished” system nobody ordered, we’ll work in tiny increments that we call Slices. Each one is a small, independently verifiable piece of functionality. Stakeholders won’t have to imagine the finished system. They’ll be able to play with it.

Let’s get started.

Questions

Who is this book for?
Software engineers, architects and team leads who want AI agents to take real responsibility for implementing well-defined functionality, and who want to stay in control of quality.
Do I need to know Event Modeling already?
No. The book introduces Event Modeling as the way to make requirements explicit before anything substantial is built.
Which tools are used?
Mainly Claude Code and OpenCode, implementing the system directly from the Event Model. The ideas themselves carry over to other agents and stacks.
Is this about generating code faster?
No. It’s about understanding the problem, building the right thing, and having enough confidence in the result to deliver it.

Ready to get started?

Learn how to turn specifications into working, verified software with AI agents.

MD

About the author

Martin Dilger is the author of Understanding Eventsourcing and a long-time practitioner of Event Modeling, Event Sourcing and Vertical Slice Architectures.