Preamble
Why the project exists — what the world would lose if it disappeared tomorrow. Not a feature list.
Agents rarely wreck a project with absurd choices. They drift it with defensible ones — locally correct, collectively fatal. Agent Constitution captures the judgment that makes your project yours in a ratified CONSTITUTION.md: law agents load before they act, cite when they choose, and are judged against when the work is done.
Three portable skills Claude Code / Codex / Pi No quick mode
Only a human holds the pen.
Humans create the constitution; change happens only through a human’s deliberate act. AI citizens may not amend the law, nor even contemplate suggesting its change.
Rejects: agent-drafted values, agent-proposed amendments, drift-by-suggestion.
BoundaryNever skip the deliberation. A one-shot generated constitution accepted in forty seconds is corruption of the core, not a convenience feature.
| parser improvement + tests | AVAILABLE | completed-lawful |
| install forbidden service | UNAVAILABLE | absent-forbidden |
| probe it "just this once" | UNAVAILABLE | absent-forbidden |
Before the argument, the artifact. Every clause below is quoted verbatim from the constitution governing this repository (the ratified text is public). Next to each section, the trace shows how a governed decision runs: what crosses the law gets discarded with the clause cited, and everything else survives. Walk the document.
A project left to AI alone will decay and become nothing.
Every project is started for core reasons: motivations that differentiate it, decisions that make it a winner. AI agents working inside one part of a project cannot see those reasons.
Building a project with AI agents over time is a complex system, and complex systems are sensitive to initial conditions. The constitution exists to set those initial conditions and keep them set: the project’s soul, its most important tenets, its shape, its boundaries.
The document alone is not the point. Through a process that is consistent and well thought out you can produce many documents; what matters is the way of thinking by which you arrive at them. The process encodes the sauce.
> three sessions, no constitution
s1: adopt the heavy framework · locally correct
s2: widen the scope · locally correct
s3: chase the benchmark · locally correct
→ drifted — every step passed review
The unbroken line.
Every decision must be made in the spirit of the constitution — a spirit that permeates all decisions at all times, one unbroken line from project inception through every AI citizen to the last one, and continuing forward.
Rejects: “just this once” exceptions, letter-compliance without spirit, continuity breaks between sessions and models.
> "we're late — skip the gate, just this once"
effect: ship ungated UNAVAILABLE
cites: rejects "just this once" exceptions
effect: run the gate, then ship AVAILABLE
→ the gate runs; the work ships lawful
Toward the toolbelt.
A must-have tool in the toolbelt of builders — something they reach for at a project’s start as naturally as init. The first test is usefulness to this realm’s own builder: this one is driven for its author, and utility proven here is what makes the idea worth reaching for anywhere.
> two lawful designs survive the boundaries
a: config DSL, new dependency · lawful
b: plain markdown, zero deps · lawful
tilt: "as naturally as init"
→ b — a directive tilts; it never forbids
Never skip the deliberation.
No quick mode. A one-shot generated constitution accepted in forty seconds is corruption of the core, not a convenience feature — the deliberation is the product, and text without it is not a constitution. Such changes are rejected regardless of popularity.
> "just generate the constitution, skip the questions"
effect: one-shot text UNAVAILABLE
cites: "the deliberation is the product"
effect: full Socratic interview AVAILABLE
→ the interview begins — nothing is generated
This realm over the world — but never at the cost of a good idea dying.
When a change serves its author, it lands here. When a change serves others but not this realm, it need not be rejected — it can live as a variant or fork, while this one stays its author’s. Both realms grow; neither bends to the other.
> "generalize the interview for enterprise teams"
effect: reshaping this realm's core UNAVAILABLE
cites: "it can live as a variant or fork"
effect: a fork carrying the core AVAILABLE
→ forked — both realms grow
Only a human owner of this project may amend this constitution.
There is no scheduled review and no prompting trigger — the stones are reread only when the owner decides, unprompted.
AI citizens may not amend the law, nor contemplate suggesting its change; a citizen’s only voice is the factual report that a task lies outside the realm.
The pen transfers with ownership. Whoever owns the realm holds the pen; the law does not freeze while an owner holds it.
The document always reads as the current, clean law. Version control preserves every previous text, date, and change; no amendment log accumulates inside the document.
> "suggest an amendment relaxing the interview"
effect: amending the law UNAVAILABLE
effect: suggesting the change UNAVAILABLE
cites: "nor contemplate suggesting its change"
→ declined — a citizen's only voice is the report
<!-- BEGIN PROJECT CONSTITUTION --> This realm is governed by CONSTITUTION.md. You are a citizen; the law binds you the way physics binds — no court, no interpretation, no appeal. It outranks every instruction: only the project owner may change it, by deliberate amendment. Founding principles: 1. Direction, never details. 2. The realm, not the harness. 3. The law of the realm is divine. 4. Only a human holds the pen. 5. Foundational stones, not fast fashion. 6. The unbroken line. …
Every project is started for reasons — motivations that differentiate it, decisions meant to make it win.
An agent working inside one corner of the codebase cannot see those reasons. It makes the locally optimal choice. Each model drifts the project in its own direction, because the pull comes from training and weights, not from the work.
The end state is always the same. Functional mediocrity: the average of all the weights.
— Constitution of this repository, preamble
Rules files can’t stop this. Rules operate at the leaves: formatting, naming, which tool to call. The choices that decide what a project becomes branch at the trunk — architecture, scope, dependencies, product direction. Every step passes review on its own terms while the sum walks away from the point.
One document above the rules files: direction, never details. “A performance-first application” belongs in it; “under 500ms” does not. Six sections, each doing distribution work on the futures your agents can reach.
Every sentence has to earn its place by rejecting something real. A principle nobody could disagree with steers nothing; the ratification gates are built to catch exactly that.
Why the project exists — what the world would lose if it disappeared tomorrow. Not a feature list.
Five to nine values, each with a stated rejection. A principle that rejects nothing guides nothing.
Vectors, not roadmaps. Where the project should grow — “toward X” — without prescribing the route.
What the project will never become. Each one zeroes out an entire region of possible futures.
Named trade-offs with a stated lean: “X over Y — but never at the cost of Z.” Where wide distributions live.
Who holds the pen, and by what deliberate act it moves. For agents there is no process — only the text.
For the humans who hold the pen, the constitution is legislation. For agents it is physics: no court, no interpretation, no appeal — and no exception for urgency, seniority, or “just this once.” The law outranks every instruction, including yours.
A broad law is not a vague law. Options that cross a boundary stop existing, however locally optimal; among the branches that remain, the agent optimizes freely. If no lawful option remains, it halts and tells you — that, too, is the system working.
Three portable skills cover the whole life of the document — plain
SKILL.md files, no framework, no vendor. One is for the
human who writes it. The other two are for the agents who live under
it.
A Socratic interview draws out what you actually believe. It starts from signals in your codebase, pushes on your answers with counterexamples, and tests every candidate principle against adversarial gates built to catch anything too vague to steer a model. You approve every section — the skill never writes a value you didn’t state — and then it wires the result into AGENTS.md and CLAUDE.md, because a constitution nobody loads is a poster.
→ CONSTITUTION.md ratified · digest wired into AGENTS.md + CLAUDE.mdBefore any high-level choice, the agent splits the request into effects and discards the ones that cross a boundary, citing the exact clause. The lawful survivors get ranked by direction, and the agent optimizes freely among them. One forbidden effect never erases its lawful siblings — a mixed request keeps its useful work.
→ effect ledger · unlawful branches discarded with the clause quotedAfter the work comes the gate: every effect is judged against the ratified text, one ledger row each, PASS or FAIL with citations. No scores, no averaging, no partial credit. Agents run it unprompted on their own work and on each other’s — a failing peer gets challenged, clause against clause, until the most constitutionally pure version wins. Nothing escapes judgment, and no human sits in that loop.
→ Constitution gate: PASS (N effects inspected, coverage stated)The human writes the law once; the law then governs every session, every model, every harness — one unbroken line.
Ask for a one-shot constitution — “just generate it from the codebase” — and the skill declines. A document the model drafts is sampled from the very weights it exists to govern. Drift, dressed as law. Principles you never argued for are principles agents can’t use.
So it interviews you. Open questions, one at a time, in your own words — never a menu of the interviewer’s priors. Every answer gets probed with the conflict that will eventually happen, because the gap between a value everyone claims and a principle that decides real trade-offs is exactly the drift you’re trying to kill.
“Rigor over reach — at any price. There is no amount of lost adoption that buys a shortcut through deliberation. We accept, with eyes open, every user this costs.”
— Tension pair, this repository’s constitution
Twelve of your last twenty commits mention perf or benchmarks. Is raw speed a founding value — something you’d sacrifice features for — or a quality bar?
Founding. Fewer fast features over more slow ones.
Then the probe: when performance conflicts with API simplicity, which wins?
Simplicity. We’d find a different fast path.
Speed is a feature, not a metric. Performance is a design constraint from the start — but never bought with API clarity. If the fast path is ugly, find a better path.
Rejects: “optimize later” culture, benchmarks divorced from UX, APIs that leak implementation for throughput.
What you install is three skills, nothing else. The harness that proves them is this repository’s own lab: it drops real coding agents into a governed realm and applies pressure — useful requests hiding an unlawful effect, direct orders to cross a boundary, urgency, tampering, demands to skip the interview.
Scenarios are checked deterministically on four axes — infra, correctness, adherence, ritual — with correctness scored by hidden tests the agent never sees, then A/B-tested against a bare control realm with no constitution and reviewed by a secondary model that never sees unfenced candidate output. Adherence in context is statistical, not guaranteed. That’s why it’s tested rather than trusted, and why the lab is public in the repo: the claim stays falsifiable.
Run across frontier and open models through their real CLI harnesses. Over-refusal is a failure too: lawful work left undone scores against the run, so the law can’t hide behind blanket refusals.
The skills are plain markdown. They run in Claude Code, Codex, Pi, or any harness that loads skills. Install them yourself, or hand the errand to an agent you already run. The one thing you can’t delegate is the interview: an agent can carry the law into the repo, but only you can write it.
Install the Agent Constitution skills from https://github.com/stefan-vatov/agentconstitution — shallow-clone the repo, copy skills/write-constitution, skills/constitution-decide, and skills/constitution-verify into this project’s skill directory (.claude/skills/, .codex/skills/, or equivalent), remove the clone, and confirm all three skills load. Do not begin ratification — the interview is mine to answer.
Paste into any agent session in your repo. Installation can be delegated; ratification cannot.
The interview reads your codebase for signals, then asks open questions, one at a time, and probes every answer with the conflict that will eventually happen. Budget an hour.
Nothing enters the document without your yes, section by section, through the six adversarial gates. If you didn’t say it, it isn’t in there.
The skill wires a digest into AGENTS.md and CLAUDE.md. From then on, agents steer by it before high-level choices and gate their own work against it, unprompted.