CQRS Implementation

SkillAI & models

cqrs-implementation is a skill that guides an AI agent through implementing Command Query Responsibility Segregation in an application. It covers core concepts such as commands, queries, handlers, and projectors, explains when to apply CQRS, and includes best practices with pointers to detailed templates and worked examples in a references file.

Use CQRS Implementation in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add CQRS Implementation and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the CQRS Implementation skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have an agent that can load skills and read project files.

CQRS ImplementationStart free

What your AI can do with it

  • Explains CQRS architecture, including commands, queries, handlers, and projectors
  • Describes when to use CQRS, such as scaling reads independently from writes
  • Guides building event-sourced systems and separating read and write models
  • Provides best practices, like validating in command handlers and versioning events
  • Points to a references file with templates and detailed worked examples

Getting started

  1. Have an agent that can load skills and read project files.
  2. Add the cqrs-implementation skill to the agent's available skills.
  3. Ask the agent to implement CQRS for your application, or to separate read and write models, optimize query performance, or build an event-sourced system.
  4. Have the agent read the references/details.md file when concrete templates or worked examples are needed.

What this skill tells your AI

The instructions your AI receives, as published by wshobson/agents in plugins/backend-development/skills/cqrs-implementation/SKILL.md and read by ahel’s review.

Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.

When to Use This Skill

  • Separating read and write concerns
  • Scaling reads independently from writes
  • Building event-sourced systems
  • Optimizing complex query scenarios
  • Different read/write data models needed
  • High-performance reporting requirements

Core Concepts

1. CQRS Architecture

                    ┌─────────────┐
                    │   Client    │
                    └──────┬──────┘
                           │
              ┌────────────┴────────────┐
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Commands   │          │   Queries   │
       │    API      │          │    API      │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Command    │          │   Query     │
       │  Handlers   │          │  Handlers   │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │   Write     │─────────►│    Read     │
       │   Model     │  Events  │   Model     │
       └─────────────┘          └─────────────┘

2. Key Components

ComponentResponsibility
CommandIntent to change state
Command HandlerValidates and executes commands
EventRecord of state change
QueryRequest for data
Query HandlerRetrieves data from read model
ProjectorUpdates read model from events

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Separate command and query models - Different needs
  • Use eventual consistency - Accept propagation delay
  • Validate in command handlers - Before state change
  • Denormalize read models - Optimize for queries
  • Version your events - For schema evolution

Don'ts

  • Don't query in commands - Use only for writes
  • Don't couple read/write schemas - Independent evolution
  • Don't over-engineer - Start simple
  • Don't ignore consistency SLAs - Define acceptable lag

Signals

GitHub stars
40k
Forks
4k
Last commit
Sep 2026

Others that do the same job

Questions

When should this skill be used?
Use it when separating read and write models, optimizing query performance, or building event-sourced systems. It also fits cases like scaling reads independently from writes, different read/write data models, or high-performance reporting requirements.
What concepts does it cover?
It covers core CQRS concepts: commands, command handlers, events, queries, query handlers, and projectors, along with when to apply CQRS and best practices for doing so.
Advanced
Item type
skill
Key
cqrs-implementation-wshobson
Source
github.com/wshobson/agents