home / skills / sickn33 / antigravity-awesome-skills / projection-patterns
This skill helps you design and implement projections and read models from event streams for CQRS, dashboards, and optimized queries.
npx playbooks add skill sickn33/antigravity-awesome-skills --skill projection-patternsReview the files below or copy the command above to add this skill to your agents.
---
name: projection-patterns
description: Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.
---
# Projection Patterns
Comprehensive guide to building projections and read models for event-sourced systems.
## Use this skill when
- Building CQRS read models
- Creating materialized views from events
- Optimizing query performance
- Implementing real-time dashboards
- Building search indexes from events
- Aggregating data across streams
## Do not use this skill when
- The task is unrelated to projection patterns
- You need a different domain or tool outside this scope
## Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.
## Resources
- `resources/implementation-playbook.md` for detailed patterns and examples.
This skill helps design and implement projections and read models from event streams for event-sourced systems. It focuses on CQRS read sides, materialized views, and strategies to improve query performance and real-time aggregation. The goal is practical, production-ready patterns and verification steps you can apply in Python-based architectures.
The skill analyzes event shapes, access patterns, and latency requirements to recommend projection topologies and update semantics (e.g., incremental, idempotent, or upsert-based). It provides concrete mapping strategies from events to read models, selection of storage backends (key-value, relational, search index), and guidance to make updates resilient and testable. It also outlines verification and monitoring checks to ensure correctness and freshness.
How do I handle out-of-order events?
Design projections to be idempotent and include causal ordering metadata; use sequence numbers or vector clocks and buffering for strict ordering when required.
What if my projection gets corrupted?
Replay events from the origin to rebuild the projection, using a deterministic processor and a replay-safe output path; maintain reconciliation checks to detect corruption early.