Agent skill

CQRS Implementation

by wshobson in wshobson/agents

Explains how to split a system into command and query sides with CQRS: handlers, events, projectors, denormalized read models and eventual consistency.

MITAuto-check passedBackend & APIs

Install CQRS Implementation

skills CLI
$ npx skills add wshobson/agents --skill cqrs-implementation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wshobson/agents cqrs-implementation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/backend-development/skills/cqrs-implementation .claude/skills/cqrs-implementation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cqrs-implementation
GitHub stars
40k
Used in
9 other repos
Token cost
~719 tokens
SKILL.md length
170 words
Files
2 (incl. references)
Skills in repo
142
Repo updated
First seen
Licence
MIT

At a glance

Explains how to split a system into command and query sides with CQRS: handlers, events, projectors, denormalized read models and eventual consistency.

  • Works in 2 steps: CQRS Architecture → Key Components
  • Separating the read and write models of a growing service
  • SKILL.md covers When to Use This Skill, Core Concepts, Templates and detailed worked… and Best Practices
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill introduces Command Query Responsibility Segregation as a way to scale reads independently from writes, support event-sourced systems and give reporting its own data model. A component table defines commands, command handlers, events, queries, query handlers and projectors that update the read model from events.

Best practices call for separate command and query models, accepting eventual consistency, validating inside command handlers before state changes, denormalizing read models for queries and versioning events. It warns against querying inside commands, coupling read and write schemas, over-engineering and ignoring consistency SLAs. Templates and worked examples are in `references/details.md`.

When your agent uses it

  • Separating the read and write models of a growing service
  • Building an event-sourced system with projections
  • Scaling reporting queries independently from writes
  • Defining acceptable lag between a write and its read model

Example prompts

  • “Split our order service into command and query sides with a projector that builds a read model.”
  • “Add event versioning to our CQRS handlers so schemas can evolve.”
  • “Design a denormalized read model for the sales dashboard, fed by order events.”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. CQRS Architecture
  2. Key Components

What it can do on your machine

Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CQRS Implementation loads about 719 tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 52 tokens; SKILL.md has 170 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~719
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 170 words, ~719 tokens.

Download SKILL.mdSave it as .claude/skills/cqrs-implementation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cqrs-implementation
description
Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

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

© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/backend-development/skills/cqrs-implementation of wshobson/agents.

  • SKILL.md
  • references/details.md

Open the folder on GitHubat commit 46891e7

Used in 9 other repositories

We found 23 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 9 other GitHub owners. This page covers the copy in wshobson/agents, which our catalogue first saw on October 7, 2026.

Compare with similar skills

CQRS Implementation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CQRS Implementation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CQRS Implementation this skillwshobson/agents40k9 repos~719Automated safety check: PassMIT
NestJS Modular Monolith Architecttech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0
Microservices ArchitectJeffallan/claude-skills12k—~1.8kAutomated safety check: PassMIT
Quarkus Patternsaffaan-m/ECC275k1 repos~5.4kAutomated safety check: PassMIT
Architecture Selectionrsmdt/the-startup551—~1.2kAutomated safety check: PassMIT
Quarkus Patternsaffaan-m/ECC275k—~6.1kAutomated safety check: PassMIT

Similar skills

  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated 18 days ago
    Backend & APIsAuto-check passed
  • Microservices Architect

    Jeffallan/claude-skills

    Designs distributed systems: bounded-context service boundaries, sync and async communication, data ownership, resilience, tracing and rollout strategy.

    12k GitHub stars~1.8k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Quarkus Patterns

    affaan-m/ECC

    Quarkus 3.x LTS architecture patterns with Camel for messaging, RESTful API design, CDI services, data access with Panache, and async processing.

    275k GitHub starsUsed in 1 repo~5.4k tokens
    Backend & APIsAuto-check passed
  • Architecture Selection

    rsmdt/the-startup

    System architecture patterns including monolith, microservices, event-driven, and serverless, with C4 modeling, scalability strategies, and technology selection criteria.

    551 GitHub stars~1.2k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • Quarkus Patterns

    affaan-m/ECC

    Quarkus 3.x LTS architecture patterns with Camel for messaging, RESTful API design, CDI services, data access with Panache, and async processing.

    275k GitHub stars~6.1k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • System Design

    ninehills/skills

    Design scalable distributed systems using structured approaches for load balancing, caching, database scaling, and message queues.

    281 GitHub stars~4.7k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed

More from wshobson/agents

All 142 skills in this repo
  • Billing Automation

    wshobson/agents

    Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.

    40k GitHub starsUsed in 14 repos~473 tokens
    Auto-check passed
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 14 repos~1.7k tokens
    Auto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 13 repos~814 tokens
    Auto-check passed
  • Portfolio Risk Metrics

    wshobson/agents

    Covers portfolio risk measurement with VaR, CVaR, Sharpe, Sortino and drawdown, plus guidance on limits, stress tests and tail risk.

    40k GitHub starsUsed in 13 repos~502 tokens
    Auto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 12 repos~1.3k tokens
    Auto-check passed
  • Plans memory headroom, works through out-of-memory failures and watches temperature and power during long ML training jobs on NVIDIA DGX Spark.

    40k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed

Categories

Questions about CQRS Implementation

What does CQRS Implementation do?

Explains how to split a system into command and query sides with CQRS: handlers, events, projectors, denormalized read models and eventual consistency. The skill introduces Command Query Responsibility Segregation as a way to scale reads independently from writes, support event-sourced systems and give reporting its own data model. A component table defines commands, command handlers, events, queries, query handlers and projectors that update the read model from events.

When should I use CQRS Implementation?

CQRS Implementation fits situations like: separating the read and write models of a growing service; building an event-sourced system with projections; scaling reporting queries independently from writes; defining acceptable lag between a write and its read model.

How do I install CQRS Implementation in Claude Code?

Run `npx skills add wshobson/agents --skill cqrs-implementation -a claude-code`. Or copy the skill folder (plugins/backend-development/skills/cqrs-implementation in wshobson/agents) into .claude/skills/cqrs-implementation in your project. Claude Code loads it when a task matches its description.

How do I install CQRS Implementation in Codex?

Run `npx skills add wshobson/agents --skill cqrs-implementation -a codex`. Or copy the skill folder (plugins/backend-development/skills/cqrs-implementation in wshobson/agents) into .agents/skills/cqrs-implementation in your project. Codex loads it when a task matches its description.

Can I use CQRS Implementation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill cqrs-implementation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cqrs-implementation, .gemini/skills/cqrs-implementation, .github/skills/cqrs-implementation and .opencode/skills/cqrs-implementation in your project.

What does CQRS Implementation need to run?

SKILL.md names no scripts, command-line tools or credentials: CQRS Implementation is instructions for the agent only.

Does CQRS Implementation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is CQRS Implementation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CQRS Implementation use?

CQRS Implementation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CQRS Implementation use?

About 719 tokens (SKILL.md is roughly 2.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.2k tokens, read only when the agent opens those files.

What are the alternatives to CQRS Implementation?

Skills that share tags, products or a category with CQRS Implementation: NestJS Modular Monolith Architect (tech-leads-club/agent-skills, 7k stars), Microservices Architect (Jeffallan/claude-skills, 12k stars), Quarkus Patterns (affaan-m/ECC, 275k stars) and Architecture Selection (rsmdt/the-startup, 551 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CQRS Implementation?

wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,287 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.

Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.