$npx -y skills add tranhieutt/software_development_department --skill event-sourcing-architectDesigns event-sourced systems with CQRS, event stores, projections, and eventual consistency patterns. Use when architecting event-driven systems or when the user mentions event sourcing, CQRS, event store, or domain events.
| 1 | # Event Sourcing Architect |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | ## Capabilities |
| 6 | |
| 7 | - Event store design and implementation |
| 8 | - CQRS (Command Query Responsibility Segregation) patterns |
| 9 | - Projection building and read model optimization |
| 10 | - Saga and process manager orchestration |
| 11 | - Event versioning and schema evolution |
| 12 | - Snapshotting strategies for performance |
| 13 | - Eventual consistency handling |
| 14 | |
| 15 | ## Use this skill when |
| 16 | |
| 17 | - Building systems requiring complete audit trails |
| 18 | - Implementing complex business workflows with compensating actions |
| 19 | - Designing systems needing temporal queries ("what was state at time X") |
| 20 | - Separating read and write models for performance |
| 21 | - Building event-driven microservices architectures |
| 22 | - Implementing undo/redo or time-travel debugging |
| 23 | |
| 24 | ## Do not use this skill when |
| 25 | |
| 26 | - The domain is simple and CRUD is sufficient |
| 27 | - You cannot support event store operations or projections |
| 28 | - Strong immediate consistency is required everywhere |
| 29 | |
| 30 | ## Instructions |
| 31 | |
| 32 | 1. Identify aggregate boundaries and event streams |
| 33 | 2. Design events as immutable facts |
| 34 | 3. Implement command handlers and event application |
| 35 | 4. Build projections for query requirements |
| 36 | 5. Design saga/process managers for cross-aggregate workflows |
| 37 | 6. Implement snapshotting for long-lived aggregates |
| 38 | 7. Set up event versioning strategy |
| 39 | |
| 40 | ## Safety |
| 41 | |
| 42 | - Never mutate or delete committed events in production. |
| 43 | - Rebuild projections in staging before running in production. |
| 44 | |
| 45 | ## Best Practices |
| 46 | |
| 47 | - Events are facts - never delete or modify them |
| 48 | - Keep events small and focused |
| 49 | - Version events from day one |
| 50 | - Design for eventual consistency |
| 51 | - Use correlation IDs for tracing |
| 52 | - Implement idempotent event handlers |
| 53 | - Plan for projection rebuilding |
| 54 | - Use durable execution for process managers and sagas — frameworks like DBOS persist workflow state automatically, making cross-aggregate orchestration resilient to crashes |
| 55 | |
| 56 | ## Related Skills |
| 57 | |
| 58 | Works well with: `saga-orchestration`, `architecture-patterns`, `dbos-*` |
| 59 | |
| 60 | ## When to Use |
| 61 | |
| 62 | - Use when 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 e... |