Install any skill in seconds. Free to start, no credit card required.
Get Started Free →nwave-ai/nw-ddd-eventsourcing
Event Sourcing and CQRS as DDD implementation patterns — when to use, aggregate event streams, projections, snapshots, sagas, upcasting, conflict resolution
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
and 1 more in the full report
3 fixed18 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
We need to build a system that accepts daily CSV batch uploads of product lookup prices, stores the latest prices, and serves them via a REST API. The system has no domain behavior or business rules beyond overwriting product price records. How should we implement the data layer?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends relational or key-value direct state storage rather than Event Sourcing | Missed | Passed |
| Identifies data-in data-out domains as poor candidates for Event Sourcing | Missed | Passed |
The instructions your model reads when the skill loads.
Implementation patterns for DDD. Event Sourcing stores every state change as an immutable event and derives current state from replay. CQRS separates write and read models. These are tools, not mandatory architecture -- apply selectively to domains where they add value.
ES adds value when:
ES is overkill when:
Key question: "Does knowing the history of how we got here provide business value?" Yes -> consider ES. No -> traditional CRUD is simpler.
Events are immutable records of things that happened. Past tense: OrderPlaced, PaymentReceived, ItemShipped.
Event structure: Include all data needed to understand what happened (self-contained) | Use domain language | One event per meaningful business fact | Events carry data only, no behavior
Granularity: Too coarse (OrderUpdated { order: {...} }) loses what changed. Too fine (OrderFieldChanged { field, old, new }) is generic audit log. Just right (OrderConfirmed { orderId, confirmedBy, confirmedAt }) has clear business meaning.
Single source of truth. Core operations:
append(streamId, expectedVersion, events) -> success or concurrency conflictread(streamId) -> ordered list of eventssubscribe(filter) -> push notification for new eventsProperties: Append-only (never modify/delete) | Ordered within stream | Immutable | Versioned (each event has position)
test cases passed, vs 19 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.