ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

rust-code-review

Reviews Rust code for ownership, borrowing, lifetime, error handling, trait design, unsafe usage, and common mistakes. Use when reviewing .rs files, checking borrow checker issues, error handling patterns, or trait implementations. Covers Rust 2024 edition patterns and modern idioms.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/anderskev/rust-code-review
Or

What This Skill Does

The rust-code-review skill provides an expert-level, automated auditing capability for Rust programming projects. It acts as a specialized assistant that scans your .rs files and Cargo.toml configurations to enforce modern idiomatic Rust standards (2021/2024 editions). Unlike generic linters, this skill deeply analyzes ownership mechanics, borrow checker patterns, complex lifetime annotations, and error propagation strategies to ensure code safety, maintainability, and performance.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal or command interface: clawhub install openclaw/skills/skills/anderskev/rust-code-review

Use Cases

  • Refactoring Legacy Code: Identify unnecessary .clone() calls and replace them with efficient borrowing or references.
  • Architecting APIs: Verify that trait bounds are appropriately applied and that function parameters use flexible types like impl AsRef<T>.
  • Production Error Handling: Ensure your library uses thiserror with descriptive context and your applications leverage anyhow for ergonomics, avoiding the common pitfalls of excessive unwrap() usage.
  • Safety Audits: Detect potential concurrency issues in async code, specifically related to Send and Sync trait bounds or improper usage of Mutex and RefCell.
  • Performance Optimization: Analyze data structures to ensure small types derive Copy and that allocation-heavy code paths are optimized using alternatives like Cow<'_, T>.

Example Prompts

  1. "Review this function for lifetime issues and suggest a more idiomatic way to handle the return value without cloning the input slice."
  2. "I'm getting a borrow checker error with this struct; please analyze the ownership flow and explain why the compiler is rejecting the current implementation."
  3. "Check my error handling strategy in this module. Are there places where I should use let-else instead of match to improve readability?"

Tips & Limitations

This skill performs static analysis based on established Rust best practices. While highly accurate, it should complement—not replace—the official rustc compiler and cargo clippy. Always prioritize compiler warnings/errors over suggestions. The skill works best when provided with the relevant Cargo.toml file to determine the correct edition, as older Rust patterns differ significantly from modern idiomatic solutions.

Metadata

Author@anderskev
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-anderskev-rust-code-review": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#rust#development#code-review#static-analysis
Safety Score: 5/5

Flags: file-read