Loading...
Loading...
Review existing Rust code for idiom, API design, error handling, safety, and maintainability, and produce a prioritized report where every finding cites the rule it breaks and gives a concrete fix. Use this whenever the user asks to review, audit, critique, grade, or "check" Rust code, a crate, a module, a .rs file, a diff, or a pull request, or asks what is wrong with their Rust or how to make it more idiomatic, even if they don't say "review". Pairs with the rust-best-practices skill, which covers writing new code.
npx skill4agent add morganlinton/beautifulrust rust-reviewrust-best-practiceslib.rspubCargo.tomlanyhowCargo.tomlcargo fmt --check
cargo clippy --all-targets --all-features -- -W clippy::pedantic
cargo testunsafe// SAFETY:transmuteunsafe impl SendSyncunwrap()expect()asOrdPartialEqHashEqBTreeMapHashMapsortdedupMutexGuard.awaitinto_inner()StringBox<dyn Error>Displaystd::error::Erroranyhow::Errormap_err(|_| ...)source()catch_unwind&String&Vec<T>&Box<T>&str&[T]&TboolRcRefCellArcDebugDisplayDefaultnew()FromStrfrom_strget_as_to_into_ManagerServiceUtil#[non_exhaustive]if x.is_some() { x.unwrap() }match+HashMap#![deny(warnings)]#[allow]# Errors# Panics# Safetyunwrap()?rust-best-practicesreferences/# Rust review: <what was reviewed>
<One paragraph: what the code does, library or application, overall verdict, and the
single most important thing to fix. Say whether clippy and tests were run.>
## Must fix
### 1. <Short title> (`src/file.rs:42`)
**Rule:** <rule name and source, e.g. "Errors implement std::error::Error (C-GOOD-ERR,
Rust API Guidelines)">
**Problem:** <what is wrong and the concrete consequence, one or two sentences>
**Fix:**
```rust
<the smallest code change that fixes it>
```
## Should fix
### 2. ...
## Consider
### 3. ...
## What's already good
- <2 to 4 specific things the code does well>file:linewhole fileC-GETTERM-PANIC-ON-BUGunwrap()[lints]lints/lints.tomllints/clippy.toml