Grimoire
AGENTS.md2 starsChanged yesterdayApache-2.0View on GitHub
Grimoire is a catalog of AI-agent assets (rules, skills, agents, tools, MCP servers) plus a Rust command-line tool (CLI), grimoire, that installs the assets a user selects into their repository. MCP is the Model Context Protocol. Doctrina is the maintainer's library of portable rules and skills for coding agents. Claude Code and Codex share five rules in .claude/rules/ (writing.md, commits.md, rust.md, testing.md, and roadmap-and-docs.md). Each rule's Project details section holds Grimoire's values. All eleven of Doctrina's skills are in .claude/skills/,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- build-courseSkill
- build-language-packsSkill
- build-roadmap-and-docsSkill
- draw-diagramsSkill
- fix-doc-driftSkill
- next-taskSkill
- phase-gatesSkill
- security-sweepSkill
- set-up-githubSkill
- simplify-codeSkill
- sweep-codeSkill
- build-courseSkill
- build-language-packsSkill
- build-roadmap-and-docsSkill
- draw-diagramsSkill
- fix-doc-driftSkill
- next-taskSkill
- phase-gatesSkill
- security-sweepSkill
- set-up-githubSkill
- simplify-codeSkill
- sweep-codeSkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 2 are common, 2 are distinctive, and 4 are very specific to this project.
≈2
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Report only what you ran: Never claim a command, test, build or scan passed unless you ran it and saw the result.
- Common: line 15
Leave git and publishing to the maintainer: Don't commit, push, tag, release, publish or create repositories, environments or secrets …
- Common: line 16
Never handle credentials: Don't hard-code or log credentials, tokens or keys.
- Distinctive: line 17
Never weaken checks: Don't weaken lints, tests, type checks or security controls to get something passing.
- Very specific: line 18
Keep changes small: Prefer the smallest complete change.
- Very specific: line 33
Use the shared rule paths in Codex skills: Read, edit, and link to Grimoire's adopted Markdown rules in .claude/rules/.
- Very specific: line 134
Every crate under crates/ opens its src/lib.rs with crate docs (the //!
- Very specific: line 147
Use Conventional Commits (feat:, fix:, docs:, chore:, ci:, refactor:, test:).
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Grimoire: conventions for contributors and coding agents
Grimoire is a catalog of AI-agent assets (rules, skills, agents, tools, MCP servers) plus a Rust command-line tool (CLI), grimoire, that installs the assets a user selects into their repository. MCP is the Model Context Protocol.
docs/00-overview.mdtodocs/05-release.mdare the core documents: the overview, the architecture, the dependency policy, the platforms, quality, and releasing. Read them in order.docs/roadmap.mdhas the milestones, their tasks and the current status.docs/subsystems/has a spec for each part of the system. Read the spec of the part you change.docs/adr/has the decisions, as architecture decision records (ADRs) that also give the reasons.docs/specs.mdhas the external specifications (specs) that Grimoire relies on, as verified at their sources.
Working rules
- Verify formats before implementing them. The agent ecosystem's formats change monthly. Before you implement or change code against any external format, re-read the primary source and update its entry in
docs/specs.md: version, URL, date checked. Never fill gaps from memory; mark what you couldn't verify as UNVERIFIED. - Report only what you ran. Never claim a command, test, build or scan passed unless you ran it and saw the result. Say which checks you did not run.
- Leave git and publishing to the maintainer. Don't commit, push, tag, release, publish or create repositories, environments or secrets unless the maintainer explicitly asks in this session. Propose a Conventional Commits message instead.
- Never handle credentials. Don't hard-code or log credentials, tokens or keys. Secrets appear only as environment-variable names.
- Never weaken checks. Don't weaken lints, tests, type checks or security controls to get something passing. Fix the cause.
- Keep changes small. Prefer the smallest complete change. Write an ADR in
docs/adr/for significant or hard-to-reverse decisions.
Rules and skills adopted from Doctrina
Doctrina is the maintainer's library of portable
rules and skills for coding agents. Claude Code and Codex share five rules in .claude/rules/
(writing.md, commits.md, rust.md, testing.md, and roadmap-and-docs.md). Each rule's
Project details section holds Grimoire's values. All eleven of Doctrina's skills are in
.claude/skills/, unchanged.
- Read the shared rules before starting work. Claude Code loads the rules by scope. In Codex
or another agent, read every Markdown file in the repository's
.claude/rules/directory before planning, editing, or running project checks. Follow rules withoutpathsfront matter throughout the task. Follow rules withpathswhen work touches a matching file, including files added to the task later. - Use the shared rule paths in Codex skills. Read, edit, and link to Grimoire's adopted
Markdown rules in
.claude/rules/. Codex uses.codex/for project configuration and.codex/rules/for command approval policies. - This file and the ADRs win where a rule's general text says otherwise, for example on the shape of a crate README (ADR-0012) or of a decision record.
- Claude Code offers the skills as slash commands, such as
/next-taskand/fix-doc-drift. Each one setsdisable-model-invocation: true, so it starts only when someone types it.build-courserelies on Doctrina'steaching-materials.md, which Grimoire hasn't adopted. - Keep the copies in step with Doctrina. Change a rule's general text or a skill in Doctrina first, then copy it here. Change only Project details here. No rule's general text differs from Doctrina's (ADR-0013).
Repository layout
| Path | What |
crates/agent-grimoire-model | Strict types for asset.toml, bundles, grimoire.toml, grimoire.lock; single-document validation; the source of the JSON Schemas |
crates/agent-grimoire-catalog | Catalog loading and catalog-wide validation, including native Agent Skills checks; the embedded pack (catalog.pack, the catalog built into the binary) and Source |
crates/agent-grimoire-resolve | Selection, versions, conflicts, clients and permission consent |
crates/agent-grimoire-install | Root-confined filesystem (file access that can't leave the project root), managed blocks (the marked sections Grimoire owns in shared Markdown files), JSON, JSONC (JSON with comments) and TOML (a configuration file format) entries, the planner, apply and verify |
crates/agent-grimoire-adapters | The six client adapters (claude-code, agents-md, codex, cursor, gemini-cli, copilot), each of which writes one client's files; the cross-client planner, which writes content that several selected clients read once, in a shared place, and warns about what other clients read too; and the plugin files for the marketplace |
crates/agent-grimoire | The grimoire CLI: a library (run) plus the binary |
crates/agent-grimoire-mcp | Shared hardening (security defenses) for MCP server assets, never published: stdio, Streamable HTTP, limits and OAuth resource-server checks (checks of the access tokens that clients present) |
crates/agent-grimoire-testkit | Fixture catalogs and projects for tests (never published) |
xtask/ | cargo xtask schema, validate, pack-catalog, gen-marketplace, new, release; scaffolding templates (the starting files for new assets) in xtask/templates/ |
packaging/ | Hand-written release inputs that aren't Rust (ADR-0010, the language-policy exceptions): the install.sh/install.ps1 templates, the npm launcher, and the templates of the workflows that sync the Homebrew tap and the Scoop bucket. Release assets are generated from them at release time and never checked in (docs/05-release.md) |
.github/scripts/ | Workflow scripts that are language-policy exceptions (ADR-0010, ADR-0011): image-tags.sh, the image's push, tag and latest steps. ShellCheck, a shell-script linter, checks them in continuous integration (CI) |
Dockerfile | The container image (ADR-0011, docs/container.md): the release's static musl binaries on distroless static, a base image with no shell and no C library, COPY only. Only release.yml builds it, from the context that cargo xtask release image context writes |
.grype.yaml | The image's Grype gate (ADR-0011); Grype is a vulnerability scanner. Any medium, high or critical match fails, fixed or not. A finding without a fix needs an ignore rule with a reason, reviewed like the exceptions in deny.toml, the cargo-deny dependency policy |
catalog/<kind>/<id>/ | One directory per asset (data only). See catalog/README.md |
.claude-plugin/, plugins/claude-code/ | The Claude Code plugin marketplace, generated from catalog/. Never edit by hand |
.claude/rules/, .claude/skills/ | The rules and skills adopted from Doctrina for work on Grimoire itself (see above). Grimoire doesn't install them; they aren't catalog assets |
schemas/ | Generated JSON Schemas. Never edit by hand |
docs/00-overview.md to docs/05-release.md, docs/roadmap.md, docs/subsystems/, docs/adr/, docs/specs.md | The planning and design documents (ADR-0013): the core documents, in reading order; the roadmap, the only place that reports status; one spec for each part of the system; the decision records; and the register of external formats |
docs/cli.md, docs/diagnostics.md, docs/configuration.md, docs/container.md | The user reference: commands, flags, exit codes, --json output and environment; every user-facing diagnostic code; grimoire.toml, grimoire.lock, permissions and clients; running and verifying the container image |
README.md, CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md | The community files, at the root. README.md is also the agent-grimoire crate's page on crates.io, the PyPI long description and the README in every CLI archive |
.github/ISSUE_TEMPLATE/, .github/pull_request_template.md, .github/CODEOWNERS | The issue forms and the config.yml of the form chooser, the pull request checklist, and the code owners |
Everyday commands
cargo fmt --all
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked # the API docs, as CI builds them: a broken intra-doc link fails
cargo xtask schema # regenerate schemas/ after changing model types
cargo xtask schema --check # what CI runs
cargo xtask validate # validate catalog/
cargo xtask validate --base origin/main # also enforce version bumps for changed assets
cargo xtask pack-catalog # regenerate the embedded catalog after changing catalog/
cargo xtask pack-catalog --check
cargo xtask gen-marketplace # regenerate .claude-plugin/ and plugins/claude-code/ after changing catalog/
cargo xtask gen-marketplace --check
cargo xtask new <kind> <id> --maintainer <login> # scaffold an asset
# Release pipeline (ADR-0009). These build and check locally; none of them publishes anything.
# CI runs them as `cargo --locked xtask …`, so a stale Cargo.lock fails instead of being rewritten.
cargo xtask release plan --event <event> --ref <ref> # the mode (dry-run, release or skip), version, targets and archive names for a release.yml run; fails past GitHub's matrix and asset limits, and in release mode on a stale catalog.pack or an asset that needs a newer grimoire
cargo xtask release build --target <triple> --out dist # build (one cargo auditable build per package), smoke-test and archive the CLI and every asset binary for one target
cargo xtask release sbom --dist dist # a CycloneDX 1.6 SBOM per archive
cargo xtask release channels --dist dist --work work # npm packages, wheels, Homebrew formula, Scoop and winget manifests, install scripts
cargo xtask release checksums --dist dist [--check] # write or check dist/SHA256SUMS
cargo xtask release verify --dist dist # the expected assets, SHA256SUMS, and the same binary in every channel
cargo xtask release notes --version <V> --image-digest <sha256:…> --out <file> # the GitHub Release text, from the version's CHANGELOG.md section (fails without one); names the image digest
# Pass --partial to `channels` and `verify` when dist/ holds only some of the six targets.
# Container image (ADR-0011). The Dockerfile is COPY only. Change its base only by digest, to one at least 7 days old:
# Dependabot can't date gcr.io digests, so check the age by hand. Run as release.yml runs them, these steps need Docker
# with a docker-container buildx builder, crane, cosign and Grype; the steps themselves call none of them.
cargo xtask release image base # print the base index reference the Dockerfile pins
cargo xtask release image context --dist dist --base base --out image # check the base index (from `crane manifest`) against the pin, unpack both Linux musl targets' binaries into a build context, write the buildx arguments
cargo xtask release image check --out image --layout image/layout --base base # check buildx's OCI layout against the plan, binaries byte for byte; print the digests
cargo xtask release image coverage --out image --report <json> --cdx <file> --platform <p> # fail unless Grype saw Debian, its packages and every binary's Rust packages
cargo +1.96.0 check --workspace --all-targets --locked # MSRV, as CI runs it, after rustup toolchain install 1.96.0 --profile minimal
cargo deny check
cargo shearTerms in the comments above:
- ADR-0009 is the release pipeline and its distribution channels, and ADR-0011 the container image and its supply chain.
- An SBOM (software bill of materials) lists the components inside an archive.
- OCI is the Open Container Initiative, whose image layout buildx writes.
- MSRV is the minimum supported Rust version.
Code conventions
- Toolchain and lints: Rust edition 2024. The toolchain is pinned in
rust-toolchain.toml, and the MSRV is the workspacerust-version. Lints are configured once in the rootCargo.toml(unsafe_code = "forbid", clippy pedantic). CI treats warnings as errors. - Model types reject unknown fields. Constrained values are newtypes (types that wrap a single value and accept only valid ones) validated while parsing, so errors carry the TOML location.
- Diagnostics have stable codes such as
manifest/kind-table-missing. A diagnostic is an error or warning that Grimoire reports. Tests assert on codes, not on message text. - The filesystem is hostile input. Never follow symlinks in the catalog or in a user's project. Use the
RelPathtype for every path that is written or installed. In a user's project, writing through a link would put content somewhere the user didn't expect (ADR-0006, which confines every write to the project root). - Generated files are checked in, with a
--checkmode in CI. Regenerate them; don't edit them. - Snapshots are reviewed, never accepted unread. Adapter output is covered by
instasnapshots, stored copies of the expected output. When one changes, read the diff before accepting it (cargo insta review, orINSTA_UPDATE=alwaysandgit diff). - The installer's guarantees are tested end to end in
crates/agent-grimoire/tests/cli.rs. A change to planning, applying or removal needs a test there.
Documentation
- The design documents follow the code (
.claude/rules/roadmap-and-docs.md). In the same change:- a change in a part's behavior or design updates its spec in
docs/subsystems/; - a decision made or changed gets a record in
docs/adr/; - a finished roadmap task is ticked in
docs/roadmap.md, and the status locations agree with it: the roadmap's**Status:**line, thebefore-first-releasenotes, the**Status:**line ofdocs/05-release.md, and each library crate's## Status; - a new crate, command, module or rule gets its row in this file;
- a change to a policy updates its core document: dependencies in
docs/02-dependency-policy.md, platforms indocs/03-platforms.md, tests and checks indocs/04-quality.md, versions and releases indocs/05-release.md; - a change to the workflow or the checks also updates
CONTRIBUTING.mdand the pull request template.
- a change in a part's behavior or design updates its spec in
- The user reference follows the code. A change to a command, flag or exit code updates
docs/cli.md, and a new user-facing diagnostic code updatesdocs/diagnostics.md. A unit test and an integration test fail when a command, flag, exit code or diagnostic code is in the code but not in these files, or the other way round. Descriptions aren't checked, so update them in the same change. - The root
README.mduses absolute links only (https://github.com/jabbott-iii/Grimoire/blob/main/…), and an xtask test enforces it. Relative links break where the file is republished: crates.io resolves them againstcrates/agent-grimoire/, PyPI doesn't rewrite them, and the CLI archives hold nodocs/. - Keep one copy of each community file.
README.md,CONTRIBUTING.md,SECURITY.mdandCODE_OF_CONDUCT.mdlive at the root. Never add one in.github/ordocs/, where GitHub also looks for them. GitHub reads.github/first, then the root, thendocs/, so a copy in.github/would replace the root file on GitHub. - Other READMEs are separate files. Package, crate and asset READMEs are required where
catalog/README.mdand ADR-0012 (crate documentation) need them. - Each crate's docs follow its code (ADR-0012).
- Every crate under
crates/opens itssrc/lib.rswith crate docs (the//!lines, its docs.rs page) in one shape: what it is, then# Where it fits,# The partsand# Example, then what a caller must know. - Each published library crate also has a
README.md, its crates.io page, with the sectionsStatus,How the CLI uses it,Platforms(only where behavior differs by operating system),DocumentationandLicense. Its Rust examples run as doc tests.agent-grimoire's page is the rootREADME.mdinstead. - A change to a crate's public API or behavior updates its crate docs and README in the same change, and a new crate starts in this shape. A test (
xtask/src/crate_docs.rs) checks the shapes, and the doc tests andcargo doccatch stale examples and broken links. Whether the words are still true is checked only by review. - In doc comments, explain a term once, in the crate docs or on the item that defines it, and link to it elsewhere with an intra-doc link such as
[`Source`].
- Every crate under
Adding an asset
Adding an asset is a data-only change under catalog/. See catalog/README.md for the required files, and run cargo xtask validate before you open a pull request.
Any change to installed content needs a version bump and a CHANGELOG entry. Asset versions and deprecation follow docs/05-release.md.
Commits
Use Conventional Commits (feat:, fix:, docs:, chore:, ci:, refactor:, test:). The root CHANGELOG.md is generated from them by release-plz (ADR-0003, which chose release-plz for versions and changelogs). Each asset's CHANGELOG.md is written by hand.
Mark a breaking change with ! (feat!: …) or a BREAKING CHANGE: footer. That includes a change that breaks any library crate's public API and, while Grimoire is 0.x, an MSRV bump (docs/05-release.md). Nothing else catches an unmarked one: release-plz runs no SemVer (semantic versioning) check of the public API.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

