doc-contractlisted
Install: claude install-skill adamw7/tools
# Doc Contract Skill
In this repository the documentation is a build artifact: `CLAUDE.md`,
`AGENTS.md` and `README.md` are validated by the `claude-code-enforcer` rules,
and a `-DenforceClaudeMd` build fails when they drift. Edit them with the rules
in mind rather than discovering them in CI.
## Who is the source of truth
`AGENTS.md` is the single source of truth. `CLAUDE.md` is a **quick-reference
summary** that defers to it — it is loaded into every session, so
`contextBudget` caps it at **32 KB**. New detail belongs in `AGENTS.md` or in a
skill, not in `CLAUDE.md`.
## Required structure
| Document | Title | Required `##` sections |
|---|---|---|
| `CLAUDE.md` | `# CLAUDE.md` | Project · Java version · Maven · Principles for Java Development · Testing · Dependencies |
| `AGENTS.md` | `# AGENTS.md` | Project overview · Module layout · Environment & toolchain · Build, test, and run · Code style & conventions · Releasing · Pull requests & commits |
Also checked: the title must be the **first non-blank line**; a required section
must have a **non-empty body** (a heading with nothing under it fails);
`CLAUDE.md` must reference `AGENTS.md`; and `memoryImports` validates the
`@`-import graph.
## The consistency rules — what must change together
- **`moduleMapConsistency`** — every `<module>` in the root `pom.xml` must be
mentioned in **both** `CLAUDE.md` and `AGENTS.md`. Adding a module means
editing three files in one commit: the pom, the module map in `CLAUDE.md`, an