rust-expert
Skill96 starsChanged 7 months agoMITView on GitHub
Expert Rust idiomatique pour développement CLI/système. Ownership, error handling avec anyhow/thiserror, traits, async Tokio, testing. Utiliser pour coder, reviewer ou refactorer du Rust.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- iamdemetris/lude-kittheir own version, first seen Jul 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- iamdemetris/lude-kit★ 0same name
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 repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- backend-architectSkill
- ccboard-rememberSkill
- code-simplifierSkill
- cybersecSkill
- design-patternsSkill
- issue-triageSkill
- performanceSkill
- pr-triageSkill
- ratatuiSkill
- rust-patternsSkill
- security-guardianSkill
- shipSkill
- tdd-rustSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Prefer &str over String for function parameters
- Very specific: line 17
Use slices (&[T]) over Vec<T> when ownership not needed
- Very specific: line 25
Context: Always use .context("operation description") with ?
- Very specific: line 26
No unwrap: Use ? operator or expect() with justification
- Very specific: line 31
Use trait objects (dyn Trait) for runtime polymorphism
- Very specific: line 52
Use #[should_panic] for expected panics
- Very specific: line 57
Linker: Use mold or lld for faster linking
- Distinctive: line 73
Keep functions focused and small
- Distinctive: line 74
Avoid deep nesting (max 3-4 levels)
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Expert Skill
Expert in idiomatic Rust 1.75+ development with focus on CLI/system tools, ownership patterns, error handling, traits, async programming, and testing.
Core Competencies
1. Ownership & Borrowing Mastery
- Prefer
&stroverStringfor function parameters - Use slices (
&[T]) overVec<T>when ownership not needed - Leverage
Cow<str>for conditionally owned strings - Apply
Arc<T>andArc<Mutex<T>>for thread-safe sharing - Design lifetimes explicitly when necessary
2. Error Handling Excellence
- Default:
anyhow::Result<T>for applications - Libraries:
thiserrorfor custom error types - Context: Always use
.context("operation description")with? - No unwrap: Use
?operator orexpect()with justification - Recovery: Provide actionable error messages
3. Trait-Driven Design
- Implement standard traits:
Debug,Clone,Default,Display - Use trait objects (
dyn Trait) for runtime polymorphism - Leverage trait bounds for generic constraints
- Organize impl blocks immediately after type definitions
- Apply async traits (native in Rust 1.75+)
4. Async Programming Patterns
- Runtime: Tokio for production async
- Patterns:
async fn,tokio::spawn,tokio::selectmacro (with!) - Streams:
tokio_streamfor async iteration - Rate limiting:
governorcrate for API throttling - Retries: Exponential backoff with
tokio::time::sleep
5. CLI Development Best Practices
- Argument parsing:
clapwith derive macros - Config:
serde+toml/yamlfor structured config - Output:
indicatiffor progress,coloredfor styling - Terminal: Handle
SIGINTgracefully, cleanup on exit
6. Testing Strategy
- Embedded tests:
#[cfg(test)] mod tests { use super::*; } - Unit tests alongside code, integration tests in
tests/ - Use
#[should_panic]for expected panics - Mock external dependencies with traits
- Property-based testing with
proptestorquickcheck
7. Build Optimization
- Linker: Use
moldorlldfor faster linking - Cache:
sccachefor incremental builds - Profile:
cargo build --releasewith LTO - Dependencies: Minimize with feature flags
- Workspace: Organize large projects with
workspace
8. Code Quality Standards
- Before commit:
cargo fmt,cargo clippy,cargo test - Clippy: Zero warnings policy
- Documentation:
///for public APIs,//with!for modules - Examples: Provide runnable examples in docs
9. Project Structure Patterns
- Flat module hierarchy when possible (rtk style)
src/main.rsfor binaries,src/lib.rsfor libraries- Group related functionality in modules
- Keep functions focused and small
- Avoid deep nesting (max 3-4 levels)
Reference Files
This skill includes detailed patterns and checklists:
- Patterns:
patterns/error-handling.md- anyhow, thiserror, Result patternspatterns/ownership.md- &str vs String, Cow, Arc, lifetimespatterns/async-patterns.md- Tokio, futures, async traitspatterns/traits-impl.md- Trait implementation organizationpatterns/testing.md- Test organization and assertionspatterns/cli-patterns.md- clap derive, subcommands
- Checklists:
checklists/code-review.md- Pre-commit review checklistchecklists/performance.md- Build optimization checklist
- Anti-Patterns:
anti-patterns/common-mistakes.md- Frequent Rust mistakesanti-patterns/memory-pitfalls.md- Ownership pitfalls
- Examples:
examples/rtk-patterns.md- Real-world patterns from rtk project
When to Use This Skill
✅ Use for:
- Writing new Rust code (CLI tools, libraries, async services)
- Code review of Rust PRs
- Refactoring to idiomatic patterns
- Performance optimization
- Error handling improvements
- Test organization
❌ Don't use for:
- Simple syntax questions (use native knowledge)
- Non-Rust languages
- Project setup without coding
Integration with SuperClaude Framework
- Works with: backend-architect (system design), TDD (test-first), code-reviewer
- Flags: Responds to
--thinkfor architectural analysis - Mode: Compatible with
--uctoken efficiency mode - Language: English for shareability, French instructions supported
Quick Reference
Error Handling
use anyhow::{Context, Result};
fn process_file(path: &str) -> Result<()> {
let content = std::fs::read_to_string(path)
.context("Failed to read file")?;
Ok(())
}Ownership Patterns
// Prefer borrowing
fn print_name(name: &str) { println!("{}", name); }
// Conditionally owned
use std::borrow::Cow;
fn maybe_modify(input: &str, modify: bool) -> Cow<str> {
if modify {
Cow::Owned(input.to_uppercase())
} else {
Cow::Borrowed(input)
}
}Async Patterns
#[tokio::main]
async fn main() -> Result<()> {
let result = tokio::time::timeout(
Duration::from_secs(5),
fetch_data()
).await??;
Ok(())
}Testing
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_calculation() {
assert_eq!(calculate(2, 3), 5);
}
}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.

