projection-patterns

Provide Python templates for building projections and read models from event streams.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill projection-patterns-himanshu040604
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: projection-patterns
Source: https://github.com/Himanshu040604/codex-skills-setup/tree/main/assets/codex/skills/claude-import/skills/plugins/backend-development%40claude-code-workflows/skills/projection-patterns
Command: npx skills add https://github.com/Himanshu040604/codex-skills-setup --skill projection-patterns-himanshu040604

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires asyncpg, elasticsearch, asyncio, and includes scripts (resource) and references (resource) components.

What problem does it solve?

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

Core Features & Use Cases

  • CQRS Read Sides: Implement the read side of Command Query Responsibility Segregation.
  • Materialized Views: Create and maintain optimized views of data derived from events.
  • Performance Optimization: Improve query speeds by denormalizing data into specific read models.
  • Use Case: When building a system where orders are event-sourced, use this skill to create a order_summary projection that aggregates order status, total amount, and item count for quick retrieval by a frontend dashboard.

Quick Start

Use the projection-patterns skill to generate a basic projector 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 an event-sourced system?

To build read models from event streams, you implement projections that subscribe to events and update materialized views. This skill provides Python templates for live, catchup, persistent, and inline projections to create optimized query views for your CQRS read side.

What is the best way to optimize query performance for CQRS read sides?

The best way to optimize query performance for CQRS read sides is to denormalize data into specific projections. This skill provides patterns to aggregate event stream data into materialized views, enabling quick retrieval without querying the event store directly.

Does this skill support database integration with asyncpg for projections?

Yes, this skill supports database integration with asyncpg for projections. It includes Python templates that utilize asyncpg alongside asyncio to efficiently manage and persist event-driven projections into your database.

Can I use Elasticsearch for search indexing in event-driven architecture projections?

Yes, you can use Elasticsearch for search indexing in event-driven architecture projections. This skill provides specific templates for indexing events into Elasticsearch, allowing you to maintain searchable read models derived from your event streams.

When should I use live projections versus catchup or persistent projections?

You should use live projections for real-time updates, catchup projections to rebuild historical state, and persistent projections to maintain continuous, fault-tolerant read models. This skill details each type to help you choose the right pattern for your event-sourced system.