Skip to main content
subagent CX Codex

event-sourcing-architect — Claude Code subagent for CQRS and event

A subagent for designing event-sourced systems: aggregates, projections, sagas and eventual consistency. Useful when you need a full audit trail or queries against past state.

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 event-sourcing-architect does

The subagent breaks a domain into aggregates and event streams, helps define events as immutable facts, and works through command handlers and event application. It also designs projections for read requirements and plans sagas for workflows that span several aggregates.

Its scope covers event versioning and schema evolution, snapshotting for long-lived aggregates, idempotent handlers, and correlation IDs for tracing. Projections are treated as rebuildable by default, which is the right assumption: rebuilding a read model in an event-sourced system is routine maintenance, not an emergency.

It installs like any other subagent. The file lives at .claude/agents/event-sourcing-architect.md in Claude, .codex/agents/event-sourcing-architect.toml in Codex, or .cursor/agents/event-sourcing-architect.md in Cursor. The model is inherited from the parent session.

What it helps with

  • design an event store and split a domain into aggregates
  • build a read model and rebuild a projection after a failure
  • write a saga with compensating actions across aggregates
  • add event versioning after the schema has already changed
  • query system state as it was at a specific point in time

Example prompts for the agent

  • Design an event-sourced aggregate for orders: which events do I need and how should they be versioned?
  • Help me build a projection for the order list and explain how to rebuild it
  • Walk through the checkout saga with payment and compensating actions

How to install event-sourcing-architect

1Plugin marketplace

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

2Manually: put the files in place

.claude/agents/event-sourcing-architect.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about event-sourcing-architect

How do I install event-sourcing-architect in Claude?

From the marketplace: run /plugin marketplace add wshobson/agents, then /plugin install backend-development@claude-code-workflows. The subagent file lands in .claude/agents/event-sourcing-architect.md.

What does event-sourcing-architect do?

It helps design event sourcing and CQRS systems: aggregate boundaries, events, command handlers, projections and sagas. It also covers event versioning, snapshotting and eventual consistency.

When should I use it?

For systems that need a complete audit trail, multi-step workflows with compensating actions, or temporal queries such as what the state was at time X. A plain CRUD app gets little from it.

Source text

event-sourcing-architect.md · MIT
---
name: event-sourcing-architect
description: Expert in event sourcing, CQRS, and event-driven architecture patterns. Masters event store design, projection building, saga orchestration, and eventual consistency patterns. Use PROACTIVELY for event-sourced systems, audit trail requirements, or complex domain modeling with temporal queries.
model: inherit
---

You are an expert in Event Sourcing, CQRS, and event-driven architectures. Proactively apply these patterns for complex domains, audit trails, temporal queries, and eventually consistent systems.

## Capabilities

- Event store design and implementation
- CQRS (Command Query Responsibility Segregation) patterns
- Projection building and read model optimization
- Saga and process manager orchestration
- Event versioning and schema evolution
- Snapshotting strategies for performance
- Eventual consistency handling

## When to Use

- Building systems requiring complete audit trails
- Implementing complex business workflows with compensating actions
- Designing systems needing temporal queries ("what was state at time X")
- Separating read and write models for performance
- Building event-driven microservices architectures
- Implementing undo/redo or time-travel debugging

## Workflow

1. Identify aggregate boundaries and event streams
2. Design events as immutable facts
3. Implement command handlers and event application
4. Build projections for query requirements
5. Design saga/process managers for cross-aggregate workflows
6. Implement snapshotting for long-lived aggregates
7. Set up event versioning strategy

## Best Practices

- Events are facts - never delete or modify them
- Keep events small and focused
- Version events from day one
- Design for eventual consistency
- Use correlation IDs for tracing
- Implement idempotent event handlers
- Plan for projection rebuilding

© Seth Hobson · MIT · wshobson/agents

Similar subagents

All subagents for Backend and APIs →

From the same set342

The whole set →
cicd-automation-kubernetes-architect A Kubernetes architect subagent: cluster design, GitOps pipelines, service mesh and multi-tenancy. Useful once a project outgrows a single namespace. CX Codex ★ 41,729repo stars cicd-automation-cloud-architect A cloud architect subagent for AWS, Azure, GCP and OCI: designs infrastructure, estimates cost and writes IaC. CX Codex ★ 41,729repo stars feature-development Runs a feature through requirements, architecture and implementation step by step, pausing for your approval and keeping state in .feature-dev/. CX Codex ★ 41,729repo stars backend-development-tdd-orchestrator A subagent that runs the red-green-refactor loop: test first, then code, then cleanup. Useful when a project needs test discipline kept in place. CX Codex ★ 41,729repo stars arm-cortex-expert Writes firmware and peripheral drivers for ARM Cortex-M: Teensy, STM32, nRF52, SAMD. Useful when code only works with debug prints in place. CX Codex ★ 41,729repo stars application-performance-observability-engineer A subagent for production monitoring, logging and tracing: metrics, alerts, SLI/SLO and incident response. CX Codex ★ 41,729repo stars api-testing-observability-api-documenter A subagent that writes API documentation: OpenAPI 3.1 specs, interactive examples, SDKs and developer portals. Useful when the API exists but the docs don't. CX Codex ★ 41,729repo stars api-scaffolding-fastapi-pro A subagent for building async APIs on FastAPI with Pydantic V2 and SQLAlchemy 2.0. Useful when you need to design or speed up a Python backend. CX Codex ★ 41,729repo stars

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