@eventmodelers/cli 1.0.36 → 1.0.38
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/package.json +1 -1
- package/shared/skills/learn-eventmodelers-api/SKILL.md +22 -13
- package/stacks/modeling-kit/templates/.claude/skills/add-next-slice/SKILL.md +2 -23
- package/stacks/modeling-kit/templates/.claude/skills/add-next-slice/references/api-fallback.md +11 -0
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +6 -57
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/references/api-fallback.md +68 -0
- package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +4 -61
- package/stacks/modeling-kit/templates/.claude/skills/attributes/references/api-fallback.md +39 -0
- package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/SKILL.md +9 -53
- package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/references/api-fallback.md +63 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/SKILL.md +12 -380
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/references/examples.md +329 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/SKILL.md +45 -290
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/api-fallback.md +97 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/examples.md +35 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/SKILL.md +15 -410
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/references/api-fallback.md +22 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/references/examples.md +397 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-core-rules/SKILL.md +182 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-automation-chains/SKILL.md +148 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-automation-chains/references/api-fallback.md +21 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/SKILL.md +48 -448
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/references/examples.md +167 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +31 -380
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/references/api-fallback.md +31 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/references/examples.md +216 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md +33 -393
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/references/api-fallback.md +79 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/references/examples.md +282 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/SKILL.md +54 -454
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/references/api-fallback.md +67 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/references/examples.md +273 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-interview-protocol/SKILL.md +31 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/SKILL.md +37 -184
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/domain-patterns.md +58 -99
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/patterns.md +82 -163
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md +86 -78
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/references/api-fallback.md +51 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/SKILL.md +5 -5
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/references/api-fallback.md +10 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/SKILL.md +22 -51
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/api-fallback.md +41 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/examples.md +12 -9
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/patterns.md +1 -10
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/SKILL.md +29 -382
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/references/api-fallback.md +77 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/references/examples.md +271 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/SKILL.md +12 -349
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/references/examples.md +306 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/SKILL.md +69 -107
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/references/api-fallback.md +14 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/SKILL.md +75 -160
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/references/api-fallback.md +14 -0
- package/stacks/modeling-kit/templates/.claude/skills/examples/SKILL.md +3 -110
- package/stacks/modeling-kit/templates/.claude/skills/examples/references/api-fallback.md +118 -0
- package/stacks/modeling-kit/templates/.claude/skills/handle-comment/SKILL.md +5 -25
- package/stacks/modeling-kit/templates/.claude/skills/handle-comment/references/api-fallback.md +35 -0
- package/stacks/modeling-kit/templates/.claude/skills/html-screen/SKILL.md +9 -44
- package/stacks/modeling-kit/templates/.claude/skills/html-screen/references/api-fallback.md +51 -0
- package/stacks/modeling-kit/templates/.claude/skills/place-element/SKILL.md +34 -180
- package/stacks/modeling-kit/templates/.claude/skills/place-element/references/api-fallback.md +203 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard/SKILL.md +14 -81
- package/stacks/modeling-kit/templates/.claude/skills/storyboard/references/api-fallback.md +74 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/SKILL.md +4 -45
- package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/references/api-fallback.md +44 -0
- package/stacks/modeling-kit/templates/.claude/skills/timeline/SKILL.md +19 -88
- package/stacks/modeling-kit/templates/.claude/skills/timeline/references/api-fallback.md +91 -0
- package/stacks/modeling-kit/templates/.claude/skills/update-prompt-status/SKILL.md +1 -9
- package/stacks/modeling-kit/templates/.claude/skills/update-prompt-status/references/api-fallback.md +14 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-integrating-legacy-systems/SKILL.md +0 -674
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/snapshotting.md +0 -204
package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md
CHANGED
|
@@ -11,6 +11,8 @@ allowed-tools:
|
|
|
11
11
|
|
|
12
12
|
> **Before doing anything else**, invoke the `connect` skill — if not already connected — to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL`. Do not proceed until it has completed. Consult `learn-eventmodelers-api` only if you need to look up a specific endpoint or field this file doesn't cover — don't load it eagerly.
|
|
13
13
|
|
|
14
|
+
This step applies the shared element rules in **`eventmodeling-core-rules`** — read it once per session if you haven't already; it defines what a COMMAND/EVENT/READMODEL/SCREEN/AUTOMATION is, how each is named, and the anti-patterns to reject, so this step doesn't restate them.
|
|
15
|
+
|
|
14
16
|
Prefer `mcp__eventmodelers__*` tools when available (registered by the `connect` skill) — the curl blocks below are the fallback for sessions without MCP connected.
|
|
15
17
|
|
|
16
18
|
## GWT vs. Storyline — Decision Rule
|
|
@@ -83,12 +85,8 @@ in a sibling `meta.storylines` collection.
|
|
|
83
85
|
|
|
84
86
|
**When to Interview**: Skip if the user has already specified: scenario coverage depth (happy path + validation + state violations), known edge cases to include, and stakeholders available for review. Interview when coverage goals are unclear or edge cases haven't been identified.
|
|
85
87
|
|
|
86
|
-
**Interview Strategy**: Align on scenario depth and coverage strategy to avoid under-specification or excessive documentation. Identify stakeholders who can validate business rules.
|
|
87
|
-
|
|
88
88
|
### Critical Questions
|
|
89
89
|
|
|
90
|
-
When scenario coverage is uncertain:
|
|
91
|
-
|
|
92
90
|
1. **Scenario Depth & Coverage Goals** (Impact: Determines scope—happy path only vs. comprehensive coverage)
|
|
93
91
|
- Question: "How comprehensive should scenario coverage be? (A) Happy path + basic validation, (B) All command variations, (C) Comprehensive including edge cases and error paths"
|
|
94
92
|
- Why it matters: Affects time investment and implementation complexity; production code needs (C), design validation might use (A) or (B)
|
|
@@ -109,80 +107,7 @@ When scenario coverage is uncertain:
|
|
|
109
107
|
- Why it matters: Multi-role review catches business logic errors; single role may miss perspective
|
|
110
108
|
- Follow-up triggers: If (A) only → ask "Will PO have time for detailed review?"; if (C) → plan review workshop
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
**Conditional Entry**:
|
|
115
|
-
```
|
|
116
|
-
If user has provided:
|
|
117
|
-
- Clear scenario coverage goals (happy path + validation + state violations)
|
|
118
|
-
- AND identified edge cases or known business rules to test
|
|
119
|
-
- AND specified who will review/validate scenarios
|
|
120
|
-
|
|
121
|
-
Then: Skip interview, proceed directly to scenario elaboration
|
|
122
|
-
|
|
123
|
-
Else: Conduct interview
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**Phase 1: Coverage Planning** (Questions 1-2)
|
|
127
|
-
- Determine depth (happy path vs. comprehensive)
|
|
128
|
-
- Identify critical edge cases to cover
|
|
129
|
-
- Establish coverage priorities
|
|
130
|
-
|
|
131
|
-
**Phase 2: Implementation & Review** (Questions 3-4)
|
|
132
|
-
- Decide on automation vs. documentation
|
|
133
|
-
- Confirm stakeholder availability
|
|
134
|
-
- Plan review workflow
|
|
135
|
-
|
|
136
|
-
### Capturing Interview Findings
|
|
137
|
-
|
|
138
|
-
Append findings to the project's event modeling file:
|
|
139
|
-
|
|
140
|
-
**File**: `.trogonai/interviews/[project-name]/EVENTMODELING.md`
|
|
141
|
-
|
|
142
|
-
Use Write tool to add/update this section:
|
|
143
|
-
|
|
144
|
-
```markdown
|
|
145
|
-
## 7. Scenarios (eventmodeling-elaborating-scenarios)
|
|
146
|
-
|
|
147
|
-
### Coverage Goals
|
|
148
|
-
[From Q1: Happy path / Comprehensive / Deep]
|
|
149
|
-
|
|
150
|
-
### Critical Edge Cases
|
|
151
|
-
[From Q2]
|
|
152
|
-
- Edge case 1: [Case] → [Why important]
|
|
153
|
-
- Edge case 2: [Case] → [Why important]
|
|
154
|
-
|
|
155
|
-
### Business Rules Requiring Scenarios
|
|
156
|
-
[From Q2]
|
|
157
|
-
- Rule 1: [Statement] → Success + Failure scenarios
|
|
158
|
-
- Rule 2: [Statement] → Success + Failure scenarios
|
|
159
|
-
|
|
160
|
-
### Testing Strategy
|
|
161
|
-
[From Q3: Automated / Manual / Documentation]
|
|
162
|
-
|
|
163
|
-
### Review & Validation
|
|
164
|
-
[From Q4: Who reviews, when, workflow]
|
|
165
|
-
|
|
166
|
-
### Key Scenario Specifications
|
|
167
|
-
[GWT format scenarios for critical commands and views]
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Validation & Completeness
|
|
172
|
-
|
|
173
|
-
### Validated
|
|
174
|
-
- [ ] All fields traced (completeness check)
|
|
175
|
-
- [ ] Events are immutable
|
|
176
|
-
- [ ] State projections deterministic
|
|
177
|
-
- [ ] Model ready for code generation
|
|
178
|
-
|
|
179
|
-
**Validation Date**: [Date]
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Update Interview Trail:
|
|
183
|
-
```markdown
|
|
184
|
-
| 7 | eventmodeling-elaborating-scenarios | [today] | Scenario coverage, testing strategy, edge cases |
|
|
185
|
-
```
|
|
110
|
+
Follow **`eventmodeling-interview-protocol`** to run this interview and record its findings — label this step "**7. Scenarios** (`eventmodeling-elaborating-scenarios`)". Findings should cover: coverage goals, critical edge cases, business rules requiring scenarios, testing strategy, review/validation plan, and the key scenario specifications themselves (GWT format for critical commands and views).
|
|
186
111
|
|
|
187
112
|
Scenarios are done, but the model is not yet ready for implementation — Steps 8–11
|
|
188
113
|
(Completeness, Validation, Slicing, Documentation) still follow. Proceed to Step 8
|
|
@@ -294,52 +219,25 @@ collapsing into one reused schema for every command and read model alike.
|
|
|
294
219
|
|
|
295
220
|
For each command and view, write scenarios in Given-When-Then format:
|
|
296
221
|
|
|
222
|
+
The full worked example set for every category below (command scenarios, state validation, view scenarios, list-type views, error paths, compensation) lives in `references/examples.md` — one compact example per category is shown here.
|
|
223
|
+
|
|
297
224
|
### 1. Command Scenarios (Given-When-Then)
|
|
298
225
|
Specify command behavior:
|
|
299
226
|
|
|
300
227
|
```
|
|
301
|
-
Feature: Order Creation
|
|
302
|
-
|
|
303
228
|
Scenario: Create order successfully
|
|
304
229
|
Given a customer with ID "cust-123"
|
|
305
230
|
And products exist with IDs ["prod-1", "prod-2"]
|
|
306
|
-
And customer has valid shipping address
|
|
307
231
|
When the customer creates an order with items:
|
|
308
232
|
| productId | quantity | unitPrice |
|
|
309
233
|
| prod-1 | 2 | 50.00 |
|
|
310
|
-
| prod-2 | 1 | 30.00 |
|
|
311
234
|
Then the order should be created with status "Draft"
|
|
312
|
-
And
|
|
313
|
-
And an "OrderCreated" event is produced with:
|
|
314
|
-
| field | value |
|
|
315
|
-
| orderId | {uuid} |
|
|
316
|
-
| customerId | cust-123 |
|
|
317
|
-
| items | [...] |
|
|
318
|
-
| total | 130.00 |
|
|
319
|
-
| status | Draft |
|
|
235
|
+
And an "OrderCreated" event is produced with orderId, customerId, items, total, status
|
|
320
236
|
|
|
321
237
|
Scenario: Reject order with invalid customer
|
|
322
|
-
Given a customer ID "invalid-cust"
|
|
323
|
-
And no customer exists with that ID
|
|
324
|
-
When the customer tries to create an order
|
|
325
|
-
Then the command should be rejected
|
|
326
|
-
And the rejection reason is "Customer not found"
|
|
327
|
-
And no event is produced
|
|
328
|
-
|
|
329
|
-
Scenario: Reject order with empty items
|
|
330
|
-
Given a customer with ID "cust-123"
|
|
331
|
-
And an empty items list []
|
|
238
|
+
Given a customer ID "invalid-cust" that doesn't exist
|
|
332
239
|
When the customer tries to create an order
|
|
333
|
-
Then the command should be rejected
|
|
334
|
-
And the rejection reason is "Order must contain items"
|
|
335
|
-
And no event is produced
|
|
336
|
-
|
|
337
|
-
Scenario: Reject order with invalid address
|
|
338
|
-
Given a customer with ID "cust-123"
|
|
339
|
-
And an incomplete shipping address (missing city)
|
|
340
|
-
When the customer tries to create an order
|
|
341
|
-
Then the command should be rejected
|
|
342
|
-
And the rejection reason is "Invalid shipping address"
|
|
240
|
+
Then the command should be rejected, reason "Customer not found"
|
|
343
241
|
And no event is produced
|
|
344
242
|
```
|
|
345
243
|
|
|
@@ -347,99 +245,40 @@ And no event is produced
|
|
|
347
245
|
Specify how stream state affects command:
|
|
348
246
|
|
|
349
247
|
```
|
|
350
|
-
Feature: Order Confirmation
|
|
351
|
-
|
|
352
248
|
Scenario: Confirm order in Draft state
|
|
353
|
-
Given an order "order-456" in Draft state
|
|
354
|
-
And OrderCreated event exists
|
|
355
|
-
And no OrderConfirmed event exists
|
|
249
|
+
Given an order "order-456" in Draft state, OrderCreated event exists
|
|
356
250
|
When the customer confirms the order with payment method "card"
|
|
357
|
-
Then
|
|
358
|
-
And an "OrderConfirmed" event is produced with:
|
|
359
|
-
| field | value |
|
|
360
|
-
| orderId | order-456 |
|
|
361
|
-
| paymentMethod | card |
|
|
362
|
-
| confirmedAt | {timestamp} |
|
|
251
|
+
Then an "OrderConfirmed" event is produced with orderId, paymentMethod, confirmedAt
|
|
363
252
|
|
|
364
253
|
Scenario: Reject confirming already-confirmed order
|
|
365
|
-
Given an order "order-456" in Confirmed state
|
|
366
|
-
And OrderConfirmed event already exists
|
|
254
|
+
Given an order "order-456" in Confirmed state, OrderConfirmed event already exists
|
|
367
255
|
When the customer tries to confirm the order again
|
|
368
|
-
Then the command should be rejected
|
|
369
|
-
And the rejection reason is "Order already confirmed"
|
|
370
|
-
And no OrderConfirmed event is produced
|
|
371
|
-
|
|
372
|
-
Scenario: Reject confirming cancelled order
|
|
373
|
-
Given an order "order-456" in Cancelled state
|
|
374
|
-
And OrderCancelled event exists
|
|
375
|
-
When the customer tries to confirm the order
|
|
376
|
-
Then the command should be rejected
|
|
377
|
-
And the rejection reason is "Cannot confirm cancelled order"
|
|
378
|
-
And no event is produced
|
|
256
|
+
Then the command should be rejected, reason "Order already confirmed"
|
|
379
257
|
```
|
|
380
258
|
|
|
381
259
|
### 3. View Scenarios (Given-When-Then)
|
|
382
260
|
Specify how read models display data:
|
|
383
261
|
|
|
384
262
|
```
|
|
385
|
-
Feature: Order Status View
|
|
386
|
-
|
|
387
263
|
Scenario: Display order after creation
|
|
388
|
-
Given an OrderCreated event with
|
|
389
|
-
| field | value |
|
|
390
|
-
| orderId | order-789 |
|
|
391
|
-
| customerId | cust-123 |
|
|
392
|
-
| items | [{...}] |
|
|
393
|
-
| total | 150.00 |
|
|
264
|
+
Given an OrderCreated event with orderId, customerId, items, total
|
|
394
265
|
When the OrderStatusView processes this event
|
|
395
|
-
Then the view should display
|
|
396
|
-
| field | value |
|
|
397
|
-
| Order ID | order-789 |
|
|
398
|
-
| Status | Draft |
|
|
399
|
-
| Total | $150.00 |
|
|
400
|
-
| Items | 3 products |
|
|
401
|
-
| Created | {date} |
|
|
402
|
-
|
|
403
|
-
Scenario: Update status after confirmation
|
|
404
|
-
Given an OrderCreated event already processed
|
|
405
|
-
And OrderStatusView showing status "Draft"
|
|
406
|
-
When an OrderConfirmed event is received with:
|
|
407
|
-
| field | value |
|
|
408
|
-
| orderId | order-789 |
|
|
409
|
-
| confirmedAt | 2024-12-31T10:00:00Z |
|
|
410
|
-
Then the view should update to display:
|
|
411
|
-
| field | value |
|
|
412
|
-
| Status | Confirmed |
|
|
413
|
-
| Confirmed Date | 12/31/2024 10:00 AM |
|
|
266
|
+
Then the view should display Order ID, Status "Draft", Total, Items, Created
|
|
414
267
|
|
|
415
268
|
Scenario: Accumulate payment information
|
|
416
269
|
Given OrderConfirmed event processed (status=Confirmed)
|
|
417
|
-
When a PaymentAuthorized event arrives with
|
|
418
|
-
|
|
419
|
-
| orderId | order-789 |
|
|
420
|
-
| paymentId | pay-123 |
|
|
421
|
-
| authCode | AUTH-456 |
|
|
422
|
-
Then the view should accumulate:
|
|
423
|
-
| field | value |
|
|
424
|
-
| Payment ID | pay-123 |
|
|
425
|
-
| Auth Code | AUTH-456 |
|
|
426
|
-
| Payment Status | Authorized |
|
|
270
|
+
When a PaymentAuthorized event arrives with paymentId, authCode
|
|
271
|
+
Then the view should accumulate Payment ID, Auth Code, Payment Status "Authorized"
|
|
427
272
|
```
|
|
428
273
|
|
|
429
274
|
### 3b. List-type Read Model Scenarios
|
|
430
275
|
Specify expected rows and empty-list intent when the THEN readmodel is a list (`listElement: true`):
|
|
431
276
|
|
|
432
277
|
```
|
|
433
|
-
Feature: Product Catalog
|
|
434
|
-
|
|
435
278
|
Scenario: Products list shows all created products
|
|
436
|
-
Given a ProductCreated event with name "Shoes", index "0"
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
Then the list should contain:
|
|
440
|
-
| name | index | family_id |
|
|
441
|
-
| Shoes | 0 | 22222... |
|
|
442
|
-
| Clothing | 1 | 33333... |
|
|
279
|
+
Given a ProductCreated event with name "Shoes", index "0"
|
|
280
|
+
When the ProductList view processes this event
|
|
281
|
+
Then the list should contain: | name | index | ... | Shoes | 0 | ... |
|
|
443
282
|
|
|
444
283
|
Scenario: Products list is empty after last item is deleted
|
|
445
284
|
Given a ProductDeleted event for the last remaining item
|
|
@@ -451,61 +290,28 @@ Then the list should be empty
|
|
|
451
290
|
Specify how system handles failures:
|
|
452
291
|
|
|
453
292
|
```
|
|
454
|
-
Feature: Payment Authorization Failure
|
|
455
|
-
|
|
456
293
|
Scenario: Handle declined payment
|
|
457
294
|
Given an order "order-001" in Confirmed state
|
|
458
|
-
And customer initiates payment
|
|
459
295
|
When the payment gateway declines the card
|
|
460
|
-
Then a PaymentFailed event is produced with
|
|
461
|
-
| field | value |
|
|
462
|
-
| orderId | order-001 |
|
|
463
|
-
| reason | Card declined |
|
|
464
|
-
| timestamp | {now} |
|
|
465
|
-
|
|
466
|
-
Scenario: Update order view on payment failure
|
|
467
|
-
Given OrderStatusView shows status "Confirmed"
|
|
468
|
-
When PaymentFailed event arrives for order-001
|
|
469
|
-
Then the view should update:
|
|
470
|
-
| field | value |
|
|
471
|
-
| Payment Status | Failed |
|
|
472
|
-
| Failure Reason | Card declined |
|
|
473
|
-
| Retry Available | Yes |
|
|
296
|
+
Then a PaymentFailed event is produced with orderId, reason, timestamp
|
|
474
297
|
|
|
475
298
|
Scenario: Allow retry after payment failure
|
|
476
|
-
Given a PaymentFailed event exists
|
|
477
|
-
And order status is still "Confirmed"
|
|
299
|
+
Given a PaymentFailed event exists, order status is still "Confirmed"
|
|
478
300
|
When customer retries payment
|
|
479
301
|
Then the new AuthorizePayment command is accepted
|
|
480
|
-
And can produce new PaymentAuthorized event
|
|
481
302
|
```
|
|
482
303
|
|
|
483
304
|
### 5. Compensation Scenarios
|
|
484
305
|
Specify rollback/cancellation flows:
|
|
485
306
|
|
|
486
307
|
```
|
|
487
|
-
Feature: Order Cancellation
|
|
488
|
-
|
|
489
308
|
Scenario: Cancel order in Draft state
|
|
490
|
-
Given an order "order-555" in Draft state
|
|
491
|
-
And only OrderCreated event exists
|
|
309
|
+
Given an order "order-555" in Draft state, only OrderCreated event exists
|
|
492
310
|
When customer cancels the order with reason "Changed mind"
|
|
493
|
-
Then an OrderCancelled event is produced with
|
|
494
|
-
| field | value |
|
|
495
|
-
| orderId | order-555 |
|
|
496
|
-
| reason | Changed mind |
|
|
497
|
-
| cancelledAt | {timestamp} |
|
|
498
|
-
|
|
499
|
-
Scenario: Cannot cancel completed order
|
|
500
|
-
Given an order "order-555" in Delivered state
|
|
501
|
-
And DeliveryConfirmed event exists
|
|
502
|
-
When customer tries to cancel
|
|
503
|
-
Then the command should be rejected
|
|
504
|
-
And the rejection reason is "Cannot cancel delivered order"
|
|
311
|
+
Then an OrderCancelled event is produced with orderId, reason, cancelledAt
|
|
505
312
|
|
|
506
313
|
Scenario: Trigger compensation on cancellation
|
|
507
|
-
Given an order in Confirmed state
|
|
508
|
-
And PaymentAuthorized event exists
|
|
314
|
+
Given an order in Confirmed state, PaymentAuthorized event exists
|
|
509
315
|
When OrderCancelled event is produced
|
|
510
316
|
Then a RefundPayment command should be automatically triggered
|
|
511
317
|
And RefundInitiated event should follow
|
|
@@ -513,135 +319,7 @@ And RefundInitiated event should follow
|
|
|
513
319
|
|
|
514
320
|
## Output Format
|
|
515
321
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
````markdown
|
|
519
|
-
# Scenarios: [Domain Name]
|
|
520
|
-
|
|
521
|
-
## Commands
|
|
522
|
-
|
|
523
|
-
### Command: CreateOrder
|
|
524
|
-
|
|
525
|
-
**Description**: Customer creates a new order with items and shipping address.
|
|
526
|
-
|
|
527
|
-
#### Scenario 1: Successful Order Creation
|
|
528
|
-
```gherkin
|
|
529
|
-
Given a customer with ID "cust-123"
|
|
530
|
-
And products ["prod-1", "prod-2"] exist in catalog
|
|
531
|
-
And the shipping address is valid
|
|
532
|
-
When the customer creates an order:
|
|
533
|
-
| customerId | cust-123 |
|
|
534
|
-
| items | [{productId: prod-1, qty: 2}, {productId: prod-2, qty: 1}] |
|
|
535
|
-
| shippingAddress | {street, city, state, zip} |
|
|
536
|
-
Then the command succeeds
|
|
537
|
-
And an "OrderCreated" event is produced with all input data
|
|
538
|
-
And the order status is "Draft"
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
#### Scenario 2: Reject with Invalid Customer
|
|
542
|
-
```gherkin
|
|
543
|
-
Given a customer ID "invalid" that doesn't exist
|
|
544
|
-
When the customer tries to create an order
|
|
545
|
-
Then the command is rejected
|
|
546
|
-
And the error is "Customer not found"
|
|
547
|
-
And no event is produced
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
[Continue for each scenario]
|
|
551
|
-
|
|
552
|
-
---
|
|
553
|
-
|
|
554
|
-
### Command: ConfirmOrder
|
|
555
|
-
|
|
556
|
-
**Description**: Customer confirms order and selects payment method.
|
|
557
|
-
|
|
558
|
-
#### Scenario 1: Confirm Draft Order
|
|
559
|
-
```gherkin
|
|
560
|
-
Given an order in "Draft" state
|
|
561
|
-
And OrderCreated event exists
|
|
562
|
-
When the customer confirms with paymentMethod="card"
|
|
563
|
-
Then an "OrderConfirmed" event is produced
|
|
564
|
-
And the order status becomes "Confirmed"
|
|
565
|
-
```
|
|
566
|
-
|
|
567
|
-
#### Scenario 2: Prevent Duplicate Confirmation
|
|
568
|
-
```gherkin
|
|
569
|
-
Given an order already in "Confirmed" state
|
|
570
|
-
And OrderConfirmed event already exists
|
|
571
|
-
When the customer tries to confirm again
|
|
572
|
-
Then the command is rejected
|
|
573
|
-
And the error is "Order already confirmed"
|
|
574
|
-
And no new event is produced
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
---
|
|
578
|
-
|
|
579
|
-
## Views
|
|
580
|
-
|
|
581
|
-
### View: OrderStatusView
|
|
582
|
-
|
|
583
|
-
**Description**: Real-time order status display showing accumulated event data.
|
|
584
|
-
|
|
585
|
-
#### Scenario 1: Initial Display After Creation
|
|
586
|
-
```gherkin
|
|
587
|
-
Given an OrderCreated event with id, customer, items, total, address
|
|
588
|
-
When the view processes this event
|
|
589
|
-
Then the view displays:
|
|
590
|
-
- Order ID: order-123
|
|
591
|
-
- Status: Draft
|
|
592
|
-
- Total: $150.00
|
|
593
|
-
- Items: 3 products
|
|
594
|
-
- Customer: cust-456
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
#### Scenario 2: Update on Confirmation
|
|
598
|
-
```gherkin
|
|
599
|
-
Given the view displaying status="Draft"
|
|
600
|
-
When an OrderConfirmed event arrives
|
|
601
|
-
Then the view updates to:
|
|
602
|
-
- Status: Confirmed
|
|
603
|
-
- Confirmed At: {timestamp}
|
|
604
|
-
- Payment Method: (from event)
|
|
605
|
-
```
|
|
606
|
-
|
|
607
|
-
#### Scenario 3: Accumulate Payment Data
|
|
608
|
-
```gherkin
|
|
609
|
-
Given status="Confirmed"
|
|
610
|
-
When PaymentAuthorized event arrives
|
|
611
|
-
Then the view shows:
|
|
612
|
-
- Payment Status: Authorized
|
|
613
|
-
- Auth Code: (from event)
|
|
614
|
-
- Payment ID: (from event)
|
|
615
|
-
```
|
|
616
|
-
|
|
617
|
-
---
|
|
618
|
-
|
|
619
|
-
## Error Paths
|
|
620
|
-
|
|
621
|
-
### Scenario: Payment Decline
|
|
622
|
-
```gherkin
|
|
623
|
-
Given an order in "Confirmed" state
|
|
624
|
-
When payment gateway declines
|
|
625
|
-
Then PaymentFailed event is produced
|
|
626
|
-
And OrderStatusView updates to show:
|
|
627
|
-
- Payment Status: Failed
|
|
628
|
-
- Retry Available: true
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
---
|
|
632
|
-
|
|
633
|
-
## Compensation Flows
|
|
634
|
-
|
|
635
|
-
### Scenario: Order Cancellation with Refund
|
|
636
|
-
```gherkin
|
|
637
|
-
Given an order in "Confirmed" state
|
|
638
|
-
And PaymentAuthorized event exists
|
|
639
|
-
When OrderCancelled event is produced
|
|
640
|
-
Then a RefundPayment command is triggered
|
|
641
|
-
And RefundInitiated event follows
|
|
642
|
-
And inventory reservation is released
|
|
643
|
-
```
|
|
644
|
-
````
|
|
322
|
+
There is no markdown-document output for this step — the deliverable is the scenarios posted directly to the board's spec cells (see "Post Scenarios to Board" below), using the same command/view/list/error/compensation scenario shapes already illustrated in the Workflow section above (§1–5). Group scenarios under their command or view exactly as shown there; there's no separate presentation format to produce first.
|
|
645
323
|
|
|
646
324
|
## Post Scenarios to Board
|
|
647
325
|
|
|
@@ -656,11 +334,7 @@ Fetch all CHAPTER nodes to find the timeline.
|
|
|
656
334
|
mcp__eventmodelers__get_nodes { "boardId": "<BOARD_ID>", "type": "CHAPTER" }
|
|
657
335
|
```
|
|
658
336
|
|
|
659
|
-
**Fallback (no MCP):**
|
|
660
|
-
```bash
|
|
661
|
-
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?type=CHAPTER" \
|
|
662
|
-
-H "x-token: $TOKEN"
|
|
663
|
-
```
|
|
337
|
+
**Fallback (no MCP):** see `references/api-fallback.md` — "Post Scenarios to Board — Step 1: Identify the Target Timeline and Column".
|
|
664
338
|
|
|
665
339
|
If there is more than one chapter, ask the user which timeline to target.
|
|
666
340
|
|
|
@@ -675,12 +349,7 @@ For each target timeline, call spec-info to discover the node IDs that may appea
|
|
|
675
349
|
mcp__eventmodelers__get_spec_info { "boardId": "<BOARD_ID>", "timelineId": "<TL>" }
|
|
676
350
|
```
|
|
677
351
|
|
|
678
|
-
**Fallback (no MCP):**
|
|
679
|
-
```bash
|
|
680
|
-
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/timelines/$TL/spec-info" \
|
|
681
|
-
-H "x-token: $TOKEN"
|
|
682
|
-
# → { timelineId, elements: [{ id, title, type }] }
|
|
683
|
-
```
|
|
352
|
+
**Fallback (no MCP):** see `references/api-fallback.md` — "Post Scenarios to Board — Step 2: Load Valid Step Elements".
|
|
684
353
|
|
|
685
354
|
Build a lookup map: `title (lowercase) → { id, type }`. Use this to resolve scenario step names to node IDs.
|
|
686
355
|
|
|
@@ -700,22 +369,14 @@ mcp__eventmodelers__add_scenario {
|
|
|
700
369
|
"boardId": "<BOARD_ID>",
|
|
701
370
|
"timelineId": "<TL>",
|
|
702
371
|
"columnId": "<COL>",
|
|
703
|
-
"scenarios": [...scenario objects, same shape as below...]
|
|
372
|
+
"scenarios": [...scenario objects, same shape as below...],
|
|
373
|
+
"compact": true
|
|
704
374
|
}
|
|
705
375
|
```
|
|
376
|
+
Pass `compact: true` — you already hold every scenario object you sent, so the response only needs to confirm `{added, scenarioCount, isNewNode}`, not echo all of them back. Same for `add_storyline`. Across a full pass posting scenarios for every command and read model column, this is the bulk of the step's response tokens.
|
|
706
377
|
`given`/`when`/`then` are arrays of `{id, title?, type?, ...}` objects — **not** bare nodeId strings (this differs from the raw REST body shown in the fallback below). The examples in Steps 4b/4c/§Rejection already use this object shape; pass them straight through as the `scenarios` array. For a state-view scenario whose `when` needs to represent a query rather than a COMMAND, `when` may hold a single inline object that is **not** a board node: `{"id": "<generated-uuid>", "type": "QUERY", "title": "...", "fields": [{"name": "...", "example": "..."}]}`. Same server-side rules apply either way (see below).
|
|
707
378
|
|
|
708
|
-
**Fallback (no MCP):**
|
|
709
|
-
```bash
|
|
710
|
-
curl -s -X POST \
|
|
711
|
-
"$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/timelines/$TL/columns/$COL/scenarios" \
|
|
712
|
-
-H "x-token: $TOKEN" \
|
|
713
|
-
-H "Content-Type: application/json" \
|
|
714
|
-
-d '[...scenario objects...]'
|
|
715
|
-
# → 201 { specNodeId, scenarios (all), added (count), isNewNode }
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
On `409` (duplicate title) or `400` (validation error), log the error and retry without the offending scenario. On `404`, check that the timeline and column IDs are correct.
|
|
379
|
+
**Fallback (no MCP):** see `references/api-fallback.md` — "Post Scenarios to Board — Step 4: Post All Scenarios for a Column in One Call".
|
|
719
380
|
|
|
720
381
|
**Rules enforced by the server (do not pre-validate — let the server reject):**
|
|
721
382
|
- `given`: EVENTs only
|
|
@@ -872,16 +533,6 @@ Bad:
|
|
|
872
533
|
Then there's an error
|
|
873
534
|
```
|
|
874
535
|
|
|
875
|
-
## Scenario Organization
|
|
876
|
-
|
|
877
|
-
1. **Happy Path**: Successful execution
|
|
878
|
-
2. **Validation Failures**: Invalid inputs
|
|
879
|
-
3. **State Violations**: Wrong pre-conditions
|
|
880
|
-
4. **Duplicate Actions**: Already processed
|
|
881
|
-
5. **Alternative Paths**: Different branches
|
|
882
|
-
6. **Error Handling**: Failures and recovery
|
|
883
|
-
7. **Compensation**: Rollback and cleanup
|
|
884
|
-
|
|
885
536
|
## Key Principles
|
|
886
537
|
|
|
887
538
|
1. **One Scenario = One Test**: Each scenario is testable
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Elaborating Scenarios — curl Fallback Calls
|
|
2
|
+
|
|
3
|
+
Only needed when MCP is not connected. Every call below has an MCP equivalent in the main SKILL.md — always prefer that.
|
|
4
|
+
|
|
5
|
+
## Post Scenarios to Board — Step 1: Identify the Target Timeline and Column
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/nodes?type=CHAPTER" \
|
|
9
|
+
-H "x-token: $TOKEN"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Post Scenarios to Board — Step 2: Load Valid Step Elements
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
curl -s "$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/timelines/$TL/spec-info" \
|
|
16
|
+
-H "x-token: $TOKEN"
|
|
17
|
+
# → { timelineId, elements: [{ id, title, type }] }
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Post Scenarios to Board — Step 4: Post All Scenarios for a Column in One Call
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -s -X POST \
|
|
24
|
+
"$BASE_URL/api/org/$ORG_ID/boards/$BOARD_ID/timelines/$TL/columns/$COL/scenarios" \
|
|
25
|
+
-H "x-token: $TOKEN" \
|
|
26
|
+
-H "Content-Type: application/json" \
|
|
27
|
+
-d '[...scenario objects...]'
|
|
28
|
+
# → 201 { specNodeId, scenarios (all), added (count), isNewNode }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
On `409` (duplicate title) or `400` (validation error), log the error and retry without the offending scenario. On `404`, check that the timeline and column IDs are correct.
|