cqrs

cqrs is a skill for Claude Code from TheBeardedBearSAS/claude-craft. It costs 37 tokens per session (793 once invoked), scanned A, original, MIT.

A guide to CQRS, an architecture that separates operations that change data from operations that read data. It also covers when this extra separation is justified, including event sourcing and different scaling needs.

In plain words
What is it for?
Use it when evaluating or implementing separate read and write models, event-sourced systems, or architectures with different read and write workloads.
Why use it?
It helps address systems where reading and writing have different performance, data-model, or auditing requirements, while avoiding unnecessary complexity for simple CRUD applications.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

Good fit Use it when evaluating or implementing separate read and write models, event-sourced systems, or architectures with different read and write workloads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thebeardedbearsas/claude-craft/cqrs
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TheBeardedBearSAS/claude-craft --skill cqrs
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cqrs

README.md
[![agentmods](https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/cqrs/github.svg)](https://agentmods.dev/skills/thebeardedbearsas/claude-craft/cqrs)
Your own site
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/cqrs"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/cqrs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cqrs

Your own site · 80×15
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/cqrs"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/cqrs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 793 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00793
Opus 5 $0.00018 $0.00396
Sonnet 5 $0.00007 $0.00159
Haiku 4.5 $0.00004 $0.00079

Measured 6d ago against content hash 9cc74ae9486b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

cqrs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/cqrs/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CQRS — Quick Reference

CQRS (Command Query Responsibility Segregation) sépare les opérations d'écriture et de lecture dans des modèles distincts. N'est pas par défaut — c'est une optimisation à activer quand le coût de la complexité est justifié.

Quand utiliser

Pertinent Pas pertinent
Domaine métier complexe avec règles d'invariants riches CRUD simple, domaine pauvre
Ratio lectures/écritures > 10× Petits projets, équipe junior
Audit / compliance (Event Sourcing naturel) Cohérence immédiate requise
Read models hétérogènes (mobile vs analytics vs back-office) Modèle de données stable et unique
Scale différencié reads vs writes (replicas, cache, search) Charge faible, monolithe modeste

Règle d'or : commencer par une architecture classique. Migrer vers CQRS lorsqu'au moins 2 des cas pertinents sont présents simultanément.

Architecture en 30 secondes

[ User ]
   ↓
[ Command ]──────────▶ [ Write Model (Domain) ]
                              ↓ persist + emit
                       [ Event(s) ]
                              ↓
[ Query ] ◀───── [ Read Model (denormalised) ] ◀── projections
  • Command side : modèle normalisé, focus invariants métier. Écrit, ne lit que ce qui est nécessaire à la validation.
  • Query side : modèle dénormalisé, focus performance lecture. N'a pas de logique métier.
  • Projections : transforment les events en read models. Eventually consistent.

Trade-off central

Bénéfice Coût
Scale indépendant lecture / écriture Eventual consistency (≈ 50-500 ms latency typique)
Read models taillés pour chaque besoin Plus de code à maintenir (2 modèles)
Event Sourcing devient facile à brancher Debugging plus complexe (event flow)
Audit trail naturel Migration tardive très coûteuse

Patterns associés (souvent ensemble)

  • Event Sourcing : stocker la séquence d'events comme source de vérité, le write model est reconstruit en replay.
  • Saga / Process Manager : orchestrer des transactions distribuées via events.
  • Outbox Pattern : garantir l'atomicité publication event + write DB.
  • Materialized Views : projections persistées en table dédiée pour query speed.

Read the full file on GitHub · 67 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 67 lines · 0 tokens per session scan A 9cc74ae9486b

Subscribe to this mod's changes

cqrs is a skill published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 7d ago), licensed MIT. It adds 37 tokens to every session and 793 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

architecture-patterns

Architecture validation and patterns for clean architecture, backend structure enforcement, project structure validation, test standards, and context-aware sizing. Use when designing system boundaries, enforcing layered architecture, validating project structure, defining test standards, or choosing the right…

yonatangross/orchestkit · 56 tokens

domain-driven-design

DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts. Python dataclass implementations with TypeScript alternatives. Use when building rich domain models, enforcing invariants, or separating domain logic…

yonatangross/orchestkit · 57 tokens

authentication-patterns

OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.

travisjneuman/.claude · 28 tokens

email-systems

Transactional email (Resend, SendGrid, SES), templates (React Email, MJML), deliverability (SPF/DKIM/DMARC), and inboxing best practices. Use when building email infrastructure, designing templates, or troubleshooting deliverability.

travisjneuman/.claude · 55 tokens

event-driven-architecture

Kafka, RabbitMQ, SQS/SNS, event sourcing, CQRS, saga patterns, dead letter queues, and idempotency. Use when designing asynchronous systems, implementing message-driven workflows, or building event streaming pipelines.

travisjneuman/.claude · 50 tokens

graphql-expert

GraphQL API design and implementation. Use when building GraphQL APIs, designing schemas, implementing resolvers, or optimizing GraphQL performance.

travisjneuman/.claude · 31 tokens