iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📝

The Value of Specification-Driven Development: Why Write Specs in the Age of AI?

に公開

Introduction: Redefining Specifications in the AI Era

In an age dominated by AI coding agents such as Claude Code, many engineers may wonder, "Do we even need specifications?" If AI can generate high-quality code, is it really necessary to go through the trouble of writing specs? Such skepticism is only natural.

As a software engineer at a major Japanese corporation, I incorporate AI into my daily workflow. Operating in a large-scale organization where many people are involved in development, I noticed the buzz around "Specification-Driven Development" and decided to learn and practice it. Based on my experience applying both Specification-Driven Development and the plan→implement cycle to multiple projects, I have reached a conclusion: The meaning of writing specifications has changed precisely because we are in the AI era.

In new projects with shifting requirements, using Kiro/Speckit to externalize judgment records provided peace of mind, knowing I could report "why we made this decision" a month later. Conversely, for adding features to projects with established frameworks, the plan→implement cycle with brief instructions proved significantly faster. However, I also faced situations where the lack of specifications led to major rework.

In this article, I will break down why we write specifications in the AI era and what their essential value is.

Terminology Note

  • Specification-Driven Development: A methodology where requirements definition, task breakdown, and design decisions are externalized as specifications, and development is conducted in collaboration with AI. This is practiced using tools such as Kiro/Speckit.
  • plan→implement cycle: An iterative workflow where one makes minimal plans (plan), implements them (implement), and reflects the results into the next plan. It leans toward "vibe coding."

The Essence of Specification-Driven Development: Externalizing Judgment Records

Why Do We Preserve Judgments?

Specification-Driven Development aims primarily to save records of intent and judgment externally. You explicitly feed constraints, background, and even rejected proposals into the AI as input. While this slows down initial progress, it provides robustness for long-term maintenance and handovers.

In the early stages of development, situations are often as follows:

Requirements are shifting; it is not yet clear what users truly want. The technology stack and data models are undecided; you are in the stage of considering which framework to use or what data structures are appropriate. The search cost for determining what to build is high.

In such situations, judgments, rejections, and changes in direction occur frequently. You decide to "use this technology," only to find after research that it does not fit the requirements, leading you to switch to another. Such judgments happen on a daily basis.

What Is Lost by Only Using the plan→implement Cycle?

If you choose a development style that repeatedly cycles through plan→implement in this state, selections tend to be made "for now." For instance, you adopt the most famous framework, adopt a general-purpose data structure for the time being, and build "something that works" while accumulating local optimizations.

Because high-performance models can fill in the gaps and create working software even with sloppy prompts, the initial speed is fast. However, the judgments made along the way evaporate in your mind, and information such as "why this technology was chosen," "why this design was adopted," and "why that proposal was rejected" remains neither in the code nor in documentation.

When you look back a week or a month later, you will not understand why the implementation is the way it is. When handing over to team members, you will be unable to explain the background. This is a serious problem, especially in team development.

Value Created by Specification-Driven Development

Specification-Driven Development demonstrates great value in this phase. By externalizing thoughts, reasons for judgment, and task structures as specifications in collaboration with AI, you can leave behind "records of judgment" alongside "working code." By following Kiro/Speckit, these can be managed as Markdown documents together with the code.

For example, if you leave specifications such as: "We adopted PostgreSQL for the database because many team members have experience with it, reducing the learning cost. MongoDB was considered but rejected because a relational data structure is necessary," or "In Phase 1 of the PoC, we scoped the work to include only the implementation of the display function. The technology selection was conducted assuming that this system architecture would be implemented for the notification function in Phase 2," the rationale for these decisions will be clear when looking back later.

This aligns with the classic principle that the ROI (Return on Investment) of design decisions is highest at the beginning. In software development, early design decisions significantly impact downstream processes. If appropriate decisions are made early on, you can prevent rework later. Conversely, if early decisions are wrong, the cost of fixing them later multiplies.

Just as ADR (Architecture Decision Record) preserves only critical decision points, Specification-Driven Development functions as a mechanism to structure the massive amount of judgments created during the exploration phase. While ADR focuses on "records of decisions," I consider the distinguishing feature of Specification-Driven Development to be the ability to externalize the "process of thinking" as well, enabling collaborative work with AI in both the present and the future.

Terminology Note: ADR (Architecture Decision Record)
A lightweight document format for recording significant architecture-related decisions. It concisely records the background of a decision, the options considered, the reason for the choice, and the reasons for rejection. It is a methodology proposed by Michael Nygard and adopted by many development teams.

Specification-Driven Development is optimized for "development for thinking."


Important Perspective: Specifications Output by AI Are Not "Documents for Humans to Read"

When I first started using Kiro/Speckit, the first hurdle I faced was the problem that "the specifications look heavy." While I felt reassured as I made many decisions through dialogue with AI and the specifications were automatically generated with confirmed items accumulating, a growing sense of discomfort emerged: "Who is going to read this later?" and "Isn't it impossible to read all of it?"

To conclude, we need to change how we perceive "specifications generated by AI in Specification-Driven Development."

Specifications Are "Structured Memory to Be Searched and Referenced"

Specifications generated by Specification-Driven Development are not documents to be read verbatim by humans. Specifications become redundant and explicit so they can be fed to AI. They often include reasons for judgments and even rejected proposals. As a result, they tend to be information-heavy for humans. Treating them as "documents that humans should read from beginning to end" leads to an explosion in operational costs. Reading everything every time is unrealistic.

Specifications should not be seen as human-oriented documentation, but as external memory (a Single Source of Truth) shared by humans and AI—structured memory to be searched and referenced. In other words, humans only reference the parts they need, while AI reads it all. I believe this asymmetric design is the essence of Specification-Driven Development.

In this context, it remains important that the specification itself be "easy to read and overview." People often prefer environments where Markdown is easy to handle visually (like IDEs or dedicated editors) to make this referencing experience comfortable. However, this is not about the superiority of tools, but a matter of personal preference.

Commonalities with Living Documentation

A similar line of thought is presented in discussions on Living Documentation. In "Specification by Example," Gojko Adzic argues that specifications should be "living documents" that are always kept up to date. At the same time, however, he points out that the premise that everyone reads all specifications at all times is doomed to fail.

Martin Fowler also states that documentation should be generated naturally as a byproduct of development. Rather than consciously writing documentation, it is ideal to have it generated automatically within the development process.

Terminology Note: Living Documentation
A concept where specifications and documentation are not "written once and finished," but are kept in a "living" state that is constantly updated along with development. It is often discussed in the context of Gojko Adzic's "Specification by Example" and Executable Specifications.


Where plan→implement Works

While I have emphasized the value of Specification-Driven Development, it is not necessarily optimal for every situation.

Situation Changes After the Mid-Development Phase

Once a prototype is running and the technical stack and data models have stabilized, the situation changes.

You now see what needs to be implemented next. It seems possible to add Feature A in order of smallest impact, then Feature B. What needs to be done is clear. The degree of freedom in decision-making has decreased. Since the technical stack is already determined, there is no need to decide "which technology to use." Since the data model is fixed, the decision on "what kind of table structure to create" is also limited.

If you have not reached the state described above, it means you have not yet entered the mid-development phase, and you should continue to solidify the foundation using Specification-Driven Development.

The Principle of "Less context, better code"

In the sense of preparing specifications for humans to read, as long as there are no major changes to the specifications, documentation only needs maintenance, and the need to write out every judgment as a specification diminishes. Also, in the sense of preparing specifications for AI to read, a short prompt is sufficient for local changes. With a brief instruction like "Add a feature to this API endpoint to return a user list," AI can generate appropriate code.

In fact, as the saying "Less context, better code" goes, providing too much context to an AI can sometimes cause problems:

  • It takes time to process a large amount of context, slowing down inference.
  • Irrelevant information may be mixed in like noise, potentially distorting the AI's judgment.
  • It may become overly conscious of the entire context, leading to unnecessary complexity in simple changes.

In this phase, the focus shifts to high-speed iterations through short instructions. "plan→implement" is optimized for "development for building."

However, this does not mean that Specification-Driven Development becomes completely unnecessary after the initial development phase. If there are major decisions that affect the architecture, the specifications should be updated and recorded.

Future Outlook: Will Specification-Driven Development Become Obsolete?

If model performance continues to improve, there is a high possibility that we will reach a world where "plan→implement" alone does not lead to failure.

In the future, as AI becomes sufficiently intelligent, it might be able to autonomously research project-related materials stored in the cloud and make appropriate decisions without requiring detailed specifications. It might automatically refer to past decisions and generate consistent code. If that happens, the necessity for humans to explicitly write out specifications will likely diminish.

Specifications Themselves Will Remain Useful

However, I believe that the external memory provided by specifications themselves will remain useful.

In organizational development, multiple members are involved in the same project. Externalization is necessary to share the knowledge residing within individuals' heads.

In long-term operation, developers change. Records are necessary to hand over past decisions to new members.

In consensus building with multiple stakeholders, it is necessary to explain technical decisions to non-technical people. With a specification document, you can demonstrate the rationale behind your decisions.

The Rise of Understanding Debt

https://zenn.dev/coconala/articles/f8e4b637f64f9a

Rather, as AI coding becomes more widespread, the need to explain "why this code was generated" will increase. As expressed in recent years by the term "understanding debt" (or comprehension debt), the cost of understanding the intent and decisions behind AI-generated code is increasing. Perhaps the value of leaving a history of decisions will only grow in the AI era.


Conclusion

In this article, I have organized the essential value of Specification-Driven Development as the "externalization of decision records."

  • Specification-Driven Development is optimized for "development for thinking."
  • AI-generated specifications are not documents for humans to read, but structured memory to be searched and referenced.
  • plan→implement is effective for "development for building" from the mid-development phase onwards.
  • It is precisely because of the AI era that the value of preserving a history of decisions has increased.

The important thing is not which is superior, Specification-Driven Development or plan→implement, but rather identifying which phase you are currently in.

Discussion