Tools enforce
rustfmt, 41 clippy and rustc lints, and cargo-deny cover 32 of 62 in-scope rules. CI blocks the merge.
One prompt, zero config work. Your coding agent downloads the configs, turns on the lints, runs fmt, clippy and cargo-deny, and fixes your code until everything is green.
Copy the prompt
Apply the Google Rust Style Guide kit to this repository.Follow the instructions athttps://daniakash.github.io/Google-Rust-Style-Guide/_llms-txt/for-coding-agents.txtThen run cargo +nightly fmt, cargo clippy --workspace --all-targets -- -D warnings,and cargo deny check bans, and fix what they report without editing the lint configuration.Paste it into your agent from your project root. Works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and any agent that can run commands.
Review the diff. Expect new config files, lint tables in Cargo.toml, and fixes in your code. The lint configuration itself should match the downloaded files exactly.
Run this in a single-crate Cargo project. It adds five files, turns on the lints, and shows you what the guide flags. Existing files are never overwritten.
base=https://daniakash.github.io/Google-Rust-Style-Guide/filesfor f in rustfmt.toml clippy.toml deny.toml rust-toolchain.toml AGENTS.md; do if [ -e "$f" ]; then echo "skipped $f (already exists)"; else curl -fsSLO "$base/$f"; fidonecurl -fsSL "$base/crate-lints.toml" >> Cargo.toml # workspaces: see the quick startcargo clippy --all-targetsUsing a workspace, or want each step explained? The quick start walks through it in four steps with the expected output.
Google’s Rust style guide mixes mechanical rules with design judgment. The kit gives each rule to the cheapest layer that can hold it.
Tools enforce
rustfmt, 41 clippy and rustc lints, and cargo-deny cover 32 of 62 in-scope rules. CI blocks the merge.
Agents follow
AGENTS.md teaches Claude Code, Codex, Cursor and others the judgment rules no linter can check.
Humans review
A review guide covers what is left: API shape, ownership design and whether each exception is justified.
Exceptions are written down
Allowed deviations become #[expect(lint, reason = "...")] at the exact spot, so reviewers can judge them.
Unofficial community project, not affiliated with or endorsed by Google. TheGoogle Rust Style Guide is published by Google under CC-BY 3.0. This kit is Apache-2.0.