Guides · Rust
How to write an AGENTS.md for a Rust project
Measured across 57 of the most-starred Rust repositories on GitHub. The median scores 63 out of 100.
What Rust repos get wrong
Rust gets dependency pinning and compiler-enforced types for free, and like Go a separate type checker is not applicable and is excluded from its total. The recurring gap is tooling config: 58% commit no clippy or rustfmt configuration, so an agent has no way to know the house style and its output drifts from yours in ways review has to catch by hand.
Most common failures
share of 57 Rust repositories scoring zero on each
Lower is better here. These are failures, not scores.
A working example
Commands first, conventions second, none of the persuasion a README carries. The test is whether a capable stranger could make a small change and verify it using only this file.
Save it at the root of the repository
as AGENTS.md. Tool-specific files like CLAUDE.md or .cursorrules still work, but
AGENTS.md is the one every tool reads.
# AGENTS.md ## Setup cargo build ## Commands cargo test # full suite, must pass before any commit cargo clippy -- -D warnings cargo fmt --check ## Conventions - Unit tests sit in the file they cover, integration tests in tests/. - Clippy warnings are errors in CI. Do not allow-by-default to silence one. ## Gotchas - The toolchain is pinned in rust-toolchain.toml. Do not override it.
The two lines that matter most
If you write nothing else, write these. An agent that cannot install the project cannot start, and one that cannot run the tests cannot tell whether it broke something.
# installcargo build# verifycargo test
Have it drafted instead
Point the tool at a repository and it writes the file from what is already there, rather than from a template.
For private code, the same rubric runs on your machine and sends nothing anywhere:
$ npx agentreadme --write-agents
Other ecosystems