architecture-paradigm-cqrs-es
Apply CQRS and Event Sourcing for read/write separation and audit trails
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/athola/nm-archetypes-architecture-paradigm-cqrs-esNight Market Skill — ported from claude-night-market/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
- Identify Aggregates: Following Domain-Driven Design principles, specify the bounded contexts and the business invariants that each command must enforce on an aggregate.
- 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.
- 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.
- 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.
- 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.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-athola-nm-archetypes-architecture-paradigm-cqrs-es": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
extract
Analyze a codebase and build a knowledge base of business logic, architecture, data flow, and engineering patterns. The foundation for gauntlet challenges and agent integration
discourse
>- Scan community discussion channels (HN, Lobsters, Reddit, tech blogs) for experience reports and opinions on a topic
synthesize
>- Merge, deduplicate, rank, and format research findings from multiple channels into a coherent report. Use after research agents return their results
workflow-monitor
Detect workflow failures and inefficient patterns, then create GitHub issues for improvement via /fix-workflow
architecture-paradigm-hexagonal
Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure