cqrs-design
Installation
SKILL.md
CQRS Design
Implement Command Query Responsibility Segregation (CQRS) to align data models with actual usage patterns and enable independent scaling of reads and writes.
Context
You are designing or refactoring a system with complex read and write patterns. The user faces performance issues, audit requirements, or divergent read/write needs. Read their current data access patterns.
Domain Context
Based on Greg Young's CQRS work and Fowler's research:
- Command Side: Optimized for writes; enforces business rules; maintains single source of truth
- Query Side: Optimized for reads; denormalized for performance; eventual consistency acceptable
- Event Sourcing: Often paired with CQRS; commands generate events, events drive queries
- Read Models: Projections built from events; can be recreated from command side state
- Consistency Boundary: Commands are strongly consistent within aggregate; queries lag slightly