What problem does it solve?
Rust backend code often drifts into inconsistent module layouts, unsafe error handling with unwrap and panic, and subtle Tokio async bugs like blocking calls on the runtime or non-cancel-safe select branches. This Skill gives the AI a concrete, enforceable rule set so generated or edited Rust code follows idiomatic Axum + Tokio conventions from the start.
Core Features & Use Cases
- Module and Project Structure Rules: Splits code by responsibility into .rs files, keeps main.rs as bootstrap only, prefers pub(crate) over pub, and bans meaningless module names like util or common.
- Error Handling Discipline: Uses thiserror for libraries, anyhow for applications, a unified AppError with IntoResponse at HTTP boundaries, and clippy deny rules for unwrap, expect, and panic in production code.
- Async and Axum Guidance: Covers spawn_blocking for blocking work, tokio::sync::Mutex across awaits, cancel-safe select!, graceful shutdown, tower-http middleware, and Router organization.
- Testing Conventions: Defines #[tokio::test] usage, unit vs integration test placement, rstest table-driven tests, and Axum testing via oneshot or real ports.
- Use Case: Ask the AI to add a new Axum endpoint with database access; it will structure the handler, route module, error type, and async DB calls according to these rules instead of producing ad-hoc code.
Quick Start
Ask the AI to write or refactor a Rust Axum handler, error type, or async service following the cc-rust-dev conventions.