What problem does it solve?
This Skill solves the common pain points of writing non-idiomatic Rust code that triggers avoidable borrow checker errors, runtime panics from improper error handling, and unmaintainable module structures, enabling developers to fully leverage Rust's compile-time safety and performance guarantees without steep trial and error.
Core Features & Use Cases
- Idiomatic Pattern Library: Provides vetted, community-aligned templates for ownership and borrowing, error handling with anyhow and thiserror, enum state modeling, trait-based abstraction, and safe concurrency.
- Code Quality Guardrails: Includes explicit anti-pattern examples, tooling guidance (cargo clippy, fmt, audit), and unsafe code usage rules to prevent common bugs and security vulnerabilities.
- Use Case: When onboarding a new developer to a Rust codebase or refactoring legacy Rust code with frequent panic points and messy domain organization, use this Skill to standardize error handling, restructure modules by business domain, and eliminate unnecessary clones and unwrap() calls.
Quick Start
Use the rust-patterns skill to refactor your existing Rust application's error handling to replace all unwrap() calls with proper Result propagation using anyhow, and restructure your src directory to organize modules by business domain instead of file type.