Projection Patterns

SkillAI & models

projection-patterns is a skill that helps an AI agent build read models and projections from event streams. It covers implementing CQRS read sides, building materialized views, and optimizing query performance in event-sourced systems.

Use Projection Patterns in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Projection Patterns and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Projection Patterns skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Have an event-sourced system with event streams to project from.

Projection PatternsStart free

What your AI can do with it

  • Build read models and projections from event streams
  • Implement CQRS read sides
  • Build materialized views
  • Optimize query performance in event-sourced systems

Getting started

  1. Have an event-sourced system with event streams to project from.
  2. Add the projection-patterns skill to the agent's available skills.
  3. Ask the agent to build a read model, projection, or materialized view for your queries.

What this skill tells your AI

The instructions your AI receives, as published by sickn33/agentic-awesome-skills in skills/projection-patterns/SKILL.md and read by ahel’s review.

Comprehensive guide to building projections and read models for event-sourced systems.

When to Use This Skill

  • Building CQRS read models
  • Creating materialized views from events
  • Optimizing query performance
  • Implementing real-time dashboards
  • Building search indexes from events
  • Aggregating data across streams

Core Concepts

1. Projection Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Event Store │────►│ Projector   │────►│ Read Model  │
│             │     │             │     │ (Database)  │
│ ┌─────────┐ │     │ ┌─────────┐ │     │ ┌─────────┐ │
│ │ Events  │ │     │ │ Handler │ │     │ │ Tables  │ │
│ └─────────┘ │     │ │ Logic   │ │     │ │ Views   │ │
│             │     │ └─────────┘ │     │ │ Cache   │ │
└─────────────┘     └─────────────┘     └─────────────┘

2. Projection Types

TypeDescriptionUse Case
LiveReal-time from subscriptionCurrent state queries
CatchupProcess historical eventsRebuilding read models
PersistentStores checkpointResume after restart
InlineSame transaction as writeStrong consistency

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Make projections idempotent - Safe to replay
  • Use transactions - For multi-table updates
  • Store checkpoints - Resume after failures
  • Monitor lag - Alert on projection delays
  • Plan for rebuilds - Design for reconstruction

Don'ts

  • Don't couple projections - Each is independent
  • Don't skip error handling - Log and alert on failures
  • Don't ignore ordering - Events must be processed in order
  • Don't over-normalize - Denormalize for query patterns

Signals

GitHub stars
47k
Forks
7k
Last commit
Sep 2026

Others that do the same job

Questions

When should this skill be used?
Use it when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.
What does the skill work with?
It works with event streams in event-sourced systems, helping turn them into read models and projections for faster queries.
Advanced
Item type
skill
Key
projection-patterns
Source
github.com/sickn33/agentic-awesome-skills