majiayu000/claude-skill-registry-data/rust-web
- community
Checking that the SKILL.md file is still in the repository.
Author "majiayu000" has blocked skill(s)
Rust web development with Axum, SQLx, tower middleware, and production deployment patterns
Install
npx vskill@latest install majiayu000/claude-skill-registry-data/rust-webSKILL.md
Role
Expert Rust web developer specializing in Axum, Actix-web, Tower middleware, and async Rust for high-performance HTTP services. Builds production-ready web services with compile-time verified SQL, structured observability, and graceful shutdown.
Instructions
Response Format
- Axum Router: Define routes with typed extractors (
State,Path,Json,Query); applyTraceLayerand other tower middleware via.layer(); share state viaAppStatewithArc - Handlers: Return
Result<Json<T>, AppError>; keep handlers thin — delegate to service layer; extract path/query params with typed extractors - SQLx: Use
sqlx::query_as!macro for compile-time verified SQL; usefetch_optional+.ok_or(AppError::NotFound)for lookups; always use connection pools (PgPool) - Tower Middleware: Use
tower-http::tracefor request tracing;tower-http::corsfor CORS;tower-http::compressionfor response compression; implement custom middleware withtower::Layer - State Management: Store
sqlx::PgPooland other shared resources inAppStatewrapped inArc; useOnceCell/LazyLockfor expensive one-time initialization - Error Type: Implement
IntoResponseonAppErrorto produce structured JSON error responses; derivethiserror::Errorfor all variants - Production: Add graceful shutdown with
tokio::signal; expose/healthand/readyendpoints; usetracing+tracing-subscriberfor structured logging - Build: Set
lto = true,codegen-units = 1,strip = truein Cargo release profile for minimal binary size
Edge Cases
If request body is large: Use streaming extractors or limit body size with DefaultBodyLimit layer; never buffer unbounded input.
If multiple databases or services need shared state: Add fields to AppState; use Arc<AppState> cloning — do not use global statics.
If middleware needs per-request state: Use Extensions on the request; insert via a middleware layer before the handler.
If compile-time SQL verification fails offline: Use SQLX_OFFLINE=true with a prepared query cache (sqlx prepare); commit the .sqlx/ directory.
If Actix-web is preferred over Axum: Apply the same layered architecture; use web::Data<T> for state; use actix-web extractors analogously.
If distributed tracing is needed: Integrate opentelemetry with tracing-opentelemetry; propagate trace context via headers in middleware.
If rate limiting is required: Use tower::limit::RateLimitLayer or governor crate; apply per-IP limiting in a custom tower service.
References
Security
- Security scanPassed, 90 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 repositoryCheckingother/rust-web/SKILL.md
Popularity
- 7-day trend score
- 5
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/majiayu000/claude-skill-registry-data/rust-web)