In my previous article, Spec-Driven Development: The New Waterfall, and It's a Good Thing I drafted a connection between Spec-Driven Development and the Waterfall Model. SDD, just like Waterfall brings the documentation back to the game - the thing agile methodologies IMHO never did right.
In SDD, the documentation now plays the role of the Single Source of Truth about the system. This is different from how we wrote the software in the last 20+ years, where the code was the ultimate authority - often becase we did not have any other reliable artifact 😛. The coding agents just trust the spec contents and that also creates... a Single Point of Failure, when the spec goes stale: the requirements are no longer valid or start contradicting each other.
In this article, I will share a couple of general thoughts on this topic and a couple of observations from two of the SDD projects I'm involved in.
Staleness: It Just Happens
The problem with SDD is that the spec can go stale. The agents will code just whatever is there. That's what I'm worried about.
Don't blame Spec-Driven Development for this. Everything that is a Single Source of Truth is vulnerable to the staleness problem: be this the code, the documentation, the spec, the dataset... If we ever invent a completely novel source of truth about the software that would replace specs, code and everything - the staleness question will emerge there naturally, too. The mere fact that it occurs is just an observation of the natural process.
Look at the code: one can say that the code can't go stale, because it needs to compile and give the working system. The deterministic nature of code is a really strong feature, no doubt. But have you ever seen a system originally designed for thing A that developers had to adapt in rush to do the thing B, then C? Have you every seen a codebase with business knowledge encoded in cryptic IF-s? That's where the staleness appears in the code. We like to call it technical debt, legacy, etc.:
- The core is still for the obsolete thing A.
- We build things B and C as more and more layers of workarounds.
- At some point, the complexity makes us get stuck, if we do nothing about it.
That's why we do reworks, refactors, and we ask for time to do it.
So here's how we should look at the stale spec problem: it's not about looking for a "magic" approach, where staleness doesn't happen. It will. We should look for techniques specific to the given Source of Truth that help us minimize the problem and bring it to the manageable level.
Validate, validate, validate
The most basic and obvious technique is the validation of the spec after we wrote it. We can also call it review, because in essence, it's the same thing: we give the output to someone else, with fresh, unbiased perspective to spot issues. It works well in the AI world, too, because:
- The AI can hallucinate and will hallucinate, introducing bugs, contradictions and issues.
- The same AI is extremely good at spotting the same bugs, contradictions, and issues, when tasked to do so.
In my projects, the first thing I look at is how the review process works: no matter what tools I use (e.g. OpenSpec, in-house instructions for the agents... ). We can see that a lot of today's attention goes into the optimization of the spec validation process. The recently open-sourced Google's Elephant-Goldfish Model is a good example. It introduces the following workflow:
- Design with a heavy "elephant" agent with the knowledge of the project, memory, etc.
- Review with independent, short-lived, stateless "goldfish" agents that aim to introduce a "fresh-eye" perspective.
Having a validation workflow is necessary to deal with the staleness problem. For small projects, it's also sufficient. The challenge beings, when things start going big - just any review process may not be enough.
Requirement Hierarchy
Long ago, I noticed that requirements are not born equal. There is certainly a difference between two (random, imagined) statements like this:
- Three days before a deadline for signing a document, the system shall send a reminder via configured communication channels (e.g. e-mail, sms)
- All documents must pass a mandatory stakeholder review before they become available for signing.
The first statement just clarifies a single, localized corner case. The second one establishes a whole business sub-process with many dependent requirements.
I like the analogy to the building, where some requirements set up a baseline for others that build on top of it - in other words, they form a hierarchy:
The key observation is that the more general the requirement is, the more costly/disruptive it is to change it. The cost can represent anything: from code changes to the impact on other requirements. We often call the changes of those fundamental requirements "pivots", especially if we already built sufficiently enough on them.
Worth noting: this is just the nature of the requirements, unrelated to any particular software development methodology. Certain decisions need to follow in order even in agile. It's obvious if we recall situations, where we report "I'm blocked, because I'm waiting for someone else's decision, and I don't know what to do". It's obvious, if we recall situations, where a change of direction in the late sprint invalidated the work done in several previous sprints.
Divide and Conquer
A change of a single - but fundamental - requirement may make a large part of the spec obsolete. And that's just how the world works.
That's the conclusion coming from the observations in Requirements Hierarchy. Unfortunately, it's also a challenge for the spec management. It's true that the AI agent can evaluate a lot of requirements against each other in short time. But "a lot" ≠ "infinite amount" - AI is not a magic oracle, and it also has resource limitations. They are just large enough that small projects may not run into them, creating an illusion of infinite precision.
If the problem becomes too large as a whole, why not dividing it into smaller sub-problems, small but meaningful enough to solve independently? That's a well known Divide and Conquer paradigm.
One of my side projects that I develop with SDD is a my API collection. I use it also as a test ground for a couple of SDD ideas. Here I combined my knowledge about the dependencies between different parts of the project with Divide and Conquer to my advantage. This is how the project looks like:
Each API is an independent module, but all of them share a common core that provides common approach to things like authorization, error handling or billing. Let's take a look at the interplay between them:
- Each API has its own business requirements.
- A change in one API does not affect other API-s, but it must follow the core principles from the core.
- A change in one of the core topics may affect multiple API-s, but only at the point of contact. It should never trigger a change in the key business logic of any API.
I built the entire review workflow around these principles with a couple of custom agent skills:
- Drafting a spec change (by hand, or agent-assisted)
- For API specs:
/validate-api-spec: checks the internal consistency of a single API spec, and the compatibility with the used mechanisms of the core. - For core specs:
-
/validate-core-spec- checks the internal consistency of the given core spec (phase 1). -
/check-core-impact- analyzes, how the change in a core spec impacts API specs (phase 2).
-
Combined with a discipline to change a single either API or architecture spec at a time, I got a neat workflow that scaled easily to the growing number of API-s. It focuses agent's attention on a single, relatively small *.md file, which contains 10-30 related requirements. When I change the API, I need to validate only those 10-30 requirements, not the entire project, and the agent has very simple, clean rules to understand the scope. Even for /check-core-impact, there's usually only 1 or 2 requirements in each spec that refer the given core mechanism, so again: the agent does not need to scan all of them. I've been working with this workflow for some time and it really did the job for me.
Granularity of Changes
Working in smaller increments helps agents stay focused on important things.
The challenge of working with AI agents is that you can give them a problem of literally any size. As long as you have enough time and tokens, the agent will do it for you. But the good, old Single Responsibility Principle applies also here and helps the agents stay focused on the right thing.
Not so long ago, we decided to do a full, agentic rewrite of an important, in-house library with years of accumulated technical/maintenance debt. The process comprised a couple of stages, and we quite intentionally decided to do it in a Big-bang approach - not only to ensure discovering all features the teams might have used, but also to test the limits of the agents. That was the entire flow:
The interesting part is that we included not 1 input, but 3. In addition to the old library, we also had a large, unfinished feature on a branch we really wanted to have from day 1. We also had guidelines for the new architecture and things from the old codebase that we knew they didn't work (things to avoid). So, the agents had quite a lot of work to do!
The rewrite succeded - we got a working product that we decided to continue with, but... our Big-Bang Approach required us to deal with a couple of challenges on the way:
- Long open-issue list: The initial list of open issues contained about 60 items. Reviewing them without getting lost was a real challenge. We managed to do it just because I had large knowledge about both the old library and the domain.
- Code does not follow specs: The agents coded a couple of details differently than the spec stated.
- Creative inventions: The agents added two mechanisms that the spec never mentioned. The intent was good (improving the testability), but the additions broke the Single Responsibility Principle and duplicated some of the logic.
Only the careful review of both the code and the spec allowed us to capture the problems and progressively remove them before releasing the library for the first time. The differences were technically correct, but we knew we should not ship them in the finished product. For example, one of the agent innovations was choosing the different default value for one of the main settings, than in the old library and that the spec wanted. But...
- The expected default was neutral for 80% of users, and beneficial for the remaining 20%.
- The agent's default was also neutral for 80% of users, and negatively impacted the stability of the remaining 20%.
I knew it, because the old library also used to have that default in the past. We intentionally changed it later, when we noticed that those 20% of users forgot to read the docs and harden their project until they experienced an outage. The agent basically reversed that change, and I even discovered why:
- The old library was a monolith, the new library had modular architecture.
- In the old code, the setting was controlled in 1 place.
- In the new code, there were two layers that applied setting (core and framework integration) + the expected "default" value was dependent on the functionality provided by yet another module.
When the agent faced the new requirements, it discovered the interplay between all these parts. It autonomously concluded that the least disruptive way to solve it would be to use a different default value. It did the best possible job to follow the instructions... just in this case, the instructions were the problem. The problem so subtle that the review process did not find it.
The trivial lesson from this project is that you should work in smaller increments to stay focused (both you and the agent). But let's try to go deeper and see why smaller increments actually work. The invariant thing is the Expert's Judgement: our expertise, understanding of the project and our ability to make opinionated decisions. If we want to understand, what we ship - we need to apply it somewhere, and we can't just skip this part:
- Big-Bang Approach (a single, large coding task): we apply it once, as a single, large review.
- Small increments (multiple small, incremental coding tasks): we apply it in smaller, more digestible chunks.
Conclusion
I think that the main challenge with staleness in SDD is that it's so easy to say "I don't care, just do it". With hand-crafted software, you really had no option: you had to understand what you code, otherwise it was almost impossible to finish any bigger change. Agents can do anything and it's both a benefit and a trap that may get us into serious maintenance trouble. If you don't understand what you build, how can you say that you own it? In this article we discussed a couple of observations and tactics about the staleness:
- Staleness Happens: you can't magically escape from it, only manage and minimze
- Review Matters: both by agents and by humans
- Divide and Conquer: to reduce the number of requirements the agent needs to track in a single change.
- Small Increments and the relationship to Expert's Judgement.
And the last one - probably the hardest one for some of us - is our own discipline. But to be honest, it was also important before the AI.




