manutej/luxor-claude-marketplace/axum-web-framework
Claude Code and agent skill by manutej/luxor-claude-marketplace
- community
Checking that the SKILL.md file is still in the repository.
Complete guide for Axum web framework including routing, extractors, middleware, state management, error handling, and production deployment
Install
npx vskill@latest install manutej/luxor-claude-marketplace/axum-web-frameworkSKILL.md
Axum Web Framework
A comprehensive skill for building production-ready web applications and APIs using Axum, the ergonomic and modular Rust web framework built on Tokio and Tower. Master routing, extractors, middleware, state management, error handling, and deployment patterns.
When to Use This Skill
Use this skill when:
- Building REST APIs with Rust and async/await
- Creating high-performance web services with type safety
- Developing microservices with Tokio ecosystem integration
- Implementing WebSocket servers or Server-Sent Events (SSE)
- Building GraphQL APIs with Rust backend
- Creating middleware-heavy applications requiring Tower integration
- Developing production-ready web applications requiring robust error handling
- Building systems requiring fine-grained control over HTTP request/response handling
- Implementing authentication, authorization, and security middleware
- Creating real-time web applications with async Rust
- Developing APIs requiring request validation and transformation
- Building web services with complex routing and nested routers
- Implementing rate limiting, timeout, and backpressure handling
- Creating web applications requiring custom extractors and response types
Core Concepts
Axum Architecture Philosophy
Axum is built on three fundamental pillars:
- Tower Services: Everything in Axum is built on Tower's
Servicetrait, providing composability and middleware integration - Type-Safe Extractors: Request data extraction is compile-time checked, eliminating runtime parsing errors
- Minimal Boilerplate: Ergonomic APIs that reduce ceremony while maintaining explicitness
The Router
The Router is the central building block in Axum. It maps HTTP requests to handlers based on path and method.
Key Properties:
- Routes are matched in the order they're defined
- Routers can be nested for modular organization
- Middleware can be applied at router, route, or method level
- Generic over state type for flexible state management
- Implements Tower's
Servicetrait for composability
Router Creation:
Handlers
Handlers are async functions that process requests and return responses. Axum supports multiple handler signatures through its powerful type system.
Handler Requirements:
- Must be async functions
- Can extract data from requests using extractors
- Must return types implementing
IntoResponse - Can have up to 16 parameters (all must be extractors)
Common Handler Patterns:
Extractors
Extractors are types that implement FromRequest or FromRequestParts, allowing type-safe extraction of data from requests.
Built-in Extractors:
- Path - Extract path parameters
- Query - Extract query string parameters
- Json - Parse JSON request body
- Form - Parse form-encoded request body
- State - Access shared application state
- Extension - Access request extensions
- Headers - Access request headers
- Method - Get HTTP method
- Uri - Get request URI
- Request - Get full request
- Bytes - Raw request body as bytes
- String - Request body as UTF-8 string
- Multipart - Handle multipart/form-data
Extractor Ordering:
- Extractors that consume the request body must come last
- Multiple body extractors in one handler will cause compilation errors
Stateand other non-body extractors can be in any order
Responses
Any type implementing IntoResponse can be returned from handlers. Axum provides many built-in implementations.
Built-in Response Types:
String,&'static str- Text responsesJson<T>- JSON responsesHtml<String>- HTML responsesStatusCode- Status-only responses(StatusCode, T)- Status with body(Parts, T)- Custom headers with bodyResponse- Full control over responseResult<T, E>- Error handling (where E: IntoResponse)
State Management
Axum uses the State extractor to share data across handlers. State must implement Clone and is typically wrapped in Arc for shared ownership.
State Patterns:
- Simple State:
- Shared State with Arc:
- Multiple State Types:
Middleware
Middleware in Axum comes from Tower and provides request/response transformation, logging, authentication, and more.
Middleware Categories:
- Tower Middleware - From
towerandtower-httpcrates - Custom Middleware - Using
middleware::from_fn - Service Middleware - Implementing Tower's
Servicetrait - Layer Pattern - Using Tower's
Layerfor composability
Middleware Application Order:
- Applied with
.layer()executes bottom-to-top (wrapping previous layers) - Applied with
ServiceBuilderexecutes top-to-bottom (more intuitive) - Middleware on
Router::layerruns after routing - Middleware around
Router(usingLayer::layer) runs before routing
Error Handling
Axum's error handling is built on the IntoResponse trait, allowing custom error types to be converted to HTTP responses.
Error Handling Strategies:
- Result Types:
- Custom Error Types:
- HandleErrorLayer:
Tower Integration
Axum is built on Tower, enabling powerful middleware composition and service abstraction.
Key Tower Concepts:
- Service Trait - Asynchronous request processing
- Layer Trait - Middleware factory pattern
- ServiceBuilder - Ergonomic middleware composition
- Timeout - Request timeout handling
- RateLimit - Request rate limiting
- LoadShed - Backpressure management
- Buffer - Request buffering
Routing
Basic Routing
Routes map HTTP methods and paths to handlers:
Path Parameters
Extract dynamic segments from paths:
Wildcard Routes
Capture remaining path segments:
Important: Nested routers strip matched prefixes, but wildcard routes retain the full URI.
Nested Routers
Organize routes into modules using router nesting:
Nesting Behavior:
- Matched prefix is stripped from URI before passing to nested router
- Handlers in nested routers only see path relative to nest point
- Fallback handlers are inherited from parent if not defined in child
- Middleware can be applied before or after nesting
Fallback Handlers
Handle unmatched routes:
Fallback Inheritance:
Method Routing
Handle multiple HTTP methods on the same route:
Extractors Deep Dive
Path Extractor
Extract typed path parameters:
Query Extractor
Extract query string parameters:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/luxor-backend-toolkit/skills/axum-web-framework/SKILL.md
Popularity
- Repository stars
- 49
- Repository forks
- 12
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/manutej/luxor-claude-marketplace/axum-web-framework)