Skip to main content
skill Claude Code CX Codex Cursor

projection-patterns — Claude Code skill: projections and setup

Build read models from event streams with guidance on projection types and replay. Useful for CQRS read sides, materialized views, and search indexes.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflows
Open on GitHub

What projection-patterns does

The skill walks through a projection pipeline: an Event Store feeds a projector, which updates a read model. It covers live projections for current-state queries, catchup projections for historical events, persistent projections with checkpoints, and inline projections that share a transaction with writes.

Its guidance covers safe replay, transactions for multi-table updates, lag monitoring, and rebuilding read models. Concrete templates and worked examples are in references/details.md. Events need to be processed in order, and failures should be logged and monitored. Install it when your project derives read models from events; it is not aimed at ordinary query work without event sourcing.

What it helps with

  • build a CQRS read model from events
  • rebuild a materialized view from event history
  • create a search index from an event stream
  • aggregate data across streams
  • resume a projection after failure using a checkpoint

Example prompts for the agent

  • Design a CQRS read model for these events.
  • Show how to rebuild this projection from history and store a checkpoint.
  • How should I create a search index from this event stream while preserving event order?

How to install projection-patterns

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflows

This installs the whole backend-development plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill projection-patterns -a claude-code

3Manually: put the files in place

~/.claude/skills/projection-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/projection-patterns/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

prisma-postgres prisma A deprecated compatibility name for prisma-postgres-setup. Use it only when explicitly invoked; new projects should select prisma-postgres-setup instead. Claude Code CX Codex Cursor +1 380,400installs prisma-postgres-setup prisma Provisions or connects a Prisma Postgres database and links it to your app. Useful for spinning up dev databases quickly or wiring connections in Vercel and v0. Claude Code CX Codex Cursor +1 374,900installs prisma-upgrade-v7 prisma Complete migration guide from Prisma ORM v6 to v7 with all critical changes: new generator, required driver adapters, ESM config, and client imports. Use when upgrading Prisma or hitting v7 errors. Claude Code CX Codex Cursor +1 374,800installs build-zoom-contact-center-app official anthropics Reference skill for Zoom Contact Center architecture. It guides integrations across desktop client apps, web embeds, and native iOS or Android SDKs. Claude Code CX Codex Cursor +1 2,100installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs lark-im larksuite This skill lets an agent work with Lark IM messages, chats, files, and interactive cards. Use it when coding tasks need access to team conversations. Claude Code CX Codex Cursor +1 472,300installs lark-event larksuite Listens to Lark/Feishu events and streams them as NDJSON. Use it for bots, message processing, and long-running subscribers. Claude Code CX Codex Cursor +1 466,200installs

Questions about projection-patterns

How do I install projection-patterns in Claude Code?

Run npx skills add wshobson/agents --skill projection-patterns -a claude-code. The supplied commands also include /plugin marketplace add wshobson/agents followed by /plugin install backend-development@claude-code-workflows.

What does projection-patterns do?

It explains how to build read models and projections from events, covering current-state queries and rebuilding from historical events.

Where are the templates and worked examples?

They are in references/details.md; the skill points to that file for concrete templates.

Source text

SKILL.md · MIT
---
name: projection-patterns
description: 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

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor