adelabdelgawad/fullstack-agents/rust-axum-api
Claude Code and agent skill by adelabdelgawad/fullstack-agents
- community
Checking that the SKILL.md file is still in the repository.
Rust Axum 0.8 handlers, routers, extractors, middleware, error mapping, JWT auth, WebSocket and graceful shutdown.
Install
npx vskill@latest install adelabdelgawad/fullstack-agents/rust-axum-apiSKILL.md
The same SKILL.md was published earlier as adelabdelgawad/fullstack-agents/rust-axum-api.
Axum 0.8 API Patterns
The HTTP layer of a Rust service. Handlers are THIN: extract, call one use case, map the result. Business logic lives in application (see rust-clean-architecture).
Path Syntax — Axum 0.8 CRITICAL
:id does not fail at compile time — it panics when the router is built. This is the #1 Axum migration foot-gun. Always {name}.
Extractor Ordering
Extractors implementing FromRequestParts (State, Path, Query, headers) can go in any position. Body-consuming extractors (Json, Form, Bytes, String) must be LAST — there is only one body.
State<T>for application state (pools, ports, config) — composes viaFromRef
for sub-states. Extension<T> ONLY for per-request data injected by middleware (e.g. authenticated Claims). Never Extension for app state.
TypedHeaderlives inaxum-extra, notaxum.
Error Mapping (IntoResponse)
One newtype wraps AppError at the HTTP boundary:
Never unwrap()/expect() in handlers — ? with ApiFailure. Never leak sqlx::Error or internal messages in responses.
Middleware
route_layerapplies only to routes registered SO FAR (unmatched paths still
404 without running it); layer wraps everything including fallback. Auth goes on route_layer of protected routes; tracing/timeout on outer layer.
ServiceBuilderorder: first listed = outermost.- Never block in middleware —
spawn_blockingfor CPU-bound work.
JWT auth middleware (cookie or bearer)
Claims carry identity only (sub, jti, exp, iat, iss, aud) — never roles or business fields; authorization is resolved server-side per request.
WebSocket
- Rooms via
tokio::sync::broadcastchannels. - Heartbeat: server pings on an interval; drop the connection on missed pongs.
- Handle
Message::Closeexplicitly — never ignore close frames.
Graceful Shutdown
Forbidden Patterns
| Pattern | Why | |
|---|---|---|
:id path syntax | Runtime panic in Axum 0.8 — use {id} | |
| Body extractor not last | Compiles in some orders, breaks — keep Json/Form last | |
Extension for app state | State + FromRef is type-checked at router build | |
unwrap/expect in handlers | Propagate with ? into ApiFailure | |
| Business logic in handlers | Extract → one use case → map; nothing else | |
sqlx::Error in response types | Map through RepoError → AppError → ApiError | |
| Blocking calls in handlers/middleware | tokio::task::spawn_blocking | |
| Missing WebSocket heartbeat | Proxies kill idle connections silently |
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 repositoryCheckingplugins/fullstack-agents/skills/rust-axum-api/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/adelabdelgawad/fullstack-agents/rust-axum-api)