← ClaudeAtlas

mir-backend-rust-axumlisted

Make It Right (Axum module). Axum 0.8 + Tower + async Rust specific reliability augmentation. Use alongside mir-backend and mir-backend-rust when the target stack is Axum — it carries the mechanical footguns that the framework-agnostic tiers deliberately omit: the 0.8 route syntax change (/:id now panics, use /{id}), extractor ordering (body-consuming extractors must be last), custom extractors after the #[async_trait] removal in axum-core 0.5, typed State<T> vs Extension<T> and the FromRef sub-state pattern, implementing IntoResponse for error types without leaking internals, DefaultBodyLimit, and Tower middleware layer ordering (outermost wraps first). TRIGGER only when the Rust backend framework is Axum — building, reviewing, or debugging an Axum handler, router, extractor, or Tower middleware. Always loads TOGETHER WITH mir-backend (the gates) and mir-backend-rust (Tokio runtime concerns: blocking, guard-across-await, cancellation safety, async traits, Arc/'static, backpressure, timeouts); this module onl
anantbhandarkar/make-it-right · ★ 15 · API & Backend · score 81
Install: claude install-skill anantbhandarkar/make-it-right
# /mir-backend-rust-axum · Make It Right (Axum) Bottom tier of the chain: `mir-backend` (generic gates) → `mir-backend-rust` (Tokio runtime model) → **this** (Axum/Tower library mechanics). Run the gates first; load the Rust runtime tier for blocking/cancellation/Arc concerns; reach for *this* at Gate 5 (design mechanics), Gate 6 (implementation), and Gate 7 review. **Runtime-level concerns (blocking the Tokio runtime, guard-across-await, cancellation safety, bounded channels, timeouts) live in `mir-backend-rust` — not here.** **Stack assumed:** Axum · Tower middleware · async Rust on Tokio. **Versions verified 13 Aug 2026:** | Crate | Current | Note | |---|---|---| | `axum` | **0.8.9** (2026-04-14) | MSRV 1.80. 0.8.0 shipped 2025-01-01 | | `axum-core` | 0.5.6 | where the `#[async_trait]` removal landed | | `tower` | 0.5.3 | | | `tower-http` | **0.7.0** (2026-06-15) | breaking changes from 0.6 — see §5 | **Axum 0.9 is not released.** Work is on `main` with breaking changes queued, and the maintainers have stated there is no timeline. Target 0.8.x. If you are reading a tutorial that shows `Router::new().route("/users/:id", ...)`, it predates 0.8 and will panic — see §1. ## The Axum footguns AI walks into most ### 1. Route syntax changed in 0.8 — `/:id` panics, write `/{id}` The single most common failure when AI writes Axum today. Axum 0.8 upgraded `matchit` to 0.8, which changed path parameter syntax. The old form was **deliberately made a panic** rather than silently