What problem does it solve?
This Skill provides a structured blueprint for implementing CQRS in a domain-driven design. It explains how to separate the write model (aggregates and domain events) from the read models (denormalized projections) and how to wire events into projections to support fast, query-optimized reads.
Core Features & Use Cases
- Command model with aggregates and domain events: write operations mutate state via aggregates that emit events.
- Projections for read models: events update dashboard and analytics views without touching the write model.
- Query handlers for reads: retrieve pre-computed views (dashboard, analytics, lists) efficiently.
- Use Case: heating-building domain uses HeatingBuilding aggregates and HeatingOptimized events to populate BuildingDashboardView and BuildingAnalyticsView for real-time monitoring.
Quick Start
Define the HeatingBuilding aggregate and its command handlers, emit HeatingOptimized events, and wire projections to update the read models. Implement GetBuildingDashboardHandler and GetBuildingAnalyticsHandler to query the views, and ensure views can be rebuilt by replaying events.