Why Spec-Driven Development Often Feels Hard to Use
Spec-driven development can become a documentation burden when specifications are vague, disconnected from the codebase, or left behind as requirements change. This article explains how short, verifiable contracts, explicit scope boundaries, and a spec-to-test workflow can help teams control drift in AI-assisted development without adding unnecessary process.
Teams adopting spec-driven development do not always gain a stronger sense of control. Instead, they may find themselves filling out templates before requirements are clear, resolving conflicts between chat history and specification files, and reviewing generated code that still misses the mark.
That friction does not mean the method is ineffective. It usually means the specification has not become the single, actionable source of truth. It is simply another document alongside the conversation.
Why Ad Hoc Prompts Do Not Scale
Directing an AI coding tool with natural-language prompts can quickly produce working code snippets for an individual developer. As a project grows, however, prompts, chat histories, and temporary changes become scattered across sessions.
The model must infer intent from whatever context is currently available. Typical failures include missing edge cases, adding unrequested features, ignoring existing tasks, or producing code that looks well structured but does not fit the existing modules.
These failures affect each role differently:
- Developers spend the time saved on coding repeatedly clarifying intent and refactoring.
- Project leads lose traceability over scope and progress because changes lack a stable record.
- Reviewers struggle to determine whether a plausible-looking implementation actually satisfies the acceptance criteria.
The central problem is not that the model lacks intelligence. It is that the project lacks a stable agreement that can be checked and updated incrementally.
Four Engineering Reasons Specifications Become Difficult to Use
1. The specification reads like a manual, not a verifiable contract
Long passages of background, adjectives, and aspirations cannot directly guide implementation or testing. Models may elaborate on whichever statements seem most compelling, while people have no reliable basis for deciding whether the work is complete.
2. The specification is disconnected from the codebase
Describing ideal behavior without documenting existing module boundaries, data constraints, error handling, and areas that must remain untouched encourages generated code to build a separate solution rather than integrate with the current system.
3. Changes do not follow a closed loop
When requirements change midway through implementation, the old specification, old task list, and new conversation may all remain active without a clear order of precedence. Telling someone to “follow the spec” is not useful when they do not know which source to trust.
4. The process is too heavy
If every small change requires a white-paper-length document, developers will bypass the process and return to casual prompting. A method that costs more effort than the problem it addresses is unlikely to survive.
What a Minimum Viable Specification Should Include
There is no need to specify an entire system upfront. A short specification for each change is enough. Use a consistent structure and describe observable behavior:
- Goals and non-goals: State what this change should accomplish and what it explicitly excludes.
- Scope: Identify the modules, interfaces, and data that may change, along with anything that must not be touched.
- Behavioral contract: Define inputs, outputs, state changes, and failure behavior in statements that can be asserted.
- Constraints: Include compatibility requirements, qualitative performance limits, and security and permission boundaries. Avoid slogans that cannot be checked.
- Acceptance criteria: Cover key scenarios, including normal operation, edge cases, and failure paths.
- Open questions: List unresolved decisions separately so the model does not fill them in on its own.
The structure can be brief:
Change: Add status filtering to order queriesNon-goals: Do not change the pagination protocol or add status enum valuesAllowed changes: Query interface and corresponding testsBehavior: If status is omitted, return all orders; an invalid value returnsa parameter error without querying the databaseAcceptance: Pass three test cases covering empty results, a single status,and an invalid status
This text serves both human readers and the model. It is short enough to maintain and specific enough to check against code and tests.
Connect the Specification to an Implementation Loop
The recommended workflow is not “write a long document, then generate everything at once.” It is a sequence of small, closed loops.
First, write the minimum specification and mark any uncertainties. A person should resolve those uncertainties before implementation, or the specification should explicitly say: “Preserve the current behavior; do not infer a new requirement.”
Next, ask the AI coding tool to propose an implementation plan based only on the specification and the existing code structure. The plan should identify:
- Which files need to change.
- Which tests need to be added.
- Which behaviors or changes are prohibited.
After a person confirms the plan, generate or modify the code. Check the result against the acceptance scenarios rather than approving it because it looks reasonable on inspection.
If implementation reveals an error in the specification, update the specification before changing the code, and record the reason in the change history. The audit trail then becomes:
Specification version → Implementation plan → Code and tests
That is more useful than a conversation history that cannot reliably reconstruct the work. When rework is necessary, the team can distinguish between a faulty contract and an implementation that deviated from it.
Task breakdown should also follow the specification. Each task should correspond to one behavior that can be accepted. Mark it complete and attach the corresponding test. Keep vague tasks such as “optimize this” or “refactor while we are here” out of the same change so scope does not expand during generation.
Practical Constraints for Context and Collaboration
Keep specifications in the repository so they are reviewed and versioned with the code, rather than stored only in personal chat sessions.
The context supplied to the model for a given task should include:
- The current specification.
- Summaries of relevant interfaces.
- Failing test cases.
- Explicit prohibitions.
Treat historical conversations as background, not as instructions with higher priority than the current specification.
Teams should also agree on specification granularity. Bug fixes and small interface changes can use short contracts. Cross-module behavior may require a more complete description. During review, prioritize non-goals, failure behavior, and testable acceptance criteria over polished prose or document completeness.
For an existing codebase, start by specifying the boundaries most often changed incorrectly, such as authorization, monetary amounts, and state machines. Do not begin by rewriting all documentation from scratch. The value of a specification lies in reducing costly deviations, not in maximizing documentation coverage.
How to Tell Whether the Method Is Working
Look for straightforward signals rather than unverifiable claims about productivity:
- Is repeated rework on similar issues decreasing?
- Are out-of-scope changes easier to reject during review?
- Do failure scenarios have tests before merging?
- After requirements change, can previous behavior still be traced through the specifications?
If these signals do not improve, simplify the template and tighten the acceptance criteria instead of adding more sections.
Spec-driven development often feels difficult because teams turn it into another document that cannot guide or verify execution. Reduce it to short contracts, make non-goals explicit, connect it to tests, and require specification changes before code changes. It can then stop being an extra layer of process and become an engineering mechanism for controlling drift in AI-assisted development.
