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.
/plugin marketplace add wshobson/agents
/plugin install backend-development@claude-code-workflowsWhat 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-workflows2Manually: put the files in place
.claude/agents/event-sourcing-architect.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/event-sourcing-architect.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/event-sourcing-architect.mdCursor also reads .claude/agents/
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