/bett3r-pv3-ai-skills:event-storming-to-specfrom bett3r-pv3-ai-skills
Transform Event Storming output into a DDD specification. Use after event storming sessions to generate structured specifications for your flow's design/refine step or the create-module skill.
Ships in bett3r-pv3-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Transform structured event storming output (Mermaid flowcharts or text) into a complete DDD specification document.
Resolve these placeholders from the repo's .blueprint.config.json:
| Placeholder | .blueprint.config.json field | Example value |
|---|---|---|
<domainEventsPath> | domainEventsPath | src/packages/shared/teselly-domain |
<serverPath> | serverPath | src/services/server |
<clientLibraryPackageName> | clientLibraryPackageName | @bett3r-dev/teselly-client-library |
The framework packages @bett3r-dev/pv3-types, @bett3r-dev/jsonschema-definer, and the
ports module are PV3 framework — identical in every PV3 repo — and appear verbatim below.
Accepts one of:
miro-to-mermaid skill (in your active work/design directory, e.g. .work/)A complete DDD specification document saved to your active work/design directory (e.g. .work/specification.md — wherever your flow keeps design docs).
If a Mermaid flowchart from the miro-to-mermaid skill exists in your active work/design directory (e.g. .work/), use it.
Otherwise, ask user to paste the event storming output.
Parse all DDD components:
Each command targets exactly one aggregate. Each event is emitted by exactly one aggregate. Map ownership:
Aggregate: OrdersAggregate
Commands: PlaceOrder, EditOrder, ChangeOrderStatus
Events: OrderPlaced, OrderEdited, OrderStatusChanged
State: OrderSchema
Look for repeating field groups (3+ fields that appear together). Extract as value objects:
// Example: Address appears in customer info, shipping, billing
export const AddressSchema = S.shape({
line1: S.string().optional(),
city: S.string().optional(),
state: S.string().optional(),
country: S.string().optional(),
postalCode: S.string().optional()
});
Write the specification to your active work/design directory (e.g. .work/specification.md):
# DDD Specification: [Module Name]
## Module
**Service:** server
**Module Location:** <serverPath>/src/modules/<module-name>/
**Domain Location:** <domainEventsPath>/src/<domain>/
**Bounded Context:** [context name]
## Purpose
[What this module does and why]
## State
### [AggregateName] State
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| ... | ... | ... | ... |
## Value Objects
### [ValueObjectName]
| Field | Type | Description |
|-------|------|-------------|
| ... | ... | ... |
## Events
| Event | Schema | Aggregate | Description |
|-------|--------|-----------|-------------|
| OrderPlaced | OrderPlacedEventSchema | OrdersAggregate | Order was created |
| ... | ... | ... | ... |
## Commands
| Command | Schema | Target Aggregate | Description |
|---------|--------|-----------------|-------------|
| PlaceOrder | PlaceOrderCommandSchema | OrdersAggregate | Create or update an order |
| ... | ... | ... | ... |
## Invariants
| ID | Rule | Error Code | Owner Aggregate |
|----|------|-----------|----------------|
| INV-1 | [Business rule description] | RULE_VIOLATION_CODE | [Aggregate] |
| ... | ... | ... | ... |
## Dependencies
| Dependency | Type | Usage |
|-----------|------|-------|
| the client library (<clientLibraryPackageName>) | internal | Cross-service commands |
| ... | ... | ... |
## Policies
| Policy | Trigger Event | Action | Description |
|--------|--------------|--------|-------------|
| MyPolicy | SomethingHappened | Execute downstream command | Reacts to X by doing Y |
| ... | ... | ... | ... |
## Read Models
| Read Model | Collection | Subscribes To | Queries |
|-----------|-----------|---------------|---------|
| OrdersReadmodel | sales_orders_readmodel | OrderPlaced, OrderEdited | /sales/orders/:id?, /sales/orders-search/ |
| ... | ... | ... | ... |
## Test Cases
### Happy Path
- [ ] [Flow description] — expected events/state
### Invariant Violations
- [ ] [Violation scenario] — expected error code
### Policy Reactions
- [ ] [Event] triggers [Policy] which [action]
### Readmodel Projections
- [ ] [Event] projects [data] into [collection]
### Boundary Tests
- [ ] [Boundary condition] — edge case description
From the specification:
Before presenting the specification, audit and critique it for accidental complexity, technical depth, and anti-patterns. Read the generated specification.md and check each item in a general sense. Starter questions can be, for example:
Accidental complexity: Is the proposed solution the simplest thing that solves the problem? Or does it solve a harder, more general version of the problem than what's actually needed? Are there new abstractions, layers, or components whose value isn't clear? Could anything be removed without losing the core outcome?. Take two steps back and critique the approach. Ask yourself the question: what are we missing? Is there a better way to do this?. Specifically about the new Domain-Driven Design artifact:
Technical depth: Is the design cutting corners? Are there any footguns? Does the design introduce patterns, dependencies, or concepts that increase long-term maintenance cost without proportional benefit? Is it building infrastructure that will only ever have one consumer? Does it add concepts that a future developer would need special knowledge to understand?. Specifically about domain-driven design:
ddd-patterns skill? If yes, justified?Anti-patterns: oes anything in the design contradict established project decisions, known failure modes from past work, or rules documented in the host repo's rules? Are there shortcuts in the design (e.g. type casts, raw HTTP calls, inline schemas) that paper over a deeper problem rather than solving it?. In regards to domain-driven design:
produces([]) on side-effect-only commandsproduces listing downstream aggregate eventswithQuery have matching schemas.paramsFlag and resolve any failures before continuing.
If any ambiguities exist:
Ask one question at a time. Let each answer inform the next question.
RegisterShipmentShipmentRegisteredAggregate or Recorder — e.g. FulfillmentRecorder (a recorder lives in a .recorder.ts file; see ADR-036 in pv3: aggregates decide, recorders record)Policy — OrderFulfillmentPolicyReadmodel — OrdersReadmodelORDER_ALREADY_EXISTSUse @bett3r-dev/jsonschema-definer (S) for all schema references in the spec.
NOT Zod.
extractIdFromEventStream())What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/create-aggregateSkill: Create AggregateScaffold a new event-sourced aggregate with PV3 AggregateBuilder pattern. Use when adding a new aggregate to handle commands and emit events./create-integration-testSkill: Create Integration TestScaffold a full-pipeline in-process integration test suite for a server module using createIntegrationHarness. Use when you want to exercise the real command → aggregate → eventstore → outbox → readmodel pipeline for a subdomain (choreography, policies, gateway callbacks), not mocked unit tests./create-Other plugins' skills for the same job
npx claudepluginhub bett3r-dev/bett3r-ai-workflow --plugin bett3r-pv3-ai-skills