Skip to content

Projection Patterns

Guides building read models and materialized views from event streams in event-sourced systems.

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

When installed, the agent gets guidance on designing projections, which turn a stream of recorded events into query-friendly read models such as database tables, views, caches or search indexes. It explains common projection types (live, catchup, persistent, inline), when to use each, and practical do's and don'ts such as making projections idempotent, storing checkpoints and monitoring lag. Detailed templates are in a reference file the agent reads when needed.

Great for

  • Backend developers implementing CQRS read sides in an event-sourced system
  • Teams building materialized views or real-time dashboards from event data
  • Engineers who need to rebuild or resume read models after failures

Skip it if

  • Simple CRUD apps without event sourcing, where the pattern adds complexity without benefit
  • Anyone expecting ready-made code for a specific framework, since the skill describes general patterns and its SKILL.md contains no runnable code

Try asking

  • “Design a projection that builds a customer order summary table from an order-events stream”
  • “Explain when to use an inline projection versus a persistent catchup projection in my CQRS system”
  • “Help me make my read-model projector idempotent and resumable after a restart”
  • “Outline how to monitor projection lag and plan for rebuilding a materialized view”
Step-by-step guide: how to use Projection PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    projection-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip projection-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip projection-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Name your event store and database (for example EventStoreDB, Kafka, PostgreSQL) so the agent can tailor the advice to your stack
  • Ask for a specific template from references/details.md rather than a general overview to get concrete code structure
  • Review any generated projection code for ordering and error-handling assumptions before running it against production data

What's inside

  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.