Front-loading Requirement Reviews: Making Spec-Driven Development Truly Work
Spec-Driven Development (SDD) has become a standard workflow for AI-assisted coding, yet developers still frequently encounter hidden defects and unmaintainable code generated by models. This article explores the root cause: poor input quality rather than poor coding capabilities. By introducing a mandatory review and reflection phase between the proposal and implementation stages, teams can intercept ambiguities before they materialize into code defects. We share a practical workflow, a reusable review checklist, and a cost-benefit analysis demonstrating how process design can elevate mid-tier models to flagship-level engineering performance.
Front-loading Requirement Reviews: Making Spec-Driven Development Truly Work
As AI-assisted programming becomes ubiquitous, an increasing number of teams are adopting Spec-Driven Development (SDD) to organize human-machine collaboration. The core idea is to first clarify requirements collaboratively with the model to produce a structured specification proposal, then let the model implement the code based on that proposal, and finally form a closed loop through verification and archiving. A typical cycle can be summarized into five stages: Explore, Propose, Implement, Verify, and Archive.
This workflow certainly equips large language models with the ability to handle complex projects. However, in real-world usage, many developers (myself included) encounter the same dilemma: even when strictly following the SDD process, the model still produces hidden defects or piles up unmaintainable “spaghetti” code. Modifying module A but forgetting module B, missing edge cases, and lacking exception paths—these issues often only surface after the project runs for a while, making developers hesitant to push generated code directly into production environments.
After a period of trial and error, followed by deep reflection, I identified the true root cause and built an effective improvement framework. This article shares this practical experience in detail.
1. Problem Identification: Defects are “Input” rather than “Written”
My initial improvement approach was the same as most: adding a round of code review after the implementation phase, allowing an independent reviewer role to perform static analysis and architectural checks on the changes. This occasionally caught issues, but the return on investment was very limited. The reason is that it assumes a flawed premise—defects primarily originate during the coding phase.
Stepping back from the code level to re-examine the entire workflow, I realized a long-ignored fact: we subconsciously scrutinize the quality of the AI’s output from a code quality perspective, but rarely examine the quality of the input fed to the AI. A typical scenario involves discussing requirements with the model, generating a proposal document, and immediately instructing the model to begin implementation. Residual requirement ambiguities, missing scenarios, and inconsistent terminology in the proposal are faithfully “implemented” by the model—I call these “input defects.” Afterward, we habitually blame the model’s lack of capability.
Recalling traditional software development: after a product manager submits a requirement, there is an indispensable step before formal coding begins—the requirement review. Engineers will not start working until every issue in the requirement and design documents is clarified. This quality gate, considered common sense in the “traditional programming” era, has been inadvertently dismantled in the AI programming era. AI happens to be the most “obedient” executor: if the input is ambiguous, it won’t stop to question it; instead, it fills the gap with its own understanding, manufacturing defects at scale and in a hidden manner.
2. Core Solution: Introducing Review and Reflection in the Proposal Stage
Based on the above assessment, I made a critical modification to the workflow: inserting a mandatory review and reflection phase between “Propose” and “Implement”, shifting the quality interception point forward to before coding. The modified workflow is as follows:
- Explore Stage: Fully discuss the background, goals, and constraints with the model to form a mutual understanding of the problem.
- Propose Stage: Produce a structured proposal, including target descriptions, scope of changes, API contracts, data structures, edge cases and exception handling strategies, impact analysis on existing modules, and acceptance criteria.
- Review Stage: Launch an independent review perspective (which can be another session or a reviewer role driven by a different set of prompts) to interrogate the proposal item by item and produce an issue list.
- Reflect and Revise Stage: Feed the issue list back to the proposer, requiring a response to each item—either revise the proposal or explicitly state the reasons for not adopting the suggestion. Iterate multiple times until converged if necessary.
- Implement Stage: Code strictly based on the review-approved proposal. Unauthorized scope expansion during implementation is prohibited.
- Verify and Archive: Verify item by item against the acceptance criteria in the proposal. Archive after passing to form a traceable decision record.
The key to this design is “role separation”: the review perspective must be independent of the proposal perspective, otherwise the model easily falls into self-affirmation. In practice, you can use explicit prompt constraints to make the reviewer act as a “picky senior architect” and mandate that they check fixed dimensions such as requirement completeness, edge case coverage, compatibility impact, testability, and security risks, avoiding vague generalities.
3. Review Checklist: Making Reflection Actionable
To prevent the review phase from becoming a mere formality, I have consolidated a reusable checklist for your reference:
- Goal Consistency: Does the proposal accurately restate the original requirements? Has the requirement scope been quietly changed?
- Scenario Completeness: Besides the main flow, are exception flows, concurrency scenarios, null values, and extreme values all addressed?
- Impact Analysis: Which existing modules are involved in this change? Do dependencies need synchronous adjustments? Are there any missed call sites?
- Data Compatibility: How is legacy data migrated? Can old and new versions transition smoothly? Is it rollback-able?
- Verifiability: Does every change have clear acceptance criteria? Can it be covered by automated tests?
- Complexity Control: Does the solution introduce unnecessary abstractions? Can the goal be achieved in a simpler way?
Each review round is required to output a three-part record of “Issue - Severity Level - Suggestion”, and the reflection phase requires closing the loop on every item. Usually, after two or three rounds of iteration, the proposal quality improves visibly.
4. Practical Results and Cost Trade-offs
After nearly a month of verification across multiple real projects, the changes brought by this reflection workflow are significant: using models of the same capability tier, the defect rate of the generated code has dropped noticeably. In particular, cross-module consistency issues like “fixing one thing but breaking another” have been drastically reduced, giving us the fundamental confidence to push the code into production. In other words, by using process design to bridge the capability gap of models, mid-tier models can achieve engineering performance approaching that of flagship models.
Of course, the cost is objective: multiple rounds of review and revision consume more time, and token overhead increases. However, compared to the cost of post-production debugging and refactoring, this upfront investment is entirely worthwhile. This is essentially trading deterministic process costs for uncertain quality risks—the exact same value logic as requirement reviews in traditional engineering.
5. Conclusion
In the era of AI programming, model capability is undoubtedly important, but workflow design equally determines the ceiling of output quality. Before we complain about the model “writing bad code,” we might as well first check: has the proposal we fed it truly passed a human-engineer-level review? Reintroducing the classic practice of requirement review into Spec-Driven Development, making the reflection mechanism a fixed component of the workflow, is perhaps the most cost-effective quality improvement lever at this current stage.
