g1joshi/agent-skills/axum
Claude Code and agent skill by g1joshi/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Expert Axum web framework assistance covering routing, extractors, tower middleware, and hyper-powered Rust async microservices. Use when building idiomatic, type-safe, ergonomic REST APIs in Rust.
Install
npx vskill@latest install g1joshi/agent-skills/axumSKILL.md
The same SKILL.md was published earlier as g1joshi/agent-skills/axum.
Axum
Axum is an ergonomic, modular web application framework built on Tokio, Tower, and Hyper for high-throughput, type-safe asynchronous Rust services.
When to Use
- Modern Asynchronous Rust Web Services: Building RESTful APIs and microservices directly within the Tokio ecosystem.
- Tower Middleware Integration: Leveraging Tower's rich ecosystem of rate-limiting, timeouts, retries, and tracing.
- Modular Type-Safe Route Handlers: Combining extractors, route routers, and shared state seamlessly.
- High-Performance WebSockets & SSE: Real-time event streaming and live pub/sub endpoints in Rust.
Quick Start
Core Concepts
Type-Safe State & Modular Routers
Sharing dependency-injected state across route modules:
Tower Middleware & Tracing Layers
Adding structured logging, timeouts, and CORS layers:
Custom Extractor with Error Rejections
Validating custom headers or authentication tokens:
Common Patterns
Dependency Injection with State Extractor
Problem: Sharing connection pools and config structs across handlers safely in Axum.
Solution: Use Router::with_state and State extractor:
Best Practices
Do:
- Use
axum::serveandtokio::net::TcpListenerfor modern Axum 0.7+ applications. - Place
Stateextractors as the last extractor argument in handler signatures. - Use
Router::with_stateto ensure compiler verification of matching state types across nested subrouters. - Implement
IntoResponsefor domain error enums to decouple error formatting from route handlers.
Don't:
- Block async worker threads; offload blocking operations with
tokio::task::spawn_blocking. - Expose internal database error details directly in HTTP error responses.
- Create separate Tokio runtimes inside handlers; utilize the existing ambient runtime.
Troubleshooting
| Error | Cause | Solution | |
|---|---|---|---|
the trait Bound '...: FromRef<...>' is not satisfied | Sub-state extractor cannot be derived from global state. | Implement FromRef for child state fields or derive Clone on entire State struct. | |
the trait 'Handler' is not implemented for fn ... | Handler signature has invalid parameter order; State/Body extractor not last. | Ensure Json or body extractor is the final parameter in the handler argument list. | |
connection closed before message completed | Handler dropped response future without finishing write. | Check for panics in background tasks or Tokio runtime shutdown. |
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/frameworks/axum/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (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/g1joshi/agent-skills/axum)