Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

rust-review

/rust-review

Audytuje kod Rust pod kątem bloków unsafe, problemów z własnością i ryzyk zależności Cargo, przy przeglądzie kodu lub przed scaleniem zmian.

Licencja
MIT
Ostatnia zmiana repozytorium
01.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
28
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Audytuje kod Rust pod kątem bloków unsafe, problemów z własnością i ryzyk zależności Cargo, przy przeglądzie kodu lub przed scaleniem zmian.

Oryginalny opis (EN)

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

Jak działa

  1. Quick Start
  2. When To Use
  3. When NOT To Use
  4. Required TodoWrite Items
  5. Progressive Loading
  6. Core Workflow
  7. Rust Quality Checklist
  8. Output Format
  9. Verify Findings Are Grounded (rust-review:findings-verified)
  10. Exit Criteria
Sekcje z nagłówków SKILL.md, w oryginale · 227 linii, 934 słów
Podgląd 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
---

# Rust Review Workflow

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

## Quick Start

```bash
/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 handling complete
- [ ] Concurrency patterns sound
- [ ] Lossy `as` casts (length truncation, `as u8`/`i8`, `as f32`)
  replaced with `TryFrom`/`From`
- [ ] Enum matches exhaustive; no `_ => unreachable!()`/`panic!`/`{}`
  catch-alls
- [ ] Floats compared with a tolerance, not exact `==`/`!=` against a
  float literal
- [ ] Tests cover critical paths

### Performance
- [ ] No unnecessary allocations
- [ ] Borrowing preferred over cloning
- [ ] Async properly non-blocking

### Idioms
- [ ] Standard traits implemented
- [ ] Conversion traits preferred over helper functions
- [ ] Stringly-typed values and boolean flags modeled as enums
- [ ] Domain invariants encoded with newtypes (private field +
  validating constructor) or type-state where warranted
- [ ] Comparison/ordering traits derived, not hand-written
- [ ] Lifetimes elided where elision rules apply; `'_` in paths
- [ ] Trailing `return` dropped in favor of the tail expression
- [ ] Explicit `-> ()` unit returns dropped (default is elided)
- [ ] Parameters take `&str`/`&[T]`/`&Path`, not `&String`/`&Vec<T>`/
  `&PathBuf` (deref coercion accepts both, so the slice is more general)
- [ ] Conversions implement `From`/`TryFrom`, not `Into`/`TryInto`; a
  fallible conversion's error is propagated, not `unwrap()`ped
- [ ] Error types well-designed
- [ ] Documentation complete

## Output Format

```markdown
## 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.

## Verify Findings Are Grounded (`rust-review:findings-verified`)

Write findings to `.review/findings.json`, run the citation verifier
(`Skill(imbue:review-core)` Step 5), and drop or label `UNVERIFIED` any
the verifier rejects.

## Exit Criteria

- All unsafe blocks audited
- Concurrency patterns verified
- Dependencies scanned
- Evidence logged
- Action items assigned
- Every reported finding carries a `Location` + verbatim `Anchor` confirmed by `citation_verifier.py` (exit `0`), or unverified findings were dropped or labeled `UNVERIFIED`
Pliki w paczce (28)
  • SKILL.md 8 KB
  • modules/async-slop.md 8 KB
  • modules/builtin-preference.md 4 KB
  • modules/cargo-dependencies.md 1 KB
  • modules/cfg-test-misuse.md 1 KB
  • modules/coercion-params.md 5 KB
  • modules/collection-types.md 1 KB
  • modules/concurrency-patterns.md 9 KB
  • modules/conversion-traits.md 5 KB
  • modules/duplicate-validators.md 2 KB
  • modules/error-handling.md 1 KB
  • modules/error-messages.md 1 KB
  • modules/float-equality.md 4 KB
  • modules/idiomatic-elision.md 5 KB
  • modules/iterator-and-allocation-slop.md 12 KB
  • modules/match-wildcard.md 4 KB
  • modules/mem-forget-audit.md 4 KB
  • modules/model-specific-tells.md 7 KB
  • modules/mutable-static-audit.md 3 KB
  • modules/native-type-modeling.md 12 KB
  • modules/numeric-cast-safety.md 4 KB
  • modules/ownership-analysis.md 1 KB
  • modules/repr-packed-audit.md 3 KB
  • modules/silent-returns.md 2 KB
  • modules/sql-injection.md 1 KB
  • modules/test-slop.md 8 KB
  • modules/transmute-audit.md 4 KB
  • modules/unsafe-audit.md 4 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · athola/claude-night-market100MIT
RediSearch/RediSearch100AGPL-3.0
morganlinton/beautifulrust100MIT
claude-dev-suite/claude-dev-suite90MIT

Migawka bazy z 28.10.2026 · wersja paczki 6c60d0e13315 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100rust-guide
    Podpowiada zasady Rust przy plikach .rs i Cargo.toml: własność, Result i Option, standardy testów oraz zasady pracy z kodem unsafe.
  • 100claude-skill-rust
    Prowadzi rozwój w Rust: styl kodu, testy, budowanie i kontrole jakości narzędziami cargo, przy pracy z kodem Rust, Cargo.toml i poleceniami cargo.
  • 82review-code
    Przegląda kod pod kątem błędów, ryzyk i jakości przed scaleniem zmian.
  • 100rust-unsafe
    Pomaga pisać i sprawdzać kod unsafe w Rust: surowe wskaźniki, transmute, bezpieczne opakowania nad unsafe i audyt bloków unsafe.
  • 90rust
    Podpowiada konwencje, wzorce i dobre praktyki kodowania w Rust przy pisaniu lub przeglądzie kodu, z pierwszeństwem reguł projektu.
  • 90rust-code-expert
    Pomaga przy rozwiązaniach w Rust, gdy o wyniku decydują własność, czasy życia, traity, async/Tokio, unsafe, FFI lub Cargo.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.