Skip to content
alyn
wshobson

Projection Patterns skill

Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.

$npx skills add wshobson/agents --skill projection-patterns
GitHub stars
42,399
Pack installs
2.6M
Alyn Score
81/99
Updated
2 days ago
License
MIT

wshobson

Projection Patterns

Install Projection Patterns

Pick your agent. Every command is ready to paste.

$npx skills add wshobson/agents --skill projection-patterns

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads projection-patterns when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the projection-patterns skill”. In Codex, type $projection-patterns.

The skill itself

SKILL.md

GitHub

Projection Patterns

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

Type Description Use Case
Live Real-time from subscription Current state queries
Catchup Process historical events Rebuilding read models
Persistent Stores checkpoint Resume after restart
Inline Same transaction as write Strong 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

Tips for Projection Patterns

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It bundles reference files. The agent reads them only when needed, so they cost no context until then.
  • • It is part of a pack with 40 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Projection Patterns

What does the Projection Patterns skill do?

Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.

How do I install Projection Patterns?

Run "npx skills add wshobson/agents --skill projection-patterns" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Projection Patterns work in Cursor and Codex?

Yes. Projection Patterns uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Projection Patterns free?

Projection Patterns is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.

Who made Projection Patterns?

Projection Patterns is published by wshobson in the wshobson/agents repository, together with 39 other skills.

Similar skills. From other creators.