affaan-m avatar

Rust Patterns

This enforces idiomatic Rust patterns across ownership, error handling, traits, and concurrency. It pushes you toward references over cloning, Result propagation with thiserror and anyhow instead of unwrap, enums that make illegal states unrepresentable, and iterator chains over manual loops. The guidance is opinionated in the right ways: exhaustive matching, minimal pub surfaces, Arc<Mutex<T>> for shared state, and builder patterns for complex construction. Useful when writing new Rust code or reviewing PRs where you want to catch unidiomatic patterns early. The examples are concrete enough to copy and adapt directly into your codebase.

skills.sh installs
6.1K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --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/ecc
Categories
Debugging, Rust
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263

Recommended

More Debugging
1okx avatarokx-cex-authokx/agent-skillsUse this skill when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up credentials', 'first time setup', 'con6.1Kskills.sh installs
2jeffallan avatarpandas-projeffallan/claude-skillsPerforms pandas DataFrame operations for data analysis, manipulation, and transformation. Use when working with pandas DataFrames, data cleaning, aggregation, m6.1Kskills.sh installs
3wordpress avatarwordpress-routerwordpress/agent-skillsUse when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo 6Kskills.sh installs
4openai avatarfigmaopenai/skillsUse the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when6Kskills.sh installs
5grafana avatargrafana-ossgrafana/skillsConfigure Grafana OSS — provisions dashboards from YAML, sets up data sources (Prometheus / Loki / Tempo / Pyroscope), writes dashboard JSON with template varia6Kskills.sh installs
6affaan-m avatarreact-patternsaffaan-m/eccReact 18/19 patterns including hooks discipline, server/client component boundaries, Suspense + error boundaries, form actions, data fetching, state management 5.9Kskills.sh installs