Skip to content
Development
Skill

/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.

From plugin
claude-night-market
343200 skills60 agents162 commands1 MCP

Claude Code

$ npx -y skills add athola/claude-night-market --skill architecture-paradigm-cqrs-es --agent claude-code

SKILL.md

architecture-paradigm-cqrs-es.SKILL.md
name: architecture-paradigm-cqrs-es
description: 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.
alwaysApply: false
category: architectural-pattern
tags:
- architecture
- CQRS
- Event-Sourcing
- distributed-systems
- audit-trail
- scalability
dependencies: []
tools: []
usage_patterns:
- paradigm-implementation
- distributed-system-design
- auditability
- scalability-optimization
complexity: high
estimated_tokens: 800

The CQRS and Event Sourcing Paradigm

When To Use

  • Designing event-sourced systems with complex domain logic
  • Systems requiring full audit trails of state changes

When NOT To Use

  • Simple CRUD applications without complex domain logic
  • Small projects where event sourcing adds unnecessary complexity

When to Employ This Paradigm

  • When read and write workloads have vastly different performance characteristics or scaling requirements.
  • When all business events must be captured in a durable, immutable history or audit trail.
  • When a business needs to rebuild projections of data or support temporal queries (e.g., "What did the state of this entity look like yesterday?").

Adoption Steps

1. **Identify Aggregates**: Following Domain-Driven Design principles, specify the bounded contexts and the business invariants that each command must enforce on an aggregate. 2. **Model Commands and Events**: Define the schemas and validation rules for all commands and the events they produce. Document a clear strategy for versioning and schema evolution. 3. **Implement the Write Side (Command Side)**: Command handlers are responsible for loading an aggregate's event stream, executing business logic, and atomically appending new events to the stream. 4. **Build Projections to the Read Side**: Create separate read models (projections) that are fed by subscriptions to the event stream. Implement back-pressure and retry policies for these subscriptions. 5. **validate Full Observability**: Implement detailed logging that includes event IDs, sequence numbers, and metrics for tracking the lag time of each projection.

Key Deliverables

  • An Architecture Decision Record (ADR) detailing the aggregates, the chosen event store technology, the projection strategy, and the expected data consistency model (e.g., eventual consistency SLAs).
  • A suite of tests for command handlers that use in-memory event streams, complemented by integration tests for the projections.
  • Operational tooling for replaying events, taking state snapshots for performance, and managing schema migrations.

Risks & Mitigations

  • **High Operational Overhead**:
  • **Mitigation**: Bugs related to event ordering and replays can be difficult to diagnose. Invest heavily in automation, Dead-Letter Queues (DLQs) for failed events, and regular "chaos engineering" drills to test resilience.
  • **Challenges of Eventual Consistency**:
  • **Mitigation**: Users may be confused by delays between performing an action and seeing the result. Clearly document the SLAs for read model updates and manage user-facing expectations accordingly, for example, by providing immediate feedback on the command side.
  • **Schema Drift**:
  • **Mitigation**: An unplanned change to an event schema can break consumers. Enforce the use of a formal schema registry and implement version gates in the CI/CD pipeline to prevent the emission of unvalidated event versions.

Concrete Components

Vocabulary for the tools and abstractions an implementation of this paradigm tends to carry. Not dependencies, and not ``tools:`` frontmatter.

  • ``event-store``: append-only log of domain events; the system of record from which projections are built
  • ``message-broker``: carries commands and integration events between bounded contexts
  • ``projection-builder``: rebuilds read-side views by replaying the event store

Exit Criteria

  • [ ] An ADR is produced naming the aggregates, the chosen event store technology, the projection

strategy, and the eventual-consistency SLA for each read model.

  • [ ] Command handler tests use in-memory event streams and pass before any persistence adapter

is wired.

  • [ ] A schema registry or versioning policy for event schemas is documented, and a CI gate

prevents emission of event versions not registered in that policy.

  • [ ] Operational tooling for event replay and state snapshots is identified (not just mentioned)

before the write-side is declared production-ready.

Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other skills on claude-night-market.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about architecture-paradigm-cqrs-es.

Which coding agents can use architecture-paradigm-cqrs-es?
architecture-paradigm-cqrs-es installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.