Specs, Guidelines, and Sensors in Spec-Driven Development Writing guidelines for AI coding agents is insufficient without automated "sensors" that fail the build when code violates a rule, according to a Spec-Driven Development article that cites Neal Ford, Rebecca Parsons, and Patrick Kua's concept of fitness functions from their book "Building Evolutionary Architectures." The article argues that specs should state only business behavior, while implementation details belong in guidelines split into company-wide and project-specific levels, and it illustrates the approach with ADR-003, which bans JPA in favor of jOOQ using a Maven Enforcer rule named "adr-003-no-jpa" and an ArchUnit rule named "adr003NoJpa." The author contends that without such checks an AI agent will eventually add spring-boot-starter-data-jpa while the build stays green and nobody notices. Specs describe the what In Spec-Driven Development, the specification says what the system must do, not how it does it. In practice, many specs mix both. A typical example is a use case step like this: "The user clicks the Save button in the Vaadin Grid, and the service calls the repository." This step mixes business behavior with UI technology and internal design. A business expert cannot review it, and when you change the UI framework or the persistence layer, the spec is wrong although the business behavior is the same. A good step says only what matters to the business: "The clerk saves the order. The system checks that the delivery date is in the future." It stays valid when the technology changes. Leaving the how out of the spec does not mean leaving it out of the project. If nobody writes it down, the AI agent decides it, and it may decide differently each time it generates the code. The how belongs to the guidelines The how belongs in the guidelines. You write them once, and every use case uses them. Guidelines contain three things: - Coding and design rules , for example naming, null handling, how to write a Vaadin view, how to structure a jOOQ query. - The general architecture , for example layers, modules, Self-Contained Systems, how systems talk to each other. - Architecture Decision Records ADRs , the concrete decisions with their reasons, for example "we use jOOQ, not JPA". I split them into two levels. Company-wide guidelines are the same in every project, so a team can reuse its Spring Boot, Vaadin, and jOOQ rules. Project-specific guidelines hold decisions for one project only, for example which payment provider we call. A guideline without a sensor is only a wish Writing guidelines down is not enough. An AI agent follows them most of the time and then drifts away, for example when the context gets long or when its training examples point in another direction. Developers drift too. So every guideline needs a sensor: an automatic check that fails when the code breaks the rule. Sensors also give the agent fast feedback. When the build fails with a clear message, the agent fixes the mistake in its next step, before a human reviews the code. So the message should say what is wrong and which rule it breaks. Neal Ford, Rebecca Parsons, and Patrick Kua call these checks fitness functions in their book "Building Evolutionary Architectures". When AI agents write most of the code, you need them for every guideline. Example: "We use jOOQ, not JPA" In my projects I use jOOQ for database access, not JPA. The ADR looks like this: ADR-003: Use jOOQ instead of JPA Status: Accepted Context The application is database-centric. We need full control over SQL, vendor features of Oracle and PostgreSQL, and type safety at compile time. Decision All database access uses jOOQ with code generated from the schema. JPA, Hibernate, and Spring Data JPA are not used. Consequences No lazy loading problems and no hidden queries. Developers must know SQL. Verification - Maven Enforcer rule "adr-003-no-jpa" bans the JPA dependencies. - ArchUnit rule "adr003NoJpa" bans the JPA packages in the code. An AI agent that implements a new use case has seen thousands of Spring Boot examples with @Entity and JpaRepository . Without a sensor, it will sooner or later add spring-boot-starter-data-jpa . The build stays green, and nobody notices. Sensor 1: ban the dependency The first sensor works on the build level. The Maven Enforcer Plugin fails the build when a banned dependency appears, also as a transitive dependency.