rust-review
Comprehensive Rust code review for ownership, lifetimes, error handling, unsafe usage, and idiomatic patterns. Invokes the rust-reviewer agent.
- Kind
- Prompt
- Works with
- Claude Code, Codex
- Languages
- Rust
- Source
- affaan-m/ECC @ d3b8a3e90890
- Path
- commands/rust-review.md
- License
- MIT
- Jobs
- Review, Debugging
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# Rust Code Review This command invokes the **rust-reviewer** agent for comprehensive Rust-specific code review. ## What This Command Does 1. **Verify Automated Checks**: Run `cargo check`, `cargo clippy -- -D warnings`, `cargo fmt --check`, and `cargo test` — stop if any fail 2. **Identify Rust Changes**: Find modified `.rs` files via `git diff HEAD~1` (or `git diff main...HEAD` for PRs) 3. **Run Security Audit**: Execute `cargo audit` if available 4. **Security Scan**: Check for unsafe usage, command injection, hardcoded secrets 5. **Ownership Review**: Analyze unnecessary clones, lifetime issues, borrowing patterns 6. **Generate Report**: Categorize issues by severity ## When to Use Use `/rust-review` when: - After writing or modifying Rust code - Before committing Rust changes - Reviewing pull requests with Rust code - Onboarding to a new Rust codebase - Learning idiomatic Rust patterns ## Review Categories ### CRITICAL (Must Fix) - Unchecked `unwrap()`/`expect()` in production code paths - `unsafe` without `// SAFETY:` comment documenting invariants - SQL injection via string interpolation in queries - Command injection via unvalidated input in `std::process::Command` …