request-response

Design CQRS request/response contracts with FluentValidation and Result types.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill request-response-faysilalshareef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: request-response
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/cqrs/request-response
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill request-response-faysilalshareef

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design CQRS request/response contracts with FluentValidation and Result types to enforce immutability and clear success/failure semantics.

Core Features & Use Cases

  • Immutability guarantees for request objects and DTOs
  • FluentValidation-based validators for commands and queries
  • Result<T> pattern to represent success and failure outcomes
  • Clear separation between requests, responses, and domain logic
  • Patterns for async validation, nested types, and practical examples

Quick Start

Create a new CQRS command or query, wire it to a FluentValidation validator, and return a Result<T> from the handler.

Frequently Asked Questions about request-response

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

FAQPage Schema
How do I design CQRS request/response contracts with clear success and failure semantics?

Design CQRS request/response contracts by creating typed request and response DTOs, wrapping outcomes in a Result<T> type, and enforcing immutability to provide clear success and failure semantics for your domain logic.

How do I integrate FluentValidation with CQRS commands and queries?

Integrate FluentValidation by creating validators for your commands and queries, applying rules to nested DTOs, and leveraging automatic validator registration to enforce immutability and validation before the handler executes.

What is the Result<T> pattern for handling CQRS outcomes?

The Result<T> pattern wraps the return value of CQRS handlers to explicitly represent success and failure outcomes, ensuring immutability and clear separation between request handling and domain logic without throwing exceptions.

Does this CQRS contract design approach support nested DTOs and async validation?

Yes, this approach supports async validation and nested DTOs by applying FluentValidation rules hierarchically within the request/response contracts, ensuring complex business workflows maintain immutability and robust validation.

When should I use immutable request and response DTOs in CQRS?

Use immutable request and response DTOs in CQRS to prevent side effects during command and query processing, ensuring that validation rules and handler logic operate on unchanging data throughout the request lifecycle.