rust-guide
Installation
SKILL.md
Rust Guide
Applies to: Rust 2021 edition+, Systems Programming, CLIs, WebAssembly, APIs
Core Principles
- Ownership Clarity: Every value has one owner; borrowing is explicit and intentional
- Result Over Panic: Return
Result<T, E>for all fallible operations;panic!is a bug - Zero-Cost Abstractions: Use iterators, generics, and traits without runtime overhead
- Minimal Unsafe: Default to
#[forbid(unsafe_code)]; justify everyunsafeblock in writing - Clippy Compliance: All code passes
cargo clippy -- -D warningswith zero exceptions
Guardrails
Edition & Toolchain
- Use Rust 2021 edition (
edition = "2021"in Cargo.toml) - Set
rust-version(MSRV) in Cargo.toml for all published crates - Use stable toolchain unless a nightly feature is explicitly justified
Related skills