| name | rust |
| description | Auto-apply when working with Rust. Trigger this skill when the user asks to create, modify, or debug Rust code, Cargo projects, crates, or Rust tests. |
Lang: Rust
Rules
- Safety: NEVER use
.unwrap(). Use ? propagation or .expect("msg").
- Style: Prefer Iterators (
.map().collect()) over for loops.
- Async: Assume
tokio. Use .await. Never block async threads.
- Errors: Use
anyhow::Result for apps, thiserror for libs.
- Tests: Co-locate unit tests in
mod tests with #[cfg(test)].
- Clippy: Code must be strictly
clippy-compliant (idiomatic).
Workflow
- Use
skill workflow-env before build/run commands.
- Build:
cargo build --release
- Test:
cargo test
- Format:
cargo fmt
Docs: Context7 /websites/doc_rust-lang_stable_book · Fallback: https://doc.rust-lang.org