npx skills add ...
npx skills add jwilger/agent-skills --skill event-modeling
Event modeling facilitation for discovering and designing event-sourced systems using a structured 9-step workflow. Use when modeling domain workflows, designing event-sourced systems, writing Given/When/Then scenarios for commands or views, validating event models, or discussing event sourcing and domain-driven design. Triggers on: "model this workflow", "event model", "event sourcing", "what events do we need", "write GWT scenarios", "Given/When/Then", "validate the event model", "decompose into slices", "map this domain", "brainstorm events". Also activates for discovering domain actors, identifying automations, mapping integrations, or decomposing workflows into vertical slices. NOT for: implementing event store infrastructure, choosing databases, or writing application code.
npx skills add jwilger/agent-skills --skill event-modeling
Value: Communication -- event modeling is a structured conversation that surfaces hidden domain knowledge and creates shared understanding between humans and agents before any code is written.
Teaches the agent to facilitate event modeling sessions following Martin
Dilger's "Understanding Eventsourcing" methodology. Produces a complete
event model (actors, events, commands, read models, automations, slices)
that drives all downstream implementation. The model lives in
docs/event_model/.
Never jump into detailed workflow design without broad domain understanding first. Phase 1 maps the territory; Phase 2 explores each region.
Phase 1 -- Domain Discovery. Identify what the business does, who the
actors are, what major processes exist, what external systems integrate, and
which workflows to model. Ask these questions of the user; do not assume
answers. Output: docs/event_model/domain/overview.md.
Phase 2 -- Workflow Design. For each workflow, follow the 9-step
process. You MUST follow references/nine-steps.md for the full methodology. Design
one workflow at a time. Complete all 9 steps before starting the next
workflow. Output: docs/event_model/workflows/<name>/overview.md plus
individual slice files in slices/.
Store what happened (events), not just current state. Events are immutable past-tense facts in business language. Every read model field must trace back to an event. If a field has no source event, something is missing from the model.
OrderPlaced, not
PlaceOrder or CreateOrderDTODataUpdated (too broad) and not
FieldXChanged (too narrow)Every event-sourced system uses these patterns. Each pattern maps to one vertical slice.
ReadModel → Command edges
should appear in diagrams. If a command needs to check whether
something already happened (e.g., idempotency), it checks the event
stream, not a read model.
Read models represent meaningful domain projections. Infrastructure
preconditions ("does directory exist?", "is service running?") that
are implicit in the command's execution context do not need their own
read model.Each slice pattern implies a minimum set of architectural layers. A slice is not complete until all required layers are implemented and wired together.
When decomposing a slice, verify that your acceptance criteria and task breakdown cover every required layer. A slice that only implements domain logic without presentation or infrastructure is incomplete — it is a component, not a vertical slice.
After workflow design, generate Given/When/Then scenarios for each slice. These become acceptance criteria for implementation.
Command scenarios: Given = prior events establishing state. When = the command with concrete data. Then = events produced OR an error (never both).
View scenarios: Given = current projection state. When = one new event. Then = resulting projection state. Views cannot reject events.
Critical distinction: GWT scenarios test business rules (state-dependent policies), not data validation (format/structure checks that belong in the type system). If the type system can make the invalid state unrepresentable, it is not a GWT scenario.
You MUST use references/gwt-template.md for the full scenario format and examples.
Every vertical slice MUST include at least one GWT scenario defined at the application boundary:
A GWT scenario that can be satisfied entirely by calling an internal function in a unit test describes a unit-level specification, not a slice acceptance criterion. Slice acceptance criteria must exercise the path from external input to observable output.
Where the application boundary is programmatically testable — HTTP endpoints, CLI output parsing, headless browser automation, message queue assertions, API contract tests, etc. — write automated acceptance tests that exercise the full GWT scenario from external input to observable output. These tests provide fast feedback and serve as living documentation of slice behavior.
Where automated boundary testing is not feasible (complex GUI interactions, hardware-dependent behavior, visual/aesthetic verification), document what the human should manually verify: the specific steps to perform and the expected observable result. This manual verification checklist becomes part of the slice's definition of done.
Slices sharing an event schema are independent. The event schema is the shared contract. Command slices test by asserting on produced events; view slices test with synthetic event fixtures. Neither needs the other to be implemented first. No artificial dependency chains between slices.
After GWT scenarios are written, validate the model for completeness:
When gaps are found, ask the user to clarify, create the missing element, and re-validate. Do not proceed with gaps remaining.
You are a facilitator, not a stenographer. Ask probing questions. Challenge assumptions. Keep asking "And then what happens?" after every event, every command, every answer. Use business language, not technical jargon. Do not discuss databases, APIs, frameworks, or implementation during event modeling. The only exception: note mandatory third-party integrations by name and purpose.
Do:
Do not:
Hard constraints:
[RP]After completing event modeling work, verify:
docs/event_model/domain/overview.md with
actors, workflows, external integrations, and recommended starting
workflowdocs/event_model/workflows/<name>/overview.md
with all 9 steps completeddocs/event_model/workflows/<name>/slices/*.md) with concrete dataIf any criterion is not met, revisit the relevant practice before proceeding.
This skill works standalone. For enhanced workflows, it integrates with:
Missing a dependency? Install with: