Get the FREE Ultimate OpenClaw Setup Guide →

rust-review

npx machina-cli add skill athola/claude-night-market/rust-review --openclaw
Files (1)
SKILL.md
4.5 KB

Table of Contents

Rust Review Workflow

Expert-level Rust code audits with focus on safety, correctness, and idiomatic patterns.

Quick Start

/rust-review

Verification: Run the command with --help flag to verify availability.

When To Use

  • Reviewing Rust code changes
  • Auditing unsafe blocks
  • Analyzing concurrency patterns
  • Dependency security review
  • Performance optimization review

When NOT To Use

  • General code review without Rust - use unified-review
  • Performance profiling - use parseltongue:python-performance pattern

Required TodoWrite Items

  1. rust-review:ownership-analysis
  2. rust-review:error-handling
  3. rust-review:concurrency
  4. rust-review:unsafe-audit
  5. rust-review:cargo-deps
  6. rust-review:evidence-log

Progressive Loading

Load modules as needed based on review scope:

Quick Review (ownership + errors):

  • See modules/ownership-analysis.md for borrowing and lifetime analysis
  • See modules/error-handling.md for Result/Option patterns

Concurrency Focus:

  • See modules/concurrency-patterns.md for async and sync primitives

Safety Audit:

  • See modules/unsafe-audit.md for unsafe block documentation

Dependency Review:

  • See modules/cargo-dependencies.md for vulnerability scanning

Core Workflow

  1. Ownership Analysis: Check borrowing, lifetimes, clone patterns
  2. Error Handling: Verify Result/Option usage, propagation
  3. Concurrency: Review async patterns, sync primitives
  4. Unsafe Audit: Document invariants, FFI contracts
  5. Dependencies: Scan for vulnerabilities, updates
  6. Evidence Log: Record commands and findings

Rust Quality Checklist

Safety

  • All unsafe blocks documented with SAFETY comments
  • FFI boundaries properly wrapped
  • Memory safety invariants maintained

Correctness

  • Error handling complete
  • Concurrency patterns sound
  • Tests cover critical paths

Performance

  • No unnecessary allocations
  • Borrowing preferred over cloning
  • Async properly non-blocking

Idioms

  • Standard traits implemented
  • Error types well-designed
  • Documentation complete

Output Format

## Summary
Rust audit findings

## Ownership Analysis
[borrowing and lifetime issues]

## Error Handling
[error patterns and issues]

## Concurrency
[async and sync patterns]

## Unsafe Audit
### [U1] file:line
- Invariants: [documented]
- Risk: [assessment]
- Recommendation: [action]

## Dependencies
[cargo audit results]

## Recommendation
Approve / Approve with actions / Block

Verification: Run the command with --help flag to verify availability.

Exit Criteria

  • All unsafe blocks audited
  • Concurrency patterns verified
  • Dependencies scanned
  • Evidence logged
  • Action items assigned

Troubleshooting

Common Issues

Command not found Ensure all dependencies are installed and in PATH

Permission errors Check file permissions and run with appropriate privileges

Unexpected behavior Enable verbose logging with --verbose flag

Source

git clone https://github.com/athola/claude-night-market/blob/master/plugins/pensive/skills/rust-review/SKILL.mdView on GitHub

Overview

Rust Review provides expert-level Rust audits focused on safety, correctness, and idiomatic patterns. It analyzes ownership, unsafe blocks, and Cargo dependencies to identify risks and ensure robust, maintainable code.

How This Skill Works

The skill guides a structured workflow: perform ownership analysis to inspect borrowing and lifetimes, verify error propagation with Result/Option, and review concurrency patterns. It then audits unsafe blocks with SAFETY invariants, documents FFI contracts, and scans Cargo dependencies for vulnerabilities and updates, recording findings in an evidence log.

When to Use It

  • Reviewing Rust code changes for safety and correctness
  • Auditing unsafe blocks and FFI boundaries
  • Analyzing concurrency patterns (async and sync) for correctness
  • Reviewing Cargo dependencies for vulnerabilities and updates
  • Performance-focused review addressing allocations and borrowing efficiency

Quick Start

  1. Step 1: Run /rust-review
  2. Step 2: Verify availability with --help
  3. Step 3: Start with quick review focusing on ownership and errors, then expand to concurrency and unsafe-audit as needed

Best Practices

  • Start with Ownership Analysis focusing on borrowing, lifetimes, and clone patterns
  • Document all unsafe blocks with SAFETY comments and check FFI boundaries
  • Validate Result/Option usage and proper error propagation
  • Review concurrency patterns (async and sync primitives) for correctness
  • Run dependency security review and vulnerability scanning on Cargo.toml

Example Use Cases

  • Auditing a module with unsafe blocks to ensure SAFETY comments are present and invariants are documented
  • Tracing ownership transfers across function boundaries to prevent unintended moves or drops
  • Assessing Arc<Mutex<T>> usage to identify potential deadlocks or contention hotspots
  • Scanning Cargo.lock for vulnerable crate versions and proposing safe version bumps
  • Ensuring error propagation paths are complete and well-typed across modules

Frequently Asked Questions

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers