projection-patterns
Agent skill fromwshobson/agents
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.
How to install projection-patterns
install projection-patterns
# install the agents pack with the skills CLI
npx skills add wshobson/agents# or add only this skill to Claude Code: copy the folder
plugins/backend-development/skills/projection-patterns/
# into
~/.claude/skills/projection-patterns/ (all projects)
.claude/skills/projection-patterns/ (one project)
1# Projection Patterns23Comprehensive guide to building projections and read models for event-sourced systems.45## When to Use This Skill67- Building CQRS read models8- Creating materialized views from events9- Optimizing query performance10- Implementing real-time dashboards11- Building search indexes from events12- Aggregating data across streams1314## Core Concepts1516### 1. Projection Architecture1718```19┌─────────────┐ ┌─────────────┐ ┌─────────────┐20│ Event Store │────►│ Projector │────►│ Read Model │21│ │ │ │ │ (Database) │22│ ┌─────────┐ │ │ ┌─────────┐ │ │ ┌─────────┐ │23│ │ Events │ │ │ │ Handler │ │ │ │ Tables │ │24│ └─────────┘ │ │ │ Logic │ │ │ │ Views │ │25│ │ │ └─────────┘ │ │ │ Cache │ │26└─────────────┘ └─────────────┘ └─────────────┘27```2829### 2. Projection Types3031| Type | Description | Use Case |32| -------------- | --------------------------- | ---------------------- |33| **Live** | Real-time from subscription | Current state queries |34| **Catchup** | Process historical events | Rebuilding read models |35| **Persistent** | Stores checkpoint | Resume after restart |36| **Inline** | Same transaction as write | Strong consistency |3738## Templates and detailed worked examples39…
Excerpt shown under the repository's MIT license.
