victorzhuk/go-ent/rust-web

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Rust web development with Axum, SQLx, tower middleware, and production deployment patterns

Install

npx vskill@latest install victorzhuk/go-ent/rust-web

SKILL.md

The same SKILL.md was published earlier as majiayu000/claude-skill-registry-data/rust-web.

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
  1. Axum Router: Define routes with typed extractors (State, Path, Json, Query); apply TraceLayer and other tower middleware via .layer(); share state via AppState with Arc
  2. Handlers: Return Result<Json<T>, AppError>; keep handlers thin — delegate to service layer; extract path/query params with typed extractors
  3. SQLx: Use sqlx::query_as! macro for compile-time verified SQL; use fetch_optional + .ok_or(AppError::NotFound) for lookups; always use connection pools (PgPool)
  4. Tower Middleware: Use tower-http::trace for request tracing; tower-http::cors for CORS; tower-http::compression for response compression; implement custom middleware with tower::Layer
  5. State Management: Store sqlx::PgPool and other shared resources in AppState wrapped in Arc; use OnceCell/LazyLock for expensive one-time initialization
  6. Error Type: Implement IntoResponse on AppError to produce structured JSON error responses; derive thiserror::Error for all variants
  7. Production: Add graceful shutdown with tokio::signal; expose /health and /ready endpoints; use tracing + tracing-subscriber for structured logging
  8. Build: Set lto = true, codegen-units = 1, strip = true in 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, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/victorzhuk/go-ent/rust-web/badge)](https://verified-skill.com/skills/victorzhuk/go-ent/rust-web)

Something wrong with this skill or its page? Tell us.