Runs automated Cargo checks, security audits, and analyzes Rust code for ownership, lifetimes, errors, unsafe usage, and idioms, producing a severity-categorized issue report.
From everything-claude-codenpx claudepluginhub burgebj/claude_everything/rust-reviewRuns automated Cargo checks, security audits, and analyzes Rust code for ownership, lifetimes, errors, unsafe usage, and idioms, producing a severity-categorized issue report.
/rust-reviewRuns cargo clippy on Rust code at optional path, categorizing issues by severity and lint type (correctness, perf, style), with targeted code fix suggestions.
/rust-reviewAudits Rust code for safety and correctness: borrowing, lifetimes, errors, concurrency, unsafe blocks, traits, generics, Cargo deps. Outputs results, analysis, and recommendations.
/rust-reviewRuns automated Cargo checks, security audits, and analyzes Rust code for ownership, lifetimes, errors, unsafe usage, and idioms, producing a severity-categorized issue report.
/rust-reviewComprehensive Rust code review for ownership, borrowing, async correctness (Tokio), error handling (thiserror/anyhow), and performance. Invokes the rust-reviewer agent.
/rust-reviewRuns automated Cargo checks, security audits, and analyzes Rust code for ownership, lifetimes, errors, unsafe usage, and idioms, producing a severity-categorized issue report.
This command invokes the rust-reviewer agent for comprehensive Rust-specific code review.
cargo check, cargo clippy -- -D warnings, cargo fmt --check, and cargo test — stop if any fail.rs files via git diff HEAD~1 (or git diff main...HEAD for PRs)cargo audit if availableUse /rust-review when:
unwrap()/expect() in production code pathsunsafe without // SAFETY: comment documenting invariantsstd::process::Command.clone() to satisfy borrow checkerString parameter where &str or impl AsRef<str> sufficesstd::thread::sleep, std::fs)Send/Sync bounds on shared types_ => match on business-critical enumswith_capacity when size is known/// documentation#[must_use] on non-must_use return types where ignoring values is likely a bug# Build gate (must pass before review)
cargo check
# Lints and suggestions
cargo clippy -- -D warnings
# Formatting
cargo fmt --check
# Tests
cargo test
# Security audit (if available)
if command -v cargo-audit >/dev/null; then cargo audit; else echo "cargo-audit not installed"; fi
User: /rust-review
Agent:
# Rust Code Review Report
## Files Reviewed
- src/service/user.rs (modified)
- src/handler/api.rs (modified)
## Static Analysis Results
- Build: Successful
- Clippy: No warnings
- Formatting: Passed
- Tests: All passing
## Issues Found
[CRITICAL] Unchecked unwrap in Production Path
File: src/service/user.rs:28
Issue: Using `.unwrap()` on database query result
```rust
let user = db.find_by_id(id).unwrap(); // Panics on missing user
```
Fix: Propagate error with context
```rust
let user = db.find_by_id(id)
.context("failed to fetch user")?;
```
[HIGH] Unnecessary Clone
File: src/handler/api.rs:45
Issue: Cloning String to satisfy borrow checker
```rust
let name = user.name.clone();
process(&user, &name);
```
Fix: Restructure to avoid clone
```rust
let result = process_name(&user.name);
use_user(&user, result);
```
## Summary
- CRITICAL: 1
- HIGH: 1
- MEDIUM: 0
Recommendation: Block merge until CRITICAL issue is fixed
| Status | Condition |
|---|---|
| Approve | No CRITICAL or HIGH issues |
| Warning | Only MEDIUM issues (merge with caution) |
| Block | CRITICAL or HIGH issues found |
/rust-test first to ensure tests pass/rust-build if build errors occur/rust-review before committing/code-review for non-Rust-specific concernsagents/rust-reviewer.mdskills/rust-patterns/, skills/rust-testing/