Projection Patterns
Unverified●30/40Claude Code◐PartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
Cursor◐PartialPlain prose you can paste in — but no Cursor rules file
Codex◐PartialPlain prose you can paste in — but no AGENTS.md
Gemini CLI◐PartialPlain prose you can paste in
Copilot◐PartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add projection-patternsWho is stuck, and on what
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.
The whole source
Frontmatter — 2 properties
| 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. |
| 1 | --- |
| 2 | name: projection-patterns |
| 3 | 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. |
| 4 | ---A5 — No allowed-tools declared — no way to tell what this skill may touch |
| 5 | |
| 6 | # Projection Patterns |
| 7 | |
| 8 | Comprehensive guide to building projections and read models for event-sourced systems. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | - Building CQRS read models |
| 13 | - Creating materialized views from events |
| 14 | - Optimizing query performance |
| 15 | - Implementing real-time dashboards |
| 16 | - Building search indexes from events |
| 17 | - Aggregating data across streams |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### 1. Projection Architecture |
| 22 | |
| 23 | ``` |
| 24 | ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ |
| 25 | │ Event Store │────►│ Projector │────►│ Read Model │ |
| 26 | │ │ │ │ │ (Database) │ |
| 27 | │ ┌─────────┐ │ │ ┌─────────┐ │ │ ┌─────────┐ │ |
| 28 | │ │ Events │ │ │ │ Handler │ │ │ │ Tables │ │ |
| 29 | │ └─────────┘ │ │ │ Logic │ │ │ │ Views │ │ |
| 30 | │ │ │ └─────────┘ │ │ │ Cache │ │ |
| 31 | └─────────────┘ └─────────────┘ └─────────────┘ |
| 32 | ``` |
| 33 | |
| 34 | ### 2. Projection Types |
| 35 | |
| 36 | | Type | Description | Use Case | |
| 37 | | -------------- | --------------------------- | ---------------------- | |
| 38 | | **Live** | Real-time from subscription | Current state queries | |
| 39 | | **Catchup** | Process historical events | Rebuilding read models | |
| 40 | | **Persistent** | Stores checkpoint | Resume after restart | |
| 41 | | **Inline** | Same transaction as write | Strong consistency | |
| 42 | |
| 43 | ## Templates and detailed worked examples |
| 44 | |
| 45 | Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates. |
| 46 | |
| 47 | ## Best Practices |
| 48 | |
| 49 | ### Do's |
| 50 | |
| 51 | - **Make projections idempotent** - Safe to replay |
| 52 | - **Use transactions** - For multi-table updates |
| 53 | - **Store checkpoints** - Resume after failures |
| 54 | - **Monitor lag** - Alert on projection delays |
| 55 | - **Plan for rebuilds** - Design for reconstruction |
| 56 | |
| 57 | ### Don'ts |
| 58 | |
| 59 | - **Don't couple projections** - Each is independent |
| 60 | - **Don't skip error handling** - Log and alert on failures |
| 61 | - **Don't ignore ordering** - Events must be processed in order |
| 62 | - **Don't over-normalize** - Denormalize for query patterns |
| 63 |
Reviews
Installed this one?Write the first review and take the Trailblazer badge.
Alternatives
Subagent Driven DevelopmentUse when executing implementation plans with independent tasks in the current session◐◐◐◐◐●36/40Python Code Style & DocumentationPython code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.◐····●35/40Competitor Price Analysis 💲Competitor pricing strategy analysis and market positioning. Price mapping, pricing gaps identification, elasticity signals evaluation, and strategic pricing optimization. Use when the user asks about competitor pricing, price analysis, pricing strategy, or co◐····●34/40Competitor Price Tracker 📊Set up competitor price tracking and monitoring workflows. Track price changes, detect promotions, analyze pricing patterns, and get alerts for competitive price movements.◐····●34/40