Agent skill

rust-patterns

Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill rust-patterns --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 13 KB
Bundled scripts: none
Path: skills/rust-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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. ```rust // 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 } } // Bad: Cloning unnecessarily to avoid borrow checker fn process_bad(data: &Vec<u8>)

What's inside
Steps it walks through
  1. When to Use
  2. How It Works
  3. Core Principles
  4. 1. Ownership and Borrowing
  5. Use Cow for Flexible Ownership
  6. Error Handling
  7. Use Result and ? — Never unwrap() in Production
  8. Library Errors with thiserror, Application Errors with anyhow
  9. Option Combinators Over Nested Matching
  10. Enums and Pattern Matching
  11. Model States as Enums
  12. Exhaustive Matching — No Catch-All for Business Logic
  13. Traits and Generics
  14. Accept Generics, Return Concrete Types
Commands it runs
Build and check
cargo build
cargo check              # Fast type checking without codegen
cargo clippy             # Lints and suggestions
cargo fmt                # Format code
Testing
cargo test
cargo test -- --nocapture    # Show println output
cargo test --lib             # Unit tests only
cargo test --test integration # Integration tests only
More from everything-openai-codex
All skills →
About this skill
What does the rust-patterns skill do?

Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill rust-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going