projection-patterns

Transform event streams into read models for CQRS queries and analytics.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/haxlys/skills --skill projection-patterns-haxlys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/haxlys/skills/tree/main/vendored/wshobson-agents/plugins/backend-development/skills/projection-patterns
Command: npx skills add https://github.com/haxlys/skills --skill projection-patterns-haxlys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Builds robust projections and read models from event streams to enable fast, scalable querying, analytics, and CQRS workflows across services.

Core Features & Use Cases

  • Projection Architecture: transforms events into read models by routing event data through projectors to denormalized storage.
  • Projection Types: Live, Catchup, Persistent, Inline for different latency and consistency requirements.
  • Templates & Examples: Basic Projector, Order Summary, Elasticsearch-backed search projection, daily aggregates, and multi-table projections.
  • Use Case: Power dashboards and order histories by materializing commonly queried views from event streams.

Quick Start

Create a simple projection using the Basic Projector template to start consuming your event stream and building a read model.

Frequently Asked Questions about projection-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build read models from event streams for CQRS queries?

You build read models by routing event stream data through projectors into denormalized storage. This transforms domain events into fast, queryable projections, enabling scalable CQRS workflows and analytics across your services.

What is the difference between live, catchup, and persistent projection modes?

Live, catchup, and persistent projection modes handle different latency and consistency requirements. Live processes new events in real-time, catchup rebuilds historical state, and persistent maintains continuous updates to read models.

What is the best way to create an Elasticsearch search index from event sourcing?

The Elasticsearch-backed search projection template transforms event stream data into an indexed search model. It denormalizes domain events into a structure optimized for Elasticsearch, enabling fast text search and analytics.

Can I use projection templates to generate daily aggregates and order summaries?

Yes, the Order Summary and daily aggregate templates project event streams into denormalized read models. These templates materialize commonly queried views, powering dashboards and order histories from domain events.

Do I need a base Projection type to implement event-sourcing projections?

Yes, this approach requires a projection framework with a base Projection type. It provides the structural foundation for routing event stream data through projectors and transactionally updating denormalized read models.

How does inline projection differ from persistent projection for read models?

Inline projection updates read models synchronously within the same transaction as the event stream write. Persistent projection operates asynchronously, maintaining continuously updated read models without blocking write operations.