cqs-patterns

Teach and enforce CQRS patterns in .NET applications.

4|1|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/DoubleslashSE/claude-marketplace --skill cqs-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cqs-patterns
Source: https://github.com/DoubleslashSE/claude-marketplace/tree/main/Plugins/dotnet-tdd/skills/cqs-patterns
Command: npx skills add https://github.com/DoubleslashSE/claude-marketplace --skill cqs-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Command Query Separation (CQS) and CQRS patterns guide you to separate read and write concerns in .NET applications, improving clarity, testability, and maintainability.

Core Features & Use Cases

  • Architectural clarity: enforce a strict boundary between commands (state-changing) and queries (read-only).
  • Scalable design: support separate read and write models, handlers, and data stores.
  • Practical guidance: includes examples of Commands, Queries, Handlers, and Dispatcher usage to model real-world scenarios.

Quick Start

Review the provided patterns and implement a minimal CQRS skeleton: define a CreateEntityCommand with a corresponding CommandHandler, a GetEntityQuery with a QueryHandler, and wire them through a Dispatcher in your .NET app.

Frequently Asked Questions about cqs-patterns

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

FAQPage Schema
How do I implement CQRS in a .NET application?

To implement CQRS in a .NET application, you separate read and write concerns by defining distinct Commands and Queries, creating dedicated Handlers for each, and routing them through a Dispatcher. This enforces a strict boundary between state-changing operations and read-only requests, improving application clarity and testability.

What is Command Query Separation and when do I need it?

Command Query Separation is an architectural pattern that divides operations into state-changing commands and read-only queries. You need it in .NET applications when separating read and write concerns to improve maintainability, enforce strict architectural boundaries, and support scalable designs with separate read and write models.

How do I structure commands and queries across application layers?

Structure commands and queries by creating distinct models for reads and writes across application layers. Define a CreateEntityCommand with a CommandHandler for state changes, a GetEntityQuery with a QueryHandler for reads, and wire them through a central Dispatcher to route requests to the correct handler.

Do I need external libraries or tooling to use CQRS patterns in .NET?

No external libraries or tooling are required to apply CQRS patterns in .NET. You only need a standard .NET development environment to define commands, queries, handlers, and dispatchers, using provided code snippets and architectural guidance to implement the patterns directly.

What is the difference between CQS and CQRS architecture?

CQS separates methods into state-changing commands and read-only queries, while CQRS extends this architectural guidance by supporting separate read and write models, dedicated handlers, and distinct data stores to improve scalability and maintainability across .NET application layers.

When should I avoid separating read and write models?

You should avoid separating read and write models when application complexity is low and the overhead of maintaining distinct commands, queries, handlers, and dispatchers outweighs the architectural clarity and scalability benefits gained from implementing CQRS patterns.