athola/rust-review
Audits Rust code for unsafe blocks, ownership issues, and Cargo dependency risks. Use when reviewing Rust code or before merging Rust changes.
npx skills add https://github.com/athola/claude-night-market --skill rust-review
Expert-level Rust code audits with focus on safety, correctness, and idiomatic patterns.
/rust-review
Verification: Run the command with --help flag to verify availability.
rust-review:ownership-analysisrust-review:error-handlingrust-review:concurrencyrust-review:unsafe-auditrust-review:cargo-depsrust-review:native-modelingrust-review:idiomatic-elisionrust-review:coercion-paramsrust-review:conversion-traits10. 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
Load modules as needed based on review scope:
Quick Review (ownership and errors):
modules/ownership-analysis.md for borrowing and lifetime analysismodules/error-handling.md for Result/Option patternsConcurrency Focus:
modules/concurrency-patterns.md for async and sync primitivesSafety Audit:
modules/unsafe-audit.md for unsafe block documentationmodules/mutable-static-audit.md for static mut globals andtheir thread-safe replacements
modules/numeric-cast-safety.md for truncating andprecision-losing as casts
modules/match-wildcard.md for catch-all arms that defeat enumexhaustiveness
modules/transmute-audit.md for mem::transmute/transmute_copycalls that reinterpret bytes with no layout check
modules/repr-packed-audit.md for #[repr(packed)] layouts whosefield borrows become unaligned references
Correctness Audit:
modules/float-equality.md for ==/!= against float literalsmodules/mem-forget-audit.md for mem::forget leaks and no-opdrop(&x) reference drops
Dependency Review:
modules/cargo-dependencies.md for vulnerability scanningIdiomatic Patterns:
modules/builtin-preference.md for conversion traits and builtin preferencemodules/native-type-modeling.md for enums-over-primitives,newtype, type-state, and derived ordering
modules/idiomatic-elision.md for lifetime elision,expression-oriented returns, and explicit -> () unit returns
modules/coercion-params.md for &String/&Vec<T>/&PathBufparameters that defeat deref coercion (prefer &str/&[T]/&Path)
modules/conversion-traits.md for impl Into that should beimpl From, and discarded try_into().unwrap() conversion errors
static mut globals; shared state uses OnceLock/LazyLock,atomics, or a Mutex/RwLock
mem::transmute/transmute_copy; bytes converted withfrom_le_bytes/from_bits/bytemuck or pointers with .cast()
#[repr(packed)] fields copied out before borrowing (no unalignedreferences)
mem::forget leaks (use ManuallyDrop/scope) and no no-opdrop(&x) reference drops
mlock/munlock calls: RLIMIT verified, page-aligned,ENOMEM handled
as casts (length truncation, as u8/i8, as f32)replaced with TryFrom/From
_ => unreachable!()/panic!/{}catch-alls
==/!= against afloat literal
validating constructor) or type-state where warranted
'_ in pathsreturn dropped in favor of the tail expression-> () unit returns dropped (default is elided)&str/&[T]/&Path, not &String/&Vec<T>/&PathBuf (deref coercion accepts both, so the slice is more general)
From/TryFrom, not Into/TryInto; afallible conversion's error is propagated, not unwrap()ped
## 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]
- Anchor: `verbatim source text at file:line`
- Risk: [assessment]
- Recommendation: [action]
## Native Type Modeling
[stringly-typed comparisons, boolean blindness, newtype/type-state notes]
## Idiomatic Elision
[needless lifetimes, trailing returns, explicit `-> ()` unit returns]
## Coercion Params
[`&String`/`&Vec<T>`/`&PathBuf` params that should be borrowed slices]
## Conversion Traits
[`impl Into` over `impl From`; discarded `try_into().unwrap()` errors]
## Numeric Cast Safety
[length-truncating, byte-narrowing, and f32 precision-losing `as` casts]
## Mutable Static Audit
[`static mut` globals and their thread-safe replacements]
## Match Wildcard
[catch-all `_ =>` arms that defeat enum exhaustiveness]
## Transmute Audit
[`mem::transmute`/`transmute_copy` calls and their typed replacements]
## Float Equality
[exact `==`/`!=` comparisons against float literals]
## Mem Forget Audit
[`mem::forget` leaks and no-op `drop(&x)` reference drops]
## Repr Packed Audit
[`#[repr(packed)]` layouts whose field borrows become unaligned]
## Dependencies
[cargo audit results]
## Recommendation
Approve / Approve with actions / Block
Verification: Run the command with --help flag to verify availability.
rust-review:findings-verified)Every finding must cite a real location and a verbatim anchor. Write
findings to .review/findings.json and confirm each citation resolves:
python plugins/imbue/scripts/citation_verifier.py \
--findings .review/findings.json --repo-root .
Drop or label UNVERIFIED any finding the verifier fails (exit 1); only
verified findings enter the report. See Skill(imbue:review-core) Step 5
and Skill(imbue:structured-output) for the schema.
Location + verbatim Anchor confirmed by citation_verifier.py (exit 0), or unverified findings were dropped or labeled UNVERIFIEDTake athola/rust-review from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.