
Solid foundation for implementing CQRS patterns with complete command and query infrastructure templates. Includes command buses, handlers, event sourcing integration, and read model projections. The code examples cover real scenarios like order management with proper separation of write operations (CreateOrder, CancelOrder) and optimized queries (paginated results, filtering). Most useful when you need to scale reads independently from writes or handle complex reporting requirements. The templates are production-ready with proper validation, error handling, and async support. Skip if you're dealing with simple CRUD operations where the complexity overhead isn't justified.
$ npx -y skills add wshobson/agents --skill cqrs-implementation --agent claude-codeInstalls into .claude/skills of the current project.
Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.
┌─────────────┐
│ Client │
└──────┬──────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Commands │ │ Queries │
│ API │ │ API │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Command │ │ Query │
│ Handlers │ │ Handlers │
└──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Write │─────────►│ Read │
│ Model │ Events │ Model │
└─────────────┘ └─────────────┘
| Component | Responsibility |
|---|---|
| Command | Intent to change state |
| Command Handler | Validates and executes commands |
| Event | Record of state change |
| Query | Request for data |
| Query Handler | Retrieves data from read model |
| Projector | Updates read model from events |
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Sponsors