projection-patterns
π―SkillA guide for apps that save every change as a separate record. It shows how to turn those records into ready-made tables that are quick to search and read, for things like dashboards and reports.
Installation
npx skills add wshobson/agents --skill projection-patternsRun it in a terminal; it asks which AI coding tools to install it for (Claude Code, Codex, Cursor and more).
Uses skills.sh Β· Node.js 22.20+
After installing
Ask for related work and the agent uses it on its own, or call it yourself.
/projection-patternsInstall by hand
Copy the whole skill folder from GitHub to the place below. Copying only SKILL.md can leave out files the skill uses.
Open the skill folder β- This project
.claude/skills/projection-patterns/ - All projects
~/.claude/skills/projection-patterns/
These paths are for Claude Code. For other tools, the command above puts it in the right place.
What this skill does
Overview
Some apps use event sourcing, which means they save every change as its own record, called an event. Reading data straight from these events can be slow. This skill shows how to build projections, which are separate tables built from the events and shaped for fast reading.
Key Features
- Learn four kinds of projections, such as live updates or rebuilding from old events.
- Build read models, which are tables made only for fast lookups.
- Create search indexes and real-time dashboards from your events.
- Save checkpoints so a projection can resume where it stopped after a crash.
- Follow a clear list of do's and don'ts, like processing events in order.
Who is this for?
This is for developers working on apps that store events instead of only the latest data. It helps when reading data has become slow or when you need new views of the same data. Full templates and worked examples are in references/details.md.
Summarized by AI from this skill's SKILL.md. Suggest a better one
SKILL.md
View on GitHub β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.
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
More from this repository10
Helps you build a consistent look for your app with Tailwind CSS v4. It sets up shared colors, sizes, dark mode and reusable components so every screen matches.
A guide to TypeScript's advanced type features, which describe the shape of your data so mistakes are caught before the code runs. It covers reusable types, types that change based on rules, and built-in helper types, with short examples.
Guidance for building reliable server-side apps with Node.js, using Express or Fastify. It covers login, error handling, databases, API design and a list of proven best practices.
Intelligent automation and multi-agent orchestration for Claude Code
Claude Code plugin for AI-powered framework migration workflows, coordinating specialized agents to plan and execute transitions between technology stacks as part of the wshobson/agents marketplace.
A Claude Code plugin for payment system integration covering Stripe, PayPal, and billing platforms with checkout flows, subscription management, and webhook handling in the wshobson/agents ecosystem.
A Claude Code plugin bundling core development tools and agents for everyday tasks like debugging and code generation, part of the wshobson/agents marketplace with 73 focused plugins.
Claude Code plugin for observability and monitoring including logging, metrics, distributed tracing, and alerting, part of the wshobson/agents marketplace with 73 focused plugins.
A Claude Code plugin providing specialized AI agents for deployment strategy planning and execution, covering blue-green deployments, canary releases, rolling updates, and zero-downtime patterns.
Claude Code plugin for JVM language development including Java, Kotlin, and Scala with specialized agents for idiomatic patterns, build tools, and runtime optimization in the wshobson/agents marketplace.