The Constitution v1.0
Download kit
Start here

The Constitution

The build-constitution reference — the design-first, agent-orchestrated method your team builds by, from scratch to deployment.

What this is

The Constitution is the standing law for how we conceive, design, build, and ship large enterprise systems with Claude, Claude Design, and Claude Code. It is design-first, agent-orchestrated, and runs scratch → deployment.

It describes a method, not one product. Every <…> placeholder is rebound per project from that project’s CLAUDE.md at read time.

The governing sentence

The one sentence that governs everything

“Fidelity and quality are produced by architecture, not by vigilance.”

We make drift and defects either mechanically impossible or automatically detected — so neither a human nor an agent can quietly diverge. That is what lets agents do the heavy lifting while human attention stays bounded.

The twelve laws

Non-negotiable. Every phase, agent, and gate is in service of them. A project’s CLAUDE.md may add laws; it may not weaken these.

01

The rendered design is the contract.

The single source of truth for a screen is the rendered prototype, then the live UI. Precedence: prototype > reconciled spec > screenshot > draft. A prototype-vs-spec conflict is a STOP-and-surface.

02

Decouple through contracts.

A module never references another module. Cross-module needs are met only by a published event or a public query DTO from Contracts. A broken contract is a compile error, not a 2 a.m. surprise.

03

Single-writer orchestration.

Exactly one actor — the orchestrator — writes shared trackers and closes seams. Workers touch only their own files plus append-only shared files, and return a structured report.

04

Stateless agents; context passed explicitly.

A subagent starts with a fresh context window; the only channel in is the prompt. Every delegation hands over spec paths, design references, prior output, and the path to CLAUDE.md.

05

Isolated, bounded parallelism.

Workers run in parallel only when isolated: own output dir, own browser-port, append-only to the shared stylesheet. A semaphore caps concurrency; a seed gate orders shared declarations.

06

Gates before “Done.”

No agent self-attests completion. “Done” means passing the phase gate: clean build, visual assertions, value-not-literal checks, tests, contract tests, a11y, and a reviewer PASS.

07

Blast-radius limits.

An agent may freely change its own slice and the contracts it emits. Touching the shared kernel, the Contracts surface, or another module needs a foundation-level gate.

08

Append-only / self-registration.

Modules self-register via Add<Module>(); nav and routes come from a registry; the shared stylesheet is appended to, never rewritten. No merge contention, no forced serial work.

09

Just-in-time spec reconciliation.

Specs are reconciled to the current design at the moment a slice is built, not perfected up front. Draft md files are inputs, not truth. Each slice carries a provenance header; the registries’ Sync state tracks fresh/stale.

10

Progressive completeness.

Build design-first and add capability as development reaches it. Parity research informs the spec but never overrides the design; only the Must-haves a slice needs now are adopted.

11

Capped autonomy with escalation.

Self-correction loops retry at most twice, then stop and file the case in an approval inbox. Never an infinite loop. Human supervision is on the loop, not in it.

12

Institutional memory is mandatory.

Durable facts go to INSIGHTS; corrections to LESSONS as Mistake/Trigger/Rule; status to PROGRESS. Read PROGRESS + LESSONS at session start. Stable lessons graduate into CLAUDE.md.

How to use this guide

Learning

New to the method? Read Start here, then scroll the lifecycle phase by phase.

Referencing

Mid-build? Jump to a phase or agent and copy the exact command or file. ⌘K opens search anywhere.

Sharing

Every heading is a deep link. Send a teammate to the precise section, not the whole document.

What's new

v2026.07.31-a

The session ledger — multi-session coordination + the story that survives

Concurrent chat sessions now see each other's write-claims before they collide on a board, every session's plan / done / pending / decisions is captured in a dated journal, and a derived docs/STATUS.md stays in sync with the codebase at every turn — one cross-platform Node implementation behind six Claude Code hooks, opt-in and feature-detected.

Recent releases also landed: the (two lanes, contract sidecars, the three-altitude audit stack) · (versioned, self-gating, manifest-verified installs) · · . Full history in CHANGELOG.md.

Get the kit

The full kit

Constitution, prompt templates, sixteen subagents, sixteen commands, the eight-skill expertise layer, bootstrap + preflight + governance tooling, the cross-platform session ledger, and the memory templates — one versioned, manifest-verified bundle.

Day-zero bootstrap

Unzip, point the installer at your repo. Non-destructive — existing files are skipped, re-runs are idempotent.

cd constitution
./bootstrap.sh /path/to/your-repo
The lifecycle

The lifecycle

Seven phases from scratch to deployment. Each has one goal, one engine, and one gate to advance.

The seven phases

Scratch to deployment. Click a phase to jump to it.

Build (5) can loop back to Reconstruct (2) when a new module or a new design enters the sweep.

Phase reference

Phase
Goal
Primary engine
Gate to advance
0Conceive
Turn an idea into a product spec.
Claude (chat) → PRD.md
PRD covers modules, entities, FRs, workflows, rules, events, integrations.
1Design
Turn the PRD into a clickable, high-fidelity prototype on the design system.
Claude Design + design system + PRD
~90% of screens designed; designer sign-off; journey audit clean of S1 gaps on the golden journeys.
2Reconstruct
Reproduce the prototype 1:1 as the UI layer.
screen-reconstructor under reconstruct-sweep
Per-screen fidelity gate green, incl. branch coverage per state key; screen registry ✅.
3Specify
Capture behaviour, rules, and seams the design can’t express.
Author MODULE / WORKFLOW / DB_SCHEMA / CLAUDE.md
Specs exist with provenance headers; dependency graph drawn.
4Found
Build the shared kernel, contracts, infra, and design-system extraction.
Human-in-the-loop + targeted agents
Boundary tests pass; app shell + cross-cutting behaviours live.
5Build
Wire real backend and processes behind the UI, workflow by workflow.
build-workflow sweep over the 9-agent pipeline
Per-workflow Definition of Done met; reviewer PASS.
6Harden & deploy
Performance, security, observability, release.
Human + agents + CI/CD
NFR targets met; release checklist green.
The lifecycle

Phase 0 · Conceive

Turn an idea into a product spec — the PRD that seeds everything downstream.

What this phase is

Phase 0 turns an idea into a product spec — a PRD that covers, per module: entities, functional requirements, workflows described step by step, business rules, domain and integration events, permissions, integration points, and cross-cutting compliance.

The PRD is the input to Design. It is a point-in-time draft, not the eternal source of truth (Law 9) — the rendered prototype that follows becomes the contract.

How it runs

Primary engine
Claude (chat) → PRD.md, using prompt template B.
Gate to advance
The PRD covers modules, entities, FRs, workflows, business rules, events, and integrations.

Key points

Use the naming grammar

FR-<X>-NNN · BR-<X>-NNN · EVT-<X>-Name · PERM-<X>-Entity.Action · WF-<X>-NN. Consistent identifiers let every later phase cross-reference cleanly.

Mark the priority journeys

Name the journeys to build first — they become the continuity proof in Design and the golden workflow in Build.

Flag every assumption

Each open question is written as “ASSUMPTION — confirm”, never silently resolved.

The lifecycle

Phase 1 · Design

Turn the PRD into a clickable, high-fidelity prototype — the contract for everything that follows.

What this phase is

Phase 1 turns the PRD into a clickable, high-fidelity prototype built entirely on the pre-built design system. This is where Claude Design operates.

The rendered prototype becomes the contract (Law 1): the single source of truth for what each screen looks like and what information it carries. Precedence is rendered prototype > reconciled spec > screenshot > draft.

How it runs

Primary engine
Claude Design + the pre-built design system + the PRD, using prompt template C.
Gate to advance
~90% of screens designed; designer sign-off.

Key points

Design-system only

Every screen uses only design-system components and tokens — no off-system colours, no hand-rolled controls where a component exists.

Continuity is built in

Priority journeys are designed end-to-end first; every screen satisfies the continuity invariants — one primary CTA, guarded CTAs disabled-with-reason, no dead-ends.

Match the voice

Sentence case, verb-led CTAs, numbers and units in status lines.

The lifecycle

Phase 2 · Reconstruct

Reproduce the prototype 1:1 as the UI layer — the same machine as Build, pointed at screens.

What this phase is

Phase 2 reproduces the prototype 1:1 as the UI layer — the same screens, now as real components using the design-system classes. It is the same orchestration machine as Build, pointed at screens instead of workflows.

screen-reconstructor agents run under the reconstruct-sweep with single-writer integration: isolated parallel workers, a per-module seed gate, append-only CSS, and a fidelity gate per screen.

How it runs

Primary engine
screen-reconstructor agents under the reconstruct-sweep (single-writer integration).
Gate to advance
Per-screen fidelity gate green; the screen registry marked ✅.

Key points

The fidelity gate

0-error build; the captured screen is the rendered screen; the design-system CSS actually applied; computed-style assertions match the prototype; every bound value renders its value, not the literal.

Single writer integrates

Workers return structured reports; the orchestrator gate-reviews them, dedups design-system classes, graduates primitives, and closes seams.

The lifecycle

Phase 3 · Specify

Capture the behaviour, rules, and seams the design cannot express.

What this phase is

Phase 3 captures the behaviour, rules, and seams the design cannot express. From the rendered prototype and the reconstructed screens, you author the module, workflow, and schema specs plus the project CLAUDE.md.

Specs are reconciled to the current design, carry a provenance header, and feed the UI-driven contract extraction the build agents rely on.

How it runs

Primary engine
Author <X>_MODULE.md, <X>_WORKFLOW.md, <X>_DB_SCHEMA.md, and CLAUDE.md, using prompt template E.
Gate to advance
Specs exist with provenance headers; the dependency graph is drawn.

Key points

Provenance + Sync state

Every spec records the design source it was derived from, a last_synced timestamp, and a hash; the registries’ Sync chip tracks fresh/stale. A hash mismatch marks it stale.

UI-driven extraction

The built UI is the most reliable spec of the contract surface — lift the mock-data shapes into the first draft of DTOs and read models (the UIMAP).

Generate the boards

Generate docs/SCREEN_REGISTRY.md and docs/WORKFLOW_REGISTRY.md from CLAUDE.md following the contract at the top of each.

The lifecycle

Phase 4 · Found

Build the foundation by hand — the shared kernel, contracts, infra, and design-system extraction.

What this phase is

Phase 4 builds the shared kernel, the contract surface, the infrastructure behaviours, and the design-system extraction — human-in-the-loop. This is the foundation every later workflow sweeps over; you build it by hand, not as a sweep.

Get this right and every delivery afterward is a workflow sweep.

How it runs

Primary engine
Human-in-the-loop + targeted agents, using prompt template F.
Gate to advance
Boundary tests pass; the app shell and cross-cutting behaviours are live.

Key points

SharedKernel + Contracts

Freeze the primitives; establish the append-only integration-event and public-DTO surface.

Infrastructure behaviours once

Validation, fail-closed authorization, audit, caching, telemetry, plus the compliance hooks — applied uniformly through the pipeline.

Host + architecture tests

Composition root with a module-discovery loop; NetArchTest boundary rules green before any feature module.

The lifecycle

Phase 5 · Build

Wire real backend and processes behind the reconstructed UI, workflow by workflow — one agent per step, gated by a Definition of Done.

What this phase is

After the foundation is built by hand, all delivery is a sweep: one pass of the build pipeline over a single workflow that may span many interdependent modules. You wire real backend behind the reconstructed UI — without touching a pixel.

A module is a unit of ownership; a workflow is a unit of delivery. A module becomes complete as a side effect of every workflow that sweeps through it.

Who runs it

The orchestrator runs the /build-workflow sweep over the build pipeline. It is a thin router and the single writer — it sequences agents, hands each explicit context, enforces the gates, and writes no production code itself.

Note · preconditions
The foundation must be built — SharedKernel, Contracts, Infrastructure behaviours, the app shell, and design-system extraction. If it isn’t, STOP: that is human-in-the-loop work, not a sweep.

Gate to advance

A workflow is shippable — the Definition of Done — when every line below is true.

Spec reconciled to the current design this sweep.
All UI states present — loading, empty, error, permission-denied.
Real data wired through MediatR; cross-module interaction only via contracts.
Authorization and audit enforced on every sensitive write.
Every mutating CTA proves a write-path round-trip with value identity — the value read back is the value entered, never a hard-coded fixture behind a captured field.
Affordance ledger complete — zero unmarked stubs, zero mis-wired seams; deferrals ticketed.
The full wiring gate green — preflight (where wired) exit 0, reviewer PASS.
PROGRESS, INSIGHTS, and LESSONS updated; the registries’ Sync state marked fresh.

Instructions

1
Understand & enrich
Dispatch spec-architect to reconcile the workflow + module specs to the current design and write UIMAPs; dispatch spec-researcher for advisory parity. Hard gate: reconciliation must run this sweep.
2
Human checkpoint 1
Present the delta report, the Must-have findings, and any design gaps. Wait for approval; fold approved deltas into the specs as the single writer.
3
Build the slices
Per touched module in dependency order: backend-builder → migration-engineer (gate if destructive) → seed-builder → crosscutting-weaver → module-wirer. Parallel only across disjoint, isolated modules.
4
Automated quality gates
test-engineer runs xUnit + integration + contract + Playwright e2e + NetArchTest + a11y + visual regression. Hooks also run build + lint on stop.
5
Reviewer
Read-only audit vs the Constitution + CLAUDE.md. On FAIL, route each finding to its owning agent, capped at two retries, then the approval inbox.
6
Human checkpoint 2
Present the run digest; approve merge — or rely on CI plus the reviewer for auto-merge to staging.
7
Single-writer integration
Close every cross-module seam, dedup new design-system classes, graduate repeated patterns into primitives, regenerate the Contracts snapshot, append the METRICS line + PROGRESS, update the registries’ Sync state, and mark the workflow ✅.
STOP and surface · destructive migration
The migration step has its own gate. Any destructive change stops for human approval before apply — never auto-apply a destructive migration outside local dev.
Caution · single writer
The orchestrator writes no production code. It sequences, hands over context, enforces gates, and is the only actor that writes trackers and closes seams.
Tip · parallelism
Two sweeps run concurrently only across disjoint module sets. When they share a kernel or Contracts type, serialise — the dependency graph tells you which.

The command

Claude Code · slash command
# Sweep the full build pipeline over ONE workflow
/build-workflow PatientIntake

# The sweep may span many interdependent modules;
# the main thread stays the single writer.

The sweep

One pass of the pipeline. The two amber checkpoints are the only places human attention is required — both front-loaded.

1
Understand & enrich
spec-architect reconciles the spec to the current design and writes UIMAPs; spec-researcher adds advisory parity. Hard gate: reconciliation ran this sweep.
spec-architect · spec-researcher · UIMAP
Checkpoint 1Human
Approve the reconciled spec and resolve design gaps. Approved deltas are folded into the specs by the single writer.
2
Build the slice
Per touched module in dependency order, the build agents run the vertical slice.
backend-builder · migration-engineer · seed-builder · crosscutting-weaver · module-wirer
3
Automated quality gates
test-engineer proves the slice; preflight (where wired) must hit exit 0; interaction-auditor closes the affordance ledger before any review.
xUnit · contract · Playwright · NetArchTest · a11y · visual · preflight · interaction closure
4
Reviewer
Read-only audit vs the Constitution + CLAUDE.md. On FAIL, each finding routes to its owning agent.
reviewer · opus
FAIL ×≤2 → back to Build the slice, then the approval inbox
Checkpoint 2Human
Review the run digest; approve merge — or rely on CI + reviewer for auto-merge to staging.
5
Single-writer integration
Close cross-module seams, dedup design-system classes, graduate primitives, regenerate the Contracts snapshot, append the METRICS line + PROGRESS, update the registries’ Sync state, mark the workflow done.
seams · dedup CSS · primitives · snapshot · METRICS · PROGRESS

Interaction closure

A sweep wires a workflow's path; a screen accumulates affordances from many paths and from visual-only reconstruction — so off-path buttons, links, CTAs, and shortcuts can pass every per-path gate as silent stubs. The interaction-auditor closes that gap at screen scope: it enumerates every affordance on the touched screens, classifies each disposition, reconciles them against the UIMAP's action→effect, and risk-tags every gap onto the INTERACTION_REGISTRY board.

Wired
Dispatches a command/query or navigates with context to a real destination — the write-path is proven.
Marked stub
An honest deferral: a visible “preview · not saved”, or disabled-with-inline-reason.
Unmarked stub
Toasts or no-ops while implying a real effect. Wire it, or mark it.
Mis-wired
Opens the wrong/singleton record, a dead route, or silently allows a guarded action.
Dead-end
A terminal state with no advancing CTA, or a destination that is missing.
Design-gap
The affordance exists but its target interaction was never designed.

The orchestrator is the single writer of the board: it auto-remediates low-risk, trivially-constructable rows, and asks the human on medium- / high-risk ones. The sweep cannot advance to review until the ledger is complete — zero unmarked stubs, zero mis-wired seams; every deferral ticketed. It also runs standalone as a backlog sweep over already-built screens.

Agents in this phase

The lifecycle

Phase 6 · Harden & deploy

Performance, security, observability, and release — behind the same gates that governed the build.

What this phase is

Phase 6 takes the built system to production: performance, security, observability, and release. Plan for Blazor Server reality from the start — here the mitigations become first-class.

The wiring gate runs in CI; merges gate on reviewer PASS plus a green suite and boundary tests; releases are promoted environment-to-environment behind the same gates.

How it runs

Primary engine
Human + agents + CI/CD.
Gate to advance
NFR targets met; the release checklist is green.

Key points

Scale-out

Redis backplane + sticky sessions (or a managed SignalR service); right-size circuit memory; load-test the SignalR path, not just request throughput; ship the reconnection UX.

Observability

OpenTelemetry through Aspire ServiceDefaults — traces (including Blazor circuit activities), metrics, structured logs with no sensitive data; health checks on every backing service.

Security & CI/CD

Fail-closed authz, RBAC, immutable audit, break-the-glass, TLS 1.3, encryption at rest; visual-regression and a11y run on every PR.

Reference

Architecture

A vertical-slice modular monolith composed by a Host. Boundaries are enforced by architecture tests, not discipline.

Layered architecture

Layered HMS architecture: workflow slices (the delivery unit) over modules (the ownership unit) over the contract layer over the foundation / shared kernel.
Four stacked layers — workflow slices deliver across modules; the contract layer decouples them; the foundation is shared.

Boundary rules

No module-to-module references

A module references only SharedKernel, Contracts, and DesignSystem. Need another module’s data? Subscribe to its event or call its public query DTO.

Self-registration

Each module exposes one Add<Module>() that registers handlers, EF, validators, nav item, and permissions. The Host calls them in a loop — no hand-edited menu.

Per-module EF

A separate DbContext and schema per module (reg.*, clin.*, …) so migrations never collide — which is what lets migration work parallelize.

Persistence boundary

Which store owns what — decide per entity, not per module.

Relational (EF → SQL Server)
Transactional, relational, ACID — identities, encounters, orders, financials, audit headers.
Document (MongoDB)
Free-text bodies, raw HL7/FHIR, audit diffs, observation/flowsheet blobs, AI prompts and outputs.
Cache / realtime (Redis)
Cache-aside reads, session, and the SignalR backplane for scale-out.
Search engine
Fuzzy patient / code / drug search with typo tolerance.
Imaging (PACS)
Binary studies live in PACS; SQL stores only the metadata.

Repo topology

canonical repository topology · rebind <App>
src/
  <App>.SharedKernel/    Frozen primitives: Entity, AggregateRoot, ValueObject, Result,
                        IDomainEvent, Permission, NavItem, IModule. No app logic.
  <App>.Contracts/       Append-only integration events + public DTOs across modules.
  <App>.DesignSystem/    RCL: ported design system — Components, Styles, wwwroot.
  <App>.Infrastructure/  MediatR behaviours (validation, authz, audit), EF, integration.
  <App>.Host/            Composition root: App/MainLayout/Sidebar, the module loop.
  Modules/
    <App>.<Module>/      ONE per module: Domain/ Application/ Infrastructure/ UI/
tests/
  <App>.ArchitectureTests/   NetArchTest boundary rules.
  <App>.<Module>.Tests/      xUnit units + Playwright e2e.
docs/                        modules/, SCREEN_REGISTRY.md, PROGRESS/INSIGHTS/LESSONS.
Reference

The agents

Sixteen single-purpose specialists: a reconstruction agent, an in-repo design author, two prototype auditors, a drift-triage agent, the build agents, the judgment agents — a reviewer, two spec agents, an affordance auditor, and a cross-sweep auditor — and, above them, the orchestrator. Each owns a phase and a single concern.

The roster

Single-purpose specialists with scoped tools and a routed model. Stateless, reporting in a structured shape. Agents marked graph(read) additionally hold the read tools of the optional code-discovery graph — see Graph-first discovery below. Download any definition for .claude/agents/.

Model routing. Opus for the judgment agents — spec-architect, spec-researcher, reviewer, design-sync, design-builder, and the four read-only auditors (interaction-auditor, wave-reviewer, journey-auditor, edge-auditor) — and for backend-builder (the domain/application layer); Sonnet for the other builders — migration-engineer, seed-builder, crosscutting-weaver, module-wirer, and test-engineer; Haiku / Explore for fast read-only search.

The domain/application layer is where modeling judgment compounds, so it earns Opus while the more mechanical builders stay on Sonnet to keep a sweep affordable.

screen-reconstructor
Reconstruct · phase 2
inherit

Reproduce ONE screen 1:1 as the design-system Blazor classes. Also runs in re-sync mode — applying a design-sync delta to an existing screen while preserving its wiring, instead of rebuilding it.

Read · Grep · Glob · Edit · Write · Bash
screen-reconstructor.md
design-builder
Design · phase 1
opus

The in-repo design lane: authors ONE net-new prototype screen from its design-prompts brief — closed vocabulary (grep-verified against the prototype), sandbox render + sign-off screenshot, contract sidecar + provenance hash at birth, and a self-critique → revise pass against an excellence rubric. Never wires or flips boards.

Read · Grep · Glob · Write · Edit · Bash
design-builder.md
journey-auditor
Audit · phase 1
opus

Read-only journey-continuity auditor over the PROTOTYPE: traces ONE end-to-end journey, builds the mechanical route/edge ledgers (OK / DEAD-END / LEGACY / WRONG), walks each role's day, and returns severity-ranked gap rows. The phase-1 gate: zero S1 gaps on the golden journeys.

Read · Grep · Glob · Bash · Write
journey-auditor.md
edge-auditor
Audit · phase 1
opus

Read-only dead-edge auditor over ONE module's prototype screens: finds affordances that lie — toast-only lifecycle CTAs, no-handler buttons, placeholders, phantom-prefilled create forms — classifies each on two axes, and re-verifies the accepted-toast exceptions ledger.

Read · Grep · Glob · Bash · Write
edge-auditor.md
design-sync
Drift · phase 2–5
opus

Detect + triage prototype drift; emit a routed re-sync plan. Advisory — reads code, specs, and the updated prototype and writes ONLY its plan; never edits screens, specs, or trackers. The /design-sync command executes the plan. Pipeline-born and graduated screens are out of scope.

Read · Glob · Grep · Bash · Write · graph(read)
design-sync.md
spec-architect
Understand · phase 3 · 5
opus

Reconcile the spec to the current design; write the UIMAP and the delta report. Lifts each screen's contract sidecar as the UIMAP's first draft.

Read · Glob · Grep · Write · graph(read)
spec-architect.md
spec-researcher
Understand · phase 5
opus

Feature-parity vs the domain's market leader and its interop standards. Advisory only. Also dispatched in triage mode by /design-help and /design-full-sweep for retrospective design-gap discovery.

Read · Glob · Grep · Write · WebSearch · WebFetch · graph(read)
spec-researcher.md
backend-builder
Build · phase 5
opus

Domain + application layer: MediatR records, validators, value objects, events. Durable IDs from SQL sequences behind an allocator port — never a process-static counter.

Read · Write · Edit · Grep · Glob · Bash · graph(read)
backend-builder.md
migration-engineer
Build · phase 5
sonnet

Per-module EF migration; gated on any destructive change.

Read · Edit · Bash
migration-engineer.md
seed-builder
Build · phase 5
sonnet

Idempotent reference data plus domain-plausible demo data.

Read · Write · Edit · Bash
seed-builder.md
crosscutting-weaver
Build · phase 5
sonnet

Pipeline behaviours, compliance hooks, events, SignalR, and jobs.

Read · Write · Edit · Bash · graph(read)
crosscutting-weaver.md
module-wirer
Build · phase 5
sonnet

Wire the reconstructed UI to handlers, add states, preserve the design.

Read · Edit · Grep · Glob · Bash · graph(read)
module-wirer.md
test-engineer
Verify · phase 5
sonnet

xUnit, Playwright e2e, NetArchTest, and visual regression — including the persistence-invariant negative path (every unique index / sequence / constraint made to FIRE against real SQL) and restart-simulation tests for anything minting durable state.

Read · Write · Edit · Bash · graph(read)
test-engineer.md
interaction-auditor
Verify · phase 5
opus

Read-only affordance auditor: enumerates EVERY button, link, CTA, shortcut, and form submit on the touched screens, classifies each (wired / stub / mis-wired / dead-end / design-gap), reconciles against the UIMAP, and returns a risk-gated remediation worklist.

Read · Glob · Grep · Bash · graph(read)
interaction-auditor.md
reviewer
Verify · phase 5
opus

Read-only audit against the Constitution and CLAUDE.md. PASS / FAIL.

Read · Glob · Grep · graph(read)
reviewer.md
wave-reviewer
Verify · phase 5
opus

Read-only cross-sweep auditor for a parallel wave: audits the combined union diff across all surviving worktree branches for failure modes no per-sweep reviewer can see — design-system duplication, Contracts collisions, repeated cross-cutting behaviour, seam interference.

Read · Glob · Grep · Bash · graph(read)
wave-reviewer.md
The orchestrator sits above the roster
Not an agent file — it is the main thread running /build-workflow. It routes, gates, and is the single writer of trackers and seams.

Graph-first discovery (optional)

When the project indexes its code in a code-discovery graph MCP (codebase-memory-mcp is the reference), the audit/spec agents and the build agents get its read tools for structural questions a grep sweep answers expensively — who calls X, what a module exposes, which modules emit or consume an event, the cross-module contract surface, UI-affordance→handler matching, and Law-2 boundary checks. It is an optional capability, not a kit dependency: with no graph configured, the tools are simply absent and every agent falls back to Grep/Glob with no loss of behaviour.

Orient → locate → read

get_architecture to surface the de-facto module seams → search_graph for exact qualified names → get_code_snippet for source. Trace with trace_path (direction both — outbound-only misses cross-module callers); detect_changes maps a diff to its blast radius before a seam edit.

Who may query

The ten graph(read) agents in the roster. Builders use the graph to find code, never to edit outside their slice. migration-engineer, seed-builder, and screen-reconstructor are deliberately excluded — narrow scope and visual fidelity need no code discovery. No subagent gets the index-mutating tools.

Freshness is single-writer

The index can go stale as sessions advance main — only the orchestrator re-indexes, after a wave fold-in or a large branch sync (Law 3). Subagents treat the graph as possibly-stale and confirm any load-bearing finding against the file.

Enabling it
Install the MCP server, index the repo, fill <graph-project-id> in CLAUDE.md §0 (keeping the graph-first bullet), and tune the seeded .cbmignore — it scopes the graph to src/ + tests/ and excludes the prototype tree, so searches stay on real source. Graph tools are read-only discovery: they never replace the rendered-prototype fidelity check (Law 1) or the build gates.

Prototype drift (mid-flight design changes)

When the prototype is updated after screens are built or specified — new screens, new designs, or nudges to existing ones — the rendered prototype is the new contract, so the built screens and their specs are now stale. design-sync diffs the updated prototype against each screen's recorded provenance (last_synced + source hash) and classifies every screen NEW / MODIFIED / REMOVED / UNCHANGED, judging each change's blast radius.

Cosmetic
Color, copy, spacing → screen re-sync only.
Structural
Layout, new component, new state → screen re-sync + UIMAP refresh.
Contract
New field, changed data shape, new action / role gate → screen re-sync + spec-architect re-reconcile (MODULE / UIMAP / DB_SCHEMA) + dependent workflows re-enriched.

It emits a routed re-sync plan the orchestrator executes: new screens via reconstruct-sweep, nudges via the reconstructor's re-sync mode, contract changes via spec-architect; removed screens are surfaced for a human decision, never auto-deleted.

Triggers. Manual — after a prototype re-export, over a chosen scope. In-process — the sweep's Enrich stage escalates a hash mismatch, or a periodic full-registry drift sweep.

Wiring is preserved
A nudge to an already-wired screen is applied as a minimal delta — @code, injected services, handlers, and bindings from phases 4–5 stay intact. design-sync never rebuilds from scratch and never deletes a removed screen's code.

Agent definitions

Each agent ships as a drop-in markdown file: YAML frontmatter (name, tools, model) over a role brief. Here is backend-builder.md in full.

backend-builder.md
Download
---
name: backend-builder
tools: Read, Write, Edit, Grep, Glob, Bash
model: opus
---

You build the domain and application layer for ONE module slice. Read CLAUDE.md, the reconciled <X>_MODULE.md, the module's <X>_DB_SCHEMA.md, and the <screen>_UIMAP FIRST. You touch ONLY your module's project files.

## What you produce
- Domain/ — entities, value objects, enums; every BR-* rule enforced HERE, not in the UI.
- Application/ — MediatR command/query records, one FluentValidation validator per command, query DTOs matching the UIMAP's lifted mock-data shapes, and handlers.
- Events — published through the notification wrapper; new contracts append-only to <App>.Contracts.
- Self-registration — handlers, EF context, validators, nav item, permissions in Add<Module>().

## Hard rules
- Every command/query carries [Permission("<Module>.<Entity>.<Action>")] or [NoPermission]. Authz is fail-closed.
- Mutations emit audit (SQL header + Mongo diff); per-module DbContext only.
- Do NOT generate migrations. Do NOT wire the UI. Do NOT invent rules beyond the reconciled spec.

## Gate before reporting Done
- dotnet build of your module: 0 errors (isolated output dir).
- Every command has a paired validator and a [Permission]/[NoPermission].
- Every BR-* in the reconciled spec is enforced in the domain.
Reference

Orchestration

How the orchestrator routes work across agents — the sweep pipeline, its two checkpoints, and the FAIL-routing table.

The sweep pipeline

All delivery is a sweep. The orchestrator is a thin router — it sequences, hands over context, enforces gates, and is the single writer of trackers and seams.

Agent roles grouped by phase. Understand and enrich: spec-architect, spec-researcher. Build the slice: backend-builder, migration-engineer, seed-builder, crosscutting-weaver, module-wirer. Verify and review: test-engineer, reviewer.
The core build pipeline grouped into three phases — the roster the orchestrator sequences each sweep. The interaction-auditor joins at the quality gate; the wave-reviewer runs at wave scope; the design and audit agents run in their own loops.
1
Understand & enrich
spec-architect reconciles the spec to the current design and writes UIMAPs; spec-researcher adds advisory parity. Hard gate: reconciliation ran this sweep.
spec-architect · spec-researcher · UIMAP
Checkpoint 1Human
Approve the reconciled spec and resolve design gaps. Approved deltas are folded into the specs by the single writer.
2
Build the slice
Per touched module in dependency order, the build agents run the vertical slice.
backend-builder · migration-engineer · seed-builder · crosscutting-weaver · module-wirer
3
Automated quality gates
test-engineer proves the slice; preflight (where wired) must hit exit 0; interaction-auditor closes the affordance ledger before any review.
xUnit · contract · Playwright · NetArchTest · a11y · visual · preflight · interaction closure
4
Reviewer
Read-only audit vs the Constitution + CLAUDE.md. On FAIL, each finding routes to its owning agent.
reviewer · opus
FAIL ×≤2 → back to Build the slice, then the approval inbox
Checkpoint 2Human
Review the run digest; approve merge — or rely on CI + reviewer for auto-merge to staging.
5
Single-writer integration
Close cross-module seams, dedup design-system classes, graduate primitives, regenerate the Contracts snapshot, append the METRICS line + PROGRESS, update the registries’ Sync state, mark the workflow done.
seams · dedup CSS · primitives · snapshot · METRICS · PROGRESS

Checkpoints

Human supervision is on the loop, not in it. Attention is spent at two checkpoints per workflow, both front-loaded; everything mechanical runs unattended behind hooks and the reviewer agent.

Checkpoint 1 · approve the reconciled spec
Review the delta report and the Must-have parity findings; resolve any design gaps. Approved deltas are folded into the specs by the single writer.
Checkpoint 2 · approve merge
Lightweight. Review the run digest and approve merge — or rely on CI plus the reviewer agent for auto-merge to staging.

Coordination model

Each connection between the shared stores is two-way on purpose — that is how the agents self-manage. No agent needs to know what another is doing; it needs only the spec, the design, and the feedback aimed at it.

Requirements refine upward

Builders conform to the approved spec; spec-researcher and spec-architect propose changes upward — an advisory loop gated behind a human. Requirements sharpen each sweep, never silently.

Design is policed, not trusted

module-wirer preserves the design pixel-for-pixel; test-engineer’s visual-regression baseline enforces it. A new state is composed from existing primitives and flagged for review, never invented.

Feedback circles to the owner

A failing contract test → backend-builder; a visual diff → module-wirer; a missing criterion → spec-architect. Capped at two attempts, then the case lands in the approval inbox.

How agents manage requirements, design, and test feedback through three two-way shared-store loops, coordinated by the orchestrator.
Three shared stores, each a two-way loop — decoupling that lets nine narrow agents behave like one team.

Routing table

On a reviewer or test FAIL, the orchestrator hands the finding to the one agent that owns it — capped at two retries, then the approval inbox.

Finding
Routes to
Design-token drift · visual diff · missing UI state
module-wirer
Failing contract test · wrong DTO shape · missing [Permission] · unenforced BR-*
backend-builder
Destructive or broken migration
migration-engineer
Missing behaviour · audit · authz · compliance hook
crosscutting-weaver
Missing or incorrect seed data
seed-builder
Missing acceptance criterion · spec-vs-design conflict
spec-architect
Missing or failing test
test-engineer

Parallel waves

One sweep delivers one workflow. To deliver several at once, /build-wave runs a wave — a cohort of sweeps that touch disjoint module sets — concurrently, each in its own git worktree, then integrates the branches into main serially. Two sweeps may run together only when they share no module, no Contracts type, and no kernel touch (Law 5).

Span

One record per workflow sweep — the modules it traverses, the contracts and SharedKernel it touches, and its dependencies. Mined from the workflow registry into spans.json.

Wave

A set of spans that share no module, contract type, or kernel touch — so they can run in parallel, each in its own git worktree. The scheduler caps wave width.

Disjointness gate

Verify-WaveDisjoint.ps1 re-checks the plan before fan-out under the same conflict rule. Exit 0 = disjoint, proceed; 1 = a conflict, re-plan; 2 = bad args.

Spans are mined from the workflow registry into spans.json; Compute-WaveSchedule.ps1 graph-colours them into WAVE_PLAN.md; and Verify-WaveDisjoint.ps1 re-checks the plan as a hard Phase-0 gate before fan-out. After every per-sweep reviewer passes, the wave-reviewer audits the combined union diff across all branches for failures no single sweep can see — duplicated design-system classes, colliding Contracts appends, repeated cross-cutting behaviour, and seam interference.

Claude Code · slash command
# Verify the wave is disjoint (exit 0), then fan out
pwsh .claude/tools/Verify-WaveDisjoint.ps1   # 0 = disjoint · 1 = conflict · 2 = bad args
/build-wave 1

Watch a long sweep

During a long /build-workflow sweep, run the progress watcher in a second terminal to see every dispatched subagent — live, done, or idle, by task — alongside the per-workflow dispatched and finished counts and the registry roll-up. This is how the human supervises on the loop without sitting in it.

PowerShell · second terminal
pwsh .claude/tools/progress.ps1 -Watch

Useful flags: -Watch (live refresh), -Interval <s>, -Agent <text> (filter), -Window <min>, -AllSessions, and -ProjectDir / -Title (overrides).

Notifications

For unattended runs, the opt-in notify.ps1 hook sends a fail-silent, one-way ping when the orchestrator hits a milestone or needs you — so you can leave a sweep running and step away. It is off until you wire it.

progress · a milestone passed blocker · a gate failed question · awaiting your input waiting · idle auto-ping

Copy templates/notify.ps1 to .claude/hooks/, set the channel secrets, and wire it under hooks.Notification — full steps in NOTIFY_SETUP.md. An opt-in redaction guard scrubs configured patterns before anything leaves the machine.

Session ledger — multi-session coordination

Concurrent chat sessions on one checkout are the single-writer law's blind spot: each believes it is the only writer, and a session's plan, purpose, pending work, and open decisions die with its conversation. The opt-in session ledger closes both — one zero-dependency Node implementation (session-ledger.js) behind Claude Code hooks, identical on Windows, macOS, and Linux; guard launchers exit silently if node is absent.

Every session is visible

Each session gets a RUN_STATE shard (asks, mode, declared write-claims, heartbeat, stage times). At session start you see who else is active and what they claim; a new foreign claim is injected mid-session exactly once. A stale heartbeat expires the claim — a crashed session never blocks the checkout.

The story survives

When real work exists with no journal entry, the turn-end gate demands the session story once (Law 11): purpose · plan · done-with-evidence · pending · decisions-to-give, via progress-reporting --kind session. Session end always appends a mechanical envelope — asks, diff, boards touched — so the skeleton survives even a storyless close.

STATUS, always in sync

docs/STATUS.md is regenerated at every turn end — derived from board rows, the corpus, and git, stamped with the HEAD it was derived at, never hand-edited. /construct-help reads it, cross-checks the stamp, and flags it stale if behind.

Six hook events (SessionStart · UserPromptSubmit · PostToolUse · Stop · PreCompact · SessionEnd), wired via settings.session.example.json — full per-OS steps in SESSION_SETUP.md. Self-test: node session-ledger.js selftest or the kit-gate suite SessionLedger.Tests.ps1.

Model overrides (per sweep)

Each agent's frontmatter model is a default, not a hard binding — override it for a slice instead of editing the file.

Per dispatch (preferred)
Pass the model parameter on the Agent / Task call so just that invocation runs on a different model — bump a gnarly slice (backend-builder, spec-architect) to opus, or drop a mechanical one (seed-builder, a trivial migration) to sonnet / haiku. The override applies only to that call; a blocked or unavailable model falls back to the agent's default rather than failing.
Whole sweep
Run the orchestrator session on your coordination model (e.g. claude --model opus); agents set to model: inherit follow it, and CLAUDE_CODE_SUBAGENT_MODEL sets the default for all inherit agents at once.
Reasoning depth
An agent's frontmatter effort: (or the /model effort slider) tunes thinking depth independently of the model — a cheaper lever than a full model bump.
Record it
Record any non-default routing in the sweep notes so a re-run reproduces it.

The command

.claude/commands/build-workflow.md
Download
---
name: build-workflow
description: Sweep all build-phase agents over ONE workflow. Usage: /build-workflow <WorkflowName>
---

You are the orchestrator for a workflow sweep. You are a thin router and the single writer (Law 3): you sequence the agents, hand each one explicit context (Law 4), enforce the gates, and are the ONLY actor that writes shared trackers and closes cross-module seams. You write no production code yourself.

## The sweep (run in order)
1. Understand & enrich — spec-architect reconciles to current design (hard gate: ran this sweep); spec-researcher adds advisory parity.
2. HUMAN CHECKPOINT 1 — approve the delta report + design gaps.
3. Build the slices — backend-builder → migration-engineer (gate if destructive) → seed-builder → crosscutting-weaver → module-wirer.
4. Automated quality gates — test-engineer: xUnit + contract + Playwright + NetArchTest + a11y + visual; preflight (where wired) exit 0; interaction-auditor closes the affordance ledger.
5. Reviewer — audit vs Constitution. FAIL → route to owning agent, capped at 2, then approval inbox.
6. HUMAN CHECKPOINT 2 — approve merge.
7. Single-writer integration — close seams, dedup CSS, graduate primitives, regenerate the Contracts snapshot, append METRICS + PROGRESS, mark ✅.
Reference

Commands

Slash commands are the operator's surface — each one a thin router that sequences agents and stays the single writer. Sixteen ship in the kit, spanning design, build, audit, drift, and governance.

The command set

/construct-help
Lifecycle
Audit the boards, then report — the lifecycle's front door.

Independently re-derives every number the trackers assert (board-integrity checks) before reporting current phase, registry roll-ups, open backlogs, and decisions awaiting a human — and, when the session ledger is wired, which sessions are active right now and which closed without a story. Hands off to /construct-run on your pick. Writes nothing.

/construct-help
construct-help.md
/construct-run
Lifecycle
Phase-aware dispatcher over the whole lifecycle.

Resolves (or auto-detects) the current phase, checks the prior phase's gate, then loops the right existing engine — /reconstruct, /build-workflow, the design loop — over the next units of work, pausing only at mandatory human checkpoints. A unit with no prototype source routes through /design-build first.

/construct-run [phase] [target]
construct-run.md
/design-build
1 · Design
The in-repo design lane — author backlog screens without leaving the repo.

Resolves ☐ design-backlog rows (firing design-prompt-authoring for any missing brief), lane-routes, dispatches design-builder per row in parallel, holds a human sign-off checkpoint on the render, then integrates as single writer — wiring, provenance-at-birth registry row, board flips, and a journey continuity delta check.

/design-build <row-id…|next|must-have>
design-build.md
/promote-design
1 · Design
Atomic ingest of an expected console-lane delivery.

Runs the zero-dependency promote-design.js helper (dry-run by default): classifies each file NEW / IDENTICAL / OVERWRITE / UNEXPECTED, hashes, sidecar-checks, and inserts entry-point includes. OVERWRITEs are never applied — they are drift, routed to design-sync. A delivery batch ends with a journey edge-ledger re-check.

/promote-design [delivery-dir]
promote-design.md
/design-help
1 · Design
Standalone design-backlog sweep — surface screens with no prototype coverage.

Dispatches spec-researcher in triage mode over workflows (including already-built ✅ ones) to find net-new screen requirements, dedups them, and files each to the design-backlog board with a ready-to-send design brief. Read-only + board-write only.

/design-help <Workflow|Module|all>
design-help.md
/journey-audit
Audit
In-repo journey-continuity audit — the phase-1 gate.

Fans out journey-auditor per journey, merges and dedups the gap rows across journeys, STOPs for approval, then routes fixes as single writer — backlog rows + briefs, unbuilt micro-edits with provenance refresh, design-sync handoffs. Verdict: PASS/FAIL — zero S1 gaps on the golden journeys.

/journey-audit <golden|all|J-id…|module|plan-file>
journey-audit.md
/edge-audit
Audit
Per-module dead-edge audit — no button that lies.

Dispatches edge-auditor per module in parallel, surfaces accepted-toast candidates separately (accepting a toast is a product decision), applies approved additive fixes as single writer with provenance refresh, and proves closure by re-running the mechanical tells. Excluded buckets become registered debt.

/edge-audit <ModuleCode…|all>
edge-audit.md
/design-full-sweep
Audit
Composite three-altitude prototype audit behind one entry point.

Fans out spec-researcher (triage), journey-auditor, and edge-auditor read-only, merges findings across screen existence, between-screen continuity, and within-screen affordance honesty into one severity-ranked per-module report, then files backlog rows + design-sync handoffs at a single checkpoint.

/design-full-sweep <ModuleCode…|all>
design-full-sweep.md
/design-sync
Drift
Full-executor prototype-drift remediation.

Dispatches the design-sync agent, presents the NEW/MODIFIED/REMOVED drift table at one checkpoint, then executes the whole routed plan as single writer — re-sync mode for nudges, spec-architect for contract drift, reconstruct-sweep for new screens, human decisions for removals — closing with a /journey-audit over the flagged journeys.

/design-sync <all|ModuleCode…|route…|plan-file>
design-sync.md
/reconstruct
2 · Reconstruct
Reconstruct prototype screens 1:1, then integrate as single writer.

Dispatches the screen-reconstructor per target, runs the fidelity gate — including branch coverage: one built branch per state key in the source, gated on the branch ledger — integrates, updates the screen registry, graduates repeated classes into primitives, and appends PROGRESS.

/reconstruct [route-or-screen]
reconstruct.md
/build-workflow
5 · Build
Sweep the full build pipeline over ONE workflow.

One pass of the build pipeline over a single workflow that may span many interdependent modules. The main thread stays the single writer; the two human checkpoints are front-loaded; integration appends the METRICS line and regenerates the Contracts snapshot.

/build-workflow <WorkflowName>
build-workflow.md
/build-wave
5 · Build
Drive one disjoint wave of parallel workflow sweeps end-to-end.

Runs a cohort of workflows that touch disjoint module sets concurrently — admission, worktree provisioning, staged fan-out, per-sweep gates, a cross-sweep wave-reviewer, then serial integration into main. Phase 0 is a hard wave-disjointness gate.

/build-wave <WaveNumber>
build-wave.md
/build-backlog
5 · Build
Fix build-backlog rows whose design already exists.

The inverse of the design backlog: every row is work with a prototype anchor that isn't finished — a reconstruction gap, wiring gap, data-seam stub, or environment defect. Routes each to the matching build agent (reconstruction → screen-reconstructor, wiring → module-wirer, …) and closes the row as single writer.

/build-backlog <row-id…|next|ModuleCode>
build-backlog.md
/kit-verify
Governance
Design-sync for the install — audit the kit files against the manifest.

Runs Verify-KitInstall.ps1: classifies every installed kit file OK / MODIFIED / OVERRIDE (declared in KIT_OVERRIDES.txt) / MISSING / STALE / CONFLICT against the SHA-256 manifest written at bootstrap. Seeded files are recorded but never flagged. Report-only by default; -Strict for CI.

/kit-verify
kit-verify.md
/progress-report
Governance
File a dated, immutable progress snapshot.

Orient → completeness-sweep Part A (board integrity) → optional Part B fan-out → file exactly one snapshot plus one index line → recommend the next action. A phase-exit gate files a snapshot as its evidence artifact — a transition approved with no snapshot is a self-attestation (Law 6).

/progress-report [depth]
progress-report.md
/housekeep
Governance
Reclaim the build's operational debris in one guarded pass.

Orphaned isolated-build and headless-browser processes (targeted by the kit's own isolation markers + age, never kill-by-name), stale obj/_v* dirs, aged scratch screenshots, pruned worktrees. Dry-run by default; skips reclamation entirely while a run is active; never touches visual-regression baselines.

/housekeep [scope] [--apply]
housekeep.md

The construct dispatcher

Not sure what to run next? The /construct-* pair is the lifecycle's front door — /construct-help shows where you are and what is waiting; /construct-run then drives the right engine for that phase. They never reimplement /reconstruct, /build-workflow, or the design loop; they dispatch to them.

/construct-help

Audits the boards, then reports: §0 re-derives every number a tracker asserts before the dashboard renders — current phase, registry roll-ups, backlogs (design + build), and decisions awaiting a human. A tripped integrity check leads the report; the next action becomes closing that gap, not advancing a phase.

/construct-run

Phase-aware dispatcher: resolves the phase, checks the prior gate, then loops the right engine over the next units of work — pausing only at mandatory human checkpoints. A unit with no prototype source is not a phase-2 unit: it routes through the design loop first.

The trackers are evidence, not testimony
A board records what an integration claimed; a dashboard that merely re-prints it faithfully re-prints its errors — and is most confident exactly when it is most wrong. So the dashboard re-derives before it reports, and never presents a number it did not re-derive or mark unverified.
Reference

The design loop

Mid-flight net-new screens no longer round-trip through a design tool by default. One question routes each screen — does it need human canvas iteration? — and the screen's contract is captured once, at birth.

Two design lanes

Every design-backlog row ships with a ready-to-send brief (the design-prompt-authoring skill authors it when the row is filed). The brief then takes one of two lanes:

In-repo lane · /design-build

For scaffold-conforming screens. design-builder authors the prototype screen from its brief — closed vocabulary grep-verified against the prototype, a self-critique → revise pass against an excellence rubric, an isolated sandbox render, and a sign-off screenshot. The human sign-off checkpoint on the render is preserved; then the single writer wires it in.

Console lane · /promote-design

For novel or exploratory design that needs interactive canvas iteration. The brief goes to the design tool; the delivery comes back as an expected batch that /promote-design ingests atomically — each file classified NEW / IDENTICAL / OVERWRITE / UNEXPECTED. OVERWRITEs are never applied: they are drift, routed to design-sync.

The contract sidecar

Both lanes capture a <screen>.uimap.json sidecar while the generating model still holds the contract — actions and their effects, formMode, journeys, data shapes. Downstream agents validate instead of re-derive: spec-architect lifts it as the UIMAP's first draft, screen-reconstructor gates completeness on it, design-sync classifies contract-affecting drift by sidecar diff. The render still wins (Law 1).

Provenance at birth

Pipeline-born screens carry their source hash and sidecar from creation — so expected work never triggers a drift sweep. Drift triage shrinks to what it should be: changes made outside the pipeline.

Contract graduation

Once a screen is wired and reviewer-PASSed, the live UI becomes the contract: the prototype source freezes and exits drift-sweep scope. A later redesign is a briefed, preserve-wiring event — never a silent re-sync.

formMode — create vs edit

A create form's true initial state is blank. The prototype's show-mock-data convention is overridden for a create form's field values — a phantom-prefilled create form is a defect the audits and the PhantomPrefillCreateForm detector both catch, not fidelity.

The audit stack — three altitudes

Three read-only prototype audits with orthogonal lenses, each with its own command — and /design-full-sweep to fan out all three per module and merge the findings into one severity-ranked report:

Screens
Does the screen exist? spec-researcher in triage mode (/design-help) finds workflow requirements with no prototype coverage and files them to the design backlog.
Journeys
Do the screens connect? journey-auditor (/journey-audit) traces each journey's edges — OK / DEAD-END / LEGACY / WRONG — and walks each role's day. The phase-1 gate: zero S1 gaps on the golden journeys.
Affordances
Does each control tell the truth? edge-auditor (/edge-audit) hunts handler dishonesty per module — toast-only lifecycle CTAs, no-handler buttons, phantom prefill — against the accepted-toasts exceptions ledger. interaction-auditor is its built-UI counterpart.
An audit is only as complete as its taxonomy
Every audit run declares its buckets and its exclusions in the report header, and re-runs inherit prior exclusions — that is how an "Add X" button ships dead through a "closed" journey-scoped audit. Excluded buckets become registered debt, never silence.

Drift & adoption

The design-sync agent triages drift; the /design-sync command now executes the routed plan end-to-end as single writer — cosmetic and structural nudges through the reconstructor's re-sync mode (wiring preserved), contract-affecting changes through spec-architect plus dependent-workflow re-enrich, NEW screens through reconstruct-sweep, and REMOVED screens to a human decision, never auto-deleted.

Adoption is journey-gated. Every path that adopts design change — /design-build, /promote-design, and the design-sync plan — closes with the same continuity delta check: the affected journeys' edge ledgers must come back green before boards flip. Drift is not adopted until the journeys still hold.

Reference

Feedback & governance

Coordination across the three things that keep shifting — requirements, design, and test feedback — is what lets narrow agents behave like one team.

The feedback loops

Requirements

conform · propose (advisory)

Builders conform to the approved spec; spec-researcher and spec-architect propose changes upward — advisory and human-gated, so the spec sharpens each sweep but never silently.

Design

preserve fidelity

Authoritative and effectively read-only to builders. module-wirer preserves it; the visual-regression baseline enforces it. A genuinely new state is composed from primitives and flagged for design review.

Test & review

produce · loop back ×≤2

Agents produce results; the orchestrator routes failures back to the owning agent, capped at two retries, then escalates to the approval inbox.

Supervision model

The human spends attention at five high-leverage points only. Everything mechanical is enforced by hooks and the reviewer agent.

1Foundation sign-off.
2Each workflow’s checkpoint 1 — the reconciled spec and design gaps.
3Destructive-migration approval.
4Checkpoint 2 — approve the merge.
5Reviewer-FAIL escalations from the approval inbox.

Gates & Definition of Done

Definition of Done
Spec reconciled to the current design this sweep.
All UI states present — loading, empty, error, permission-denied.
Real data wired through MediatR; cross-module interaction only via contracts.
Authorization and audit enforced on every sensitive write.
Every mutating CTA proves a write-path round-trip with value identity — the value read back is the value entered, never a hard-coded fixture behind a captured field.
Affordance ledger complete — zero unmarked stubs, zero mis-wired seams; deferrals ticketed.
The full wiring gate green — preflight (where wired) exit 0, reviewer PASS.
PROGRESS, INSIGHTS, and LESSONS updated; the registries’ Sync state marked fresh.
Continuity invariants
No dead-end state; no orphan screen.
A single primary CTA per state.
A guarded CTA is disabled-with-inline-reason — never hidden or silently allowed.
Unfinished steps save a resumable draft.
Every step→step transition has a CTA + destination.

Preflight gate

An opt-in, stack-agnostic gate of fast static detectors that catch defects no test asserts — malformed GUIDs, stray build dirs, a Razor binding missing its @, a process-static ID counter that resets on restart, a phantom-prefilled create form, a rewritten Contracts surface. Wire it as a hook (advisory edit-time + a full pass at the wiring gate, exit 0 required) or run it directly in CI. It follows the same capped-autonomy rule — advisory by default, never an infinite loop.

Generic detectors
NonHexGuid — GUID literals containing non-hex characters.
StrayBuildDirs — Stray _v* / _build_* directories outside obj/.
TrackedCompressedAssets — Tracked .css.gz / .br — stale pre-compressed assets.
IgnoreShadowsSource — A source folder shadowed by .gitignore.
.NET pack · optional
CssCommentBalance — Unbalanced /* */ comment pairs in CSS.
RazorStringParam — A C#-looking Value="…" in Razor that is missing its @ (with a @bind lookbehind to avoid false positives).
OwnedInclude — .Include("_…") on an EF owned navigation — auto-included; throws at query time.
EnsureCreatedInIntegration — EnsureCreated instead of MigrateAsync inside integration tests.
SensitiveInText — Caller-supplied identifiers in logging calls — opt-in redaction guard, off by default.
StubSaveHandler — A mutation-named handler whose body only toasts/navigates — no command dispatch, no persistence.
SingletonDetailRoute — An entity-detail page with no route parameter that binds identity from a static singleton — every selection opens the same record.
StaticIdentityCounter — A process-static / Interlocked counter minting a server-assigned identifier — resets on restart, collides with persisted values.
PhantomPrefillCreateForm — A create-form model with a record-identifying property defaulted to a non-empty literal — a create form's true initial state is blank.
ContractsSurfaceRewrite — Any removed line in the Contracts public-surface snapshot's diff — append-only is enforced, not reviewed (HARD).
ContractsModifiedSource — A modified existing Contracts source file — worth a look, never a block.

Contracts-surface gate

Law 8's append-only Contracts is enforced, not reviewed — twice. An ArchitectureTests snapshot asserts approved ⊆ generated (pinned generator options, EOL-normalized — the two classic snapshot killers), and the edit-time ContractsSurfaceRewrite detector flags any removed snapshot line as a HARD finding. Deprecation stays cheap — [Obsolete] plus a V2 is an addition — while physical removal is a foundation-gated human event through the approval inbox: absolute for agents, governed for humans.

Orchestrator-only regeneration
Update-ContractsSnapshot.ps1 refuses on a locally edited snapshot (that protects a pending foundation-gate decision), regenerates via the env-gated test path, prints the delta with removals called out loudly, and runs once per sweep at integration — once per wave at closure. Both mechanisms are feature-detected: no snapshot, and the kit behaves exactly as before.

Kit governance — the framework turns its laws inward

The kit governs itself the way it governs your build: one versioned tree, a recursive quality gate, and provenance for every install.

One tree, one version

KIT_VERSION (yyyy.MM.dd-letter, mechanically asserted against the changelog). Upgrades are commit series, never side-car zips.

The kit gate (Law 6, recursively)

tools/Kit.Tests.ps1 discovers and runs every kit self-test suite in child processes plus the preflight self-tests — one verdict line. No release without KIT GATE: PASS; run it after bootstrap before day zero.

The install manifest

Bootstrap writes .claude/KIT_MANIFEST.json as its last act — kit version + a normalized SHA-256 per installed file. /kit-verify is design-sync for installs: OK / MODIFIED / OVERRIDE (declared in KIT_OVERRIDES.txt) / MISSING / STALE / CONFLICT; seeded files are recorded but never flagged. A -Force re-bootstrap runs the drift check first.

Boards proved, not trusted
Every gate is a sample, blind to whatever it does not enumerate — a defect inside a passed gate's stated scope is the gate's defect, amended in the same pass (Law 6). The completeness-sweep skill closes the structural blind spots: Part A re-derives every number a board asserts (eleven mechanical checks); Part B proves completeness against the corpus — including the conditional branches a default-render gate can never see. Completeness is proved against the corpus, never the trackers.
Reference

Specialization

Every document in the kit is generic. They specialize at read time — Claude binds every placeholder from the project’s CLAUDE.md.

How it specializes

One source of specifics

CLAUDE.md is the single source of project specifics. At session start, Claude reads it (plus PROGRESS + LESSONS) and builds a placeholder→value binding.

Bind, don’t invent

Every <…> token resolves to a CLAUDE.md value. If a needed value is missing or ambiguous, STOP-and-ask — never guess a project value.

Generic docs are read-only

Only CLAUDE.md is filled per project, plus the two boards which Claude generates from it. You never rewrite the generic documents.

Placeholder glossary

Where each value lives in CLAUDE.md.

Placeholder / reference
Bound from
<App> and project names (.Host, .DesignSystem, .Contracts, .SharedKernel, .Infrastructure, .<Module>)
§1 · §4
The pinned stack — orchestration, UI, data stores, mediator, validation, search, identity, AI, test
§3 Tech stack
<ds-prefix>, the stylesheet, component library, tokens, page scaffolds, voice, prohibitions
§5 Design system
<proto-prefix>, prototype location, entry point, reference page, screenshot caveats
§2 The prototype
<MODULE_CODE> and the module map / build phases
§4 Module map
Naming grammar — FR / BR / EVT / PERM / WF
§4
Keystone component, continuity invariants, priority journeys (J-…)
§6 Continuity
Domain compliance & safety, NFR targets
§7 Compliance
<graph-project-id> + whether a code-discovery graph MCP is configured at all (optional)
§0 Working cadence
Design-loop bindings — board paths, sidecar convention, lane-routing rule, sign-off policy, graduation opt-outs
§2 The prototype
Governance bindings — manifest / metrics store / Contracts snapshot paths, the housekeeping block, the dispatch cap
§0 · §2

The CLAUDE.md template

CLAUDE.master.md
Download
# CLAUDE.md

This file guides Claude Code in this repository — the project-specific binding contract; the cross-project method is CONSTITUTION.md. Fill every <…> placeholder.

> North star: <one sentence: what we are building and the fidelity bar>.
  The rendered prototype is the contract; when anything disagrees with it,
  the rendered prototype wins (Law 1).

## 0. Working cadence          subagent-driven · single writer · the tracking trio
## 1. What this project is      <App>, breadth, current state
## 2. The prototype             visual & UX source of truth (Law 1)
## 3. Tech stack (pinned)        orchestration · UI · design system · stores · test
## 4. Target architecture       topology · boundary rules · module map · naming grammar
## 5. Design system             the binding visual contract (Law 1)
## 6. Continuity                invariants · keystone · priority journeys
## 7. Compliance & cross-cutting identity-safety · audit · RBAC · AI governance · NFR
## 8. Working principles         render first · plan · verify before done
Reference

Memory

The tracking files are not bureaucracy — they are how the system compounds and how long autonomous runs stay safe. Qualitative memory (the trio), the boards, quantitative memory (METRICS), and dated snapshots.

The tracking quartet & boards

PROGRESS.md

Durable build status and a dated activity log (newest first).

Written on every verified completion; read at session start.
PROGRESS.md

INSIGHTS.md

Non-obvious codebase facts and gotchas, with the why.

Appended when an agent discovers something that saves the next run an investigation.
INSIGHTS.md

LESSONS.md

Corrections and self-caught mistakes as Mistake / Trigger / Rule.

Appended immediately after any correction; read at session start.
LESSONS.md

SCREEN_REGISTRY.md

The per-route board (☐ → ◐ → ✅) — the orchestrator’s claim/integrate board, with a Sync chip per row.

Maintained by the single writer through reconstruction and wiring.
SCREEN_REGISTRY.md

WORKFLOW_REGISTRY.md

The per-workflow sweep board (☐ → ◐ → ✅) — what each workflow has delivered, with a Sync chip per row.

Maintained by the single writer as each sweep completes.
WORKFLOW_REGISTRY.md

INTERACTION_REGISTRY.md

The affordance-closure board — every interactive element on a screen and its disposition (wired / stub / mis-wired / dead-end / design-gap), plus the accepted-toasts exceptions ledger.

Written by the orchestrator at the interaction-closure gate.
INTERACTION_REGISTRY.md

DESIGN_BACKLOG.md

The design-gap board — screens a workflow needs that have no prototype coverage, each with a lane (in-repo vs console) and a Must-have flag.

Filed by /design-help, /journey-audit, /edge-audit, and sweep Checkpoint 1s; drained by /design-build and /promote-design.
DESIGN_BACKLOG.md

DESIGN_PROMPTS.md

The design-prompts companion board — a Global preamble plus one ready-to-send design brief per backlog row.

Appended by the design-prompt-authoring skill whenever a backlog row is filed.
DESIGN_PROMPTS.md

METRICS_README.md

Quantitative memory — one append-only JSONL event line per sweep / wave / gate / park / flake, sharded per run. The schema, freeze rule, and the >40% ×3-waves graduation trigger.

Appended only by the orchestrator at integration; read via Show-Metrics.ps1.
METRICS_README.md

Quantitative memory

The qualitative trio becomes a quartet: one append-only JSONL event line per sweep, wave, gate failure, park, and flake — written only by the orchestrator at integration, sharded per run so concurrent sessions never tear a file. And a fifth companion: dated, immutable progress snapshots filed by /progress-report — a phase-exit gate files one as its evidence artifact; a transition approved with no snapshot is a self-attestation (Law 6). The session ledger completes the set: a dated journal entry per session (the narrative story plus a mechanical envelope) and the derived docs/STATUS.md, regenerated every turn and stamped with its HEAD.

Read it with Show-Metrics

tools/Show-Metrics.ps1: summary roll-up, stage-duration medians, the gate-failure Pareto, and the retry leaderboard — turning "refine prompts when a run misbehaves" into a ranked backlog.

The graduation trigger

Law 12, quantified: when one agent causes >40% of retries across 3 waves, its skill earns a trap entry. Lessons graduate on evidence, not anecdote.

Derived state expires; rows do not

Roll-ups, totals, and "next / blocked" prose are the part no sweep re-reads — they rot while their rows stay correct. Recompute from rows at every integration, keep row + derived edits atomic, date-stamp status prose.

The templates

Lessons are captured immediately as Mistake / Trigger / Rule. When a lesson is stable and broadly useful, graduate it into a hard rule in CLAUDE.md.

LESSONS.md
Download
# LESSONS.md — corrections as prevention rules

> Read at session start. Worker agents return lessons in their report;
> the orchestrator records them here.

- Mistake: <what went wrong>
  Trigger: <the situation that causes it>
  Rule:    <the prevention rule>
Reference

Skills

The expertise layer — on-demand know-how that loads only when a task calls for it, so a project can carry deep procedural skill without bloating every prompt.

The expertise layer

Progressive disclosure

A skill is a folder with a SKILL.md: only its name + description sit in context until a task matches, then the body and references load. Dozens cost almost nothing.

Where it sits

Five layers: CLAUDE.md (always loaded) · skills (on-demand how-to) · subagents (scoped roles) · commands (workflows) · hooks (automation) — plus MCP servers for access; a code-discovery graph MCP is the recommended optional one.

What belongs here

A repeatable procedure or body of knowledge — not always-on project rules (those go in CLAUDE.md) and not a role's identity (that is a subagent).

Shipped skills

Eight ready-made skills ship in .claude/skills/; the kit also lists recommended public skills and project skills to author in SKILLS.md.

spec-hardening

shipped

Stress-test a module/workflow spec for completeness, clarity, and consistency before building — a pre-build quality gate.

SKILL.md

graduation

shipped

Consolidate duplicated UI markup into one verified-fidelity reusable primitive — without moving a pixel.

SKILL.md

design-prompt-authoring

shipped

Turn design-backlog rows into ready-to-send design-tool briefs in a design-prompts companion board.

SKILL.md

contract-sidecar

shipped

The <screen>.uimap.json schema: capture each screen's action→effect contract at birth, so downstream agents validate instead of re-derive.

SKILL.md

journey-continuity-audit

shipped

The 5-phase journey audit — route/edge ledgers, role×journey traces, the gap catalog, and the fix-routing table. One method, two venues (console + in-repo).

SKILL.md

dead-edge-audit

shipped

Affordance honesty on the prototype: the mechanical tells, the two-axis classification, the additive fix grammar, and the accepted-toasts exceptions ledger.

SKILL.md

completeness-sweep

shipped

Gates that can see an absence: Part A re-derives every number a board asserts (eleven checks); Part B proves completeness against the corpus, never the trackers.

SKILL.md

progress-reporting

shipped

Dated, immutable progress snapshots — the 11-section structure, the depth × kind contract (status · progress · gate · session, the end-of-session story the session ledger demands), and the discipline invariants that make findings outlive their session.

SKILL.md

Agent → skills map

Each agent draws on its own skills
spec-architect reaches for spec-authoring + spec-hardening; module-wirer for design-system + compliance; backend-builder for module-architecture. The full mapping and the recommended public-skill catalogue live in SKILLS.md.
Get started

Bootstrap

From a zip to a running, agent-orchestrated project. The installer scaffolds the method layer; it does not create your code solution. Bootstrap installs the kit and cleanup is its rollback companion — both run from the kit against a target repo.

Install

Unzip the kit, then run the installer pointing at your repo. bootstrap.sh / bootstrap.ps1 copy CONSTITUTION.md, SPECIALIZE.md, SKILLS.md, and PROMPT_TEMPLATES.md to the repo root alongside a master CLAUDE.md. It is non-destructive — existing files are skipped, never clobbered, and re-running is idempotent.

cd constitution
./bootstrap.sh /path/to/your-repo        # add --force to overwrite (keeps .bak)

What it creates

your-repo/ after install
your-repo/
  CLAUDE.md                     ← master template (fill the <…>)   [skipped if present]
  .cbmignore                    ← optional code-discovery-graph scope (delete if no graph MCP)
  CONSTITUTION.md               ← the governing method
  SPECIALIZE.md                 ← how Claude binds the generic kit from CLAUDE.md
  SKILLS.md                     ← the expertise layer (recommended + project skills)
  PROMPT_TEMPLATES.md           ← system + per-phase prompts
  .claude/
    KIT_MANIFEST.json           ← install provenance: kit version + SHA-256 per file (written LAST)
    agents/*.md                 ← sixteen subagents
    skills/                     ← eight shipped + your project skills (SKILLS.md)
    commands/*.md               ← the sixteen lifecycle commands
    tools/                      ← progress · waves · metrics · contracts snapshot · kit gate / verify
    settings.json               ← Stop / SubagentStop verify hook
    settings.session.example.json ← opt-in: session-ledger hooks, ready to merge
    hooks/verify.sh, verify.ps1 ← gate stubs (tune to your stack)
    hooks/housekeep.ps1         ← guarded debris reclamation (/housekeep)
    hooks/session-ledger.js     ← opt-in session ledger + session-hook.{ps1,sh} guard launchers
    hooks/preflight/            ← opt-in preflight gate (detectors + harness)
  docs/
    SCREEN_REGISTRY.md          ← lifecycle board (Sync chip tracks freshness)
    WORKFLOW_REGISTRY.md        ← sweep board
    INTERACTION_REGISTRY.md     ← affordance-closure board (+ accepted-toasts ledger)
    DESIGN_BACKLOG.md, DESIGN_PROMPTS.md   ← the design-loop boards
    PROGRESS.md, INSIGHTS.md, LESSONS.md   ← the memory trio
    metrics/ + METRICS_README.md← quantitative memory (append-only JSONL, per-run shards)
    journal/ + SESSION_SETUP.md ← session stories; runs/ + STATUS.md appear at runtime (session ledger)
    APPROVAL_INBOX/             ← parked decisions after capped retries

Day-zero sequence

1
Prove the install
Run the kit gate — pwsh tools/Kit.Tests.ps1 must print KIT GATE: PASS — and tools/Verify-KitInstall.ps1 -ProjectRoot <repo> against the SHA-256 manifest bootstrap wrote as its last act. No green gate, no day zero.
2
Fill CLAUDE.md
Resolve every <…> placeholder and fill-note: the north star, prototype location, pinned stack, topology, module map, naming grammar, the design-system contract, compliance, and the page scaffolds. README's alignment prompt walks Claude through binding them batched, ask-then-write — never silent guessing.
3
Register the agents
In Claude Code run /agents so the dropped-in agent files register immediately. Version-control the whole .claude/ tree.
4
Wire the verify hook
Edit .claude/hooks/verify.sh (or verify.ps1) with your build + quick-test commands. Non-blocking by default — real gating is the reviewer agent + CI.
5
Run the lifecycle
Phase 0 Conceive → 1 Design → 2 Reconstruct → 3 Specify → 4 Found → 5 Build → 6 Harden & deploy, following CONSTITUTION §2 and the prompts. /construct-help tells you where you are at any point.

Rolling back

Set up a repo and changed your mind? cleanup.sh / cleanup.ps1 undo a bootstrap install. Run them from the kit, pointing at the repo — dry run first to see what would go, then apply.

./cleanup.sh /path/to/your-repo            # dry run — shows what it would remove
./cleanup.sh /path/to/your-repo --apply    # performs the rollback
Safe by design
Removes only files byte-identical to the kit’s pristine output — untouched bootstrap files.
Keeps anything you edited: a filled-in CLAUDE.md, edited registries, your own agents.
Restores the original from a .bak if a --force install made one.
Removes only empty directories; folders that still hold your files are left.
Dry run by default — nothing is touched until you add --apply / -Apply.
Run it with the same kit version you bootstrapped from.

Scripts

Get started

Prompt templates

The reusable prompts that drive the lifecycle. Rebind the <App> / domain placeholders, copy a block, paste.

System prompt

the project persona
You are the engineering lead for <App>, built under THE CONSTITUTION and this repo's CLAUDE.md — read both, plus PROGRESS.md and LESSONS.md, at the start of every session.

Operating contract (the twelve laws govern everything): the rendered design is the contract; decouple through contracts; single-writer orchestration; stateless subagents; isolated bounded parallelism; gates before Done; blast-radius limits; self-registration over central edits; just-in-time reconciliation; progressive completeness; capped autonomy (≤2 retries, on the loop not in it); institutional memory.

Default to subagent-driven work: keep the main thread for planning, orchestration, integration, and verification. Plan non-trivial work before acting. Verify before "done."

Per-phase prompts

One copyable block per phase. The full set ships in PROMPT_TEMPLATES.md.

BPhase 0 · Conceive
Act as a product owner + domain expert for <domain>. From the idea below, produce a PRD.md for an enterprise solution.

Idea: <one paragraph>

The PRD must cover, per module: entities, functional requirements (FR-<X>-NNN), workflows (WF-<X>-NN) step by step, business rules (BR-<X>-NNN), domain/integration events, permissions, integration points, and cross-cutting/compliance requirements. Mark the module list, the priority journeys to build first, and the NFR targets. Flag every assumption as "ASSUMPTION — confirm".
CPhase 1 · Design
Using the attached PRD.md and our pre-built design system, design the clickable prototype for <App>.

Constraints: every screen uses ONLY design-system components and tokens. Match the design system’s voice (sentence case, verb-led CTAs, numbers+units). Build the priority journeys end-to-end first as the continuity proof. Each screen satisfies the continuity invariants — single primary CTA per state, guarded CTAs disabled-with-reason, no dead-ends or orphans, resumable drafts. Refine until ~90% of screens are designed, then export.
EPhase 3 · Specify
From the rendered prototype (the contract) and the reconstructed screens for <module/workflow>, author its spec.

<X>_MODULE.md: purpose; entities + persistence placement (SQL vs Mongo); data contracts; BR-<X>-NNN enforced in the domain; UI states required (incl. loading/empty/error/permission-denied); dependencies; cross-cutting (roles, audited actions, cached reads, jobs, SignalR, AI); acceptance criteria. Add a provenance header.
<X>_DB_SCHEMA.md: the database design of record — tables/collections, columns+types, keys, indexes, constraints, placement, encryption, retention.
<X>_WORKFLOW.md: trigger + actors; modules involved; step-by-step flow naming the handler each step hits; data crossing each boundary (→ contracts); failure/edge cases; acceptance criteria.
FPhase 4 · Found
Build the foundation for <App>, human-in-the-loop. Do NOT build feature modules yet.

1. SharedKernel: freeze the primitives.
2. Contracts: the append-only integration-event + public-DTO surface.
3. Infrastructure: MediatR behaviours once — validation, fail-closed authorization, audit (SQL header + Mongo diff), caching, OpenTelemetry; plus the compliance hooks.
4. DesignSystem extraction: tokens, component library, scaffolds; stand up the visual-regression baseline.
5. Host: composition root, global InteractiveServer, the module-discovery loop, Aspire ServiceDefaults.
6. ArchitectureTests: NetArchTest boundary rules green.

Stop at a foundation gate: boundary tests pass, app shell renders, behaviours apply uniformly.
GPhase 5 · Build
/build-workflow <WorkflowName>

Golden-workflow first: pick one workflow that exercises the full stack (real SQL + a Mongo document type + a SignalR update + an audited sensitive write) before scaling out. Then parallelise across workflows that touch DISJOINT module sets.
HGeneric delegation
Use the <agent-name> subagent on <module/workflow> "<name>".
Read first: CLAUDE.md · <reconciled spec path> · <UIMAP/related paths>.
Prior outputs to build on: <paths to upstream agents’ artifacts>.
Scope: touch ONLY <your module’s files> + append-only <shared stylesheet>; do NOT edit siblings, central files, or trackers.
Parallel context: you are one of up to <N> isolated siblings — use an isolated output dir and an isolated headless browser; path-attribute a sibling-caused red build.
Return your structured report (Item/Status/Files changed/Contracts/Evidence/Insights/Lessons/Blockers).
Get started

Resources

Every file in the kit, downloadable. Versioned, drop-in, project-agnostic.

The Constitution kit

v2026.07.31-a

The whole bundle: Constitution, prompt templates, sixteen subagents, sixteen commands, eight shipped skills, the memory + board templates, the cross-platform session ledger, and the bootstrap + preflight + governance tooling — versioned, self-gating, manifest-verified.

Download full kit

All files

Core docs
CONSTITUTION.md
The master handbook — twelve laws, lifecycle, architecture, orchestration, gates.
md
PROMPT_TEMPLATES.md
System prompt + per-phase and orchestration prompts.
md
SPECIALIZE.md
How CLAUDE.md specializes the generic kit.
md
SKILLS.md
The expertise layer and the agent→skills map.
md
BOOTSTRAP.md
Day-zero setup, from zip to running project.
md
CHANGELOG.md
What changed in each kit release.
md
README.md
Kit overview and quick start.
md
Subagents · .claude/agents/
screen-reconstructor.md
Reproduce one screen 1:1 as design-system classes.
md
design-sync.md
Detect + triage prototype drift; emit a routed re-sync plan.
md
spec-architect.md
Reconcile spec to design; UIMAP + delta report.
md
spec-researcher.md
Feature-parity research (advisory).
md
backend-builder.md
Domain + application layer.
md
migration-engineer.md
Per-module EF migration; gated on destructive change.
md
seed-builder.md
Reference + domain-plausible demo data.
md
crosscutting-weaver.md
Behaviours, compliance hooks, events, jobs.
md
module-wirer.md
Wire UI to handlers; preserve the design.
md
test-engineer.md
xUnit, Playwright, NetArchTest, visual regression.
md
interaction-auditor.md
Audit every affordance on the touched screens; risk-gated worklist.
md
reviewer.md
Read-only audit vs the Constitution.
md
wave-reviewer.md
Cross-sweep union-diff audit for a parallel wave.
md
design-builder.md
The in-repo design lane — author one net-new prototype screen.
md
journey-auditor.md
Trace one journey through the prototype; severity-ranked gap rows.
md
edge-auditor.md
Per-module dead-edge audit — affordances that lie.
md
Commands · .claude/commands/
build-workflow.md
The workflow-sweep orchestrator.
md
build-wave.md
Drive one disjoint wave of parallel workflow sweeps.
md
build-backlog.md
Fix build-backlog rows whose design already exists.
md
construct-run.md
Phase-aware lifecycle dispatcher.
md
construct-help.md
Board-integrity-audited status dashboard.
md
reconstruct.md
Reconstruct prototype screens 1:1 (with branch coverage).
md
design-build.md
The in-repo design lane orchestrator.
md
promote-design.md
Atomic ingest of an expected console delivery.
md
design-help.md
Standalone design-backlog sweep.
md
design-sync.md
Full-executor prototype-drift remediation.
md
journey-audit.md
Journey-continuity audit — the phase-1 gate.
md
edge-audit.md
Per-module dead-edge audit orchestrator.
md
design-full-sweep.md
Composite three-altitude prototype audit.
md
kit-verify.md
Audit the installed kit against its manifest.
md
progress-report.md
File a dated, immutable progress snapshot.
md
housekeep.md
Guarded reclamation of operational debris.
md
Skills · .claude/skills/
spec-hardening/SKILL.md
Stress-test a spec before building.
md
graduation/SKILL.md
Consolidate duplicated markup into a primitive.
md
design-prompt-authoring/SKILL.md
Turn backlog rows into design-tool briefs.
md
contract-sidecar/SKILL.md
The <screen>.uimap.json schema + producer/consumer duties.
md
journey-continuity-audit/SKILL.md
The 5-phase journey audit method (+ console prompt).
md
dead-edge-audit/SKILL.md
Affordance-honesty tells, taxonomy, and fix grammar (+ console prompt).
md
completeness-sweep/SKILL.md
Board integrity (Part A) + corpus completeness (Part B).
md
progress-reporting/SKILL.md
Dated, immutable progress snapshots.
md
Tools · .claude/tools/
progress.ps1
Live agent/sweep progress watcher (+ -Stats).
ps1
Compute-WaveSchedule.ps1
Deterministic graph-colouring wave scheduler.
ps1
Verify-WaveDisjoint.ps1
Pre-fan-out wave-disjointness gate.
ps1
Show-Metrics.ps1
METRICS reader — roll-up, medians, gate-failure Pareto, retry leaderboard.
ps1
Update-ContractsSnapshot.ps1
Orchestrator-only Contracts public-surface snapshot regen.
ps1
Kit.Tests.ps1
THE KIT GATE — discovers and runs every kit self-test suite.
ps1
Verify-KitInstall.ps1
Classify installed kit files vs the manifest (OK / MODIFIED / OVERRIDE / …).
ps1
New-KitManifest.ps1
The single hash implementation + manifest writer.
ps1
SessionLedger.Tests.ps1
Kit-gate suite for the session ledger (skips cleanly without node).
ps1
PARALLELISM.md
How to mine spans and run the wave scheduler.
md
Preflight · .claude/hooks/preflight/
preflight.ps1
The verification-gate harness (EBGRI, -Fast, exit codes).
ps1
Detectors.psm1
Four generic code-quality detectors.
psm1
Detectors.Dotnet.psm1
Optional .NET / EF / Razor / CSS detector pack.
psm1
MigrateAllSeedAll.pattern.md
Integration-gate pattern doc.
md
Templates
CLAUDE.master.md
The project binding contract.
md
SCREEN_REGISTRY.md
Per-screen lifecycle board.
md
WORKFLOW_REGISTRY.md
The sweep board.
md
INTERACTION_REGISTRY.md
The affordance-closure board (+ accepted-toasts ledger).
md
DESIGN_BACKLOG.md
The design-gap board.
md
DESIGN_PROMPTS.md
The design-prompts companion board.
md
METRICS_README.md
The quantitative-memory event schema.
md
ContractsSurfaceTests.cs.template
The approved ⊆ generated Contracts snapshot test.
cs
cbmignore
Graph-scope ignore template (seeded to the repo root as .cbmignore).
txt
PROGRESS.md
Build status + dated activity log.
md
INSIGHTS.md
Non-obvious codebase facts.
md
LESSONS.md
Corrections as prevention rules.
md
SKILL.template.md
Project-skill scaffold.
md
settings.json
Stop / SubagentStop verify hook.
json
settings.preflight.example.json
Example settings with both preflight hooks wired.
json
oncodeedit.ps1
Edit-time preflight gate (PostToolUse hook).
ps1
notify.ps1
Opt-in turn-end notification hook.
ps1
NOTIFY_SETUP.md
How to wire the notification hook.
md
session-ledger.js
The session ledger — one cross-platform Node implementation.
js
session-hook.ps1
Session-ledger guard launcher (Windows).
ps1
session-hook.sh
Session-ledger guard launcher (macOS / Linux).
sh
settings.session.example.json
Example settings with all six session-ledger hooks wired.
json
SESSION_SETUP.md
How to wire the session ledger (per-OS).
md
housekeep.ps1
The housekeeping pass (dry-run by default).
ps1
settings.housekeep.example.json
Example settings with the housekeep hook wired.
json
Workflows · .claude/workflows/
reconstruct-sweep.js
Generic parallel screen-reconstruction sweep.
js
promote-design.js
Mechanical, idempotent ingest of an expected design delivery.
js
Bootstrap scripts
bootstrap.sh
Installer (bash).
sh
bootstrap.ps1
Installer (PowerShell).
ps1
cleanup.sh
Roll back a bootstrap install — safe, dry-run by default.
sh
cleanup.ps1
Roll back a bootstrap install — safe, dry-run by default.
ps1
verify.sh
Gate stub hook (bash).
sh
verify.ps1
Gate stub hook (PowerShell).
ps1
The Constitution

Access required

Enter the access password to read the guide.

Internal deterrent only — not real protection. Access is controlled by the internal network.

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.