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…
от existential-birds★ 92 звезды на GitHubОб этом скилле
Rust Code Review
Review Workflow
Follow this sequence to avoid false positives and catch edition-specific issues:
- Check
Cargo.toml— Note the Rust edition (2018, 2021, 2024) and MSRV if set. Edition 2024 introduces breaking changes to unsafe semantics, RPIT lifetime capture, temporary scoping, and!type fallback. This determines which patterns apply. Check workspace structure if present. - Check dependencies — Note key crates (thiserror vs anyhow, tokio features, serde features). These inform which patterns are expected.
- Scan changed files — Read full functions, not just diffs. Many Rust bugs hide in ownership flow across a function.
- Check each category — Work through the checklist below, loading references as needed.
- Verify before reporting — Complete Gates (below), including the verification-protocol gate, before submitting findings.
Gates
These steps are sequenced: do not skip ahead with “mental verification.” Each step has an objective Pass you can satisfy from files on disk and your own read path.
- Crate context — Before relying on edition-specific checklist rows (Edition 2024, MSRV-sensitive APIs) or dependency assumptions. Pass: You opened the relevant
Cargo.toml(package or workspace manifest) and can stateeditionandrust-version(if set) in one line. - Expanded read — Before reporting a Major or Critical finding. Pass: You read the full function,
unsafeblock, orimpl/ trait item that contains the cited line (not only a diff hunk). - Severity match — Before each finding line in the report. Pass: The Severity label matches Severity Calibration for that issue class, or you use Informational and give a one-line rationale.
- Verification protocol — Before finalizing the report. Pass: the review-verification-protocol skill is loaded and every step in it that applies to this review is completed (do not substitute a vague “I checked”).
Output Format
Report findings as:
[FILE:LINE] ISSUE_TITLE
Severity: Critical | Major | Minor | Informational
Description of the issue and why it matters.
Quick Reference
| Issue Type | Reference |
|---|---|
| Ownership transfers, borrowing, lifetimes, clone traps, iterators | references/ownership-borrowing.md |
| Lifetime variance, covariance/invariance, memory regions | references/lifetime-variance.md |
Result/Option handling, thiserror, anyhow, opaque vs enumerated errors, deferred-cleanup with ? |
references/error-handling.md |
| Async pitfalls, Send/Sync bounds, poll contract, Pin mechanics, cancellation soundness | references/async-concurrency.md |
| Send/Sync semantics, atomics, memory ordering, lock patterns | references/concurrency-primitives.md |
| Memory ordering decision tree, fences, ABA, out-of-thin-air | references/memory-ordering.md |
| Hand-rolled spinlocks, channels, Arc, seqlock, CAS retry patterns | references/lock-free-patterns.md |
| Shared-memory vs worker-pool vs actor design, async vs threads, race-condition vs data race | references/concurrency-models.md |
| Type layout, alignment, repr, PhantomData, generics vs dyn Trait, wide pointers, auto-trait leakage | references/types-layout.md |
| Dyn compatibility (object safety), ergonomic trait impls, Deref discipline, fallible destructors, hidden contracts, is_normal | references/interface-design.md |
| Index pointers, drop guards, extension traits, crate preludes | references/patterns-in-the-wild.md |
| Unsafe code, API design, derive patterns, clippy patterns | references/common-mistakes.md |
| Validity vs safety, drop check, may_dangle, provenance, panic safety in unsafe, MaybeUninit, Miri | references/unsafe-deep.md |
For development guidance on performance, monomorphization, clippy config, dyn compatibility, generics, and documentation, load the rust-best-practices skill.
Review Checklist
Ownership and Borrowing
- No unnecessary
.clone()to silence the borrow checker (hiding design issues) - No
.clone()inside loops — prefer.cloned()or.copied()on iterators - No cloning to avoid lifetime annotations (take ownership explicitly or restructure)
- References have appropriate lifetimes (not overly broad
'staticwhen shorter lifetime works) - Edition 2024: RPIT (
-> impl Trait) captures all in-scope lifetimes by default; use+ use<'a>for precise capture control
Установить rust-code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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.
Как установить скилл rust-code-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust-code-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic