Skip to content
Maxwell CollinsContact

The AI Development Governance Manual, a book on governing AI coding agents

A commercial book and install pack that teaches teams to make AI coding agents produce correct software.

What it achieved

$282,000estimated yearly saving on a twelve-product platform

The book's method for controlling AI coding agents saved a twelve-product software platform an estimated $282,000 a year.

The short version

The book's method for controlling AI coding agents saved a twelve-product software platform an estimated $282,000 a year, and cut a booking platform from three or four AI sessions per feature to one. Maxwell wrote The AI Development Governance Manual, a fifty-page commercial book in six parts and fifteen chapters. It teaches CTOs, tech leads, senior developers and solo founders how to make AI coding agents produce correct software. It draws on over 150 sources and on two systems he governed himself: a twelve-product property-technology platform and a multi-tenant booking platform. It is sold with an installable pack of twenty ready-made blocking rules, instruction-file templates, a mistakes guide and five diagrams. It is published under his business, Code Rescue.

The problem

Teams adopting AI coding agents hit the same failures again and again. Agents stop following their instruction files, lose context mid-session, and write tests that pass without testing anything. Architecture erodes one plausible change at a time, and security holes appear that nobody wrote on purpose. Most advice says to write better prompts, which asks the agent to police itself.

In use

  1. A reader starts with the thirty-minute first session in chapter 12 and installs the companion pack the same day.
  2. They write the truth documents that say what is true about their system.
  3. They add enforcement layers that refuse what is wrong, whether or not the agent cooperates.
  4. They move human review to the specification, where it is cheap, through a governed pipeline.

What it achieved

  • Saved a twelve-product software platform an estimated $282,000 a year, and gave it 4,784 automated tests across 381 suites in its first sprint, covering more than 80% of the code's decision paths.
  • Each new feature on a booking platform went from three or four AI work sessions to one.
  • A reader goes from nothing to a governed project in thirty minutes, with a companion pack installed the same day: twenty ready-made rules that block the costliest AI mistakes (leaked secrets, skipped tests, money stored as inexact numbers), instruction-file templates, a mistakes guide and five diagrams.
  • Published as a commercial book under his business, Code Rescue, drawing on over 150 sources.

The full record

On this page
In one sentence

Maxwell built The AI Development Governance Manual: How to Control AI-Assisted Development Before It Controls You, a fifty-page commercial governance book in six parts and fifteen chapters, drawn from over 150 sources and from two systems he governed himself (a twelve-product property-technology platform and a multi-tenant booking SaaS), that teaches CTOs, tech leads, senior developers and solo founders how to make AI coding agents produce correct software, sold with an installable companion pack of twenty production-ready hookify block rules, two-tier CLAUDE.md templates, a mistakes-to-avoid guide and five diagrams. He builds by directing AI agents, and he built this manual and its pack that way.

pages
50
chapters
15
sources
150+
block rules in the pack
20
diagrams
5

What it does

The manual is a working method for a team, or one person, who wants AI coding agents (Claude Code, Cursor, Copilot, Windsurf) to build real software without the failures that come with them. It does not depend on any one tool. Its argument is that an agent cannot be trusted by asking it to behave, so behavior has to be governed by three things: truth documents that say what is true, enforcement layers that refuse what is wrong, and a governed pipeline in which humans review specifications instead of code. Every chapter ends with a key-takeaway box, and the companion pack turns the method into files a reader installs the same day.

Part I: The problem

Chapter 1, Why AI-assisted development needs governance, sets out the evidence: a 45% vulnerability rate in AI-written code, and accuracy that falls from 87% on a single function to 19% on multi-file work. It names five failure modes and explains each: instruction degradation (agent instruction files stop working beyond about 150 lines), context drift (information lost when the conversation is compacted), testing theater (tests that pass without proving anything), architecture erosion and security negligence, and the "vibe coding death spiral" they produce together. It frames governance through a car-safety analogy: seatbelts and anti-lock brakes are not optional because the driver is good.

Part II: The governance system

  • Chapter 2, Truth documents. A truth hierarchy from most to least authoritative: the constitution, then the specification, then the API contracts, then the code, with a variant for SaaS products that puts business logic at the top. It gives ten real constitutional invariants from a 500-million-record property platform (central token authentication, all data through one API layer, time-ordered UUIDv7 identifiers, time-zone-aware timestamps, an append-only audit log, a single spatial reference system, test-driven development, fail-closed security, a quality gate before every commit and trunk-based development). It shows how to keep an agent instruction file under about 150 lines with no style rules in it, inheriting about 100 lines at ecosystem level and about 50 per product, and which supporting documents carry the rest.
  • Chapter 3, Enforcement. Five layers of defense: real-time hookify rules, event-driven hooks, pre-commit, pre-push and CI/CD. It documents a critical flaw in the hookify tool (warning messages never reach the AI), which is why every rule in the twelve-product system blocks instead of warning. It specifies three essential hooks (re-orienting the session, enforcing skills, injecting governance into every helper agent), the hook exit codes, and the quality gate in order (lint, type check, structural pattern checks, dependency constraints, tests: affected tests before a commit, the full suite before a push). Skipping the hooks must itself be blocked, or the system is "a suggestion system with extra steps." It closes with a map of what belongs where: invariants in enforcement rules, style in linters, workflows in skills, context in the instruction file.
  • Chapter 4, The governed pipeline. Five phases, each closed by a human gate: specify (given-when-then criteria written by one agent and checked by a reviewer agent), plan (three parallel exploration agents, method signatures only, a constitution compliance table), tasks (failing test before passing code, no more than three files per task, every task self-contained), implement (a fresh helper agent per task with the constitution injected, the test commit separate from the implementation commit) and review (three parallel reviewers, findings rated critical, important or minor, false positives filtered, a report written for two audiences). Reviewing specifications instead of code cuts the review burden tenfold. A failure protocol stops the agent after two attempts at a failing test, two at a type error or three in all, and hands the problem to a person.
  • Chapter 5, Context and memory. When compaction triggers (at about 98% of the window) and what it loses; keeping about a quarter of the window free; where quality starts to fall; the difference between session memory and instruction files; three kinds of memory (factual, experiential and working); keeping the memory index under 200 lines; why contextual memory outperformed retrieval (84.23% against 80.05% accuracy at a tenth of the cost); and a weekly memory review.

Part III: Scaling

  • Chapter 6, Multi-agent orchestration. Four patterns (sequential, parallel fan-out and fan-in, hierarchical and event-driven), the practical limit of three to four agents at once, why helper agents must be handed governance explicitly, and the prompt patterns that work for agents: chain-of-thought, reason-and-act, reflection and self-correction.
  • Chapter 7, Monorepo governance and API contracts. When to choose a monorepo (more than 30% of changes cross product lines), a decision table between Nx and Turborepo, consumer-driven contract testing for twelve consumer apps on one API, code ownership, affected-only commands and cache discipline.

Part IV: Stack-specific guidance

  • Chapter 8, NestJS: three test tiers (unit, integration on SQLite, end-to-end on Postgres), 80% branch coverage or more, and the rules to block: database access outside the data layer, raw SQL, network calls inside transactions, mutations without idempotency and writes outside the command and repository pattern.
  • Chapter 9, Next.js: the test stack, client and server state, and a performance gate that fails the build below a Lighthouse score of 90.
  • Chapter 10, Mobile: test stacks for Swift, Kotlin and React Native, matrix builds, and where governance tooling for mobile falls short.

Part V: Practical application

  • Chapter 11, Case studies. Three systems he governed. A solo SaaS, a multi-tenant booking platform with payments and an AI phone agent: a 22-section constitution, a four-tier truth hierarchy, a money type that makes float arithmetic impossible, time read from one file only, 15 guard scripts and 14 decision records, which brought a feature from three or four sessions down to one. An enterprise platform of twelve products (one API, six web apps and five mobile apps) over 500 million records and five stacks: ten invariants, thirteen real-time rules, eight skills and three lifecycle hooks produced 4,784 tests across 381 suites in the first sprint, branch coverage above 80% and an estimated $282,000 a year saved. GuardRails, his plugin that turns eleven plain-English questions into a project's whole governance stack (see the governance plugins page).
  • Chapter 12, Your first 30 minutes. Four time-boxed steps from nothing to a governed project, and a ten-item minimum governance checklist.

Part VI: Reference

  • Chapter 13, Roadmap: month one foundation, month two the first governed product, month three scaling to no more than four parallel agents, months four to six the full ecosystem, with a timeline by team size from solo (two to three weeks) to enterprise (six months and more).
  • Chapter 14, The ten costliest mistakes: instruction-file bloat, the warning bug, too many agents, trust without enforcement, the vibe spiral, testing theater, cache invalidation, retrieval for agentic work, speed without governance and the legacy trap.
  • Chapter 15, Tools: a plugin evaluation table and the monorepo build tools compared.
  • Appendix A groups the 150+ sources into eight topic bands; Appendix B is a glossary.

The five diagrams

  1. Ungoverned against governed: the same team before and after, with 13 block rules, one session per feature instead of three or four, 4,784 tests, coverage above 80% and $282,000 a year.
  2. The truth hierarchy.
  3. The defense-in-depth stack of five enforcement layers.
  4. The governed pipeline, with the tenfold drop in review burden.
  5. The memory hierarchy: the ecosystem tier (an instruction file of about 100 lines, a memory index under 200, architecture, testing and shared-pattern files, audited quarterly), the product tier for each of twelve products (about 50 lines, product memory and product quirks, reviewed weekly) and the temporary session tier.

The companion pack

Twenty production-ready hookify block rules, each written in hookify's own format with its match patterns and explained in four parts (the rule, what it catches, why it matters, how to adapt it), installed by saving each as a file in the project's .hookify/ folder. Every one blocks; none merely warns.

  • Security: no hard-coded secrets (key, secret, password and token assignments, production and test payment keys, cloud access keys); no skipping git hooks; no dangerous shell commands (deleting from root, force-pushing, world-writable permissions, hard resets); no fail-open security (empty catch blocks, catches that return true, swallowed authentication errors); no debug code in production.
  • Testing integrity: no skipped tests; no weakened assertions (truthy checks, "is defined" checks, assertions that cannot fail); no deleted tests; tests and implementation in separate commits; no drop in a file's assertion count.
  • Architecture: no direct database access from consumer apps; no circular dependencies; no feature branches (trunk-based development); no wrong-layer imports; no updates or deletes on audit and observation records.
  • Data integrity and code quality: no floating-point money; no reading the clock outside the time service; no random UUIDv4 identifiers; no timestamps without a time zone; no console logging in source.

It names the five rules to install first: secrets, hook skipping, test skipping, fail-open security and dangerous commands.

Two-tier CLAUDE.md templates, held under 150 lines together. The ecosystem tier (about 95 lines, at the repository root) covers the overview, architecture, eight constitutional invariants, shared commands, shared patterns for errors, data access, testing, money and time, the failure protocol, the truth hierarchy and a "do not put in this file" section. The product tier (about 45 lines, in each app) covers context, stack, key files, product commands, product patterns, product quirks and dependencies on other products. An annotated walkthrough explains why each section exists and its line budget, with a five-question table for deciding what stays.

A mistakes-to-avoid guide with the ten most expensive mistakes, four cases where expert sources contradict each other (each resolved by naming the deciding factor) and a quick-reference list of prevention rules. The pack also carries the five diagrams as standalone SVG files and a redistribution bundle.

What it achieved

  • A complete, sellable method: fifty pages, six parts, fifteen chapters, two appendices and over 150 sources, published under his business, Code Rescue.
  • Figures from systems he governed, not hypotheticals: 4,784 tests across 381 suites in the first sprint of a twelve-product platform, branch coverage above 80%, an estimated $282,000 a year saved, and a booking SaaS that went from three or four sessions per feature to one.
  • A companion pack a reader installs in minutes: twenty block rules (602 lines), two-tier templates (192 lines), a mistakes guide (242 lines) and five diagrams.
  • A path anyone can start on: a 30-minute first session, a ten-item minimum checklist and a six-month roadmap by team size.

The problem it solves

Teams adopting AI coding agents meet the same failures again and again: instruction files the agent stops following, context lost mid-session, tests that pass without testing anything, architecture that erodes one plausible change at a time and security holes no one wrote on purpose. Most advice tells people to write better prompts, which asks the agent to police itself. The manual gives them a system instead: documents that fix what is true, layers that refuse what is wrong whether or not the agent cooperates, and a pipeline that moves human review to the specification, where it is cheap. It also documents the traps practitioners only find the hard way, such as warning rules that never reach the AI.

How he built it

Maxwell built the manual from his own production work. The methods in it were first built and run on the systems in its case studies: the constitution, truth hierarchy, guard scripts and decision records of the booking SaaS; the invariants, real-time rules, skills and lifecycle hooks of the twelve-product platform; and GuardRails, which automates the setup. The manual carries the fixes from those systems, such as replacing every warning rule with a block.

He directed AI agents to research the field across more than 150 sources, resolved the places where sources contradicted each other by naming the factor that decides each case, and wrote the result as a structured book with a takeaway at the end of every chapter. The companion pack was extracted from rules and templates already in service, rewritten so any team can adapt them, and shipped with the diagrams as files so a reader moves from reading to an enforced project in one sitting.