Cqrs Implementation skill for Claude

Implement Command Query Responsibility Segregation for scalable architectures.

When Claude uses it

Use when separating read and write models, optimizing query performance, or building event-sourced systems.

Cqrs Implementation SKILL.md

The full skill file from wshobson/agents (MIT).

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

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

How to install Cqrs Implementation

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit wshobson/agents/plugins/backend-development/skills/cqrs-implementation#main ~/.claude/skills/cqrs-implementation

Codex

npx degit wshobson/agents/plugins/backend-development/skills/cqrs-implementation#main ~/.codex/skills/cqrs-implementation

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Cqrs Implementation skill do?

Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

+How do I install Cqrs Implementation in Claude Code?

Copy the skill folder into ~/.claude/skills/cqrs-implementation, for example with "npx degit wshobson/agents/plugins/backend-development/skills/cqrs-implementation#main ~/.claude/skills/cqrs-implementation". Claude Code loads it automatically and uses it when a task matches.

+Does Cqrs Implementation work with ChatGPT or Codex?

Yes. Cqrs Implementation uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/cqrs-implementation. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Cqrs Implementation free?

Cqrs Implementation is published on GitHub by wshobson under the MIT license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Data Quality Frameworks

    Implement data quality validation with Great Expectations, dbt tests, and data contracts.

    wshobson/agents★ 43k
  5. Debugging Strategies

    Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or…

    wshobson/agents★ 43k
  6. Dependency Upgrade

    Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing.

    wshobson/agents★ 43k
  7. Dotnet Backend Patterns

    Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.

    wshobson/agents★ 43k
  8. Fastapi Templates

    Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling.

    wshobson/agents★ 43k
  9. Git Advanced Workflows

    Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from…

    wshobson/agents★ 43k

See all software development skills →

More skills from wshobson

  1. Data Storytelling

    Transform data into compelling narratives using visualization, context, and persuasive structure.

    wshobson/agents★ 43k
  2. Database Migration

    Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures.

    wshobson/agents★ 43k

All skills by wshobson →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.