Skip to content
Development
Skill

/rust-review

Audits Rust code for unsafe blocks, ownership issues, and Cargo dependency risks. Use when reviewing Rust code or before merging Rust changes.

From plugin
claude-night-market
337200 skills59 agents162 commands1 MCP
Install
$ npx -y skills add athola/claude-night-market --skill rust-review --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/rust-review

Context preview

The summary Claude sees to decide when to auto-load this skill.

Audits Rust code for unsafe blocks, ownership issues, and Cargo dependency risks. Use when reviewing Rust code or before merging Rust changes.

SKILL.md

rust-review.SKILL.md
name: rust-review
description: Audits Rust code for unsafe blocks, ownership issues, and Cargo dependency risks. Use when reviewing Rust code or before merging Rust changes.
globs: "**/*.rs"
alwaysApply: false
category: code-review
tags:
- rust
- ownership
- concurrency
- unsafe
- traits
- cargo
tools: []
usage_patterns:
- rust-audit
- unsafe-review
- dependency-audit
- concurrency-analysis
complexity: advanced
model_hint: deep
estimated_tokens: 400
progressive_loading: true
dependencies:
- imbue:proof-of-work
- imbue:review-core
- imbue:structured-output
modules:
- ownership-analysis.md
- error-handling.md
- concurrency-patterns.md
- unsafe-audit.md
- cargo-dependencies.md
- silent-returns.md
- collection-types.md
- sql-injection.md
- cfg-test-misuse.md
- error-messages.md
- duplicate-validators.md
- builtin-preference.md
- native-type-modeling.md
- idiomatic-elision.md
- coercion-params.md
- conversion-traits.md
- numeric-cast-safety.md
- mutable-static-audit.md
- match-wildcard.md
- transmute-audit.md
- float-equality.md
- mem-forget-audit.md
- repr-packed-audit.md
- model-specific-tells.md
- iterator-and-allocation-slop.md
- test-slop.md
- async-slop.md

Table of Contents

  • [Quick Start](#quick-start)
  • [When to Use](#when-to-use)
  • [Required TodoWrite Items](#required-todowrite-items)
  • [Progressive Loading](#progressive-loading)
  • [Core Workflow](#core-workflow)
  • [Rust Quality Checklist](#rust-quality-checklist)
  • [Safety](#safety)
  • [Correctness](#correctness)
  • [Performance](#performance)
  • [Idioms](#idioms)
  • [Output Format](#output-format)
  • [Summary](#summary)
  • [Ownership Analysis](#ownership-analysis)
  • [Error Handling](#error-handling)
  • [Concurrency](#concurrency)
  • [Unsafe Audit](#unsafe-audit)
  • [[U1] file:line](#[u1]-file:line)
  • [Dependencies](#dependencies)
  • [Recommendation](#recommendation)
  • [Exit Criteria](#exit-criteria)

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:native-modeling` 7. `rust-review:idiomatic-elision` 8. `rust-review:coercion-params` 9. `rust-review:conversion-traits` 10. `rust-review:numeric-cast-safety` 11. `rust-review:mutable-static-audit` 12. `rust-review:match-wildcard` 13. `rust-review:transmute-audit` 14. `rust-review:float-equality` 15. `rust-review:mem-forget-audit` 16. `rust-review:repr-packed-audit` 17. `rust-review:evidence-log` 18. `rust-review:findings-verified`

Progressive Loading

Load modules as needed based on review scope:

**Quick Review** (ownership and 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
  • See `modules/mutable-static-audit.md` for `static mut` globals and

their thread-safe replacements

  • See `modules/numeric-cast-safety.md` for truncating and

precision-losing `as` casts

  • See `modules/match-wildcard.md` for catch-all arms that defeat enum

exhaustiveness

  • See `modules/transmute-audit.md` for `mem::transmute`/`transmute_copy`

calls that reinterpret bytes with no layout check

  • See `modules/repr-packed-audit.md` for `#[repr(packed)]` layouts whose

field borrows become unaligned references

**Correctness Audit**:

  • See `modules/float-equality.md` for `==`/`!=` against float literals
  • See `modules/mem-forget-audit.md` for `mem::forget` leaks and no-op

`drop(&x)` reference drops

**Dependency Review**:

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

**Idiomatic Patterns**:

  • See `modules/builtin-preference.md` for conversion traits and builtin preference
  • See `modules/native-type-modeling.md` for enums-over-primitives,

newtype, type-state, and derived ordering

  • See `modules/idiomatic-elision.md` for lifetime elision,

expression-oriented returns, and explicit `-> ()` unit returns

  • See `modules/coercion-params.md` for `&String`/`&Vec<T>`/`&PathBuf`

parameters that defeat deref coercion (prefer `&str`/`&[T]`/`&Path`)

  • See `modules/conversion-traits.md` for `impl Into` that should be

`impl From`, and discarded `try_into().unwrap()` conversion errors

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
  • [ ] No `static mut` globals; shared state uses `OnceLock`/`LazyLock`,

atomics, or a `Mutex`/`RwLock`

  • [ ] No `mem::transmute`/`transmute_copy`; bytes converted with

`from_le_bytes`/`from_bits`/`bytemuck` or pointers with `.cast()`

  • [ ] `#[repr(packed)]` fields copied out before borrowing (no unaligned

references)

  • [ ] No `mem::forget` leaks (use `ManuallyDrop`/scope) and no no-op

`drop(&x)` reference drops

  • [ ] `mlock`/`munlock` calls: RLIMIT verified, page-aligned,

ENOMEM handled

Correctness

  • [ ] Error
Read more
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Get the whole plugin

Other skills on claude-night-market.