File structure
Stages follow the plan this repo was started from: A is the constitution and this design, B is structured sources and deterministic compilation, C is feedback and proposals (observation only), D is scoped automatic adoption. Directories for C and D are reserved, not created.
README.md the repo's front page, in English A
README.zh-CN.md the same page in Chinese A
LICENSE Apache-2.0, for everything but the text
below A
LICENSE-CC-BY-4.0 CC BY 4.0, for the text of constitution/,
rules/ and skills/ A
AGENTS.md the instruction file for agents working
here, compiled by statute from
statute.toml; never edited by hand A
AGENTS.legacy.md the former hand-written AGENTS.md, kept
until a person says to delete it A
statute.toml the rule set: the constitution, the domains
and rules this repo takes, its parameters A
statute.lock the pinned rules and their hashes, the
version of statute and the commands of the
checks, written by statute A
.statute/
.gitignore written by statute before its first generated
file, so that a new clone ignores the files
statute generates in .statute/ A
rules/ the local rules, one file per rule A
constitution/
<YYYY-MM>/ the edition directory, today 2026-10
(constitution.md) A
index.toml status, edition, revision, languages, title,
front A
articles/
<NN>-<id>/ one directory per article, numbered A
article.toml the article: title, intro A
<NN>[a-z]-<id>.toml one section per file, numbered: status,
text in every language, list items A
generated/ built from the sources, committed A
constitution.en.md the constitution in English A
constitution.zh.md the constitution in Chinese A
constitution.en.agent.md the version for agents, English A
constitution.zh.agent.md the version for agents, Chinese A
crates/ the Rust workspace's crates, one directory
each A
statute/ the statute binary, under development A
src/constitution/ the constitution build A
assets/ the design tokens and the icons the sites'
pages share (frontend.md) A
docs/
design/ this design, one file per topic, indexed
by README.md A
zh/ its Chinese translation, one file of the
same name per file A
rules/
<id>.toml one node of the rule tree per file, named
by its number A
params.toml the parameters the rules use A
skills/
<name>/SKILL.md one general skill per directory, with any
template files beside it, installed as is A
.agents/skills/<name>/ skills installed by statute, with a link
.claude/skills/<name> to each A
schema/ schemas for the rules, fixtures and the
overlay manifest B
tools/ a uv workspace, one Python project each:
site/ package constitution_site, runs statute
export A
src/constitution_site/
count_tokens.py counts the tokens the static site shows
(count-tokens) A
check_site_anchors.py checks the built site's links
(check-site-anchors) A
tests/ their tests, and test_site.py, the tests of
the site's Hugo templates A
checks/ package repo_checks, this repo's own checks A
src/repo_checks/
check_instruction_changes.py instruction files apart
(check-instruction-changes) A
check_design_translation.py the design's translation in step
with the English (check-design-translation) A
lint_zh_sources.py limae on the zh sources (lint-zh-sources) A
tests/ their tests A
<others> compiler, checkers, private-term scanner B
examples/
overlay/ a fictional private overlay B
golden/ its compiled output and build manifest B
fixtures/
static/ deterministic fixtures, happy and redline B
behavior/ real-agent scenarios C
cases/<id>.md decided cases C
proposals/ reserved for the adoption pipeline D
web/ the static site's Hugo project: hugo.toml,
content adapter, layouts, style sheets,
scripts, i18n A
themes/hugo-book/ the theme, a git submodule at a pinned
commit A
site/ built static site, not committed A
.github/workflows/ CI A
.github/assets/ the README's icon and diagrams, light and
dark A
.pre-commit-config.yaml commit hooks A
pyproject.toml the workspace root: its members, Python
version, pins of limae, pre-commit and the
Python checkers, and their configuration A
uv.lock the workspace's one lock file, written by uv A
Cargo.toml the Rust workspace root: its members and
shared package fields A
Cargo.lock the Rust workspace's lock file, written by
cargo A
rust-toolchain.toml the Rust toolchain version, read by rustup
locally and in CI A
.python-version the Python minor version uv runs tools/ on A
.fleet/config.json issue-tracker metadata for Agent Fleet; the
toolchain never reads it AThe design is split into files by topic, so that changes to different
topics touch different files, as rule 113 (design-file-per-topic) asks.
Rule system is the overview of the files that describe
the rule system, each listed in the index
(agent-constitution design).
Four stage B pieces start early. tools/ starts in stage A with this
repo’s own checks and the static site’s tools. rules/ starts in stage A too,
holding the
concrete practices taken out of the constitution. skills/ starts in
stage A as plain directories, each holding a SKILL.md with the usual
skill front matter (name, description) and no metadata of this
repo’s own. crates/ starts in stage A with one crate, statute, whose
first release, 0.0.1, is a placeholder published early to hold the name
on crates.io; the command starts with 0.1.0. It builds the constitution,
which is itself compiled from one directory per article and one file per
section (see Source formats), and the binary that compiles and checks the rules grows in it in
stage B (what it does so far:
The command and the first version). Compiling and checking the
rules, and building the instruction file, stay in stage B.
Stage B, in the order to build it: schema/ and the schema checker,
the rest of rules/ (filled by migration), the compiler, examples/
with the drift check, the reference and relaxation checkers, the
private-term scanner, fixtures/static/ with the fixture gate, then load
verification. Each step is usable on its own.
What the amendment article protects is the text of the constitution
(protected-text); in the core that is the sources under
the edition directory (index.toml and articles/) and the wording
of the files built from them. A change to the text is an amendment and
takes effect as approving-amendments says (see Approving an
amendment).
Everything else is an ordinary change under rule-evolution
(ordinary-tooling), reviewed and tested like any other:
tools/, crates/ and schema/ (compiler, checkers, the fixture-gate runner),
.github/workflows/, fixtures/ and examples/golden/. A person’s
attention goes to what the constitution says; the tools are kept honest by
their unit tests and happy-path end-to-end tests, not by a person reading
them. The generated files change only by rebuilding. A change to the
build script that alters only their numbering or layout is ordinary, and its
pull request shows their diff so a person can glance at the format; one that
alters their wording changes the text and is an amendment
(protected-text). The notes the build script writes itself (the header
line, the repealed note, and in the version for agents the line under the
title and the mark in place of a provision’s text) are not the text of the
constitution: they change as the script does, by an ordinary change
(ordinary-tooling), and may only say what the text already says (that
the constitution binds every agent, terms.agent), point to the full
text and describe the layout; a note that would change a meaning needs an
amendment first. Which provisions the version for agents leaves out is set
in the sources (audience, see Constitution), so changing it is an amendment.