Skip to content

Provider instruction files are generated from the one policy, deterministically

CLAUDE.md, AGENTS.md, GEMINI.md and any other target the policy names are not written by hand. majordomus update generates them from one canonical policy, the profiles, and one shared body text, through a small template per provider. Running it twice with the same inputs produces byte-identical files.

guaranteed Deterministic and blocking. Implemented, and a behavioural test proves it.

Running update twice leaves the byte-identical file. The test asserts the hash.

What it means

CLAUDE.md, AGENTS.md, GEMINI.md and any other target the policy names are not written by hand. majordomus update generates them from one canonical policy, the profiles, and one shared body text, through a small template per provider. Running it twice with the same inputs produces byte-identical files.

How it works

lib/update.sh hashes the policy and profiles, renders each target from its adapter — the templates under the distribution's share/providers/, or the repository's own override under its providers section — and writes each target atomically. Every generated file is a bootstrap: it names README.md, points at .ai/README.md, names the default profile and the lifecycle workflow, and carries no rule of its own. Its first line is a stamp naming the command that produced it, the policy hash it came from and the hash of its own content. Adapters translate; they do not add rules — a rule that exists for one provider and not another is a policy bug by definition, and doctor fails a generated file that has grown a rule corpus.

How to see it

majordomus update && shasum CLAUDE.md
majordomus update && shasum CLAUDE.md   # identical hash; output says "unchanged CLAUDE.md"

What it does not cover

v0.1 projects a deliberately narrow subset of the policy — the budget, the profile table, state locations, the finish contract, the identity-fields rule — and lists what is not projected. It does not merge an existing hand-written instruction file; you decide what moves into the body on first use.

Why it exists

In one workspace of about twenty repositories, the instruction files for two AI tools in the same repository shared between none and a tenth of their content. They were not duplicates; they were disjoint rulebooks, and which one applied depended on which tool was open.

Detail rendered from docs/claims/projection-generation.md.

Provenance

defined in
read it on this site · docs/DESIGN.md
implemented in
lib/update.sh · majordomus update
proved by
test/cases/03_update.sh
claim id
projection-generation

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh 03_update

Where this claim is used

Related claims same implementation

The moments this answers