rust-axum

Standardize Axum 0.7 router, handler, extractor, and middleware patterns.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/neon-law-foundation/navigator --skill rust-axum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-axum
Source: https://github.com/neon-law-foundation/navigator/tree/main/.claude/skills/rust-axum
Command: npx skills add https://github.com/neon-law-foundation/navigator --skill rust-axum

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes how to build and maintain Axum-based web features so teams avoid inconsistent router setup, handler signatures, extractor usage, middleware wiring, and testing patterns.

Core Features & Use Cases

  • Router composition: Organize application areas with router functions, merges, nests, and typed state.
  • Handler and extractor patterns: Use the right extractor order, clean response types, and custom authentication extractors.
  • Middleware and error handling: Apply tower layers consistently, handle application errors cleanly, and log server failures correctly.
  • Testing guidance: Build routers in tests and exercise them deterministically without real sockets.
  • Use case: When adding a new authenticated endpoint or fixing a flaky route test, this Skill gives the canonical Axum 0.7 approach for implementation and validation.

Quick Start

Ask me to apply the rust-axum patterns to your handler, router, middleware, or Axum test so I can rewrite it in the standard web crate style.

Frequently Asked Questions about rust-axum

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure an Axum router with typed state and nested routes?

Axum router composition uses router functions, merges, and nests with typed AppState to organize application areas. This standardizes router setup by applying canonical handler ordering and typed state usage consistently across web services.

What is the correct extractor order for Axum 0.7 handlers?

Axum 0.7 handler extractor order requires specific canonical positioning to avoid runtime extraction failures. Standardized patterns enforce the right extractor sequence, clean response types, and custom authentication extractors for consistent request processing.

How do I apply tower middleware layers consistently in a Rust web service?

Tower middleware layering in Axum applies layers consistently across routes for request processing. This approach handles application errors cleanly via AppError response handling and logs server failures correctly through standardized middleware wiring.

How do I test Axum routers deterministically without real network sockets?

Deterministic Axum router testing builds routers in tests and exercises them without real sockets. This validates HTTP routes and handler logic reliably by avoiding flaky network dependencies during test execution.

Can I use custom auth extractors with Axum middleware for authenticated endpoints?

Custom auth extractors in Axum integrate with middleware layers to authenticate endpoints. The standardized pattern applies tower middleware layering alongside custom extractors to enforce authentication cleanly within the web crate architecture.

Why does my Axum route test fail inconsistently between runs?

Flaky Axum route tests often stem from non-deterministic testing patterns or real socket dependencies. The canonical approach builds routers in tests and exercises them deterministically without real sockets to ensure reliable validation.