@eventmodelers/cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +175 -0
- package/cli.js +676 -0
- package/package.json +35 -0
- package/shared/build-kit/code-export.mjs +560 -0
- package/shared/build-kit/lib/ollama-agent.js +147 -0
- package/shared/build-kit/package.json +11 -0
- package/shared/build-kit/ralph-ollama.js +39 -0
- package/shared/build-kit/realtime-agent.js +18 -0
- package/stacks/axon/templates/.claude/skills/build-automation/SKILL.md +407 -0
- package/stacks/axon/templates/.claude/skills/build-automation/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/SKILL.md +496 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/axon-workflow-api.md +279 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/SKILL.md +396 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/axon-test-fixture-patterns.md +162 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/feature-flag-patterns.md +56 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/rest-api-patterns.md +115 -0
- package/stacks/axon/templates/.claude/skills/build-state-view/SKILL.md +282 -0
- package/stacks/axon/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +611 -0
- package/stacks/axon/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/axon/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/axon/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/axon/templates/build-kit/lib/backend-prompt.md +158 -0
- package/stacks/axon/templates/build-kit/lib/prompt.md +126 -0
- package/stacks/axon/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/axon/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/axon/templates/build-kit/ralph.sh +98 -0
- package/stacks/axon/templates/root/.env.example +5 -0
- package/stacks/axon/templates/root/CLAUDE.md +60 -0
- package/stacks/axon/templates/root/README.md +44 -0
- package/stacks/axon/templates/root/docker-compose.yml +64 -0
- package/stacks/axon/templates/root/mvnw +259 -0
- package/stacks/axon/templates/root/mvnw.cmd +149 -0
- package/stacks/axon/templates/root/pom.xml +125 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/QuickstartApplication.java +128 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/config/WebConfig.java +155 -0
- package/stacks/axon/templates/root/src/main/resources/application.properties +2 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-body.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-header.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/index.html +596 -0
- package/stacks/cratis-csharp/templates/.claude/skills/_shared/cratis-conventions.md +251 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/SKILL.md +99 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/references/patterns.md +115 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/SKILL.md +163 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/references/patterns.md +234 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/SKILL.md +120 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/references/patterns.md +166 -0
- package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +169 -0
- package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +609 -0
- package/stacks/cratis-csharp/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +58 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/backend-prompt.md +129 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/prompt.md +124 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +302 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +37 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph.sh +98 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.css +29 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.html +17 -0
- package/stacks/cratis-csharp/templates/root/.frontend/main.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.json +42 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.node.json +11 -0
- package/stacks/cratis-csharp/templates/root/.frontend/vite.config.ts +56 -0
- package/stacks/cratis-csharp/templates/root/App.tsx +23 -0
- package/stacks/cratis-csharp/templates/root/CLAUDE.md +62 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.csproj +25 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.sln +18 -0
- package/stacks/cratis-csharp/templates/root/GlobalUsings.cs +3 -0
- package/stacks/cratis-csharp/templates/root/Home.tsx +102 -0
- package/stacks/cratis-csharp/templates/root/Program.cs +26 -0
- package/stacks/cratis-csharp/templates/root/README.md +192 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/AllListings.ts +47 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.cs +11 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.ts +12 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/ListingDataTable.tsx +17 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Register.ts +51 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/RegisterDialog.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Registration.cs +27 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeFeature.tsx +22 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeName.cs +3 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/appsettings.Development.json +9 -0
- package/stacks/cratis-csharp/templates/root/appsettings.json +26 -0
- package/stacks/cratis-csharp/templates/root/docker-compose.yml +23 -0
- package/stacks/cratis-csharp/templates/root/package.json +33 -0
- package/stacks/cratis-csharp/templates/root/tsconfig.json +3 -0
- package/stacks/modeling-kit/templates/.claude/settings.local.json +13 -0
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +215 -0
- package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +176 -0
- package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +182 -0
- package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/SKILL.md +383 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/SKILL.md +465 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/SKILL.md +587 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/facilitating-event-modeling-workshops.md +626 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/SKILL.md +542 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/SKILL.md +497 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +783 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md +604 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/SKILL.md +699 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-integrating-legacy-systems/SKILL.md +674 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/SKILL.md +231 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/domain-patterns.md +150 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/patterns.md +329 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/snapshotting.md +204 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md +352 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/references/project-planning-with-event-modeling.md +341 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/SKILL.md +153 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/SKILL.md +136 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/examples.md +78 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/patterns.md +85 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/SKILL.md +655 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/SKILL.md +479 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/SKILL.md +234 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/examples/SKILL.md +200 -0
- package/stacks/modeling-kit/templates/.claude/skills/handle-comment/SKILL.md +94 -0
- package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +441 -0
- package/stacks/modeling-kit/templates/.claude/skills/place-element/SKILL.md +290 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard/SKILL.md +212 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/SKILL.md +123 -0
- package/stacks/modeling-kit/templates/.claude/skills/timeline/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/modeling-kit/templates/.claude/skills/wdyt/SKILL.md +134 -0
- package/stacks/modeling-kit/templates/kit/lib/agent.sh +20 -0
- package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +147 -0
- package/stacks/modeling-kit/templates/kit/lib/ralph.js +286 -0
- package/stacks/modeling-kit/templates/kit/package.json +12 -0
- package/stacks/modeling-kit/templates/kit/ralph-claude.js +50 -0
- package/stacks/modeling-kit/templates/kit/ralph-ollama.js +38 -0
- package/stacks/modeling-kit/templates/kit/ralph.sh +61 -0
- package/stacks/modeling-kit/templates/kit/realtime-agent.js +18 -0
- package/stacks/modeling-kit/templates/root/CLAUDE.md +56 -0
- package/stacks/node/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +412 -0
- package/stacks/node/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/node/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/node/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/node/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/node/templates/build-kit/README.md +86 -0
- package/stacks/node/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/node/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/node/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/node/templates/build-kit/lib/prompt.md +122 -0
- package/stacks/node/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/node/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/node/templates/build-kit/ralph.sh +98 -0
- package/stacks/node/templates/root/.env.example +15 -0
- package/stacks/node/templates/root/CLAUDE.md +60 -0
- package/stacks/node/templates/root/docker-compose.yml +15 -0
- package/stacks/node/templates/root/flyway.conf +17 -0
- package/stacks/node/templates/root/migrations/V1__schema.sql.example +12 -0
- package/stacks/node/templates/root/package.json +50 -0
- package/stacks/node/templates/root/server.ts +130 -0
- package/stacks/node/templates/root/setup-env.sh +53 -0
- package/stacks/node/templates/root/src/common/assertions.ts +6 -0
- package/stacks/node/templates/root/src/common/db.ts +32 -0
- package/stacks/node/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/node/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/node/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/node/templates/root/src/common/realtimeBroadcast.ts +12 -0
- package/stacks/node/templates/root/src/common/replay.ts +16 -0
- package/stacks/node/templates/root/src/common/routes.ts +19 -0
- package/stacks/node/templates/root/src/common/testHelpers.ts +44 -0
- package/stacks/node/templates/root/src/swagger.ts +34 -0
- package/stacks/node/templates/root/src/util/assertions.ts +6 -0
- package/stacks/node/templates/root/src/util/hash.ts +9 -0
- package/stacks/node/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/node/templates/root/tsconfig.json +32 -0
- package/stacks/node/templates/root/vercel.json +8 -0
- package/stacks/supabase/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +390 -0
- package/stacks/supabase/templates/.claude/skills/build-webhook/SKILL.md +303 -0
- package/stacks/supabase/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/supabase/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/supabase/templates/build-kit/README.md +86 -0
- package/stacks/supabase/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/supabase/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/supabase/templates/build-kit/lib/prompt.md +123 -0
- package/stacks/supabase/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/supabase/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/supabase/templates/build-kit/ralph.sh +98 -0
- package/stacks/supabase/templates/root/.env.example +22 -0
- package/stacks/supabase/templates/root/CLAUDE.md +61 -0
- package/stacks/supabase/templates/root/flyway.conf +17 -0
- package/stacks/supabase/templates/root/package.json +52 -0
- package/stacks/supabase/templates/root/server.ts +177 -0
- package/stacks/supabase/templates/root/setup-env.sh +53 -0
- package/stacks/supabase/templates/root/src/common/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/common/db.ts +32 -0
- package/stacks/supabase/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/supabase/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/supabase/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/supabase/templates/root/src/common/realtimeBroadcast.ts +19 -0
- package/stacks/supabase/templates/root/src/common/replay.ts +16 -0
- package/stacks/supabase/templates/root/src/common/routes.ts +23 -0
- package/stacks/supabase/templates/root/src/common/testHelpers.ts +54 -0
- package/stacks/supabase/templates/root/src/supabase/README.md +141 -0
- package/stacks/supabase/templates/root/src/supabase/api.ts +56 -0
- package/stacks/supabase/templates/root/src/supabase/requireOrgaAdmin.ts +32 -0
- package/stacks/supabase/templates/root/src/supabase/requireSysUser.ts +40 -0
- package/stacks/supabase/templates/root/src/supabase/requireUser.ts +72 -0
- package/stacks/supabase/templates/root/src/swagger.ts +34 -0
- package/stacks/supabase/templates/root/src/util/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/util/hash.ts +9 -0
- package/stacks/supabase/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/supabase/templates/root/supabase/config.toml +295 -0
- package/stacks/supabase/templates/root/supabase/migrations/V1__schema.sql.example +12 -0
- package/stacks/supabase/templates/root/supabase/seed.sql +1 -0
- package/stacks/supabase/templates/root/tsconfig.json +32 -0
- package/stacks/supabase/templates/root/vercel.json +8 -0
package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md
ADDED
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eventmodeling-identifying-inputs
|
|
3
|
+
description: "Step 4 of Event Modeling - Identify Commands/Inputs from UI and Processor actions. Map user actions to commands and data. Use after storyboarding UI. Do not use for: identifying read models or outputs (use eventmodeling-identifying-outputs) or elaborating behavior specifications (use eventmodeling-elaborating-scenarios)."
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- AskUserQuestion
|
|
6
|
+
- Write
|
|
7
|
+
- Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Identifying Inputs
|
|
11
|
+
|
|
12
|
+
> **Before doing anything else**, invoke the `connect` skill to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL`. Then invoke the `learn-eventmodelers-api` skill to load the full API reference. Do not proceed until both skills have been loaded.
|
|
13
|
+
|
|
14
|
+
## Interview Phase (Optional)
|
|
15
|
+
|
|
16
|
+
**When to Interview**: Skip if the user has already identified UI actions/commands and processor triggers. Interview when it's unclear which actions are user-initiated vs. processor-automated.
|
|
17
|
+
|
|
18
|
+
**Interview Strategy**: Separate UI-driven commands from processor-driven commands before cataloging inputs. Mixing them leads to incorrect role attribution, which breaks the Role Catalog traceability that downstream steps depend on.
|
|
19
|
+
|
|
20
|
+
### Critical Questions
|
|
21
|
+
|
|
22
|
+
1. **Automation Level** (Impact: Determines which commands are UI-triggered vs. processor-triggered)
|
|
23
|
+
- Question: "Are there actions that should be: (A) User-initiated only, (B) Processor-automated, (C) Mix of both?"
|
|
24
|
+
- Why it matters: Knowing automation vs. manual separates command types
|
|
25
|
+
- Follow-up triggers: If (C) → ask "Which specific user actions trigger automation? What does the processor decide on its own?"
|
|
26
|
+
|
|
27
|
+
2. **External System Triggers** (Impact: Determines if there are processor commands from webhooks/integrations)
|
|
28
|
+
- Question: "Will commands be triggered by: (A) UI only, (B) External webhooks (payments, notifications, etc.), (C) Scheduled processors, (D) All of above?"
|
|
29
|
+
- Why it matters: External triggers are processor commands, not UI commands
|
|
30
|
+
- Follow-up triggers: If (B) or (D) → ask which external systems send webhooks and what data they include
|
|
31
|
+
|
|
32
|
+
### Interview Flow
|
|
33
|
+
|
|
34
|
+
**Conditional Entry**:
|
|
35
|
+
```
|
|
36
|
+
If user has provided:
|
|
37
|
+
- UI actions already listed per storyboard screen
|
|
38
|
+
- AND processor triggers identified with source systems named
|
|
39
|
+
- AND it's clear which role/actor initiates each action
|
|
40
|
+
|
|
41
|
+
Then: Skip interview, proceed directly to command identification
|
|
42
|
+
|
|
43
|
+
Else: Conduct interview
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Phase 1: Trigger Classification** (Question 1)
|
|
47
|
+
- Establish which commands come from human actors vs. automated processors
|
|
48
|
+
- Confirm Role Catalog from Step 1 is available for attribution
|
|
49
|
+
|
|
50
|
+
**Phase 2: External Triggers** (Question 2)
|
|
51
|
+
- Identify all external system integrations that issue commands
|
|
52
|
+
- Confirm whether scheduled jobs or event-driven processors exist
|
|
53
|
+
|
|
54
|
+
### Capturing Interview Findings
|
|
55
|
+
|
|
56
|
+
Append findings to the project's event modeling file:
|
|
57
|
+
|
|
58
|
+
**File**: `.trogonai/interviews/[project-name]/EVENTMODELING.md`
|
|
59
|
+
|
|
60
|
+
Use Write tool to add/update this section:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## 4. Identifying Inputs (eventmodeling-identifying-inputs)
|
|
64
|
+
|
|
65
|
+
### Automation Classification
|
|
66
|
+
[From Q1: Which actions are user-initiated vs. processor-automated?]
|
|
67
|
+
|
|
68
|
+
### External System Triggers
|
|
69
|
+
[From Q2: Which external systems trigger commands? Webhook formats?]
|
|
70
|
+
|
|
71
|
+
### Command Attribution Summary
|
|
72
|
+
- UI-issued commands: [list with role from Role Catalog]
|
|
73
|
+
- Processor-issued commands: [list with source system]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Update Interview Trail:
|
|
77
|
+
```markdown
|
|
78
|
+
| 4 | eventmodeling-identifying-inputs | Done | UI commands, processor commands, role attribution |
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Workflow
|
|
84
|
+
|
|
85
|
+
Given UI storyboards and event timeline, identify all inputs.
|
|
86
|
+
|
|
87
|
+
**PREREQUISITE**: The **Role Catalog** from Step 1 (eventmodeling-brainstorming-events) must exist. Every command identified below MUST be attributed to a specific role or system actor from that catalog.
|
|
88
|
+
|
|
89
|
+
### 1. Extract Commands from UI Actions
|
|
90
|
+
For each user action in storyboard, create a command attributed to a specific role:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Storyboard: Order Creation Screen
|
|
94
|
+
User action: Click "Create Order" button
|
|
95
|
+
↓
|
|
96
|
+
Command: CreateOrder
|
|
97
|
+
Input data from form:
|
|
98
|
+
- customerId
|
|
99
|
+
- items[] (product selections + quantities)
|
|
100
|
+
- shippingAddress
|
|
101
|
+
Validation:
|
|
102
|
+
- customerId must exist
|
|
103
|
+
- items must not be empty
|
|
104
|
+
- quantities must be > 0
|
|
105
|
+
Produces event: OrderCreated
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 2. Identify Processor Triggers
|
|
109
|
+
Identify automation-triggered commands:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Processor trigger: Payment gateway webhook received
|
|
113
|
+
↓
|
|
114
|
+
Command: AuthorizePayment (from Processor, not UI)
|
|
115
|
+
Input data from webhook:
|
|
116
|
+
- orderId
|
|
117
|
+
- paymentId
|
|
118
|
+
- authorizationCode
|
|
119
|
+
Validation:
|
|
120
|
+
- orderId must exist and be in Confirmed state
|
|
121
|
+
- authorizationCode must be valid
|
|
122
|
+
Produces event: PaymentAuthorized
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 2b. Understand the Processor "Todo List" Pattern
|
|
126
|
+
Processors don't directly process events—they maintain a todo list driven by events:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Event Stream (Domain events):
|
|
130
|
+
PaymentAuthorized → triggers Inventory system
|
|
131
|
+
|
|
132
|
+
Processor: InventoryReserver
|
|
133
|
+
|
|
134
|
+
Todo List:
|
|
135
|
+
When PaymentAuthorized event arrives:
|
|
136
|
+
1. Add item to todo: "Reserve inventory for order-123"
|
|
137
|
+
|
|
138
|
+
Processor Logic (continuously):
|
|
139
|
+
FOR EACH todo item IN todo_list:
|
|
140
|
+
- Check if inventory available
|
|
141
|
+
- If yes: Reserve inventory, produce InventoryReserved event, mark done
|
|
142
|
+
- If no: Produce InventoryFailed event, mark failed
|
|
143
|
+
- If error: Keep in todo for retry
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
Event: PaymentAuthorized(orderId=order-123, items=[{prodId: P1, qty: 2}])
|
|
147
|
+
↓
|
|
148
|
+
Todo added: Reserve P1 qty 2
|
|
149
|
+
↓
|
|
150
|
+
Processor checks: P1 has 5 available, need 2
|
|
151
|
+
↓
|
|
152
|
+
Action: Reserve 2 units
|
|
153
|
+
↓
|
|
154
|
+
Event produced: InventoryReserved(orderId=order-123, reserved=[...])
|
|
155
|
+
↓
|
|
156
|
+
Todo marked done
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Key insight**: Processors are reactive. They listen for events and create todo items, then execute those todos by issuing commands that produce new events.
|
|
160
|
+
|
|
161
|
+
### 2c. Document Processor Automation (Gears Symbol)
|
|
162
|
+
Show which commands come from automation vs. user actions:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Command Catalog with Role Attribution (from Role Catalog):
|
|
166
|
+
|
|
167
|
+
UI-Issued Commands (attributed to specific human roles):
|
|
168
|
+
1. CreateOrder (Order Entry screen) [ Customer]
|
|
169
|
+
2. ConfirmOrder (Confirmation screen) [ Customer]
|
|
170
|
+
3. CancelOrder (Status screen) [ Customer]
|
|
171
|
+
4. RequestReturn (Order page) [ Customer]
|
|
172
|
+
5. OverrideOrderStatus (Admin panel) [ Support Agent]
|
|
173
|
+
|
|
174
|
+
Processor-Issued Commands (attributed to system actors):
|
|
175
|
+
6. AuthorizePayment (Payment gateway webhook) [ Payment Gateway]
|
|
176
|
+
7. ReserveInventory (Triggered by PaymentAuthorized) [ Inventory System]
|
|
177
|
+
8. CreateShipment (Triggered by InventoryReserved) [ Fulfillment System]
|
|
178
|
+
9. NotifyCustomer (Triggered by multiple events) [ Notification Service]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Validation**: Every command MUST have a role/actor attribution. If a command says `[ User]` instead of a specific role name, it's incomplete — go back to the Role Catalog and assign the correct role.
|
|
182
|
+
|
|
183
|
+
### 3. Document Command Specifics
|
|
184
|
+
For each command, define structure:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
Command: ConfirmOrder
|
|
188
|
+
Source: UI (user clicks button)
|
|
189
|
+
Input:
|
|
190
|
+
orderId: string (from URL/context)
|
|
191
|
+
paymentMethod: enum ('card' | 'transfer')
|
|
192
|
+
[paymentDetails]: depends on method
|
|
193
|
+
|
|
194
|
+
Validation rules:
|
|
195
|
+
- Order must exist
|
|
196
|
+
- Order must be in Draft state
|
|
197
|
+
- Payment method must be supported
|
|
198
|
+
- Funds must be available (pre-check)
|
|
199
|
+
|
|
200
|
+
Preconditions (from stream state):
|
|
201
|
+
- OrderCreated event exists
|
|
202
|
+
- No ConfirmOrder previously processed
|
|
203
|
+
|
|
204
|
+
Success result: OrderConfirmed event
|
|
205
|
+
|
|
206
|
+
Failure results:
|
|
207
|
+
- "Order not found" → Command rejected, no event
|
|
208
|
+
- "Order already confirmed" → Command rejected, no event
|
|
209
|
+
- "Payment method not supported" → Command rejected, no event
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 4. Create Command Catalog
|
|
213
|
+
List all commands the system accepts:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
Command Catalog: Order System
|
|
217
|
+
|
|
218
|
+
### UI-Issued Commands
|
|
219
|
+
|
|
220
|
+
1. CreateOrder
|
|
221
|
+
Source: User (Order Entry screen)
|
|
222
|
+
Input: customerId, items[], shippingAddress
|
|
223
|
+
Produces: OrderCreated event
|
|
224
|
+
|
|
225
|
+
2. ConfirmOrder
|
|
226
|
+
Source: User (Confirmation screen)
|
|
227
|
+
Input: orderId, paymentMethod
|
|
228
|
+
Produces: OrderConfirmed event
|
|
229
|
+
|
|
230
|
+
3. CancelOrder
|
|
231
|
+
Source: User (Status screen)
|
|
232
|
+
Input: orderId, reason
|
|
233
|
+
Produces: OrderCancelled event
|
|
234
|
+
|
|
235
|
+
### Processor-Issued Commands
|
|
236
|
+
|
|
237
|
+
4. AuthorizePayment
|
|
238
|
+
Source: Payment Processor (webhook)
|
|
239
|
+
Input: orderId, paymentId, authCode
|
|
240
|
+
Produces: PaymentAuthorized event
|
|
241
|
+
|
|
242
|
+
5. FailPayment
|
|
243
|
+
Source: Payment Processor (webhook)
|
|
244
|
+
Input: orderId, paymentId, reason
|
|
245
|
+
Produces: PaymentFailed event
|
|
246
|
+
|
|
247
|
+
6. ReserveInventory
|
|
248
|
+
Source: Inventory Processor (triggered by PaymentAuthorized)
|
|
249
|
+
Input: orderId, items[]
|
|
250
|
+
Produces: InventoryReserved event
|
|
251
|
+
|
|
252
|
+
7. CreateShipment
|
|
253
|
+
Source: Fulfillment Processor (triggered by InventoryReserved)
|
|
254
|
+
Input: orderId, items[]
|
|
255
|
+
Produces: OrderShipped event
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 5. Map Data Sources
|
|
259
|
+
Document where each command input comes from:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
Command: ConfirmOrder
|
|
263
|
+
|
|
264
|
+
Data origin matrix:
|
|
265
|
+
orderId
|
|
266
|
+
↑ Source: UI context (from OrderCreated, displayed to user)
|
|
267
|
+
↑ Captured: Hidden in URL or session
|
|
268
|
+
↑ Validation: Must match Order from stream
|
|
269
|
+
|
|
270
|
+
paymentMethod
|
|
271
|
+
↑ Source: UI form selection
|
|
272
|
+
↑ Captured: User selects checkbox/radio
|
|
273
|
+
↑ Validation: Must be in allowed list
|
|
274
|
+
|
|
275
|
+
[paymentDetails] (conditional)
|
|
276
|
+
↑ Source: Depends on paymentMethod
|
|
277
|
+
↑ For 'card': Card number, CVV, expiry (from payment form)
|
|
278
|
+
↑ For 'transfer': Bank account, routing number (from form)
|
|
279
|
+
↑ Validation: Format and validity checks
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### 6. Identify Implicit Context
|
|
283
|
+
Document what comes from stream state:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
Command: ShipOrder
|
|
287
|
+
Explicit input (from UI/Processor):
|
|
288
|
+
orderId
|
|
289
|
+
shipmentId (from fulfillment system)
|
|
290
|
+
|
|
291
|
+
Implicit context (from stream state):
|
|
292
|
+
Order must exist
|
|
293
|
+
Order must be in InventoryReserved state
|
|
294
|
+
Payment must be authorized (from PaymentAuthorized event)
|
|
295
|
+
Inventory must be reserved (from InventoryReserved event)
|
|
296
|
+
|
|
297
|
+
These implicit checks use stream state:
|
|
298
|
+
currentState.orderId === orderId
|
|
299
|
+
currentState.status === 'InventoryReserved'
|
|
300
|
+
currentState.paymentId exists
|
|
301
|
+
currentState.shipmentId can be set
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Output Format
|
|
305
|
+
|
|
306
|
+
Instead of writing a markdown document, **place each COMMAND on the board** using the `node:created` API.
|
|
307
|
+
|
|
308
|
+
> **CRITICAL: Every COMMAND node MUST include `meta.fields` with a `mapping` on every field.** A command without fields — or with fields that lack `mapping` — is an incomplete model that cannot be traced, validated, or turned into code.
|
|
309
|
+
|
|
310
|
+
### Field data lineage — the `mapping` attribute
|
|
311
|
+
|
|
312
|
+
Every field on a COMMAND must carry a `mapping` that says exactly where its value comes from. Use one of these forms:
|
|
313
|
+
|
|
314
|
+
| `mapping` format | Meaning | `generated` | Example |
|
|
315
|
+
|---|---|---|---|
|
|
316
|
+
| `"user-input"` | User types or selects this value directly | `false` | `startTime` picked from a date picker |
|
|
317
|
+
| `"session:<fieldName>"` | Read from the authenticated session | `false` | `session:customerId` |
|
|
318
|
+
| `"<EventTitle>.<fieldName>"` | Taken from a previously emitted event | `false` | `BikeReserved.bikeId` |
|
|
319
|
+
| `"derived:<expression>"` | Computed by the system | `true` | `derived:uuid4()`, `derived:now()` |
|
|
320
|
+
| `"webhook:<payloadField>"` | Comes from an external webhook payload | `false` | `webhook:gateway_transaction_id` |
|
|
321
|
+
|
|
322
|
+
Set the field's `generated` property according to this table. Fields typed by the user (typically from a screen form) are never generated — the user supplies the value. Fields with a `derived:` mapping are always generated — the system produces the value automatically.
|
|
323
|
+
|
|
324
|
+
The `mapping` traces the value all the way back to its origin. **If you cannot write a mapping for a field, that field has an unknown origin — treat it as a gap and resolve it.**
|
|
325
|
+
|
|
326
|
+
Every field must also set `"cardinality"` — use `"Single"` unless the field genuinely holds a list of values (e.g. multi-select), in which case use `"List"`. Default to `"Single"` when unsure. Only add fields the command actually needs to do its job — do not add speculative fields; enrich later via `/attributes`.
|
|
327
|
+
|
|
328
|
+
### Field traceability rule for events
|
|
329
|
+
|
|
330
|
+
Every field in the resulting EVENT must either:
|
|
331
|
+
- Appear in the command's `fields` (direct mapping — same name or documented rename), or
|
|
332
|
+
- Be derivable from command fields + system state
|
|
333
|
+
|
|
334
|
+
Example: `BikeReserved.reservedAt` is not in `ReserveBike` but derives from `derived:now()`. That is acceptable — document it. `BikeReserved.reservationId` is not in `ReserveBike` but derives from `derived:uuid4()`. Also acceptable.
|
|
335
|
+
|
|
336
|
+
If an event field has **no** corresponding command field and **no** derivation rule, that is a gap — add it to the command or note it as a system-generated field.
|
|
337
|
+
|
|
338
|
+
> **Connected-element rule**: A field `mapping` may only reference elements that are connected to this COMMAND via board arrows (`SCREEN → COMMAND`). If a field's value would come from something not yet connected, flag it as a gap. **If a mapping cannot be defined at all, it hints at missing data in the model or a modeling error** — a missing event field, a missing screen field, or a broken connection. Investigate before proceeding.
|
|
339
|
+
|
|
340
|
+
```json
|
|
341
|
+
{
|
|
342
|
+
"type": "COMMAND",
|
|
343
|
+
"title": "ReserveBike",
|
|
344
|
+
"fields": [
|
|
345
|
+
{"name": "customerId", "type": "String", "example": "cust-42", "mapping": "session:customerId", "generated": false},
|
|
346
|
+
{"name": "bikeId", "type": "String", "example": "bike-17", "mapping": "user-input", "generated": false},
|
|
347
|
+
{"name": "stationId", "type": "String", "example": "stn-03", "mapping": "user-input", "generated": false},
|
|
348
|
+
{"name": "startTime", "type": "Date", "example": "2026-06-01T09:00:00Z", "mapping": "user-input", "generated": false},
|
|
349
|
+
{"name": "endTime", "type": "Date", "example": "2026-06-01T17:00:00Z", "mapping": "user-input", "generated": false}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Event fields produced by this command:
|
|
355
|
+
- `reservationId` → `derived:uuid4()` → `generated: true`
|
|
356
|
+
- `customerId` → `ReserveBike.customerId` → `generated: false`
|
|
357
|
+
- `bikeId` → `ReserveBike.bikeId` → `generated: false`
|
|
358
|
+
- `stationId` → `ReserveBike.stationId` → `generated: false`
|
|
359
|
+
- `startTime` → `ReserveBike.startTime` → `generated: false`
|
|
360
|
+
- `endTime` → `ReserveBike.endTime` → `generated: false`
|
|
361
|
+
- `reservedAt` → `derived:now()` → `generated: true`
|
|
362
|
+
|
|
363
|
+
Commands go in the `interaction` lane — same column as their resulting event.
|
|
364
|
+
|
|
365
|
+
### Creating a COMMAND node with fields
|
|
366
|
+
|
|
367
|
+
**Every `node:created` call MUST include `cellId`.** Without it the node has no cell reference and will appear stranded at position 0,0 — not in any timeline column.
|
|
368
|
+
|
|
369
|
+
Commands go in the **interaction lane**, same column as the event they produce. Before creating each command:
|
|
370
|
+
|
|
371
|
+
**Step A — Find the event's column ID.** Query the event node to read its current cell:
|
|
372
|
+
```bash
|
|
373
|
+
curl -s -H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" \
|
|
374
|
+
"$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$EVENT_NODE_ID"
|
|
375
|
+
# → node.meta.cellId is "<someRowId>-<columnId>" — extract the columnId part
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Step B — Fetch the chapter to find the interaction row ID:**
|
|
379
|
+
```bash
|
|
380
|
+
curl -s -H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" \
|
|
381
|
+
"$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/$CHAPTER_ID"
|
|
382
|
+
# → timelineData.rows — find the row where type === "interaction"
|
|
383
|
+
```
|
|
384
|
+
Save `interactionRow.id`.
|
|
385
|
+
|
|
386
|
+
**Step C — Compute the cell ID:**
|
|
387
|
+
```
|
|
388
|
+
cellId = interactionRow.id + "-" + columnId
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Step D — Create the command with `cellId`:**
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
curl -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes/events" \
|
|
395
|
+
-H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" -H "x-user-id: identifying-inputs" \
|
|
396
|
+
-H "Content-Type: application/json" \
|
|
397
|
+
-d '[{
|
|
398
|
+
"id": "<event-uuid>",
|
|
399
|
+
"eventType": "node:created",
|
|
400
|
+
"nodeId": "<node-uuid>",
|
|
401
|
+
"boardId": "<boardId>",
|
|
402
|
+
"timestamp": 1234567890,
|
|
403
|
+
"chapterId": "<chapterId>",
|
|
404
|
+
"cellId": "<interactionRowId>-<columnId>",
|
|
405
|
+
"meta": {
|
|
406
|
+
"type": "COMMAND",
|
|
407
|
+
"title": "ReserveBike",
|
|
408
|
+
"fields": [
|
|
409
|
+
{"name": "customerId", "type": "String", "example": "cust-42", "mapping": "session:customerId"},
|
|
410
|
+
{"name": "bikeId", "type": "String", "example": "bike-17", "mapping": "user-input"},
|
|
411
|
+
{"name": "startTime", "type": "Date", "example": "2026-06-01T09:00:00Z","mapping": "user-input"}
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
}]'
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
> **Never call `drop` after using `cellId` in `node:created`.** The drop endpoint adds a second cell reference without removing the first. `node:created + cellId` is the only placement step needed.
|
|
418
|
+
|
|
419
|
+
### Preventing backward arrows (mandatory pre-placement check)
|
|
420
|
+
|
|
421
|
+
A `SCREEN → COMMAND` connection must always go downward within the same column (actor row → interaction row). A `COMMAND → EVENT` connection must also be within the same column. Both are inherently forward because they share a column.
|
|
422
|
+
|
|
423
|
+
However, if a screen placed in Step 3 (Storyboarding) is in a column that is **different** from the event column, the connection will span columns and may go backwards. Before placing a command:
|
|
424
|
+
|
|
425
|
+
1. Confirm the screen for this command is in the **same column** as the event it produces.
|
|
426
|
+
2. If the screen is in an earlier column, move it to the event's column before wiring.
|
|
427
|
+
3. If the screen is in a later column, move the event's column (by inserting a new column at the correct index) or move the screen to match.
|
|
428
|
+
|
|
429
|
+
The timeline must always read left-to-right: SCREEN and COMMAND belong in the same column as the EVENT they produce.
|
|
430
|
+
|
|
431
|
+
### Wire connections after placing each COMMAND
|
|
432
|
+
|
|
433
|
+
After `place-element` returns the COMMAND node ID, create the arrows that complete the slice:
|
|
434
|
+
|
|
435
|
+
1. **SCREEN → COMMAND** — find the SCREEN node in the actor row of the same column:
|
|
436
|
+
```bash
|
|
437
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?cellId=<actorRowId>-<columnId>" \
|
|
438
|
+
-H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" -H "x-user-id: eventmodeling-identifying-inputs"
|
|
439
|
+
```
|
|
440
|
+
If a SCREEN node exists, connect it:
|
|
441
|
+
```bash
|
|
442
|
+
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/connections" \
|
|
443
|
+
-H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" -H "x-user-id: eventmodeling-identifying-inputs" \
|
|
444
|
+
-H "Content-Type: application/json" \
|
|
445
|
+
-d '{"source":"<screenNodeId>","target":"<commandNodeId>"}'
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
2. **COMMAND → EVENT** — find the EVENT node in the swimlane row of the same column:
|
|
449
|
+
```bash
|
|
450
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?cellId=<swimlaneRowId>-<columnId>" \
|
|
451
|
+
-H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" -H "x-user-id: eventmodeling-identifying-inputs"
|
|
452
|
+
```
|
|
453
|
+
Connect command to its resulting event:
|
|
454
|
+
```bash
|
|
455
|
+
curl -s -X POST "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/connections" \
|
|
456
|
+
-H "x-token: $TOKEN" -H "x-board-id: $BOARD_ID" -H "x-user-id: eventmodeling-identifying-inputs" \
|
|
457
|
+
-H "Content-Type: application/json" \
|
|
458
|
+
-d '{"source":"<commandNodeId>","target":"<eventNodeId>"}'
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Skip a connection silently if the target cell is empty (the element may be placed in a later step). Log each created arrow: `→ connected SCREEN→COMMAND "PlaceOrder"` or `→ connected COMMAND→EVENT "PlaceOrder"→"OrderPlaced"`.
|
|
462
|
+
|
|
463
|
+
After all commands are placed and wired, present the Command Catalog summary as text to the user.
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
For reference, the full markdown structure is:
|
|
468
|
+
|
|
469
|
+
```markdown
|
|
470
|
+
# Inputs: [Domain Name]
|
|
471
|
+
|
|
472
|
+
## Commands Summary
|
|
473
|
+
|
|
474
|
+
| Command | Role/Actor | Source | Trigger | Input | Event |
|
|
475
|
+
|---------|------------|--------|---------|-------|-------|
|
|
476
|
+
| CreateOrder | Customer | UI | User action | customerId, items, address | OrderCreated |
|
|
477
|
+
| ConfirmOrder | Customer | UI | User action | orderId, paymentMethod | OrderConfirmed |
|
|
478
|
+
| CancelOrder | Customer | UI | User action | orderId, reason | OrderCancelled |
|
|
479
|
+
| AuthorizePayment | Payment Gateway | Processor | Webhook | orderId, paymentId | PaymentAuthorized |
|
|
480
|
+
| ReserveInventory | Inventory System | Processor | PaymentAuthorized event | orderId, items | InventoryReserved |
|
|
481
|
+
| ShipOrder | Fulfillment System | Processor | InventoryReserved event | orderId, shipmentId | OrderShipped |
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## Detailed Commands
|
|
486
|
+
|
|
487
|
+
### Command: CreateOrder
|
|
488
|
+
|
|
489
|
+
**Source**: User (Order Entry screen)
|
|
490
|
+
|
|
491
|
+
**Input Data**:
|
|
492
|
+
- customerId: string
|
|
493
|
+
- items: Array<{productId: string, quantity: number}>
|
|
494
|
+
- shippingAddress: {street, city, state, zip}
|
|
495
|
+
|
|
496
|
+
**Validation**:
|
|
497
|
+
- customerId must exist in system
|
|
498
|
+
- items array must not be empty
|
|
499
|
+
- quantities must be > 0
|
|
500
|
+
- address fields must be non-empty
|
|
501
|
+
|
|
502
|
+
**Preconditions** (from stream state):
|
|
503
|
+
- Stream Order:X does not exist yet
|
|
504
|
+
|
|
505
|
+
**Success**: Produces OrderCreated event
|
|
506
|
+
|
|
507
|
+
**Failure**: Command rejected, no event
|
|
508
|
+
- "Customer not found"
|
|
509
|
+
- "Items invalid"
|
|
510
|
+
- "Address incomplete"
|
|
511
|
+
|
|
512
|
+
--- [Repeat for each command]
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Data Completeness Check
|
|
517
|
+
|
|
518
|
+
### Data Input → Event
|
|
519
|
+
|
|
520
|
+
Verify every command input becomes event data:
|
|
521
|
+
|
|
522
|
+
| Command Input | Event Data | Status |
|
|
523
|
+
|---------------|-----------|--------|
|
|
524
|
+
| customerId | orderId | Stored in OrderCreated |
|
|
525
|
+
| items | items | Stored in OrderCreated |
|
|
526
|
+
| shippingAddress | shippingAddress | Stored in OrderCreated |
|
|
527
|
+
|
|
528
|
+
### Missing Data
|
|
529
|
+
|
|
530
|
+
Document any input that doesn't make it to events:
|
|
531
|
+
- None identified
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## Processor Commands
|
|
536
|
+
|
|
537
|
+
Document all processor-triggered commands:
|
|
538
|
+
[List each with source system and trigger condition]
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
## Quality Checklist
|
|
542
|
+
|
|
543
|
+
- [ ] Every UI action maps to a command
|
|
544
|
+
- [ ] Every processor action maps to a command
|
|
545
|
+
- [ ] **Every command is attributed to a specific role/actor from the Role Catalog**
|
|
546
|
+
- [ ] **No command uses generic "User" — must name the specific role (Customer, Seller, Admin, etc.)**
|
|
547
|
+
- [ ] Every command input is documented
|
|
548
|
+
- [ ] Every input validates against rules
|
|
549
|
+
- [ ] Preconditions from stream state are explicit
|
|
550
|
+
- [ ] Success and failure outcomes documented
|
|
551
|
+
- [ ] Implicit context from stream state is identified
|
|
552
|
+
- [ ] No undocumented commands exist
|
|
553
|
+
- [ ] Command naming is consistent and clear
|
|
554
|
+
- [ ] Processor triggers are explicit
|
|
555
|
+
- [ ] **Processor todo list pattern explained for each automation**
|
|
556
|
+
- [ ] **Event-to-todo triggering mechanism documented**
|
|
557
|
+
- [ ] **Automation marked with [AUTO] to distinguish from user actions [USER]**
|
|
558
|
+
- [ ] **Processor failure/retry handling specified**
|
|
559
|
+
|
|
560
|
+
## Key Principles
|
|
561
|
+
|
|
562
|
+
1. **Source Clarity**: Every command comes from UI or Processor
|
|
563
|
+
2. **Input Completeness**: All needed data captured
|
|
564
|
+
3. **Validation Explicit**: All rules documented
|
|
565
|
+
4. **State Awareness**: Preconditions from stream state clear
|
|
566
|
+
5. **Event Mapping**: Every input becomes event data
|
|
567
|
+
|
|
568
|
+
## Common Patterns
|
|
569
|
+
|
|
570
|
+
### User Command Pattern
|
|
571
|
+
```
|
|
572
|
+
User action on UI screen
|
|
573
|
+
↓
|
|
574
|
+
Captures form/selection data
|
|
575
|
+
↓
|
|
576
|
+
Validation checks
|
|
577
|
+
↓
|
|
578
|
+
Command issued
|
|
579
|
+
↓
|
|
580
|
+
Event created or rejection
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Processor Command Pattern
|
|
584
|
+
```
|
|
585
|
+
External event/webhook received
|
|
586
|
+
↓
|
|
587
|
+
Triggers processor logic
|
|
588
|
+
↓
|
|
589
|
+
Processor validates and decides
|
|
590
|
+
↓
|
|
591
|
+
Command issued (if valid)
|
|
592
|
+
↓
|
|
593
|
+
Event created or decision recorded
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### Conditional Input Pattern
|
|
597
|
+
```
|
|
598
|
+
Command: PaymentConfirm
|
|
599
|
+
Input:
|
|
600
|
+
- paymentMethod (user selected)
|
|
601
|
+
- paymentDetails (conditional on method)
|
|
602
|
+
If method='card': cardNumber, CVV, expiry
|
|
603
|
+
If method='transfer': bankAccount, routingNumber
|
|
604
|
+
```
|