domain-web

Enforce domain-driven constraints for Rust web services with axum, actix-web, warp, and rocket.

1|2|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/dojoengine/torii-core --skill domain-web-dojoengine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-web
Source: https://github.com/dojoengine/torii-core/tree/main/.agents/skills/domain-web
Command: npx skills add https://github.com/dojoengine/torii-core --skill domain-web-dojoengine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The domain constraints skill codifies best practices and constraints for web service design, helping teams create robust, scalable Rust APIs by standardizing patterns around async by default, stateless design, and safe shared state.

Core Features & Use Cases

  • Async by default: non-blocking handlers with clear guidance to avoid blocking.
  • Shared state & middleware: patterns for Arc-based state and tower middleware for observability, security, and routing.
  • Framework guidance: actionable comparisons and patterns for axum, actix-web, warp, and rocket to build consistent APIs.
  • Request lifecycle & extractors: safe extraction, typed payloads, and ownership semantics to reduce errors.
  • Use cases: RESTful services, GraphQL APIs, websocket endpoints with scalable routing and composable middleware.

Quick Start

Start by scaffolding a small async web service and applying the domain constraints guidelines to your handlers and shared state.

Frequently Asked Questions about domain-web

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

FAQPage Schema
How do I enforce domain-driven constraints when building async web services in Rust?

To enforce domain-driven constraints in async Rust web services, apply standardized patterns for non-blocking handlers, stateless design, and safe shared state using Arc-based state and tower middleware integration.

What are the best practices for shared state and middleware in Rust web frameworks?

Best practices for shared state and middleware in Rust web frameworks involve using Arc-based state management and tower middleware to ensure safe shared state, observability, security, and scalable routing across async handlers.

How do I handle request lifecycle and extractors safely in Rust APIs?

Handle the request lifecycle and extractors safely in Rust APIs by using typed payloads, safe extraction techniques, and clear ownership semantics to reduce errors and enforce domain constraints during async processing.

Can I use domain constraints with Rust frameworks like axum, actix-web, warp, and rocket?

Yes, you can apply domain constraints with Rust frameworks like axum, actix-web, warp, and rocket. The skill provides actionable comparisons and design patterns to build consistent, scalable APIs across these specific frameworks.

Why does my async Rust web service experience blocking issues in request handlers?

Async Rust web services experience blocking issues when handlers execute blocking operations. Enforcing async by default constraints ensures non-blocking handlers, preventing performance degradation and maintaining scalable API request processing.

What design patterns help create scalable and secure APIs in Rust?

Design patterns that help create scalable and secure APIs in Rust include stateless design, Arc-based shared state, tower middleware for observability and security, and typed request extractors to enforce strict domain constraints.