projection-patterns

Project event streams into queryable read models with Python templates.

1|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/mokbhai/claude --skill projection-patterns-mokbhai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/mokbhai/claude/tree/main/skills/projection-patterns
Command: npx skills add https://github.com/mokbhai/claude --skill projection-patterns-mokbhai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams convert streams of events into readable, queryable read models by applying projection patterns across event-sourced systems. It provides architecture guidance, patterns for Live, Catchup, Persistent, and Inline projections, and ready-to-use template code to implement projections against common stores.

Core Features & Use Cases

  • Live projections: real-time updates of read models from new events.
  • Catchup projections: rebuild read models from historical streams.
  • Persistent checkpoints: store progress to resume after failures.
  • Template code: Python-based projectors and examples for PostgreSQL and Elasticsearch.
  • Use Case: Build a materialized view for customer orders that powers dashboards and fast queries.

Quick Start

Create a projection by defining a Projection subclass, register it with a Projector, and run the projection to materialize a read model from your event stream.

Frequently Asked Questions about projection-patterns

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

FAQPage Schema
How do I build queryable read models from event streams?

To build queryable read models from event streams, you project events into materialized views using a Projection subclass. Register it with a Projector to apply transactional upserts and generate fast, readable views for CQRS architectures.

What is the best way to rebuild a read model from historical event-sourced data?

Rebuilding a read model from historical event-sourced data uses Catchup projections. This pattern replays past event streams to reconstruct materialized views, allowing you to restore or migrate read model state without disrupting live queries.

Can I use Python to create projections for PostgreSQL and Elasticsearch?

Yes, you can use Python to create projections for PostgreSQL and Elasticsearch. The skill provides ready-to-use Python template code and optional integrations for both platforms to apply transactional upserts and materialize queryable views.

How does checkpointing work for event-sourced projections?

Checkpointing for event-sourced projections works by persistently storing processing progress. This allows the projector to resume materializing read models from the last saved point after a failure, ensuring deterministic recovery without reprocessing the entire stream.

When do I need live projections versus inline projections in CQRS?

You need live projections in CQRS for real-time dashboard updates as new events arrive, while inline projections apply state changes synchronously within the write operation. Choose based on whether immediate query availability or write-time consistency is required.