architecture-paradigm-cqrs-es

Apply CQRS and Event Sourcing for read/write separation and audit trails

3,891 stars

Best use case

architecture-paradigm-cqrs-es is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Apply CQRS and Event Sourcing for read/write separation and audit trails

Teams using architecture-paradigm-cqrs-es should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nm-archetypes-architecture-paradigm-cqrs-es/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/athola/nm-archetypes-architecture-paradigm-cqrs-es/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nm-archetypes-architecture-paradigm-cqrs-es/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How architecture-paradigm-cqrs-es Compares

Feature / Agentarchitecture-paradigm-cqrs-esStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Apply CQRS and Event Sourcing for read/write separation and audit trails

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

> **Night Market Skill** — ported from [claude-night-market/archetypes](https://github.com/athola/claude-night-market/tree/master/plugins/archetypes). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# 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.
## Troubleshooting

### Common Issues

**Command not found**
Ensure all dependencies are installed and in PATH

**Permission errors**
Check file permissions and run with appropriate privileges

**Unexpected behavior**
Enable verbose logging with `--verbose` flag

Related Skills

Agent Memory Architecture

3891
from openclaw/skills

Complete zero-dependency memory system for AI agents — file-based architecture, daily notes, long-term curation, context management, heartbeat integration, and memory hygiene. No APIs, no databases, no external tools. Works with any agent framework.

architecture-paradigm-event-driven

3891
from openclaw/skills

Apply event-driven async messaging to decouple producers and consumers. Use for real-time processing

architecture-paradigm-client-server

3891
from openclaw/skills

Client-server architecture for web/mobile apps with centralized services and API design

agent-architecture-patterns

3891
from openclaw/skills

AI Agent architecture patterns library with 10 patterns for single and multi-agent systems

CLI-Agent Architecture Skill

3891
from openclaw/skills

> A single `run(command="...")` tool with Unix CLI commands outperforms typed function calls.

langgraph-architecture

3891
from openclaw/skills

Guides architectural decisions for LangGraph applications. Use when deciding between LangGraph vs alternatives, choosing state management strategies, designing multi-agent systems, or selecting persistence and streaming approaches.

deepagents-architecture

3891
from openclaw/skills

Guides architectural decisions for Deep Agents applications. Use when deciding between Deep Agents vs alternatives, choosing backend strategies, designing subagent systems, or selecting middleware approaches.

agent-architecture-analysis

3891
from openclaw/skills

Perform 12-Factor Agents compliance analysis on any codebase. Use when evaluating agent architecture, reviewing LLM-powered systems, or auditing agentic applications against the 12-Factor methodology.

site-architecture

3891
from openclaw/skills

When the user wants to audit, redesign, or plan their website's structure, URL hierarchy, navigation design, or internal linking strategy. Use when the user mentions 'site architecture,' 'URL structure,' 'internal links,' 'site navigation,' 'breadcrumbs,' 'topic clusters,' 'hub pages,' 'orphan pages,' 'silo structure,' 'information architecture,' or 'website reorganization.' Also use when someone has SEO problems and the root cause is structural (not content or schema). NOT for content strategy decisions about what to write (use content-strategy) or for schema markup (use schema-markup).

agent-architecture-evaluator

3891
from openclaw/skills

Use when evaluating, testing, and optimizing an agent architecture or multi-agent system. Best for reviewing planning, routing, memory, tool use, reliability, observability, cost, and system-level failure modes.

architecture-governance-assessment

3891
from openclaw/skills

Architecture governance and assessment tool. Evaluate cloud architectures against best practices and generate actionable improvement reports.

react-flow-architecture

3880
from openclaw/skills

Architectural guidance for building node-based UIs with React Flow. Use when designing flow-based applications, making decisions about state management, integration patterns, or evaluating whether React Flow fits a use case.