Beautiful Rust plugin

Three skills and a clippy config: an agent writes, reviews and ports idiomatic Rust, and CI enforces the checkable rules

  • 1,728 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • The review skill runs `cargo fmt`, clippy and your project's tests, and tests execute repository code
  • The porting skill creates and overwrites files of a new Rust project and `PORTING.md`
All reasons and checks

morganlinton/beautifulrust

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add plugins/beautiful-rust

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The review skill runs `cargo fmt`, clippy and your project's tests, and tests execute repository code
  • The porting skill creates and overwrites files of a new Rust project and `PORTING.md`

This is third-party code. Review the repository files before installing.

What it does

Beautiful Rust gives an agent three skills and a clippy configuration. The `rust-best-practices` skill loads when an agent writes or changes Rust and steers it toward idiomatic, robust code: private fields, documented errors, doc examples safe to copy. The `rust-review` skill reviews a file, a crate or a diff and writes a report in three tiers: must fix, should fix and consider. Each finding has a `file:line` location, the rule it breaks with its source and the smallest fix. The `rust-port` skill ports C, C++, Python, Go or JavaScript to Rust with the same behavior, porting the tests first, and writes a `PORTING.md` mapping the old API to the new one. The `lints/` directory holds a drop-in clippy configuration for CI that enforces the machine-checkable rules. The guidance is distilled from five sources: the Google Rust Style Guide, the Rust API Guidelines, Effective Rust, Rust Design Patterns and Microsoft's guidelines. A digest of each sits inside the skill, and where the sources disagree the skill picks a side and says why. The skills follow the Agent Skills format and work in Claude Code, Codex, GitHub Copilot, Cursor and Gemini CLI. In the author's measurement on three tasks (a library, a CLI and refactoring a messy module) the skill passed 29 of 30 checks against 24 of 30 without it.

Who it is for. For Rust developers and teams who write Rust with agents and want shared style rules, source-cited review and CI enforcement.

Good fit when

  • An agent writes a new Rust library and you want private fields and documented errors
  • You want a file or diff reviewed with a tiered report and a fix for each finding
  • A C, Python or Go module is being ported to Rust and the tests should move first
  • You want the same clippy rules in CI, chosen to match the skills' guidance
  • You want one set of skills for Claude Code, Codex, Copilot, Cursor and Gemini CLI at once

Not a fit when

  • You need help outside Rust: the skills cover Rust code and questions only
  • You want an automatic formatter with no style discussion: `cargo fmt` and clippy are enough without skills
  • The project already follows its own internal style guide that conflicts with the five sources

Example request

Review src/parser.rs with rust-review, give me a tiered report and then propose the fixes

Limitations

  • The skills run `cargo fmt`, clippy and tests when a Rust toolchain is available, so install one for a full review. The author checked that every code example compiles on stable Rust and that every clippy lint matches current clippy.
  • Installing with `npx skills add` needs Node 22.20 or newer, and Gemini CLI and GitHub CLI 2.90 have their own commands.
  • Claude Code does not read the shared `.agents/skills/` directory and needs its own directory or the plugin. For claude.ai each skill is uploaded as a separate zip in the Skills section with code execution enabled.
  • The author's tests cover three tasks, so the 29 of 30 and 24 of 30 figures come from a small sample.

How to disable. In Claude Code run `/plugin uninstall beautiful-rust@beautiful-rust`. For skills installed through `skills`, delete the `rust-best-practices`, `rust-review` and `rust-port` folders from the agent's skills directory. Remove the clippy config copied from `lints/` from your project by hand.

FAQ

How do I install Beautiful Rust in Claude Code?

Run `claude plugin install beautiful-rust --marketplace morganlinton/BeautifulRust`, or inside a session `/plugin marketplace add morganlinton/BeautifulRust` and `/plugin install beautiful-rust@beautiful-rust`. The skills appear as `/beautiful-rust:rust-best-practices`, `/beautiful-rust:rust-review` and `/beautiful-rust:rust-port`, but they also trigger on their own.

How do I install the skills for Codex?

Run `codex plugin marketplace add morganlinton/BeautifulRust`, then `codex plugin add beautiful-rust@beautiful-rust`. The same package works in the ChatGPT desktop app. Another option is `npx skills add morganlinton/BeautifulRust -a codex`.

How is rust-review different from plain clippy?

Clippy checks what a machine can check. The skill runs it and adds a source-cited review: each finding has a rule (for example the API Guidelines code C-GETTER), a location and the smallest fix. The report ends with what the code does well.

What does rust-port do with the tests?

It ports them first, then designs a Rust API instead of transliterating the original, and verifies with `cargo test` and clippy. A port comes with a `PORTING.md` mapping the old API and tests to the new ones.

Do I need all three skills?

Yes, the author advises installing all three. The review and port skills lean on best-practices for style.

Discussion

No questions or reviews yet.

Plugins

265 short Rust rules for an AI agent covering ownership, errors, async, unsafe and performance, each with a bad and a good code example

SkillMinimal access672Repository stars

A Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server

CLIBroad access187Repository stars

CodeGraph (Rust)

codegraph-rust

A Rust code graph for agents: four MCP tools show what an edit will touch, how the architecture fits together and where the fragile spots are

MCP serverExtended access913Repository stars

A Rust SDK for coding agents and the ready-made abstract CLI: REPL, 34 tools, MCP, graph memory, Anthropic and OpenAI, JSON output for CI

CLIBroad access464Repository stars
Official

agnix lints CLAUDE.md, AGENTS.md, SKILL.md, hooks and MCP configs with 702 rules, autofix and editor extensions for VS Code and JetBrains

CLIMinimal access471Repository stars

A Rust MCP server on standard threads: the agent gets hover info, go to definition, references, formatting and compiler diagnostics from rust-analyzer

MCP serverExtended access486Repository stars

README in short

The README presents the three skills and the clippy configuration, shows code with and without the skill and gives install steps for Claude Code, Codex, GitHub Copilot, Gemini CLI, Cursor and claude.ai. Further sections cover review and porting, the clippy rules, how the skills were tested and the repository layout.

README badge

Original SKILL.md

---
name: rust-best-practices
description: >-
  Write idiomatic, robust, maintainable Rust. Use this skill whenever you write, review,
  refactor, debug, or explain Rust code: new crates, modules, functions, structs, traits,
  error types, async code, unsafe or FFI code, Cargo.toml, tests, or rustdoc. Trigger on
  any mention of Rust, cargo, crates, .rs files, the borrow checker, lifetimes, traits,
  clippy, or rustfmt, even when the user does not ask for "best practices" or "idiomatic"
  code. Synthesized from the Google Rust Style Guide, the Rust API Guidelines,
  Effective Rust, Rust Design Patterns, and Microsoft's Pragmatic Rust Guidelines.
---

# Rust best practices

Distilled from five Rust style and design guides, with a digest of each in `references/`.
Where they disagree, this file says which to follow and why.

## 1. Mindset

- **Write Rust-shaped code.** Don't port C++, Java, C#, or Python constructs one-to-one.
  Model errors with `Result`, resources with ownership and `Drop`, polymorphism with
  traits and enums, and nullability with `Option`. Inheritance-flavored tricks (`Deref` to
  a "base" struct, `Manager`/`Factory` types, `throw_if_null` helpers) are smells.
- **Make invalid states unrepresentable.** Push invariants into types: enums instead of
  bool flags and "must be X if Y" comments, newtypes for units and IDs, fallible
  constructors that validate once. Then the compiler enforces what a comment only requests.
- **Application code is not library code.** Library code (anything with external users)
  follows the API-design rules below strictly. Application code should favor simplicity
  and directness: concrete types, `String` or `&str` rather than `impl Into<String>`
  parameters, `anyhow`-style errors, `Vec` return values, no speculative generality.
- **Let the tools do the work.** rustfmt owns formatting, clippy owns idiom checks, the
  compiler owns memory safety. Spend your attention on design.

## 2. Before you hand back code

Run these and fix everything they report:

```bash
cargo fmt
cargo clippy --all-targets --all-features -- -D warnings
cargo test
cargo doc --no-deps   # libraries: catches broken doc links and missing docs
```

- Fix a lint rather than silencing it. When a lint is genuinely wrong for one item, use

Report a problem

Foxx AIBeautiful Rust
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.