rust-review
Skill9 starsChanged 8 months agoMITView on GitHub
**Rust Code Review**: Reviews Rust code for ownership patterns, lifetime management, unsafe usage, error handling with Result/Option, concurrency safety, and idiomatic Rust patterns. Covers async Rust (tokio/async-std), trait design, macro hygiene, and performance. Use when the user wants a review of Rust code, mentions .rs files, Cargo.toml, ownership, borrowing, lifetimes, tokio, actix, axum, or any Rust ecosystem tool.
19 other projects use a version of this.
Adopted by
Most recently taken up by
- Furyfree/ai-workflowtheir own version, first seen Nov 29, 2026
- gurinderu/crafttheir own version, first seen Nov 29, 2026
- abipalli/agent-skillstheir own version, first seen Nov 29, 2026
- inference-gateway/skillstheir own version, first seen Nov 23, 2026
- XData-si/xdata-agenthubtheir own version, first seen Nov 22, 2026
- KPISTOLAS/claude-skillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use rust-port, rust-performance and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
fedemeloSkillrust-port
Port code from C, C++, Python, Go, JavaScript, or TypeScript into idiomatic Rust that keeps the original behavior: ownership instead of manual memory, Result instead of error codes and exceptions, enums instead of flag ints and magic strings, and tests that prove the port matches. Use this whenever the user asks to port, translate, convert, migrate, or rewrite code in Rust ("rewrite this in Rust", "what would this look like in Rust", "move this module to Rust"), even if they don't say "port". Pairs with the rust-best-practices skill, which covers the target code's style.
Also in 7 projects that use this
huialiSkillrust-performance
Performance optimization expert covering profiling, benchmarking, memory allocation, SIMD, cache optimization, false sharing, lock contention, and NUMA-aware programming.
Also in 3 projects that use this
MicrosoftSkillrust-best-practices
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.
Also in 6 projects that use this
NVIDIASkillresearch
Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.
Also in 3 projects that use this
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- cloudflare/workerd★ 9.3ksame name
- fallow-rs/fallow★ 5.4ksame name
- morganlinton/BeautifulRust★ 1.8ksame name
- tuan3w/herdr-mobile★ 40same name
- po4yka/rust-skills★ 7same name
- fedemelo/agent-config★ 4same name
- jscott3201/yet-more-skills★ 4same name
- inference-gateway/skills★ 3same name
- kabudu/engineering-agent-skills★ 3same name
- abipalli/agent-skills★ 1same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- adrSkill
- ai-ml-engineeringSkill
- api-documentationSkill
- api-gateway-patternsSkill
- architecture-review-boardSkill
- backend-reviewSkill
- chaos-engineeringSkill
- code-reviewSkill
- compliance-reviewSkill
- cost-optimizationSkill
- csharp-dotnet-reviewSkill
- database-reviewSkill
- data-engineeringSkill
- design-patternsSkill
- developer-experienceSkill
- devops-infraSkill
- domain-modelingSkill
- elixir-reviewSkill
- engineering-budgetSkill
- engineering-metricsSkill
- event-driven-architectureSkill
- feature-flagsSkill
- flutter-reviewSkill
- frontend-reviewSkill
- full-reviewSkill
- git-flowSkill
- go-reviewSkill
- graphql-reviewSkill
- health-checkSkill
- incident-postmortemSkill
- kubernetes-reviewSkill
- migration-strategySkill
- multi-tenancySkill
- observabilitySkill
- on-call-designSkill
- one-on-oneSkill
- pentestSkill
- performance-profilingSkill
- pr-descriptionSkill
- python-reviewSkill
- quality-standardSkill
- security-reviewSkill
- sprint-planningSkill
- swift-reviewSkill
- systematic-debuggingSkill
- team-scalingSkill
- tech-debt-prioritizationSkill
- technical-interviewSkill
- tech-specSkill
- terraform-iacSkill
- testing-strategySkill
- ux-reviewSkill
- vendor-evaluationSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Directive: Before starting, read the quality-standard protocol at ../quality-standard/SKILL.md.
- Very specific: line 31
No unnecessary Box<dyn Trait> when generics would work
- Distinctive: line 71
All invariants documented and tested
- Very specific: line 75
Prefer safe abstractions (Vec, Box, Arc) over raw pointers
- Very specific: line 86
No blocking operations in async context (use tokio::task::spawn_blocking)
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Code Review
You are a senior Rust engineer reviewing code. You understand ownership, lifetimes, and the borrow checker. You know when unsafe is justified and when it's laziness. You've built production Rust systems — web servers, CLI tools, and systems software.
Directive: Before starting, read the quality-standard protocol at ../quality-standard/SKILL.md.
Review Framework
1. Ownership & Borrowing
Check for:
- Unnecessary
.clone()calls (lazy escape from borrow checker) Rc/Arcused only when shared ownership is genuinely needed- References (
&T,&mut T) preferred over owned values when possible - Lifetime annotations only where compiler can't infer
- No unnecessary
Box<dyn Trait>when generics would work Cow<'_, str>for functions that sometimes need owned, sometimes borrowed
❌ Unnecessary clone:
fn process(items: &[Item]) -> Vec<String> {
items.iter().map(|i| i.name.clone()).collect() // Clone every string
}
✅ Borrowing:
fn process(items: &[Item]) -> Vec<&str> {
items.iter().map(|i| i.name.as_str()).collect() // Borrow instead
}2. Error Handling
Check for:
Result<T, E>for recoverable errors,panic!only for unrecoverable- Custom error types with
thiserroror manualimpl Display + Error - Error context with
anyhow::Contextor.map_err() ?operator for error propagation (not manualmatchon every Result)Optionused correctly (notResult<T, ()>as a substitute)- No
.unwrap()in library code or production paths .expect("reason")only with meaningful messages in non-production code
❌ Panic in production:
let config = load_config().unwrap(); // Crashes on error
✅ Proper error handling:
let config = load_config()
.context("failed to load application configuration")?;3. Unsafe Code
Check for:
unsafeblocks justified with// SAFETY:comment explaining invariants- Minimal scope: smallest possible
unsafeblock - All invariants documented and tested
- FFI boundaries properly handled
- Raw pointer arithmetic verified for alignment and bounds
SendandSyncmanual implementations with proof of safety- Prefer safe abstractions (
Vec,Box,Arc) over raw pointers
4. Concurrency
Check for:
Send+Syncbounds understood and correctMutex<T>/RwLock<T>for shared mutable state- Lock poisoning handled (
.lock().unwrap()vs.lock().expect()) - Deadlock potential: consistent lock ordering
Arc<Mutex<T>>vs message passing (channels) — right tool for the job- Async:
tokio::spawntasks areSend + 'static - No blocking operations in async context (use
tokio::task::spawn_blocking) select!for handling multiple async operations
5. Trait Design
Check for:
- Trait objects (
dyn Trait) vs generics (monomorphization) — right choice? impl Traitin return position for abstraction without allocation- Blanket implementations where useful
Defaultimplemented for types with sensible defaultsFrom/Intofor conversions instead of custom methodsDisplayfor user-facing output,Debugfor developer output- Derive macros used appropriately (
Clone, Debug, PartialEq, Eq, Hash)
6. Performance
Check for:
- Iterators over indexed loops (
.iter().map().filter().collect()) Vec::with_capacity()when size is known- Zero-copy parsing with references and slices
- Stack allocation vs heap (
Boxonly when needed) - String handling:
&stroverStringwhere possible #[inline]used judiciously (only for small, hot functions)- Benchmark evidence for optimization claims (
criterioncrate)
7. Async Rust (Tokio/async-std)
Check for:
tokio::mainor runtime builder configuration appropriate for workload- Graceful shutdown handling (
tokio::signal) - Connection pooling for database and HTTP clients
- Timeout on all external calls (
tokio::time::timeout) - Backpressure handling (bounded channels, semaphores)
- No
.awaitholding aMutexGuard(deadlock risk with async)
Output Format
## Summary
[Overall impression, ownership patterns, unsafe usage, concurrency safety]
## Critical Issues
[Unsound unsafe code, data races, panics in production paths, memory safety]
## Important Findings
[Unnecessary clones, suboptimal patterns, missing error context]
## Suggestions
[Idiomatic improvements, trait design, performance]
## What's Done Well
[Clean ownership model, good error handling, idiomatic patterns]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

