implement-event-sourcing

Implement event-sourced domains with replayable history, snapshots, and projections.

Updated Oct 27, 2025
One-click install
npx skills add https://github.com/mariotoffia/gobridge --skill implement-event-sourcing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implement-event-sourcing
Source: https://github.com/mariotoffia/gobridge/tree/main/.cursor/skills/implement-event-sourcing
Command: npx skills add https://github.com/mariotoffia/gobridge --skill implement-event-sourcing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured guide for implementing event sourcing, including storing state changes as immutable events, replaying them to reconstruct current state, and rebuilding projections from the event log.

Core Features & Use Cases

  • Event Store Design: an append-only store with versioning and optimistic concurrency control.
  • Aggregate Replay & Snapshots: reconstruct domain state by replaying events; use snapshots to improve performance.
  • Projections & Upcasting: derive read models from events and evolve schemas with upcasters.

Quick Start

Start by defining your domain events, configure an event store to persist them, and build a projection to query the read model. Then spawn a test scenario that creates events, replays history, and validates the resulting aggregate state.

Frequently Asked Questions about implement-event-sourcing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement event sourcing with CQRS and DDD?

Implement event sourcing by defining immutable domain events, persisting them to an append-only event store with versioning, and rebuilding state through replay. This approach separates write models from read projections, fitting naturally with CQRS and DDD architectures.

What is the best way to rebuild aggregate state from an event store?

Rebuild aggregate state by replaying the immutable event log sequentially to reconstruct current domain state. To optimize performance for large event streams, periodically save aggregate snapshots and restore from the nearest snapshot before replaying subsequent events.

How do I evolve event schemas in an event-sourced system?

Evolve event schemas in an event-sourced system by applying upcasters to transform outdated events into the current version. This allows you to handle schema changes without migrating the append-only event store, ensuring replayable history remains compatible.

How do I generate read models from an event-sourced aggregate?

Generate read models by building projections that subscribe to the event log and derive query-optimized views. This allows you to create tailored read models for specific queries while the event store remains the single source of truth for domain state.

Can I use event sourcing in a microservices and event-driven architecture?

Yes, event sourcing fits microservices and event-driven workflows by using an append-only event store to persist state changes. It enforces optimistic concurrency control and enables reliable event replay across distributed services.

When should I use snapshots in an event-sourced domain?

Use snapshots in an event-sourced domain when replaying large event streams becomes a performance bottleneck during aggregate reconstruction. Snapshots capture the state at a specific version, reducing the number of events you must replay to restore current domain state.