This is a comprehensive guide to writing production-ready Rust code with strong opinions on the right way to do things. It covers ownership patterns to avoid unnecessary cloning, error handling with Result and the ? operator (using thiserror for libraries and anyhow for applications), modeling states as enums to make invalid states unrepresentable, and safe concurrency primitives. The examples are concrete and show both good and bad patterns side by side. Use this when you want to write idiomatic Rust that leverages the type system for safety rather than fighting the borrow checker, or when reviewing code to catch common antipatterns like unwrap in production or overly defensive cloning.

skills.sh installs
5K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill rust-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Rust Development Patterns

Idiomatic Rust patterns and best practices for building safe, performant, and maintainable applications.

When to Use

  • Writing new Rust code
  • Reviewing Rust code
  • Refactoring existing Rust code
  • Designing crate structure and module layout

How It Works

This skill enforces idiomatic Rust conventions across six key areas: ownership and borrowing to prevent data races at compile time, Result/? error propagation with thiserror for libraries and anyhow for applications, enums and exhaustive pattern matching to make illegal states unrepresentable, traits and generics for zero-cost abstraction, safe concurrency via Arc<Mutex<T>>, channels, and async/await, and minimal pub surfaces organized by domain.

Core Principles

1. Ownership and Borrowing

Rust's ownership system prevents data races and memory bugs at compile time.

// Good: Pass references when you don't need ownership
fn process(data: &[u8]) -> usize {
    data.len()
}

// Good: Take ownership only when you need to store or consume
fn store(data: Vec<u8>) -> Record {
    Record { payload: data }
}

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
Rust
First seen
Apr 16, 2026

More from affaan-m/everything-claude-code

All 256

Recommended

More Rust
1mindrally avatarrustmindrally/skillsExpert in Rust development with focus on safety, performance, and async programming806skills.sh installs
2zhanghandong avatarrust-learnerzhanghandong/rust-skillsrust learner688skills.sh installs
3zhanghandong avatarrust-deps-visualizerzhanghandong/rust-skillsrust deps visualizer684skills.sh installs
4zhanghandong avatarrust-skill-creatorzhanghandong/rust-skillsrust skill creator670skills.sh installs
5manutej avataraxum-web-frameworkmanutej/luxor-claude-marketplaceComplete guide for Axum web framework including routing, extractors, middleware, state management, error handling, and production deployment659skills.sh installs
6sickn33 avatarrust-prosickn33/antigravity-awesome-skillsrust pro458skills.sh installs