cqrs-projection-tests
Installation
SKILL.md
cqrs-projection-tests
Per [Fowler - CQRS], CQRS "splits commands and queries into distinct models." Read-model (projection) is rebuilt from the write-model's events. Tests verify the projection is correct + reproducible + consistent within the documented eventual-consistency window.
When to use
- A read-heavy bounded context where queries hit a denormalized projection rather than the write-model.
- Adding a new projection from an existing event stream.
- Migrating an existing projection schema (zero-downtime swap).
Step 1 - Projection-from-events determinism
Per [Fowler - CQRS], the read model is "optimized for reading and displaying information." Test that rebuilding from the same events yields the same projection state: