Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

Overview

In AI-assisted specification-driven development, requirements and acceptance criteria are recorded before implementation. AI agents then use those records to produce plans and code. Acceptance criteria describe what must be true for a request to be considered fulfilled, in a form that can be checked later. After implementation, the same criteria are used to compare the code changes with the verification results.

For example, when adding a price range filter to a product search feature, a request such as "Let users filter by price" does not establish whether the boundary prices should be included. Even if code is generated, the requester and the AI agent may have different expectations about its behavior. The expected behavior is therefore defined first and carried through planning, implementation, and verification.

Connecting acceptance criteria, implementation, and verification results to the same change

The diagrams in this article retain their original Japanese labels.

Instead of rereading the entire conversation, the next person responsible can consult the specification and outstanding work. When verification results are also recorded for the relevant change, someone else can independently check the implementer's claim that "It's done."

Deriving verification methods from acceptance criteria

The specification first describes behavior visible to users. For a price range filter, it defines not only normal search behavior but also what happens when only one price is specified or an invalid range is submitted. Consider these three illustrative criteria.

Acceptance criterion Example input Expected behavior
AC-1 Include the boundaries Minimum price ¥1,000, maximum price ¥5,000 Include products priced at ¥1,000 and ¥5,000 in the search results
AC-2 Allow a single bound Minimum price ¥1,000 only Return products priced at ¥1,000 or more
AC-3 Reject invalid ranges Minimum price ¥5,000, maximum price ¥1,000 Return HTTP 400

To satisfy these criteria, the implementer plans which parts of input validation and search processing need to change. The verifier reads the same criteria and prepares tests for boundary values and invalid inputs. For example, even if the test for AC-3 passes, the entire price range filter cannot be considered verified without a check covering AC-1.

Mapping work to results

After defining the requirements, record which tasks correspond to each acceptance criterion. By recording the AC-1 identifier in both the task list and the verification results, it becomes possible to trace the boundary-value requirement to the relevant code and verification outcome.

File names and update procedures depend on the tools used. If the specification, task progress, and verification results are stored in separate files, pass their respective locations to the next person responsible. When the meaning of a requirement changes, revisit its corresponding plan and verification procedures as well.

From implementation to verification

  1. Record the expected behavior in the specification

    The user decides how boundary values and invalid inputs should be handled and records these decisions as acceptance criteria.

  2. Plan the scope and order of work

    The implementer identifies where to modify input validation and search conditions, and assigns acceptance criterion identifiers to each task.

  3. Modify the code according to the plan

    The implementer updates the relevant code and tests and records which files changed and which tasks remain incomplete.

  4. Reproduce the acceptance criteria and record the results

    The verifier exercises the boundary values and invalid inputs, linking the checks performed and their outcomes to the relevant change.

  5. Determine completion from the diff and verification results

    The reviewer compares the specification, change diff, and verification results, identifying remaining issues and decisions that require user input.

The acceptance criteria in this example were devised to illustrate the process. They are not results from tests run with a particular tool or measurements of generated code quality.

Evaluating different types of results separately

A pass at any stage applies to the specific subject examined at that stage. Checking that a specification is properly formatted is different from checking that the code behaves as required.

Check What it establishes What to check afterward
Specification check Whether the requirements and acceptance criteria can be understood Whether the implementation satisfies those criteria
Testing Whether the results for the inputs tested match expectations Whether important conditions remain untested
Independent review Whether another reviewer compared the diff with the supporting evidence Whether the checks remain valid after addressing findings
User acceptance Whether the request is fulfilled in the intended scenario Whether the conditions for release or operation have been met

Verification results should identify the change under examination and the conditions under which the checks were run. If an earlier success report is reused after the code changes, it is unclear whether that report still applies to the new code. Rerun the checks affected by the change and update the results.

Record checks that could not be performed because the necessary environment was unavailable as not run. For example, passing unit tests does not justify reporting a successful connection to the user's environment if that connection has not been tested.

Example workflow with GitHub Spec Kit

GitHub Spec Kit is one way to formalize these handoffs. In the official v1.2.0 workflow examined in this series, project principles are kept separate from feature-specific records, and the process progresses from requirements to implementation.

The Spec Kit workflow from project principles to implementation reconciliation

Requirements are recorded in spec.md, the technical approach in plan.md, and implementation tasks in tasks.md. After implementation, converge compares the implementation against the specification artifacts and returns outstanding work to the task list. Even after this comparison passes, completion is determined using the test and review results required by the project.

Checks tailored to ambiguity

When a specification admits multiple interpretations, add clarify to incorporate questions and answers into the specification. Depending on the problem, use checklist to identify missing requirements or analyze to detect inconsistencies among the specification, plan, and task list.

Distinguish the recommended order in the official documentation from the dependencies that each operation strictly requires. In Spec Kit, the strict prerequisite for plan is specify. The official documentation recommends defining the project principles first. The file structure and operations are covered in detail in a dedicated article.

How GitHub Spec Kit Connects Requirements to Implementation

Returning to the stage where a problem originated

When verification reveals a problem, identify the record in which it originated before continuing to modify the code alone. For example, if the specification does not define whether the minimum and maximum price boundaries are inclusive, return that decision to the specification and then align the plan and code with it.

Artifacts by role and where to send issues back for correction

Problem identified Artifact to revisit What to check after the correction
The meaning of a requirement is unresolved Specification Whether the user's expected behavior is captured in acceptance criteria
The scope or order of work is incomplete Plan and task list Whether the implementer can identify the relevant files and dependency order
Actual behavior differs from expectations Code and tests Whether the corresponding acceptance criteria can be reproduced
A change was missed during review Review record Whether the corrected diff has been reviewed again

When responsibilities are divided among different people, also define which records each person can read and modify. An independent review examines the specification and actual diff in addition to the implementer's explanation. To prevent the workflow from progressing simply because a reviewer changes a pass/fail result, the project must design where reports are stored and who has permission to perform the relevant operations.

Checks proportionate to the change

For a disposable prototype, start by defining inputs and expected results and observing actual behavior. Authentication and operations involving funds, on the other hand, can result in substantial losses if an incorrect decision is made. Rather than determining the process solely by the number of lines changed, assign verification responsibilities and execution permissions according to the impact of failure.

When introducing tools, examine which necessary records and checks they provide. Comparing how they support specification storage, approvals, verification, and resumption of work helps determine which parts to incorporate into your own development process.

15 AI Specification-Driven Development Tools

Conclusion

In AI-assisted specification-driven development, expected behavior is recorded first, and the plan, code, and verification results are linked to the same change. By distinguishing what was verified at each stage and returning to the record where a problem originated, another person can inspect the evidence for completion. When selecting tools, establish where the required records are stored and who determines completion based on which results.

The official GitHub Spec Kit documentation describes the artifacts, dependencies between commands, and recommended workflow.