ClaudeCodeMod

All shelves / Skills

projection-patterns

wshobson/agents · 11.2k installs · 42.1K stars

Skill Comprehensive guide to building projections and read models for event-sourced systems.

Install

The repo has no one-line install. Follow its README.

Open the repo

Files

SKILL.md

Projection Patterns

Comprehensive guide to building projections and read models for event-sourced systems.

When to Use This Skill

  • 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

Core Concepts

1. Projection Architecture
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Event Store │────►│ Projector   │────►│ Read Model  │
│             │     │             │     │ (Database)  │
│ ┌─────────┐ │     │ ┌─────────┐ │     │ ┌─────────┐ │
│ │ Events  │ │     │ │ Handler │ │     │ │ Tables  │ │
│ └─────────┘ │     │ │ Logic   │ │     │ │ Views   │ │
│             │     │ └─────────┘ │     │ │ Cache   │ │
└─────────────┘     └─────────────┘     └─────────────┘
2. Projection Types
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

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's
  • Make projections idempotent - Safe to replay
  • Use transactions - For multi-table updates
  • Store checkpoints - Resume after failures
  • Monitor lag - Alert on projection delays
  • Plan for rebuilds - Design for reconstruction
Don'ts
  • Don't couple projections - Each is independent
  • Don't skip error handling - Log and alert on failures
  • Don't ignore ordering - Events must be processed in order
  • Don't over-normalize - Denormalize for query patterns

Facts

Kind
Skill
Repo
wshobson/agents
Group
Uncategorized
Installs
11.2k
Stars
42.1K

Same repo on other shelves

Marketplaces

  1. 16wshobson/agentswshobson/agentsMulti-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, Google Antigravity, and Pi42.8k

From the same repo

  1. 2768employment-contract-templateswshobson/agents11.2k
  2. 2778slo-implementationwshobson/agents11.1k
  3. 2796defi-protocol-templateswshobson/agents11.1k
  4. 2815team-composition-analysiswshobson/agents11k
  5. 2817mtls-configurationwshobson/agents11k
  6. 2821on-call-handoff-patternswshobson/agents11k