TL;DR

  • Agents got really fast at writing code. That moves the hard part: it's no longer typing the code, it's knowing exactly what you want.
  • In my opinion lights-out engineering and spec-driven development (SDD) can't live without each other. Without a spec, agents build the wrong thing very fast. Without lights out, you do all that careful thinking and then still babysit every task.
  • The research agrees. A review of 67 sources calls it the Productivity-Reliability Paradox: we write a lot more code, but we don't ship more. Their conclusion: specification discipline is the bottleneck, not the model.
  • A good spec answers the hard questions up front, is testable, and says honestly what's still unclear. I show four common ways specs go wrong.
  • I tried the full flow with Spec Kit on a small webshop: 35 tasks, 26 merged pull requests, a little over four hours of agents working on their own. And a lighter alternative, OpenSpec.

Last week I wrote about lights-out engineering: handing clear work to agents, closing your laptop and checking the results later.

These two topics are really one story to me. I'm genuinely fascinated by agentic teams: agents with their own memory, their own specialists, even their own scrum ceremonies. But with a lot of customers who want that kind of autonomous workflow, we keep hitting the same wall. The output of our fancy agents isn't what the customer actually wanted. What's the point of an agent team that ships a feature in under an hour if it's the wrong feature?

That's why I think lights out and SDD can't live without each other:

  • Lights out without a spec is garbage in, garbage out, at scale. Nobody is there to answer the agent's questions, so it guesses. And it guesses confidently.
  • A spec without lights out is a lot of good thinking that you then spend babysitting 35 tasks one by one. You paid for the thinking up front, but you never collect the reward.

The spec is what makes it safe to walk away. Lights out is what makes writing the spec worth it.

The bottleneck moved

I already told the stories of the .NET team and the Copilot Cowork team in the lights-out post, so I'll keep it short. Both teams let agents write most of the code. And both ended up at the same place.

Stephen Toub described his job on dotnet/runtime as: "identifying work, scoping problems, and giving direction." The tasks that merged best were the clearly defined ones, like cleanup and tests. New features and performance work, which need judgment, came last.

The Cowork team put it even more directly: "The bottleneck was not knowing exactly what we wanted." And: "The faster agents became at implementation, the more important it became for us to be precise about intent, requirements, and what good looked like."

Identifying work, scoping problems, being precise about intent. If you think about it, that's basically what writing a spec is.

I saw the same thing at a hackathon with one of the customers I work with. They built an agentic software factory: AI interviews the product owner until the requirement is clear, that becomes a spec, a plan gets reviewed, and an agent team implements it. Their biggest learning: the spec was the most important moment to have a human in the loop. If the spec is wrong, everything after it is wrong too, no matter how fast the agents are.

Does it hold up?

This sounds nice, but I wanted numbers. The best source I found is a recent paper by Sabry Farrag from the University of East London. He reviewed 67 sources on AI-assisted development from 2022 to 2026, so it's basically a summary of what we know so far.

In controlled studies, developers are 20 to 56% faster with AI. That's the number you usually see on slides. But those are nice, well-scoped tasks. In real teams, across more than 10,000 developers, teams create 98% more pull requests, review time goes up 91% and delivery metrics stay flat. One randomised trial with experienced developers on mature codebases even found they were 19% slower.

He calls this the Productivity-Reliability Paradox, and his conclusion is pretty blunt: "Specification discipline, not model capability, is the binding constraint on AI-assisted software dependability." So waiting for a better model won't fix it.

The paper also describes a four-month pilot: the same teams, two months without specs and two months with Spec Kit.

  • Lead time per feature: from 8–12 working days down to 6–9.
  • Late hotfixes per sprint: from 3–5 down to 1–2.
  • Rollbacks per month: from 2–4 down to 0–1.
  • Developer confidence: from 3.1 to 3.9 out of 5.

Code that got rewritten within two weeks roughly halved. It isn't free though: writing the spec and plan cost 45 to 90 extra minutes per medium-sized feature. You pay a little up front and win it back in rework. The paper calls it an illustrative pilot with approximate metrics, so treat it as a direction, not proof.

What a good spec looks like

A spec is a short document that says what you want to build and why: who it's for, what it should do, and how you know it's done. It doesn't say how to build it. That's the plan.

It's the shared agreement between you and the agent. You make your decisions there before any code is written, so the agent doesn't have to guess. And it's what you check the result against in review.

Sounds simple, but it's easy to get wrong. Here are four examples for a workshop booking app, each with a bad and a good version.

1. A prompt is not a spec

This is how most of us start:

Add workshop booking.
Users should be able to reserve
a seat. Make it work well.

Sounds reasonable. But what happens when two people grab the last seat at the same moment? What if the payment fails? The prompt doesn't say, so the agent guesses. Here's a spec for the same feature:

# Feature: Workshop booking

## User story (P1)
As an attendee I reserve a seat, so my place is guaranteed.

## Acceptance criteria
- Given 1 seat left, when 2 users book at the same time,
  then exactly 1 succeeds and the other sees "Full"
- A failed payment releases the seat within 5 minutes
- Max 1 seat per user per workshop

## Out of scope
- Waitlists, refunds

[NEEDS CLARIFICATION] Can admins overbook?

It answers exactly those questions: the race for the last seat, the failed payment, the limits and what's out of scope. And where something isn't decided yet, it says so instead of guessing. If you leave the questions open, the agent answers them for you.

2. Adjectives aren't acceptance criteria

Writing a spec doesn't automatically make it a good one. This one has a title and bullets, so it looks like a spec:

# Feature: Cancel booking
Users can cancel their booking.
- Cancelling should be easy and fast
- Handle refunds properly
- Notify the right people
- Must be secure

But read it: easy, fast, properly, secure. What is "properly"? Who are "the right people"? The agent will happily build something and call it done, and you can't prove it wrong. The good version turns every line into something you can check:

# Feature: Cancel booking

## User story (P1)
As an attendee I cancel my seat, so someone else can take it.

## Acceptance criteria
- Given a booking, when I cancel more than 48h before start,
  then I get a full refund and the seat is free again
- Cancel within 48h: seat is freed, no refund
- The organiser gets an email within 1 minute
- Only the person who booked can cancel, others get 403

## Out of scope
- Partial refunds

3. A spec says what and why, not how

This is the opposite mistake, and as developers we make it a lot:

# Feature: Waitlist
- Add a waitlist table with FK to workshop
- Use a Redis queue + cron job every 5 min
- Build a React WaitlistPanel component
- Send emails via SendGrid

That's a task list. It's all about how, but nobody knows what problem we're solving or when we're done. The good version starts with why and then describes the behaviour:

# Feature: Waitlist

## Why
Popular workshops sell out in minutes, and people give up.

## User story (P2)
As an attendee I join the waitlist for a full workshop,
so I get a seat when one frees up.

## Acceptance criteria
- Given a full workshop, I can join the waitlist once
- When a seat frees up, the first in line gets an offer
  and has 2 hours to accept
- No answer in 2 hours: the offer goes to the next person

The how comes later, in the plan.

4. The happy path is the easy part

This one is sneaky, because the bad spec actually looks good. It even uses Given-When-Then:

# Feature: QR check-in

## Acceptance criteria
- Given a valid ticket,
  when the host scans the QR code,
  then the attendee is checked in

But it only covers the happy path. What if someone scans twice? Has a ticket for another workshop? What if there's no Wi-Fi in the room? The agent decides that for you, and you find out on the day of the event.

# Feature: QR check-in

## Acceptance criteria
- Given a valid ticket, when the host scans the QR code,
  then the attendee is checked in

## Edge cases
- Scanned twice: show "Already checked in at 09:12"
- Ticket for another workshop: refuse, show the right room
- Cancelled booking: refuse, no check-in
- No internet: store the scans, sync when back online
- More than 30 min late: check in, but flag as late

Agents are great at the happy path. The edge cases are where your spec earns its keep.

Your turn: which one would you hand to an agent?

The last one has no right answer. Same feature, workshop reminders, written in two styles. A is long: about 450 lines, 3,400 words and 4,500 tokens. Shortened, it looks like this:

# Feature Specification: Workshop reminders
Branch: 003-workshop-reminders · Status: Draft
Input: "Remind attendees before their workshop"

### User Story 1 - Get reminded (Priority: P1)
As an attendee I want a reminder before my workshop,
so I don't forget to show up.
Why this priority: no-shows waste seats.

Acceptance Scenarios:
1. Given a confirmed booking, When it's 24h before start,
   Then the attendee gets an email
2. Given a cancelled booking, When it's 24h before start,
   Then no email is sent

### Edge Cases
- Booked less than 24h before start? Send right away.
- Workshop rescheduled after the reminder was sent?
  Send a new reminder with the new time.

### Functional Requirements
- FR-004: System MUST send a reminder 24h before start
- FR-006: System MUST NOT remind cancelled bookings

### Measurable Outcomes
- SC-001: no-shows drop by 30% within 2 months

## Assumptions
- Email is the only channel for now (no SMS or push).

B is about 150 lines, 1,100 words and 1,500 tokens:

# notifications Specification

## Purpose
Keep attendees informed about their workshops:
confirmations, reminders and changes.

### Requirement: Workshop reminder
The system SHALL send a reminder email 24h before
the workshop starts.

#### Scenario: Confirmed booking
- WHEN a booking is confirmed and start is 24h away
- THEN the attendee receives a reminder email

#### Scenario: Cancelled booking
- WHEN the booking was cancelled
- THEN no reminder is sent

### Requirement: Reschedule
The system SHALL send a new reminder when the
workshop moves after a reminder was sent.

A is in the style of a Spec Kit feature spec: priorities, the reason behind each one, success criteria and assumptions. B is in the style of an OpenSpec capability spec: short, and only the behaviour. Both cover the same rules. A tells you more about why and how you'll measure success. B is cheaper to read, for you and for the agent. Which one is better depends on your team, how big the feature is and how much governance you need. I come back to that in the comparison at the end.

The full flow

SDD isn't a tool, it's a way of working:

  1. Envision. You often don't know exactly what you want yet. Explore with AI until the direction is clear. This is where vibe coding is allowed.
  2. Spec. What you want, the constraints and how you know it's done. AI helps you write it, but you own it. That can be the product owner, or a developer who uses the ticket from GitHub or Azure DevOps as input.
  3. Plan. The how: stack, architecture, which files change, how to test it.
  4. Tasks. Small steps in a fixed order, marked where they can run in parallel. Small tasks need less context, a retry is cheap and you can actually follow what's happening.
  5. Execute. Agents build, test and open pull requests.
  6. Review and ship.

This looks like a straight line, but most of us work in brownfield codebases with years of history. So the spec isn't a document you write once. It lives next to your code. When a review shows the agent got something wrong, you often have to fix the spec, not just the code. Otherwise it's just outdated documentation again, and we all know how that ends.

Trying it: Spec Kit on Planet Pizza

GitHub Spec Kit turns this flow into a few slash commands: constitution, specify, clarify, plan, tasks and implement. I used it on Planet Pizza, a small demo webshop, to add order tracking.

Constitution. The house rules of your project. You write them once and every spec, plan and task has to follow them. My prompt started with: base the principles on what is already true in this repo. That's important in brownfield, because I don't want the agent to invent new rules. I want it to write down the ones we already follow. I got six principles with MUST and MUST NOT rules and a short reason for each, like "the server is the source of truth: prices are always recalculated on the server, because the browser is untrusted."

Specify. Three user stories with acceptance scenarios that were really concrete. One said that an order placed with "Earthling@Example.com" must still be found when you type it in lowercase with an extra space. I never said that, but now it's written down and testable. The edge cases covered things like "#0042", letters in the order number, and the server being down.

Clarify. It's optional, but in my opinion the most important step. Instead of guessing, the agent asks you questions, one at a time, with a recommendation. How long can the browser that placed the order see it without the email? 24 hours. How strict is the rate limit? 10 lookups per minute. Those were my calls, not the agent's.

Plan. My prompt was literally "Write the plan." The best part is the Constitution Check: every principle, pass or fail, with evidence. Because the constitution says new dependencies need a reason, it wrote about 40 lines of rate limiting instead of pulling in a library. And it flagged that the existing SELECT * would leak the token hash to the browser.

Tasks. 35 tasks in six phases, each naming the exact file to change, with 9 marked as parallel.

Small tip if you use Claude models in VS Code: in SDD you read a lot, so you often wait more than five minutes between prompts, and by default the prompt cache is gone by then. The experimental settings github.copilot.chat.anthropic.promptCaching.extendedTtl and extendedTtlMessages give you a one-hour cache. When I tested it, this only worked on the Claude 4 models, and not in the CLI yet.

Then the lights go out

Up to here I steered every step. That's on purpose: the spec is where the human matters most. But if the thinking is done and the tasks are small and clear, do I still need to sit there for 35 tasks? I don't think so.

People own the spec. Agents own the execution.

A customized /speckit.taskstoissues turned tasks.md into one parent issue with 35 sub-issues and 53 "blocked by" links between them. Adding a label is the start signal. From there, workflows assign each unblocked task to Copilot with the right custom agent, a review gate asks Copilot code review to check the pull request, Copilot fixes the comments, and it merges. Merging unblocks the next tasks.

The result: 35 tasks, 26 pull requests merged, 8 rounds where the review gate found something and the agent fixed it, in a little over four hours. The setup is in the lights-out post and the template is in advanced-sdd-workflows.

In my setup the gate merges without a human, so you can see the whole loop. In a real project you probably want a person on that last click, and that's fine.

When the requirements change

They will. I see three ways to handle it:

  • Flow-forward. What Spec Kit does by default. Every change gets a new feature folder (001, 002, 003) and you run the full flow again. Old specs stay as history.
  • Living spec. spec.md is the one contract. Change it first, regenerate the plan and tasks, and nothing moves until all three agree.
  • Flow-back. You discover something while building and capture it where it shows up, then work backwards to bring the spec in line. The most flexible, but it needs discipline.

For monorepos: Spec Kit works per folder. Every folder with a .specify folder is its own project with its own constitution and numbering. There's no shared constitution, so company-wide rules you sync yourself.

Spec Kit or OpenSpec?

OpenSpec is a lighter alternative. openspec/specs/ describes how your system behaves today, and every change in openspec/changes/ only holds a delta: what's ADDED, MODIFIED or REMOVED. Two changes can edit the same spec without conflicts if they touch different requirements. Its propose step does specify, plan and tasks in one go. For the same feature I got 12 tasks instead of 35.

The biggest difference: OpenSpec answers "what does our system do?", Spec Kit answers "what did we build for feature 003?" Spec Kit is stronger on governance through the constitution, which matters in healthcare, finance or government. OpenSpec is lighter and probably cheaper for small changes, but neither project publishes official token benchmarks, so take that with a grain of salt.

With customers I see three routes: adopt one as is, adapt it with your own constitution, templates and commands (like my taskstoissues), or skip the framework and just use a spec template plus an instruction that says "no code without a spec". All three work.

What's not there yet

  • It costs time up front. 45 to 90 minutes per feature in the pilot. For a bug fix or small refactor where the what fits in one sentence, plan mode is enough.
  • Specs rot. If nobody updates them when the code changes, you're back to outdated documentation.
  • Spec Kit is heavy for small changes. 35 tasks is a lot of reading. OpenSpec or your own lighter template may fit better.
  • The evidence is still thin. The pilot numbers are approximate and from a small set of teams. I'd love to see more.

Want to try it?

  1. Pick one feature this week and write the spec before any code. What, why, how you know it's done, and the edge cases.
  2. Run clarify, or just ask the agent: "what's still unclear in this spec?" Answer those questions yourself.
  3. Only then let go. Split the plan into small tasks and hand them to agents. That's where lights out starts to pay off.

The template and references are in advanced-sdd-workflows. I'm really curious how you handle specs in your team, especially in brownfield codebases. If you try it or think I'm wrong, let me know.

References

Back to all posts