Back to articles

AI-Assisted Development

Spec first: how I build software with AI agents using OpenSpec

Coding agents write fast, but they forget, guess and drift. Spec-driven development proposes something old: writing down what you are going to build before you write the code. Here is how I use it, and what the evidence says.

You ask a coding agent for a new feature. A few minutes later you have hundreds of lines and everything looks fine, until you actually sit down and review it: it solved a different problem, changed something you didn't ask for, or forgot a decision the two of you made two hours ago. The next day you open a new session and have to explain everything again. If you've worked with agents for more than an afternoon, you know the pattern.

I built two projects with AI agents: an audit tool for Salesforce Marketing Cloud and the full redesign of this website. In both I used OpenSpec, a lightweight spec-driven development (SDD) framework. It isn't magic and it isn't for everything, but it gave me an order I didn't have before: understand the problem first, then decide, and only then build. Here's what I learned, with the sources, so you don't have to take my word for it.

The problem

The problem isn't that the agent writes bad codeLink to this section

Today's models write pretty good code. What breaks is everything around the code. Den Delimarsky, from GitHub, put it well when introducing Spec Kit: we treat agents like search engines, when we should treat them like very literal pair programmers. They do exactly what they understood, and what they understood depends on what we gave them. In practice, that breaks in four places.

Context gets lost. What you agreed on in the chat lives only in that conversation. When the session closes or gets compacted, the decision goes with it. And more context doesn't always help: a Chroma study of 18 models found that performance consistently drops as the input grows, even on simple tasks.

Vague prompts. If the request is ambiguous, the answer will be plausible, not necessarily correct. And this isn't just an agent thing: when OpenAI cleaned up the SWE-bench benchmark to create SWE-bench Verified, it found many tasks with descriptions so underspecified that it wasn't clear what the problem was or how to solve it.

Drift. Without a reference document, every session decides things a little differently. A few weeks in, the code no longer reflects a clear intent. It reflects the sum of a lot of prompts.

Review burden. The agent produces faster than a person can keep up reviewing. The 2025 DORA report describes AI as an amplifier: it magnifies the strengths of good teams and the dysfunctions of struggling ones. The same report found that AI is now associated with higher throughput, but delivery instability keeps rising.

~90%

Technology professionals who use AI at work

DORA 2025, via InfoQ

Survey of nearly 5,000 people. Using AI is no longer the question: the question is how to work with it

18

Models evaluated by Chroma

Chroma Research, July 2025

Across all experiments, performance dropped as the input length increased

73,030

Public repositories with spec files

Agarwal et al., 2026

The SpecMine corpus gathers 470,795 specification files found on GitHub

The idea

What spec-driven development isLink to this section

Let's be honest up front: the definition is still moving. Birgitta Böckeler, from Thoughtworks, sums it up this way on Martin Fowler's site: writing a spec before writing code with AI, so that the spec becomes the source of truth for both the human and the agent. A spec, in this sense, is a structured, behavior-oriented document in natural language. It says what the system must do, not how it's programmed.

Böckeler distinguishes three levels, and I find them useful for placing any tool:

  1. Spec-first. You write the spec, use it for the task and then forget it.
  2. Spec-anchored. The spec is kept and updated as the feature evolves.
  3. Spec-as-source. You only edit the spec and the code is generated from it.

In practice, most of the tools she reviewed stay at the first level. The third one is reminiscent of the old model-driven development (MDD), which already came with rigidity and a high maintenance cost, now with the non-determinism of LLMs on top. In November 2025, the Thoughtworks Technology Radar placed SDD in "Assess": a fascinating space, but with elaborate workflows and specs that are sometimes long and hard to review.

The tool

How OpenSpec worksLink to this section

OpenSpec is an open source project by Fission AI, under the MIT license. Its README explains it in one line: AI coding assistants are powerful but unpredictable when requirements live only in chat history. That's exactly the problem above. The idea is to add a lightweight spec layer so you agree on what to build before writing code, and it works with more than 30 coding assistants.

Everything lives in an openspec/ folder inside the repository, and it has two parts:

  • openspec/specs/: how the system behaves today, organized by domain. It is the source of truth.
  • openspec/changes/: each proposed change lives in its own folder with four artifacts. proposal.md explains why and what changes; specs/ holds the new or modified requirements, with scenarios; design.md keeps the technical approach and the decisions; tasks.md is the task list with checkboxes.

According to the concepts documentation, requirements use the RFC 2119 keywords (SHALL, MUST, SHOULD) and each one has scenarios with GIVEN, WHEN and THEN steps that can be tested. This is a real requirement from the redesign of this site (written in Spanish, translated here):

## ADDED Requirements

### Requirement: Featured article
The most recent article in the page language SHALL be featured
with title, summary, date and reading time; the rest SHALL go
in a list with title, date and minutes.

#### Scenario: Featured in English
- **WHEN** a visitor opens `/en/blog`
- **THEN** the featured article is "AI Won't Replace Your Job,
  Someone Using AI Will"
Excerpt from openspec/changes/redesign-blog-and-utility-pages/specs/blog-pages/spec.md. With this article published, that scenario is no longer true. That's what the archive step is for.

Changes don't rewrite the whole spec. They're delta specs, with ADDED, MODIFIED and REMOVED sections that say what is added, what is replaced and what is removed relative to what already exists. That's why OpenSpec presents itself as a tool built for existing (brownfield) projects, not only for starting from scratch. Its own docs say it plainly: most work modifies behavior that already exists.

The life cycle of a change

  1. Explore

    Before proposing anything, you research: the agent reads the code, checks sources and helps you understand the problem. The tool treats it as optional; for me it is where everything starts.

  2. Propose

    The agent creates the change folder with the proposal (options, pros and cons), the delta specs, the design and the tasks. You review the plan before a single line of code exists.

  3. Apply

    The agent implements the tasks in order, checking off each box as it goes. If something does not match the plan, fix the plan, not just the code.

  4. Archive

    The deltas are merged into openspec/specs/ and the change folder moves to changes/archive/ with a date. The spec is up to date for the next change.

That last step is the one that makes the difference. In November 2026, the Thoughtworks Radar moved OpenSpec to "Trial" and highlighted exactly that: it centers on a spec-anchored workflow, where changes are tracked as deltas against a spec that sticks around. The teams that tried it reported more predictable results and fewer unintended changes than with bare prompts, and they especially valued how it works on existing code.

First-hand experience

Two real projects: the Navixum Auditor and this siteLink to this section

The first project was the Navixum Auditor, a support tool that reduces the time of a Salesforce Marketing Cloud audit. It pulls the client's resources, maps how they connect to each other and runs 109 checks for security, data quality and data costs. It runs on .NET, SQL Server and Azure, and I built it by orchestrating AI agents with OpenSpec.

109

Automated checks

Navixum Auditor

For security, data quality and data costs, over the client's resources and their connections

~3,000

Resources scanned

Navixum Auditor, internal test

Marketing Cloud resources walked through and mapped during that test

289

Findings

Navixum Auditor, internal test

Findings from that same test, ready for an auditor to review

One important detail about that 289: the tool doesn't "find everything" and it doesn't replace auditors. It helps them. It does the mechanical work of going through thousands of resources so the person can spend their time interpreting and deciding. And a system with 109 checks is exactly the kind of project where an agent without a spec gets lost, because there are a lot of rules that have to behave the same from one session to the next. With the rules written down as requirements with scenarios, every session started from a document and not from my memory.

The second project is the one you're looking at. I planned the redesign of this site, in Angular with static prerendering and in two languages, with 14 OpenSpec change proposals, each with its own proposal, specs, design and tasks. Several AI agents executed them in parallel, and every result went through an independent review.

What worked in both was the order. The first job is solving the problem, not writing code:

  1. Research. That's OpenSpec's explore step: the agent and I go through the code, the sources and the constraints before proposing anything.
  2. Propose with options. With all the research on the table, the proposal brings alternatives, pros, cons and the design itself. Reviewing the plan is cheaper than reviewing the code: fixing a proposal takes minutes; finding the same mistake in a huge diff takes an afternoon.
  3. Decide and plan. Once the decision is made, it becomes an execution plan broken into tasks.
  4. Execute in order. Every session starts with the right context, the proposal and the tasks, instead of starting from scratch. Since each change lives in its own folder, several agents can move forward in parallel without stepping on each other, and at the end another agent reviews the result against the spec. A reviewer without a spec gives opinions; one with a spec verifies. The Claude Code documentation recommends something similar.

In short: you research, analyze and plan better, and you implement in an orderly way.

It's not all upside, either. There's a lot of markdown to read, and a spec nobody reviews is just pretty text.

The limits

What it doesn't solve, for nowLink to this section

It would be dishonest to sell you SDD as the answer. For now there's little independent evidence, and what there is points in several directions. These four lines sum up the conversation well:

To be honest, I'd rather review code than all these markdown files.

Birgitta BöckelerDistinguished Engineer, Thoughtworks

Sometimes it's overkill. Böckeler tried Kiro and Spec Kit on small bugs and medium-sized features, and the process cost more than it gave back. For a typo or a style tweak, a proposal with four artifacts is pure ceremony.

It gives a false sense of control. In her tests, agents sometimes ignored instructions or duplicated code that already existed, even though the spec was right there. Context fitting in the window doesn't mean the model uses all of it.

The spec ages too. Agarwal and colleagues interviewed 21 practitioners and analyzed 266 active repositories. They found that teams use SDD selectively, mostly for new features; that they report more reliable agents, but also higher planning and review costs; and that putting implementation details in the spec helps the agent, but makes the spec go stale faster. The Radar warns the same about OpenSpec: archiving the deltas helps, but keeping the spec current still takes discipline.

There's no proof yet that it reduces defects. A study presented at ESEM 2026 analyzed 88,052 pull requests across 119 open source repositories and found no significant difference in defects or rework between changes with and without a spec. Here's a nuance almost nobody mentions: almost all of those "artifacts" were references to tickets, and no repository in the sample kept the output of SDD tools. It says more about tickets than about OpenSpec, but it's a good reminder: writing a document doesn't improve quality on its own.

Comparison

OpenSpec compared with the alternativesLink to this section

You don't have to pick just one. Here's how I see them:

Four ways to give an agent context
CriterionPrompts in the chatADRSpec KitOpenSpec
What it leaves in writing Nothing outside the conversation. One architecture decision: context, decision, status and consequences. A project constitution, the spec, the plan and the tasks. The living specs of the system and one folder per change with proposal, deltas, design and tasks.
Built for Small tasks and exploration. Decisions worth remembering years later. New features with a phased process. Changes to systems that already exist, and new projects too.
Does the spec stay current? Not applicable. An ADR is not edited: if the decision changes, it is marked as superseded by another. In practice it tends to stay spec-first, according to Böckeler. Yes: on archive, the deltas are merged into the spec.
Cost Minimal up front, high in rework. Low. High: rigid phases and lots of markdown. Thoughtworks reports instruction bloat. Medium: every change has to be reviewed and archived.

An ADR and an OpenSpec spec get along well: the ADR explains why we decided something and the spec describes what the system does. On this site they live side by side: design decisions are in a decision log and behavior is in the specs of each change. Kiro, from AWS, follows a similar flow of requirements, design and tasks, but inside its own development environment.

Practical advice

How to start without drowning in markdownLink to this section

  1. Start with a real change in a project that already exists. That is where the value of deltas shows.
  2. Write the why and what is out of scope yourself. The agent can draft the rest, but the intent has to be yours.
  3. Review the proposal before the agent touches code. It is the cheapest review of the whole process.
  4. Make scenarios verifiable. A WHEN and a THEN that someone could turn into a test. If it can't be tested, it is an opinion.
  5. Keep changes small. One folder per change, with a scope you can review in one sitting.
  6. Give the agent a way to check its work. Build, tests and verification tasks inside tasks.md.
  7. Ask for an independent review against the spec. From another person or from another agent that didn't write the code.
  8. Always archive. If you don't merge the deltas, in a month you're going to have specs describing a system that no longer exists.
  9. Don't use it for everything. A typo doesn't need a proposal.

The spec doesn't make the agent smarter.

It forces you to know what you want to build before you ask for it. And that was always the hard part.

Let’s build something that lasts.

I’m not taking new client projects right now, but I’m open to future work. What would you like to talk about?

Tell me about the type of project and the timeline, for when I’m available.

Write to me
© 2026 Christian J. Caldera, Torreón, México