ClaudeCodeMod

All shelves / Skills

cqrs-implementation

wshobson/agents · 11.6k installs · 42.1K stars

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

Install

The repo has no one-line install. Follow its README.

Open the repo

Files

SKILL.md

CQRS Implementation

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
Component Responsibility
Command Intent to change state
Command Handler Validates and executes commands
Event Record of state change
Query Request for data
Query Handler Retrieves data from read model
Projector Updates 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

Facts

Kind
Skill
Repo
wshobson/agents
Group
Uncategorized
Installs
11.6k
Stars
42.1K

Same name on this shelf 1

  1. 22493cqrs-implementationsickn33/antigravity-awesome-skills207

Same repo on other shelves

Marketplaces

  1. 16wshobson/agentswshobson/agentsMulti-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, Google Antigravity, and Pi42.8k

From the same repo

  1. 2610airflow-dag-patternswshobson/agents11.6k
  2. 2611workflow-patternswshobson/agents11.6k
  3. 2614dbt-transformation-patternswshobson/agents11.6k
  4. 2619paypal-integrationwshobson/agents11.6k
  5. 2620anti-reversing-techniqueswshobson/agents11.6k
  6. 2628temporal-python-testingwshobson/agents11.6k