rc-axum

Implements and reviews Axum 0.8 web APIs in Rust with routing, middleware, and typed errors.

19|1|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/rodolfochicone/rc-project --skill rc-axum-rodolfochicone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rc-axum
Source: https://github.com/rodolfochicone/rc-project/tree/main/skills/stacks/rc-axum
Command: npx skills add https://github.com/rodolfochicone/rc-project --skill rc-axum-rodolfochicone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building production Axum services in Rust involves many decisions — state injection, extractor ordering, Tower middleware layering, typed error mapping, WebSocket handling, and security hardening — and getting any of them wrong leads to panics, leaked secrets, or unhandled timeouts. ## Core Features & Use Cases - Implementation guidance: Covers Axum 0.8 routing, AppState with State extractors, Tower ServiceBuilder middleware ordering, typed IntoResponse errors, and WebSocket upgrade patterns. - Security and hardening: Provides CORS lockdown, loopback binding behind a reverse proxy, auth-before-upgrade for WebSockets, body size limits, and secrets handling. - Testing and lint gates: Includes oneshot-based HTTP tests, WS test checklists, and cargo fmt/clippy/test CI gates. - Use Case: When adding a new authenticated JSON endpoint to an Axum backend, use this Skill to sketch the router, define AppState ownership, map errors to status codes, and write oneshot tests before claiming done. ## Quick Start Ask the agent to implement a new Axum 0.8 REST endpoint with typed errors, middleware, and tests for your Rust backend.

Frequently Asked Questions about rc-axum

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

FAQPage Schema
How do I structure an Axum 0.8 API with shared state?▼

Define one AppState struct deriving Clone, wrapping non-Clone clients in Arc, and inject it with .with_state(...) on the router. Handlers access it via the State<AppState> extractor, keeping handlers thin and domain logic separate.

How to add middleware to Axum routes with Tower?▼

Use tower::ServiceBuilder to layer middleware in order: HandleErrorLayer with timeout first, then TraceLayer, CorsLayer, and body limits. Apply auth as a route_layer only on protected routes so public endpoints stay unauthenticated.

Does Axum 0.8 support WebSockets?▼

Yes, enable the ws feature on the axum crate and use WebSocketUpgrade in a handler, calling on_upgrade to spawn the socket loop. Authenticate before the upgrade for private streams, handle Close messages, and cap frame sizes in production.

How do I test Axum handlers without running a server?▼

Use tower::ServiceExt::oneshot to send a constructed Request directly against your Router in a tokio::test. Assert on status codes and JSON bodies for happy paths, validation failures, auth rejections, and not-found cases.

When should I not use this Axum skill?▼

Do not use it for SvelteKit frontends, pure SQLx data-layer work, or general Rust language idioms — those belong to dedicated skills. It targets Axum 0.8.x HTTP and WebSocket service implementation and review specifically.