# Beautiful Rust

> Agent Skills that teach coding agents to write, review and port idiomatic Rust

- Category: Agents & Automation / Agent Skills & Plugins
- Language: Python
- Licence: MIT
- Repository: https://github.com/morganlinton/BeautifulRust
- Website: https://www.beautifulrust.dev
- Canonical page: https://ai-tldr.dev/tools/beautiful-rust/

## In short

Beautiful Rust is Agent Skills that teach coding agents to write, review and port idiomatic Rust. A `lints/` folder holds a drop-in clippy configuration that enforces the machine-checkable rules in CI. It sits in the Agent Skills & Plugins category of the Agents & Automation tools and is open-source, written in Python and licensed MIT.

## Overview

Beautiful Rust is a package of three Agent Skills plus a lints configuration for one job: getting coding agents to produce idiomatic Rust. `rust-best-practices` loads whenever an agent writes or changes Rust code; `rust-review` reviews a file, crate or diff and writes a prioritised report; `rust-port` ports C, C++, Python, Go or JavaScript to Rust with the same behaviour. A `lints/` folder holds a drop-in clippy configuration that enforces the machine-checkable rules in CI.

The guidance is distilled from five published sources — the Google Rust Style Guide, the official Rust API Guidelines, Effective Rust, Rust Design Patterns and Microsoft's Pragmatic Rust Guidelines — with a condensed digest of each bundled inside the skill so the agent can look up the reasoning. Where the sources disagree, the skill picks a side and says why. Every code example compiles on stable Rust, and a dedicated reference covers Bevy, whose ECS conventions contradict some general Rust advice.

Because the skills use the standard Agent Skills format, they work in Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI and other agents that read it, and the repository doubles as a Claude Code and Codex plugin marketplace. It ships its own eval cases; the project's October 2026 run, graded blind by a Claude model with one run per configuration, reports Claude Code going from 85% to 94% of checks with the skills and Codex CLI from 62% to 89%. It is licensed MIT.

## What it does

- `rust-best-practices`: a ~500-line writing skill covering ownership, API design, errors, idioms, concurrency, unsafe/FFI, crates, docs, tests and performance
- `rust-review`: runs fmt, clippy and tests when available, then reports must-fix / should-fix / consider findings with a file:line, the rule's source and the smallest fix
- `rust-port`: ports C, C++, Python, Go or JavaScript by porting the tests first, designing a Rust API rather than transliterating, and writing a PORTING.md
- A clippy lints table — no `unwrap()` outside tests, `// SAFETY:` on every unsafe block, reasons on `#[allow]`, `# Errors` / `# Panics` docs — with a check crate proving each lint fires
- A Bevy reference that tells the agent which Bevy conventions to leave alone and which ECS bugs compile cleanly
- Installs as a Claude Code or Codex plugin, via `npx skills`, `gh skill` or `gemini skills`, or by copying folders into `.agents/skills/`

## Getting started

Install all three skills — the review and port skills rely on the best-practices skill for style. The universal installer needs Node 22.20 or later.

1. Install for any agent with one command

   The `skills` installer puts the skill folders where most agents look. Add `-g` for a user-wide install, or `-a <agent>` (for example `-a codex` or `-a cursor`) to pick an agent.

```bash
npx skills add morganlinton/BeautifulRust
```

2. Or install it as a Claude Code plugin

   The skills then appear as `/beautiful-rust:rust-best-practices`, `/beautiful-rust:rust-review` and `/beautiful-rust:rust-port`, though they trigger on their own.

```bash
claude plugin install beautiful-rust --marketplace morganlinton/BeautifulRust
```

3. Or as a Codex plugin

   The same package also works in the ChatGPT desktop app.

```bash
codex plugin marketplace add morganlinton/BeautifulRust
codex plugin add beautiful-rust@beautiful-rust
```

4. Ask for a review or a port

   Prompt the agent normally, for example "review src/parser.rs" or "port parser.c to Rust"; the matching skill loads itself and produces a tiered review report or a tested port with a PORTING.md.

5. Enforce the rules in CI

   Copy `lints/clippy.toml` next to your `Cargo.toml`, paste the `[lints]` block from `lints/lints.toml` into it, then run clippy with warnings as errors.

```bash
cargo clippy --all-targets --all-features -- -D warnings
```

## When to use it

- Stopping an agent from shipping public fields, undocumented errors and `unwrap()` in Rust library code
- Getting a prioritised, source-cited review of a Rust crate or pull request
- Porting a C or Python module to Rust with the original tests carried over to prove the behaviour matches
- Keeping agent-written Rust in a Bevy game from breaking ECS conventions
