wshobson avatar

Projection Patterns

If you're building event-sourced systems with CQRS, you'll eventually need to create read models from your event streams, and that's where this becomes essential. It provides concrete projector implementations that handle the mechanics of consuming events, maintaining checkpoints, and updating read models in databases or search indexes. The templates cover real scenarios like building order summaries from multiple event types and syncing data to Elasticsearch. What I appreciate is the focus on practical concerns like batch processing, error handling, and projection rebuilding. It's the kind of code you'd write anyway, but having tested patterns saves you from reinventing the checkpoint management and event handling infrastructure.

skills.sh installs
10.9K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill projection-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
DevOps & CI/CD, Debugging

More from wshobson/agents

All 174
1wshobson avataron-call-handoff-patternswshobson/agentsMaster on-call shift handoffs with context transfer, escalation procedures, and documentation. Use this skill when transitioning on-call responsibilities betwee10.7Kskills.sh installs
2flutter avatarflutter-building-layoutsflutter/skillsMaster Flutter's constraint system to build responsive, overflow-free layouts efficiently.10.7Kskills.sh installs
3msw-git avatarmsw-scriptingmsw-git/msw-ai-coding-plugins-officialAuthoring MSW scripts (.mlua) plus integrated playtest and debugging. Covers mlua syntax, annotations (@Component/@Logic/@ExecSpace/@Sync), lifecycle, exec spac10.7Kskills.sh installs
4msw-git avatarmsw-avatarmsw-git/msw-ai-coding-plugins-officialMSW avatar management — costume (CostumeManagerComponent, 17 slots) + animation 3-layer pipeline (StateComponent → AvatarStateAnimationComponent → AvatarRendere10.6Kskills.sh installs
5msw-git avatarmsw-combat-systemmsw-git/msw-ai-coding-plugins-officialMSW combat system integration guide. Covers the Attack→Hit pipeline, damage model, i-frame, knockback, Hit Stop, Camera Shake, Sprite Flash, SFX, death/revive, 10.6Kskills.sh installs
6msw-git avatarmsw-behaviourtreemsw-git/msw-ai-coding-plugins-officialAuthors MSW `.behaviourtree` files end-to-end and maintains the project-specific authoring spec (`.behaviourDocs/bt-spec.md`). Scans every `.codeblock` whose pa10.5Kskills.sh installs