rust-agents-code-reviewer
Rust Agents Code Reviewer
This skill reviews already-written Rust code for quality, idiom, and latent bugs. It is the deep-review counterpart to [[rust-agents-orchestrator]] (which routes and runs a fast checklist) and [[rust-agents-compile-fix]] (which iterates on compiler errors).
ALWAYS use this skill when a prompt asks "review this Rust code", "is this idiomatic", "find code smells", or before approving a Rust pull request. NEVER treat compilation success as a passed review: cargo build proves type-checking, not quality.
This skill reviews. It does NOT route tasks (that is rust-agents-orchestrator) and does NOT fix compiler errors (that is rust-agents-compile-fix). Treating these three as interchangeable is an anti-pattern.
The Review Loop
ALWAYS follow this order. Each step is a hard gate.
- Mechanical pass: run
cargo clippy --all-targets --all-features -- -D warningsandcargo fmt --all --check. Resolve every clippycorrectnessandsuspiciousfinding before human review continues. - Naming pass: check every identifier against the Rust API Guidelines casing table below.
- Error-handling pass: locate every
.unwrap()/.expect()/panic!and demand a justification for each. - Async pass: check every
async fnand spawned future for blocking calls, locks held across.await, andSendbounds. - Memory pass: check every
Arc<Mutex<T>>,RwLock,RefCell, and.clone()for appropriateness. - Suppression pass: check every
#[allow(...)]for a reason comment; recommend#[expect(...)]. - Verdict: produce the structured verdict from the review checklist in
references/methods.md.