cqrs-event-sourcing

cqrs-event-sourcing is a skill for Claude Code, Codex from NickCrew/Claude-Cortex. It costs 46 tokens per session (904 once invoked), scanned A, original, MIT.

A guide to CQRS and event sourcing for systems that separate data changes from data reads and store changes as a history of events. This makes it possible to rebuild past states and maintain detailed audit trails.

In plain words
What is it for?
Use it to design auditable systems, temporal queries, event-driven applications, historical replay, separate read models, and complex high-scale domain logic.
Why use it?
It helps with systems where knowing what happened, reviewing past states, or using different read and write designs is important.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design auditable systems, temporal queries, event-driven applications, historical replay, separate read models, and complex high-scale domain logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nickcrew/claude-cortex/cqrs-event-sourcing
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 NickCrew/Claude-Cortex --skill cqrs-event-sourcing
Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex

Made for: Claude Code, Codex.

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-event-sourcing

README.md
[![agentmods](https://agentmods.dev/badge/skills/nickcrew/claude-cortex/cqrs-event-sourcing/github.svg)](https://agentmods.dev/skills/nickcrew/claude-cortex/cqrs-event-sourcing)
Your own site
<a href="https://agentmods.dev/skills/nickcrew/claude-cortex/cqrs-event-sourcing"><img src="https://agentmods.dev/badge/skills/nickcrew/claude-cortex/cqrs-event-sourcing/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-event-sourcing

Your own site · 80×15
<a href="https://agentmods.dev/skills/nickcrew/claude-cortex/cqrs-event-sourcing"><img src="https://agentmods.dev/badge/skills/nickcrew/claude-cortex/cqrs-event-sourcing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 904 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.
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.00046 $0.00904
Opus 5 $0.00023 $0.00452
Sonnet 5 $0.00009 $0.00181
Haiku 4.5 $0.00005 $0.00090

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

Security

Grade A, and why

cqrs-event-sourcing 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.

skills/cqrs-event-sourcing/SKILL.md · 102 lines

How it starts

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

CQRS and Event Sourcing Patterns

Expert guidance for implementing Command Query Responsibility Segregation (CQRS) and Event Sourcing patterns to build scalable, auditable systems with complete historical tracking and optimized read/write models.

When to Use This Skill

  • Building systems requiring complete audit trails and compliance
  • Implementing temporal queries ("show me the state at time T")
  • Designing high-scale applications with complex domain logic
  • Creating systems with significantly different read and write patterns
  • Building event-driven architectures with historical replay capability
  • Implementing systems requiring multiple read model projections
  • Designing applications where understanding "what happened" is critical
  • Building collaborative systems with conflict resolution needs

Core Principles

1. Command Query Separation

Separate operations that change state (commands) from operations that read state (queries).

Commands (Write) Queries (Read)
Express intent (CreateOrder, UpdatePrice) Return data, never change state
Can be rejected (validation failures) Can be cached and optimized
Return success/failure, not data Multiple models for different needs
Change system state Eventually consistent with writes

2. Events as Source of Truth

Store state changes as immutable events rather than current state snapshots.

Traditional: Store what IS → UPDATE users SET email = '[email protected]' Event Sourcing: Store what HAPPENED → APPEND UserEmailChanged event

Result: Complete history, temporal queries, audit trail

3. Eventual Consistency

Accept temporary inconsistency between write and read models for scalability.

4. Domain-Driven Design Integration

  • Aggregates enforce business invariants
  • Events represent domain facts
  • Commands express domain operations
  • Bounded contexts define consistency boundaries

Quick Reference

Task Load reference
CQRS implementation patterns skills/cqrs-event-sourcing/references/cqrs-patterns.md
Event sourcing & snapshots skills/cqrs-event-sourcing/references/event-sourcing.md
EventStoreDB & Axon Framework skills/cqrs-event-sourcing/references/event-store-tech.md
Consistency patterns skills/cqrs-event-sourcing/references/consistency-patterns.md
Best practices checklist skills/cqrs-event-sourcing/references/best-practices.md

Read the full file on GitHub · 102 lines

Files

What ships with it

5 files 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 · 102 lines · 46 tokens per session scan A 40da77533643

Subscribe to this mod's changes

cqrs-event-sourcing is a skill published in the GitHub repository NickCrew/Claude-Cortex (39 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 904 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-paradigm-cqrs-es

Applies CQRS and Event Sourcing for read/write separation and audit trails. Use when designing systems with complex domain logic or full state-change history.

athola/claude-night-market · 39 tokens

cratis-readmodel

Step-by-step guidance for creating a Cratis Chronicle read model from scratch — defining events, choosing between projection and reducer, [ReadModel] record with static query methods, and the generated TypeScript proxy in React. Use when creating a read model, working with [EventType], [ReadModel], IProjectionFor…

Cratis/AI · 100 tokens

cratis-arc-ef-core-migration

Change an Entity Framework Core schema in a Cratis Arc application — the DbContext base types Arc provides, the cross-database column helpers, JSON columns, how a migration is created and applied, and how an EF Core read model becomes injectable into a command. Use when adding or changing a table, column…

Cratis/AI · 93 tokens

cratis-chronicle-event-type-migration

Evolve a Chronicle event schema without breaking replay - add a generation and an EventTypeMigration so stored events upcast into the new shape. Use when an event needs a new required property, a renamed or split property, a structural change, or a changed enum value after events of the prior shape already exist. Do…

Cratis/AI · 93 tokens

cratis-chronicle-read-model

Create a Chronicle read model and its query surface - past-tense event types, the read-model record and its key, choosing a projection or a reducer to build it, snapshot versus observable queries, and reading an instance directly through IReadModels. Use when creating a read model from scratch; for changing how an…

Cratis/AI · 81 tokens

add-projection

Use this skill when asked to add a Chronicle projection to a Cratis-based project. Favor model-bound projections by default, and only fall back to declarative/fluent IProjectionFor projections when model-bound attributes cannot express the behavior cleanly. Enforces the AutoMap-first rule and Chronicle-specific join…

Cratis/AI · 68 tokens