
rust-web
Design, implement, test, and operate production Rust server-side HTTP services, including axum, Actix Web, routing, extractors, application state, error mapping, middleware order, timeouts, body limits, observability, graceful shutdown, and database boundaries. Use when users ask for Rust REST APIs, web handlers, middleware, server lifecycle, HTTP contracts, or production web-service architecture; hand security controls to rust-web-security.
- Installs
- 109
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-web- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads rust-web automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Rust HTTP Service Delivery
Deliver server-side HTTP APIs based on HTTP contracts and runtime lifecycles. The framework handles transport adaptation; domain logic and data access remain independently testable without embedding all backend issues into handlers.
Confirming the Service Contract
Before modification, verify from OpenAPI specs, existing routes, clients, tests, configuration, and run environments:
- Methods, paths, status codes, request/response schemas, and compatibility strategies;
- Authentication context origin (authentication system design is outside this skill scope);
- Request bodies, concurrency limits, timeouts, upload sizes, and response size constraints;
- Dependencies on external HTTP services, databases, caches, or queues, including failure semantics;
- Listening addresses, proxies, TLS termination, health checks, graceful shutdown budgets;
- Rust/MSRV versions of axum, Tokio, Tower, and related crates with locked dependencies;
- Logging levels, tracing configuration, metrics exposure, sensitive field handling, data retention policies.
Response fields from existing client libraries constitute compatibility constraints. When contracts are missing, declare minimal assumptions first.
Workflow
1. Establish Current Baseline
rustc --version --verbose
cargo metadata --format-version 1
cargo tree -e features
cargo test --all-targets
Verify service entry points, router composition, state management, error types, middleware ordering, shutdown signals, and testing tools. Adhere strictly to Cargo.lock versions and official documentation; do not mix axum/Tower APIs based on memory rather than versioned specifications.
2. Define Transport Boundaries
Recommended call flow:
HTTP request
-> router / extractor / transport validation
-> application service / use case
-> repository or outbound HTTP port
-> domain result/error
-> centralized HTTP response mapping
- Handlers perform extraction, transport-layer validation, invoke use cases, and map responses;
- Domain logic does not depend on axum request/response types;
- Database connection pools and HTTP clients serve as stateful dependencies within the service layer; do not store business data in global locks.
- Transactions belong to use case/data access boundaries and are not scatteredly controlled by handlers.
- DTOs, domain models, and persistence models should be separated based on change reasons to avoid unintended reuse of structures without control.
Refer to Service Boundaries when determining specific layering or adapter requirements.
3. Implement Routing and Input Boundaries
- Route paths, extractors, and response types must align with locked axum versions;
- Explicitly validate path parameters, query strings, headers, and request bodies to distinguish syntax errors from domain conflicts;
- Enforce limits on request body size, uploads, pagination, and batch sizes;
- Avoid
.awaitoperations across lock-held states; prefer delegating shared mutable state to dedicated services or storage mechanisms. - Do not use
unwrap()/expect()for handling failures in requests, network access, database queries, or serialization; instead, convert unexpressible preconditions into type-level checks and centralized validation that avoids duplication across multiple handlers.
4. Unified Error Response Mapping
Define a single mapping from application errors to HTTP responses:
- Validation failures → client-fixable 4xx status codes;
- Not found, conflicts, and permission denials → stable client-error statuses such as
404,409, and403; - Downstream unavailability, timeouts, internal defects → 5xx status codes that do not leak internal details.
Each error response must include a stable machine code and request/tracing identifiers for correlation. Full error chains enter controlled logging; responses should not expose SQL queries, tokens, file paths, or backtraces. Avoid mapping all errors to 500 or hiding failures by returning 200.
5. Middleware Composition and Security Boundaries
Review the Tower middleware layer in accordance with actual call order:
- Redact sensitive headers while retaining request IDs and trace identifiers;
- Configure global and downstream timeouts;
- Enforce request body limits and concurrency/load protection measures;
- Integrate authentication contexts and authorization checks at appropriate points.
- Maintain precise CORS allowlists; do not default to permissive policies when credentials are present in the service chain.
- Account for CPU costs associated with compression and risks of exposing sensitive responses under compressed headers.
- Trust proxy headers only from explicitly controlled sources.
Middleware ordering, timeout configurations, and graceful shutdown strategies are documented in Middleware and Lifecycle.
6. Managing Async Lifecycles
- Configure layered timeouts for servers, external requests, and database operations;
- Ensure cancellation propagates downward to clean up subtasks without creating leaked tasks detached from request lifetimes;
- Gracefully shut down by stopping new incoming requests while exhausting in-flight ones within budget limits before releasing resources.
- Distinguish between non-retryable and retryable errors; retries require budgets, backoff strategies, and idempotency guarantees.
- Route deep design of Tokio tasks, channels,
Send/Sync, cancellation safety, and lock scopes to$rust-concurrency.
7. Bounded External Adapter Access
This skill can integrate with services requiring databases or outbound HTTP clients but focuses solely on the server-side boundary:
- Reuse connection pools/client instances rather than creating new ones per request;
- Configure timeouts, connection limits, and observable error reporting for downstream components;
- Ensure transaction coverage across complete use cases without unnecessary external network waits.
- Route schema migrations, indexes, transactions, SQL tuning, and ORM modeling to
$rust-database. - Independent SDKs, crawlers, or bulk HTTP clients are not part of the server-side main flow; they belong to separate tooling domains.
- Route JWT/OAuth flows, sessions, tokens, CORS/CSRF policies, and secret management to
$rust-web-security; this skill only consumes principal identities and authorization outcomes from verified sources. - WebSocket upgrades, message protocols, heartbeat mechanisms, and backpressure handling are processed as independent sub-flows when explicitly requested.
8. Layered Service Testing
Ensure coverage of:
- Domain/use case pure tests;
- Router-level request testing without binding to real ports per use case;
- Extractor failures, error mapping logic, body limits, timeouts, and authentication boundaries;
- External adapter contract validation and fault injection scenarios;
- Database migration isolation, commits, rollbacks when requiring real databases;
- Limited socket tests verifying listening behavior, proxy configurations, or graceful shutdown dynamics.
Detailed test matrices are provided in HTTP Service Testing. Test organization, coverage targets, CI gate policies, and performance baselines fall under the purview of rust-testing.
Common Gates
cargo fmt --all -- --check
cargo check --all-targets
cargo test --all-targets
cargo clippy --all-targets -- -D warnings
Add OpenAPI/schema compatibility checks, integration environment tests, and security scans per project. Do not silently skip failing dependency-based tests to claim overall pass status.
Completion Criteria
- HTTP contracts, versioning assumptions, and compatibility guarantees are explicit;
- Handlers remain thin with domain logic and external adapters testable independently;
- Error handling, status codes, timeouts, middleware ordering, and graceful shutdown behaviors have corresponding tests;
- Logs and responses do not leak secrets or internal details.
cargo fmt,cargo check,cargo test, andclippypass successfully;- When real databases, networks, TLS connections, or deployments are unverified, remaining boundaries must be explicitly marked.
Handoff Boundaries
| Primary Issue | Assigned Responsibility |
|---|---|
| Schema definitions, migrations, transactions, connection pools, SQL/ORM modeling | rust-database |
| Authentication, authorization, sessions/tokens, CORS/CSRF policies, SSRF protection | rust-web-security |
| Tokio tasks, locks, channels, cancellation safety, graceful shutdown implementation | rust-concurrency |
| Test layering strategies, coverage targets, attribute tests, performance baselines | rust-testing |
| Ownership semantics, serde type contracts, generic error design patterns | rust-stable |
| Features, workspace configurations, build scripts, release pipelines | rust-cargo-build |
| Unsafe network libraries, C ABI interfaces, raw buffer handling | rust-unsafe-ffi |
On-Demand Resources
- Service Boundaries: Consult when designing handlers, state management, data structures, or outbound HTTP adapters.
- Middleware and Lifecycle: Review Tower configuration, timeout policies, CORS rules, load balancing strategies, or graceful shutdown logic.
- HTTP Service Testing: Refer to design patterns for router integration, end-to-end testing, fault injection scenarios.
- Examples: Use templates for end-to-end task decomposition when needed.
examples/golden-handler/: Offline compilation and verification of transport boundary behavior and error mapping logic.
References
FAQ
What does the rust-web skill do?
Design, implement, test, and operate production Rust server-side HTTP services, including axum, Actix Web, routing, extractors, application state, error mapping, middleware order, timeouts, body limits, observability, graceful shutdown, and database boundaries. Use when users ask for Rust REST APIs, web handlers, middleware, server lifecycle, HTTP contracts, or production web-service architecture; hand security controls to rust-web-security.
How do I install rust-web?
Run npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-web in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rust-web/ (personal) or .claude/skills/rust-web/ (project).
Which AI agents can use rust-web?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is rust-web safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains rust-web?
It is published by full-stack-skills in full-stack-skills/rust-skills. It has 109 recorded installs.
More from full-stack-skills/rust-skills
rust-testing
full-stack-skills/rust-skills
Design, implement, and validate Rust tests, including unit, integration, doctest, compile-fail, property, fuzz, benchmark, coverage, async, concurrency, process, daemon, IPC, terminal, platform, and hardware-facing test strategies. Use when users ask for Rust test architecture, flaky-test diagnosis, coverage gates, benchmarks, trybuild, cargo-nextest, real-process tests, or failure-path verification.
rust-concurrency
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-style-clippy
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-performance
full-stack-skills/rust-skills
Measure, profile, optimize, and regression-test Rust performance across latency, throughput, CPU, allocations, memory, binary size, and compile time using representative workloads, Criterion, iai-callgrind, cargo-flamegraph, samply, DHAT, heap or pprof tools, cargo-bloat, cargo-llvm-lines, and build timings. Use when users report slow Rust code, high memory or CPU, large binaries, noisy benchmarks, tail-latency regressions, or need performance budgets and evidence-backed optimization.
rust-code-review
full-stack-skills/rust-skills
Review Rust changes for correctness, memory and thread safety, error semantics, unnecessary allocation or cloning, lock scope, API compatibility, test gaps, documentation, and dependency risk, applying the Rust API Guidelines checklist (C-PANIC, C-UNWRAP, C-TRANSMUTE, C-BOOL, C-NEWTYPE, C-COMMON-TRAITS, C-CONVERT, C-SEALED, C-NON-EXHAUSTIVE). Use when reviewing Rust diffs, pull requests, libraries, unsafe boundaries, or production incidents; report actionable findings by severity before summaries, route automated formatting or lint policy to rust-style-clippy, and route API shape decisions (trait sealing, error taxonomy, newtype design, builder patterns) to rust-api-design.
rust-cargo-build
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.