agentreadme

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

Lint and format rules 58%
Instruction quality 58%
Agent instruction file 51%

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 — Rust
# 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.

# install
cargo build

# verify
cargo 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

TypeScript 71Python 60Go 70JavaScript 60Java 44C++ 42