Nov 3, 2026
Write, Review, and Port Idiomatic Rust With Three Tested Agent Skills
Beautiful Rust is a 2k-star set of three Agent Skills and a clippy config that teach Claude Code, Codex, Copilot, Cursor, and Gemini CLI to write, review, and port idiomatic Rust — every code example compiles on stable Rust, and every lint in the config is proven to fire.
Agents write Rust that compiles but reads like transliterated C: public fields nobody should mutate, doc examples that call unwrap(), missing # Errors sections. morganlinton/BeautifulRust distills five canonical Rust style sources into three Agent Skills plus a clippy config, so the judgment calls land in the prompt and the machine-checkable ones land in CI.
Why This Skill Matters
The repo ships three skills and a lints config. rust-best-practices loads whenever your agent writes or changes Rust and steers it toward idiomatic, robust, maintainable code. rust-review reviews existing code — a file, a crate, or a diff — and writes a prioritized report where every finding cites the rule it breaks and shows the fix. rust-port ports C, C++, Python, Go, or JavaScript to idiomatic Rust with the same behavior, porting the original tests first so you can prove the two match. The lints/ directory is a drop-in clippy configuration that enforces the machine-checkable rules in CI.
The guidance is distilled from five sources — the Google Rust Style Guide, the official Rust API Guidelines, Effective Rust by David Drysdale, Rust Design Patterns, and Microsoft's Pragmatic Rust Guidelines — with a condensed digest of each bundled in the skill so the agent can consult the original reasoning. Where the sources disagree, the skill picks a side and says why. Every code example compiles on stable Rust, and every lint in the config was checked against current clippy. The skills work with Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, and any other agent that reads the Agent Skills format.
Installation
The skills installer supports most agents (Node 22.20 or later):
npx skills add morganlinton/BeautifulRust
Add -g to install for your user instead of the current project, or -a <agent> to pick an agent, such as -a codex or -a cursor. On Claude Code, installing as a plugin gets you one-command updates:
claude plugin install beautiful-rust --marketplace morganlinton/BeautifulRust
Install all three skills: the review and port skills lean on the best-practices skill for style. One directory caveat from the README: Claude Code does not read the shared .agents/skills/ location, so use its own directory or the plugin.
Real Workflow: Review a Messy Module
Ask your agent to review a file, crate, or diff — for example:
review src/parser.rs
The rust-review skill runs cargo fmt, clippy, and the tests when a toolchain is available, then writes a report with three tiers: must fix, should fix, and consider. Every finding gives a file:line location, the rule it breaks with its source — an API Guidelines code such as C-GETTER, an Effective Rust item, a Microsoft guideline, or a clippy lint — and the smallest code change that fixes it. Each report ends with what the code already does well.
Real Workflow: Port a C Module to Rust
Ask for a port — "port parser.c to Rust" or "rewrite this Python service in Rust". The rust-port skill reads the original and its tests, ports the tests first, and designs a Rust API instead of transliterating the original, verifying with cargo test and clippy. It maps each language's habits to their Rust equivalents: NULL and None to Option, error codes and exceptions to an error enum, out-parameters to return values, flag ints and magic strings to typed enums and options, and dict insertion order to an ordered collection instead of a HashMap that would silently reorder output. Each port comes with a PORTING.md that maps the old API and tests to the new ones and lists every deliberate difference.
Enforce It in CI
The skills teach the rules; the lints keep them from slipping back in. Copy lints/clippy.toml next to your Cargo.toml, paste the [lints] block from lints/lints.toml, then run:
cargo clippy --all-targets --all-features -- -D warnings
It flags unwrap() outside tests, unsafe blocks without a // SAFETY: comment, #[allow] without a reason, any bool function parameter, silent lossy as casts, missing # Errors and # Panics docs, assert! without a message, exported enums that aren't #[non_exhaustive], and leftover dbg! and todo!. Lints marked [lib] are for libraries, and applications can drop them. Every lint in the table is proven to fire: lints/check/ is a small crate with one deliberate violation per lint, and bash scripts/check-lints.sh fails if a lint stops firing.
The Bevy Exception
Bevy calls your systems and builds their arguments, so some general Rust advice is wrong for them. When a crate depends on bevy or bevy_ecs, the writing and review skills read references/bevy.md first. It covers Bevy 0.20, names the conventions to leave alone (system parameters taken by value, the prelude, public fields on plain-data components), and lists the ECS bugs that compile cleanly — two queries that can both mutate the same component panic with error B0001 on the first frame. Every behavior in the reference was checked with a test against bevy 0.20.0.
Tips
- The repo's October 2026 benchmark ran eight cases on Claude Code and Codex CLI, with and without the skills: Claude Code (Opus 5.5) went from 72/85 (85%) to 80/85 (94%), Codex from 53/85 (62%) to 76/85 (89%). The skills helped Codex more than Claude, and helped reviews most; Claude did worse on the Bevy feature task with them. The benchmark page notes it was one run per configuration, graded by a Claude model.
- Validate before contributing:
python3 scripts/check-skill.pychecks frontmatter, links, evals, and manifests, andpython3 scripts/check-examples.pycompiles every Rust block in the skills, reference digests, README, and examples. - Updates arrive per installer:
claude plugin update beautiful-ruston Claude Code,codex plugin marketplace upgrade beautiful-ruston Codex; anyone who copied the folder or used an installer re-runs the install command. - For claude.ai, upload one zip per skill with the skill folder as the zip root; code execution must be enabled first.
When Not to Use This
The lints enforce one specific rule set, including bool-parameter bans and #[non_exhaustive] requirements some codebases deliberately relax — review the table before wiring it into CI, and remember applications can drop the [lib]-marked lints. You also still need a Rust toolchain locally: the review skill runs cargo fmt, clippy, and the tests only when a toolchain is available.
See the leaderboard for more skills.