Governance-centric agentic software engineering

Agent Governance Mechanisms

Generative AI is shifting software engineering from a practice built around scarce implementation toward one built around abundant, low-cost code. The hard part stops being writing code and becomes governing the conditions under which fast code can be trusted. That means keeping it inspectable, correctable, and maintainable at speed.

QUICK START: Install the skills for Claude →

Between two schools of thought

Two common ways to build with agents sit at opposite ends of a spectrum. This site is about the midway.

Vibe coding

Prompt an agent, accept what looks right, iterate by feel. Fast and fluid, but quality rests on the model and your eye. At scale the same failures keep recurring, and human review becomes the bottleneck.

all velocity — no durable guardrails

Governance-centric

The midway. Velocity exposes failures; you convert each recurring one into a guardrail: a type, a lint, a gate. The guardrails grow out of real failures, so code stays fast and stays trustworthy.

velocity + guardrails grown from failure

Oversight-centric

Check everything before you trust it, whether a human reviews every change or a formal specification is verified against. Rigorous and safe, but checking becomes the bottleneck: all of it must be vetted, and neither humans nor specs anticipate the failures that only appear at velocity. (Spec-driven development is this, with the spec as the checker.)

all oversight — everything checked

← all velocity   •   all oversight →

Both ends of the spectrum pay the pet tax. Each spends per-change human attention, whether you're coaxing the output at one end or inspecting it at the other, and that attention grows with the size of the fleet until it becomes the bottleneck. The midway is cattle, not pets: build the fences and chutes once, and the guardrails ride every change instead of a person.

The midway is a discipline: establishing and maintaining a governed engineering environment. It works in two directions at once.

  1. Up front, you specify what you can: the architecture that makes a class of error impossible, the model the fleet reasons through (more on that below), the templates and checklists that put a change on rails before it's written.
  2. In flight, you let velocity surface the failures you couldn't foresee, and convert each recurring one into a durable guardrail.

This site describes both halves. The first is the guidance on what to fix in advance; the second is the machinery for responding when something slips through. It packages both as three Claude skills with a quick-start. The catalogue itself is 69 governance mechanisms across three roles, each written like a design pattern — the recurring failure it kills, and why it is not just the cheaper thing everyone already does.

Documentation, taken to its limit

Start with the up-front half. Anyone who has built with agents has found the first move on their own: give them good documentation and tests, then point them at it. Agents write and maintain those artifacts as fast as they write code, so the cost that always made thorough docs a fantasy is gone. The step the training data won't suggest is the next one. Documentation has a hierarchy, and its top is not prose. It is a typed model.

A context-bounded agent working on a context-exceeding system needs a typed, queryable, drift-checked model of that system to reason through, the blueprint for a structure too large to hold in one view. That is model-based software engineering, and it is the bridge between the agent and the codebase it cannot fit in its head. Two things make it more than a tidier README:

Agent-legible & precise

A six-state machine with typed invariants is something an agent reasons over without error the way it never could over 300,000 lines of prose-and-code. Abstraction shrinks the space it can be wrong in, not just the token count. A model is more precise than any document.

It can’t lie

A document rots the moment the code moves; a model wired to a build-time drift check cannot: the gate stays red until the map matches the territory again. That guarantee is what prose can never give.

Because agents build and maintain the model the way they maintain docs and tests, pointing them at it costs almost nothing, and it pays back in higher code quality, fewer tokens spent rederiving what the model already states, and fewer mistakes. The catalogue's models-bridge role is this bridge, made concrete.

Governance has two mechanisms

A guardrail is one of two kinds: prevent the error, or catch it.

Architecture

Make the error impossible by construction: the typed model above, a state that cannot be represented wrongly, one sanctioned seam. Software poka-yoke, error-proofing, so the bad move can’t happen in the first place.

Control

Where you can’t prevent it, observe and guard the behavior: a lint, a gate, a validator, an audit that fires on a violation and holds the line. Error-catching, deterministically, before the failure escapes.

A control works like a sensor: it detects a mistake and surfaces it after the fact. Architecture works like a wall: it makes the whole class of mistake impossible to make. Reach for the wall first, because a sensor still lets the mistake happen. But a wall built across the only exit blocks the people trying to leave — an over-constrained design stops legitimate work as surely as it stops the error, so the wall belongs around the class you can name, not across the whole floor.

The way of thinking

Three stances that make the midway work, distilled from the AI-First Engineering Method (architecture, controls, and the stance that wields them); the full set ships in the starter CLAUDE.md.

Architect deliberately

  • Implementation is cheap; architecture compounds. Buy the right design, not the fast one.
  • Name shapes with types; primitive-passing leaves the architecture anonymous.
  • Make models, state, and policy explicit: state machines over scattered counters, enums over magic strings.
  • One canonical way beats many clever ones. Agents will apply patterns they see 200× with no debate.
  • Attack accidental complexity; budget for the essential kind.

Convert failure into machinery

  • When a failure recurs, encode it (a lint, type, gate, or schema) instead of re-inspecting for it.
  • Move audits to lints: cheap, at-commit, deterministic beats expensive and post-hoc.
  • Let the compiler and gates hold the line; review is not a substitute for static analysis.
  • Never fail quiet: every caught error logs, re-throws, or is justified in a comment.
  • No compatibility shims. Migrate every call site in the same change.

Keep judgment scarce & central

  • Carry work autonomously; surface only the architectural calls.
  • Hyper-experimentation: pilot, compare, measure; a cheap experiment beats a debate, and negative results are wins.
  • Verify claims and trust nothing stale. Re-run the gates yourself, because markers rot.
  • Reason about second-order dynamics: what happens at T+100, or under concurrency?
  • Documentation encodes invariants that drive tests, not prose that rots.

The three skills — govern, operate, communicate

The catalogue ships as three partner Claude skills (one plugin). Two are one substrate seen from opposite ends (self-governance designs the controls, self-operations runs them), and self-communicate makes what they produce legible: the docs, and the operator's own reports to the human.

self-governance · harden

The design-time lens: the census of controls plus the engine that mints new ones — what exists, what you're missing, how to add one.

self-operations · operate

The run-time lens: it runs the substrate those controls govern — the lifecycle you operate, the runbook you follow, the hook you wire.

self-communicate · communicate

The prose-and-diagram craft: a rhetoric toolkit, the Diátaxis register, a house lexicon, and an audit that emits fixes — for the docs the other two produce and the operator's own reports to the human.

Govern and operate are one substrate seen two ways; communicate is the craft that keeps their output legible. The loop closes across all three: operate surfaces a recurring break, govern mints the control, communicate writes it up in the shared register. Install all three →

Live system it governs: DocAble (scholaccess.com)
The goal is a governed engineering environment. Some of the governance mechanisms you probably know up front: business requirements, security scanners you always run, etc. Others you need to figure out through trial and error, because they depend on the nature of the errors made by the models you're working with. The mindset shift is from reviewing your agents' code, to reviewing their failures and constraining their future moves as needed.

Walking through the loop

Governance conversion is a non-terminating loop: higher velocity keeps surfacing failure classes that earlier governance didn't address.

1Velocity exposes failureAgent changes surface ambiguity, drift, and weak boundaries — fast.
2Monitoring intelligence classifies itLocal defect, or a recurring structural weakness?
3Convert to governanceEncode it: a type, a lint, a schema, a gate, or a harness rule.
4Action space narrowsEvery later agent inherits a smaller, more explicit space.

Governability compounds. The environment absorbs more agent work, so velocity stays sustainable.

Implementation is cheap; the judgment that decides which governance should exist is the costly, human part. Two paired concepts hold it together:


Explore the catalogue

69 governance mechanisms — the repertoire this loop produced in one real production system.

Views of the governance cataloguethe whole catalogue at a glance — four views, mechanisms clickable Abstractions glossarythe artifacts the mechanisms are built from — named by role, not filename Quick starttwo ways to adopt — DIY the catalogue, or install the self-governance skill Starter CLAUDE.mda mature one — have Claude fold it into your CLAUDE.md (see Quick start) Epic templatethe section shape + Definition-of-Done, portable Design-doc templateinvariants-driven; dynamics + observability blocks Agent-brief templatethe dispatch — scope, context, acceptance, hand-back Op-playbook templatesituation → inspect → healthy → what-to-do Governance-lint examplea real, runnable lint — copy the shape, change the check Download the catalogueall writeups as a markdown ZIP

The catalogue

A representative selection — mechanism patterns, not an exhaustive list of every lint and gate in the system. Each row is one mechanism with its one-line Summary and how it Enforces: Hard is deterministic (blocks, audits, or signals regardless of agent cooperation), Soft is probabilistic (aims an agent but cannot block), and Soft·Hard is soft guidance with a hard counterpart. Click a name for the full writeup.

Governance: Agents

Context & dispatch substrate

What an agent knows and how it is launched.

MechanismSummaryEnforcement
Brief-lintingReject a malformed dispatch brief before it can launch.Hard
Docs hierarchy + governance indexOne enforced, numbered rule index every agent boots with.Soft·Hard
Dynamic context injectionInject the rules governing these files into the brief.Soft
Role-typed dispatchA typed role fixes LLM, isolation, and gates per dispatch.Hard

Gates & merge-train

The path-to-production staircase for agent work.

MechanismSummaryEnforcement
Pre-commit hook (3-stanza, tree-sha markers)Cheap changed-file checks gate every commit, marker-verified.Hard
Sentinel first-commit early-abortAbort a broken agent at its first commit, not its last.Hard
Merge-train MIS batchingLand non-conflicting worktrees together via a maximum independent set.Hard
Staged deploy gates (canary → smoke → promote)Canary → smoke → promote; gate before users see it.Hard

Mediators & resource locks

Host-level wrappers that ration shared compute across concurrent worktrees. Three cap by

MechanismSummaryEnforcement
Test-serializer (N=1 flock on dotnet test)Serialize dotnet test to a single writer per host.Hard
Build-serializer (M=8 semaphore)Cap concurrent heavy builds with an M=8 host semaphore.Hard
Aggregate-compute protection (lint-all host mutex)One lint-all per host; one in flight per orchestrator.Hard
Resource-pressure gating (admit before, shed during)One pressure signal gates heavy work at admission and execution — admit before, shed during.Hard

Lifecycle & observability

Live signal surfaces over the fleet.

MechanismSummaryEnforcement
Agent-registry (agent-registry.jsonl + marker cache)Authoritative record of which agents are live right now.Hard (signal)
Orchestrator-as-reactor over an event busThe orchestrator reacts to typed fleet events via a per-topic playbook.Hard (signal)
Deploy heartbeats + stale-worker detectionPeriodic liveness so a hung deploy differs from a slow one.Hard (signal)
Tombstone commits (lifecycle close records)A close record proving a worktree is safe to reclaim.Hard (audit)
Cron-alerts gateBlock new dispatch while a HIGH cron alert is unresolved.Hard (blocking)
Lifecycle hooks (turn-stop / compaction / session-start / pre-action)A hook on a runtime lifecycle event so an operator's omitted step can't be forgotten.Soft·Hard
Reflection-facet substrate (tempo-gated policy nudges)Many policy-reflection nudges as one facet registry over a shared tempo budget — ≤1 emission/window.Soft·Hard
Caused-by provenance (agent-side change traceability)A typed caused-by field, minted at the cause and gated at commit, threads a change to its reason.Hard

Governance-doc mechanisms

Documentation treated as enforced infrastructure.

MechanismSummaryEnforcement
CLAUDE.md rule index + cap lintThe governance document itself, enforced by its own lints.Soft·Hard
Mandatory snippet-table enforcementBrief-linting asserts every required brief snippet is present.Hard
Epic Definition-of-Done (Final-Opus trust-nothing re-run)Close an Epic only after re-running its checks at HEAD.Hard
Doc-hygiene lints (index coverage, autogen provenance)Lints keep docs indexed, provenance-headed, and cross-reference-valid.Hard
Operational playbooks (situation-keyed devops procedures)Situation-keyed devops procedures agents follow instead of improvising.Soft
Operator runbook skill (positive map + symptom index, ref-lint-kept)Positive substrate map + symptom→doc routing, generated from typed YAML, ref-lint-checked.Soft·Hard
Epic & design-doc templatesFixed section-templates for Epics and design docs so plans are complete.Soft·Hard
Enforce at the right semantic levelMatch a mechanism's enforcement scope to the semantic scope of the property it checks.Soft

Governance: Models — a bridge between agents and product

System models

One MBSE

MechanismSummaryEnforcement
Executable source-of-truth (data-not-code, can't drift) — trunk / methodTyped models read every run and generated from; can't drift.Hard
Drift & parity gates (model↔reality) — trunk / methodBidirectional model↔reality checks so models cannot drift.Hard
Agent-first MBSE harness (frozen records; adopt schema, skip runtime) — trunk / methodTyped frozen-record models + five hand-rolled disciplines; adopt the schema, skip the runtime.Hard
Formal invariant verification (temporal form → model check) — trunk / methodEach invariant's temporal-logic form derives its checker — proven, not sampled.Hard
Coverage → model-node mapping (which invariants are tested) — trunk / methodProject test coverage onto model nodes (states, seams, invariants) so untested ones are visible.Soft·Hard
Journey-criticality → test-tier placement (which host a test runs on) — trunk / methodA journey's criticality derives its test's host tier; a lint holds the local-coverage floor.Soft·Hard
Invariant-DAG execution policy (typed Scheduler: correctness vs resource + cost) — trunk / methodA DAG holds correctness + cost-gate edges only; a typed Scheduler rations load + budget per host.Soft·Hard
Model-driven codegen — trunk / methodGenerate real artifacts from the models, provenance-headed.Hard
Model query surface (repo-query) — trunk / methodrepo-query — the agent-facing read API over the models.Soft
Meta-model consumption (read, don't hardcode) — trunk / methodRead the model at runtime; never hardcode a snapshot.Hard
Control↔substrate dependency (computed blast-radius) — trunk / methodEach control declares its substrate assumption as metadata; a query computes the blast radius.Hard
Symbol-anchored traceability graph (derived edges) — trunk / methodA typed model↔lint↔code↔proof↔registry graph whose edges are derived, symbol-anchored, re-checked.Hard
Model-graded finding severity (distance-graded gate) — trunk / methodA gate grades each finding block/warn/silence by its model-distance from the changed files.Hard
Service-flow / API model — product-facingThe SOA source-of-truth NetworkPolicy and wiring are generated from.Hard
User-journey model (product-goal → implementation) — product-facingUser journeys as typed entities: actor, goal, ordered steps joined to the endpoints they cross.Hard
Domain registries — product-facingFrozen typed registries for the system's domain facts.Hard
Synchronization model (meta-sync) — orchestration-facingA registry of every lock, what it guards, and its ordering.Hard
Agent-orchestration model (developer journeys) — orchestration-facingThe fleet + orchestrator loop modeled with the product's own MBSE method: developer journeys.Hard
Component & zone model — shared spineA typed map of every component's code zone and seams.Hard
Mediator & single-writer contracts — shared spineDeclared mediator and single-writer contracts, coverage-checked.Hard
Deployment & tier topology — shared spineTyped models of where things run and how they layer.Hard

Governance: Product

This is the part that's specific to the DocAble project — you'll need your own for your project.

Canonical models & seams

The one sanctioned typed model or seam per concern, each held in place by a ban-lint.

MechanismSummaryEnforcement
PdfModel (sole PDF mutation surface)All PDF I/O through one typed model; raw canonical-PDF-library access banned.Hard
Office Models ({Slides,Docs,Sheets}Model)All OOXML through typed models; raw SDK access banned.Hard
ServiceClient (typed cross-service seam)A BinaryIO seam makes file-path-over-wire impossible.Hard
Canonical walkers (one traversal per tree)One canonical traversal per tree, not ad hoc recursion.Hard
Sole raw-Redis seam (the dispatch module)All raw Redis in one seam; queue atomicity encoded once.Hard

Validation & conformance

Deterministic pass/fail checks over the artifact.

MechanismSummaryEnforcement
ContentValidator (input ⊆ output fidelity)Assert input content survives remediation — a fidelity gate.Hard
Blocking semantic lintsThe blocking semantic-lint fleet over the tool's own source.Hard
Standards / WCAG rule engineMap each finding to the WCAG/508/PDF-UA criterion it closes.Hard
Cross-source coherence lintsAssert independent sources agree — catch cross-source drift.Hard

Regression tests

Repeatable behaviour-pinning bodies.

MechanismSummaryEnforcement
Test-onion tiers (Smoke / Lite / targeted / full)Cost-stratified test tiers: Smoke, Lite, targeted, full.Hard
FsCheck property testsFsCheck invariants over generated inputs find hidden bugs.Hard
Fuzz campaigns (+ auto-coverage)Malformed-input campaigns; fix to the spec, not the seed.Hard
DDT pin-trailersDoc-derived characterization pinned to a cited source.Hard

Provenance & attribution

Durable records of what the tool changed.

MechanismSummaryEnforcement
Per-mutator attribution stampsEvery mutation embeds an attribution stamp in the artifact.Hard (audit)
F10 mutator-stamp-wiring lintFail the build if any mutator verb lacks a stamp.Hard
derive-changelog (reconstruct mutations)Reconstruct the attributed mutation history from the stamps.Hard (audit)
a11y_ prefix conventionPrefix invisible inserts so they're distinguishable and tracked.Hard

Repair vocabulary

The bounded move-space of the remediator.

MechanismSummaryEnforcement
Typed ViolationCategory / FailureCategory enumsTyped enums replace free-form failure strings.Hard
Closed remediation-verb setsA closed, named set of remediation actions — bounded moves.Hard
Codemod-first threshold (N≳50 → AST transformer)For 50+ deterministic sites, write one AST transformer.Soft