projection-patterns

Implement projection patterns for event-sourced systems with Python templates.

3|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/DrLuggels/my_dhbw --skill projection-patterns-drluggels
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/DrLuggels/my_dhbw/tree/main/.claude/plugins/backend-development/skills/projection-patterns
Command: npx skills add https://github.com/DrLuggels/my_dhbw --skill projection-patterns-drluggels

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and practical templates for building efficient read models and projections from event streams, crucial for optimizing query performance in event-sourced systems.

Core Features & Use Cases

  • CQRS Read Models: Implement the read side of Command Query Responsibility Segregation.
  • Materialized Views: Create and maintain denormalized views of data for faster querying.
  • Performance Optimization: Reduce database load by serving queries from optimized read models.
  • Use Case: When implementing a new feature that requires real-time reporting on order statuses, use this Skill to define and build a projection that aggregates order events into a queryable order_summary table.

Quick Start

Use the projection-patterns skill to create an OrderSummaryProjection using the provided template.

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 Python?

To build read models from event streams, you implement projection patterns that subscribe to events and update materialized views. This Skill provides Python templates for creating queryable projections like order summaries to optimize CQRS read-side performance.

What is a projection pattern in event sourcing?

A projection pattern in event sourcing is a mechanism that processes event streams to build and maintain denormalized read models. It translates append-only event data into materialized views, allowing you to query current state without replaying the entire event history.

How do I optimize CQRS query performance for real-time dashboards?

You optimize CQRS query performance by creating aggregating projections that maintain pre-calculated materialized views. This reduces database load by serving real-time dashboard queries directly from optimized read models instead of computing aggregates on demand.

Can I create Elasticsearch search projections using these Python templates?

Yes, you can create Elasticsearch search projections. The Skill includes specific Python templates for building search projections alongside basic, order summary, aggregating, and multi-table projections to handle various querying needs.

When should I use multi-table projections instead of basic read models?

You should use multi-table projections when your read model requires complex data relationships that cannot be captured in a single flat table. They allow you to populate multiple interconnected tables simultaneously from a single event stream for comprehensive querying.