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.
Comprehensive guide to building projections and read models for event-sourced systems.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Event Store │────►│ Projector │────►│ Read Model │
│ │ │ │ │ (Database) │
│ ┌─────────┐ │ │ ┌─────────┐ │ │ ┌─────────┐ │
│ │ Events │ │ │ │ Handler │ │ │ │ Tables │ │
│ └─────────┘ │ │ │ Logic │ │ │ │ Views │ │
│ │ │ └─────────┘ │ │ │ Cache │ │
└─────────────┘ └─────────────┘ └─────────────┘
| Type | Description | Use Case | | -------------- | --------------------------- | ---------------------- | | Live | Real-time from subscription | Current state queries | | Catchup | Process historical events | Rebuilding read models | | Persistent | Stores checkpoint | Resume after restart | | Inline | Same transaction as write | Strong consistency |
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/projection-patterns · pinned to the source commit
git clone https://github.com/wshobson/agents.git
cd agents
git checkout d82998e7df393c671ede2387a8435075f0b633f5
mkdir -p ".claude/skills/projection-patterns"
cp -r "plugins/backend-development/skills/projection-patterns" ".claude/skills/projection-patterns"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit d82998e7df39. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.