projection-patterns

Build read models from event streams using projection logic.

Updated May 16, 2026
One-click install
npx skills add https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory --skill projection-patterns-p-o-ke-nae
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory/tree/main/.github/skills/projection-patterns
Command: npx skills add https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory --skill projection-patterns-p-o-ke-nae

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you turn event streams into optimized read models so queries stay fast, reporting stays current, and complex system state becomes easy to consume.

Core Features & Use Cases

  • Projection Design: Structure projectors that consume events and update query-friendly views.
  • Read Model Optimization: Denormalize and aggregate data for dashboards, search, analytics, and user-facing lookups.
  • Operational Reliability: Support checkpoints, replay, rebuilds, ordering, and idempotent updates for event-sourced systems.
  • Use Case: A product team can use this Skill to build a live order summary table, a daily sales report, or a customer activity view from the same event stream.

Quick Start

Ask for a projection design that transforms your event stream into a read model for your specific query pattern.

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 in a CQRS architecture?

To build read models from event streams, you apply projection logic that consumes events and updates denormalized query stores. This creates optimized, query-friendly views for fast lookups, dashboards, and reporting in event-sourced systems.

What is the best way to keep materialized views updated without losing event ordering?

To keep materialized views updated reliably, you need ordered event processing combined with checkpoints. This tracks the last processed event, ensuring your read models stay current and can resume safely without missing updates.

How do I handle multi-table updates when projecting events to a read model?

To handle multi-table updates during event projection, you should use transactions. This ensures that all related tables in your denormalized query store are updated atomically, maintaining data consistency across complex reporting views.

Why do my event sourcing projections produce duplicate data on replay?

Duplicate data on replay occurs when projection handlers are not idempotent. You must implement idempotent handlers so applying the same event multiple times yields the same read model state, allowing safe rebuilds of persistent projections.

When do I need to rebuild persistent projections in an event-sourced system?

You need to rebuild persistent projections when your read model schema changes or data becomes corrupted. Because projections are derived from event streams, you can replay events from the beginning using checkpoints to restore the correct state.

Can I use event projections for search indexes and daily sales reporting?

Yes, you can use event projections to populate search indexes and daily sales reports. By denormalizing and aggregating event stream data, projections create specialized query stores optimized for analytics and user-facing lookups.