Write and review production Rust using the official API Guidelines, Style Guide, and this engineering standard: allocation contracts, ownership, Result vs panic, debug_assert, Clippy, tests, rustdoc, unsafe, and Cargo CI.
Write and review production Rust against official docs and this engineering standard
An Agent Skill for Claude Code, Codex, Cursor, Grok and compatible agents
An agent writing or reviewing Rust loads this skill and applies one standard: official API Guidelines and Style Guide for language and public APIs, plus allocation contracts, ownership, Result vs panic, debug_assert!, Clippy, tests, rustdoc, unsafe, and Cargo CI for production crates.
/rust-best-practices <path> reviews a crate or file. Each finding quotes the line, names the rule (including official C-* ids), and gives the fix.
The logo above is the official Rust gear, linked to rust-lang.org. This project is not affiliated with or endorsed by the Rust Project or the Rust Foundation.
Add -g for a user-level install, -a claude-code (or another agent) to target one agent.
As a Claude Code plugin:
claude plugin marketplace add massimodeluisa/rust-best-practices-skill
claude plugin install rust-best-practices@rust-best-practices-skill
Manual: copy skills/rust-best-practices into ~/.claude/skills/ (or your agent's skills directory) and restart the agent.
Usage
/rust-best-practices applies the standard to the current Rust work.
/rust-best-practices crates/project-core reviews that path.
Example prompts:
Review this parser for allocation on the hot path
Replace unwrap in this library with typed errors
Add Clippy and rustfmt to CI
Is this debug_assert validating caller input?
Design a heapless parse API with a caller-owned buffer
How it works
SKILL.md is the router: authority, always-on rules, which reference to load. Details live one level down in references/, loaded only when the task needs them.
Official pages are cited, not copied. Agents should fetch the live Style Guide, API Guidelines checklist, Clippy config, and Cargo profile docs rather than invent lint names or APIs.
Repository structure
rust-best-practices-skill/
├── .claude-plugin/ plugin.json, marketplace.json
├── .github/ validate workflow
├── assets/ official Rust logo (CC-BY, unmodified) and social preview
├── skills/rust-best-practices/
│ ├── SKILL.md router and always-on rules
│ ├── evals/ review and API scenarios
│ └── references/ official, allocation, ownership, errors,
│ design, unsafe, performance, quality, review
├── AGENTS.md · CONVENTIONS.md · CONTRIBUTING.md · CHANGELOG.md
└── LICENSE