Skip to content

Google Rust Style Guide, enforced

Drop-in rustfmt, clippy and cargo-deny configuration, AGENTS.md for coding agents, and a human review guide for Google's Rust style guide. Hand one prompt to your coding agent, or set it up yourself in five minutes.
Recommended

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.

  1. Copy the prompt

    Prompt
    Apply the Google Rust Style Guide kit to this repository.
    Follow the instructions at
    https://daniakash.github.io/Google-Rust-Style-Guide/_llms-txt/for-coding-agents.txt
    Then 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.
  2. 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.

  3. 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.

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.

Last updated:

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.