axum-scaffolder
Skill3 starsChanged 4 months agoMITView on GitHub
Scaffolds Axum HTTP endpoints with OpenAPI (utoipa), Tower middleware, JWT auth, rate limiting, CORS, health checks, and versioning. Axum-first: typed extractors, typed responses, compile-time route verification. Use when creating Rust REST APIs, scaffolding Axum endpoints/projects, configuring Tower middleware, or adding OpenAPI/JWT to Axum. Not when the codebase uses Actix-web — Axum-into-Actix needs manual integration not covered here.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- project-templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- project-templates/CLAUDE.mdCLAUDE.md
- alembic-migration-managerSkill
- architecture-journalSkill
- architecture-reviewSkill
- automated-code-reviewSkill
- capture-consolidateSkill
- cargo-package-scaffoldSkill
- code-review-coachSkill
- confluence-guide-writerSkill
- dependency-mapperSkill
- doc-syncSkill
- dotnet-architecture-checklistSkill
- dotnet-controller-api-scaffolderSkill
- dotnet-security-reviewSkill
- dotnet-vertical-sliceSkill
- ef-migration-managerSkill
- email-captureSkill
- environment-healthSkill
- evaluate-testsSkill
- fastapi-scaffolderSkill
- fitness-functionsSkill
- jira-comment-writerSkill
- legacy-migration-analyzerSkill
- minimal-api-scaffolderSkill
- nuget-package-scaffoldSkill
- oss-vettingSkill
- pattern-tradeoff-analyzerSkill
- php-api-scaffolderSkill
- php-architecture-checklistSkill
- php-feature-sliceSkill
- php-migration-managerSkill
- php-package-scaffoldSkill
- php-security-reviewSkill
- pr-feedback-writerSkill
- pypi-package-scaffoldSkill
- python-architecture-checklistSkill
- python-feature-sliceSkill
- python-modernization-analyzerSkill
- python-security-reviewSkill
- qraspi-architectureSkill
- qraspi-graduateSkill
- qraspi-implementSkill
- qraspi-planSkill
- qraspi-questionsSkill
- qraspi-researchSkill
- qraspi-skeletonSkill
- qrspi-implementSkill
- qrspi-planSkill
- qrspi-questionsSkill
- qrspi-researchSkill
- qrspi-specSkill
- react-app-scaffolderSkill
- react-architecture-checklistSkill
- react-component-scaffolderSkill
- react-feature-sliceSkill
- react-modernization-analyzerSkill
- react-security-reviewSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 58
Exit criteria: all routes scaffolded, documented, secured, and verified.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Axum Scaffolder
"An API that is not documented is an API that is not finished. Security by default: every route is protected unless explicitly marked public."
Core Philosophy
Axum is Rust's most ergonomic HTTP framework, built on Tower's middleware ecosystem and Tokio's
async runtime. This skill scaffolds production-ready Axum APIs with OpenAPI documentation, security
middleware, and proper error handling from day one. The OpenAPI spec is generated from code, not
written separately; routes are versioned from the first commit; auth is applied at the router level
so anonymous access is explicit; request and response data flow through typed extractors and
impl IntoResponse, never raw Request parsing.
Non-Negotiable Constraints:
- OPENAPI-FIRST —
#[utoipa::path]on every handler;utoipa::OpenApiderive on the app; the spec must be accurate. - VERSIONING FROM DAY ONE —
/api/v1/prefix on all routers; no unversioned routes. - SECURITY BY DEFAULT — Tower middleware for JWT validation; anonymous access is explicit (
/health,/docs). - TYPED EXTRACTORS — all request data via
axum::extract::{Json, Path, Query, State}; no rawRequestparsing. - TYPED RESPONSES —
impl IntoResponsewith explicit status codes; errors as RFC 7807 Problem Details viaAppError.
Full principle table, KB lookups, discipline rules, anti-patterns, and error recovery live in
references/conventions.md.
Workflow
DETECT Existing Cargo.toml/deps, AppState/AppError/main router, Rust edition + Tokio version,
existing utoipa setup.
CONFIGURE Add deps to Cargo.toml; create src/errors.rs (AppError), src/state.rs (AppState),
src/openapi.rs (OpenApi derive). (Templates in router-template.md.)
SCAFFOLD Feature router with typed handlers; request/response models with ToSchema;
#[utoipa::path] on handlers; feature error type with From<FeatureError> for AppError.
SECURE Add JWT validation middleware; apply to protected route groups; leave /health + /docs
unprotected. (Layer ordering + JWT in middleware-patterns.md.)
DOCUMENT #[utoipa::path] on all handlers; ToSchema on all types; OpenApi derive with all
paths/schemas; /docs route serving the OpenAPI UI.
VERIFY cargo build · cargo test · cargo clippy -- -D warnings · curl /health → 200 ·
curl /docs → OpenAPI UI · protected routes → 401 without token.Exit criteria: all routes scaffolded, documented, secured, and verified.
State Block
<axum-scaffold-state>
phase: DETECT | CONFIGURE | SCAFFOLD | SECURE | DOCUMENT | VERIFY | COMPLETE
feature_name: [name]
edition: [2015 | 2018 | 2021 | 2024]
tokio_version: [1.x | unknown]
utoipa_configured: true | false
auth_middleware: true | false
rate_limiting: true | false
cors_configured: true | false
health_check: true | false
openapi_ui: true | false
build_status: pass | fail | not-run
last_action: [description]
next_action: [description]
</axum-scaffold-state>Output Template
- Cargo.toml deps, errors/AppError, auth/JWT, openapi, main, health, scaffold checklist —
references/router-template.md. - Layer ordering, JWT, CORS, rate limiting, tracing, timeout, compression, security headers —
references/middleware-patterns.md. - Principle table, KB lookups, discipline rules, anti-patterns, error recovery —
references/conventions.md.
Integration with Other Skills
| Skill | Relationship |
rust-feature-slice | Provides feature module organization; this skill provides the HTTP infrastructure (middleware, OpenAPI, auth). Use both together. |
rust-security-review | After scaffolding, verify auth middleware, CORS, and input validation. |
rust-architecture-checklist | After scaffolding, verify handler thinness, error handling, and trait design. |
sqlx-migration-manager | When the API needs database access, use it for the migration lifecycle. |
minimal-api-scaffolder | Parallel skill for .NET Minimal API — same OpenAPI-first philosophy, different ecosystem. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

