From rc
Implements and reviews Axum 0.8+ APIs in Rust — routing, State, extractors, Tower middleware, typed errors, WebSockets, CORS, timeouts, and production hardening. Use when building or changing Axum backends, handlers, middleware, or real-time WS endpoints. Do not use for SvelteKit/frontends (rc-sveltekit), SQLx/Postgres data layer alone (rc-sqlx), or general React/Next work.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rc:rc-axumsonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Opinionated guide for production Axum services (Tokio + Tower + Hyper). Target crate line: **axum 0.8.x** (docs verified against axum v0.8.4+). Pair with `rc-sqlx` for Postgres and `rc-sveltekit` when the front is SvelteKit.
Opinionated guide for production Axum services (Tokio + Tower + Hyper). Target crate line: axum 0.8.x (docs verified against axum v0.8.4+). Pair with rc-sqlx for Postgres and rc-sveltekit when the front is SvelteKit.
AppState: Clone (pool, config, clients); inject with .with_state(...). Prefer State<T> over request-global Extension for app state.Path, Query, Json, State, TypedHeader as needed; fail early with typed errors.ServiceBuilder order: errors/timeouts → tracing → CORS → auth route_layer where needed.references/security.md.tower::ServiceExt::oneshot for HTTP; dedicated WS tests. Read references/testing.md.cargo fmt, clippy -D warnings, release build. Read references/lint-tooling.md.| Topic | File | Load when |
|---|---|---|
| Routing, State, extractors, errors, WS | references/guide.md | Implementing or refactoring handlers |
| Auth, CORS, headers, hardening | references/security.md | Auth, public API, production deploy |
| Unit/integration tests | references/testing.md | Writing or fixing tests |
| Clippy, fmt, CI, features | references/lint-tooling.md | Tooling, CI, crate features |
axum::serve(listener, app), Message::Text as in current WS).AppState cheap to clone (Arc inside if needed).impl IntoResponse / custom error type implementing IntoResponse — never panic in handlers for expected failures.HandleErrorLayer so timeout errors become HTTP responses.Close, limit message size, authenticate before upgrade when data is private.tracing + TraceLayer; structured fields, no tokens/passwords.Clone heavy resources directly in state without Arc.format! SQL (use rc-sqlx + binds).0.0.0.0 without proxy/TLS plan on a public VPS.spawn_blocking or dedicated workers).When implementing Axum features, deliver:
AppState fields and ownership (Arc where needed)oneshot and/or WS) + commands: cargo test, cargo clippy -- -D warningsrc-fullstack-axum-svelte — umbrella for API + DB + SvelteKitrc-sqlx — Postgres accessrc-sveltekit — SSR front talking to this APIrc-observability — metrics/logs/traces beyond basic tracingrc-resilience — retries, timeouts across servicesrc-final-verify — before claiming donenpx claudepluginhub rodolfochicone/rc-projectCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.