Use this skill when editing or reviewing Rust code, focusing on idiomatic Rust, module splitting, error handling (thiserror/anyhow), Tokio async pitfalls, Axum routing organization, and testing.
Do not use for:
- Formal review or fix/debug workflows
- Operations risk assessment
- General change boundaries unrelated to Rust
- wasm / CLI / embedded scenarios (this skill focuses on backend Web)
Core rules
- Split modules by responsibility into
.rsfiles, do not pile intolib.rs;pub(crate)takes precedence overpub。 - Errors: libraries use
thiserror, applications useanyhow, unified across boundariesAppError + IntoResponse。 - Production code prohibits
.unwrap()/.expect()/panic!(); configure clippy deny. - Async: blocking calls must
tokio::task::spawn_blocking; across.awaitlocks usetokio::sync::Mutex。 tokio::select!branches must be cancel-safe; when unsure, save state toselect!externally.- Default
edition = "2024", TLS chooserustls; business code in principle prohibitsunsafe。
Expand as needed
- Style:
references/style.md - Error handling:
references/errors.md - Async and Axum:
references/async.md - Testing:
references/testing.md - Project structure:
references/project-shape.md