@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
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# Snapshotting Strategy
|
|
2
|
-
|
|
3
|
-
## Contents
|
|
4
|
-
- Criteria for Snapshotting
|
|
5
|
-
- Context-Based Decision Thresholds
|
|
6
|
-
- Snapshotting Downsides
|
|
7
|
-
- Snapshot Frequency & Versioning
|
|
8
|
-
- Snapshot Cleanup Strategies
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## When Snapshotting is Actually Needed
|
|
13
|
-
|
|
14
|
-
### Conservative First Approach: Keep Streams Short
|
|
15
|
-
|
|
16
|
-
**Default Principle**: Prefer shorter streams over snapshotting
|
|
17
|
-
- Shorter streams = simpler code, easier debugging, fewer bugs
|
|
18
|
-
- Snapshotting = added complexity that's hard to get right
|
|
19
|
-
- Most systems don't actually need snapshotting if designed well
|
|
20
|
-
|
|
21
|
-
### Criteria: Snapshotting Only When ALL Are True
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
1. Stream length > 100 events (conservative default) AND
|
|
25
|
-
2. You've measured latency and it exceeds SLA AND
|
|
26
|
-
3. The latency problem IS stream replay (not read model) AND
|
|
27
|
-
4. Aggregate boundary is already optimal (can't split further) AND
|
|
28
|
-
5. You have operational capability to maintain snapshots
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**If ANY criteria fail**: Don't snapshot. Redesign instead.
|
|
32
|
-
|
|
33
|
-
### Context-Based Thresholds (Ask These Questions)
|
|
34
|
-
|
|
35
|
-
Instead of assuming a fixed number, ask about your actual business context:
|
|
36
|
-
|
|
37
|
-
**Question 1: How is this aggregate read?**
|
|
38
|
-
```
|
|
39
|
-
"From stream replay" (loaded every time)
|
|
40
|
-
→ Conservative threshold: 50-100 events
|
|
41
|
-
→ Reason: Replay latency compounds
|
|
42
|
-
|
|
43
|
-
"From read model/cache" (projection loaded once)
|
|
44
|
-
→ Conservative threshold: Not relevant (stream size doesn't matter!)
|
|
45
|
-
→ Reason: You're not replaying on each read
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Question 2: What's your read latency requirement?**
|
|
49
|
-
```
|
|
50
|
-
"Immediate/real-time" (< 50ms, user-facing)
|
|
51
|
-
→ Conservative threshold: 50 events max
|
|
52
|
-
→ Reason: Strict SLA, no room for slowness
|
|
53
|
-
|
|
54
|
-
"Normal web response" (100-500ms, typical page load)
|
|
55
|
-
→ Conservative threshold: 100-300 events
|
|
56
|
-
→ Reason: Some latency acceptable if not critical path
|
|
57
|
-
|
|
58
|
-
"Background/batch operations" (seconds to minutes)
|
|
59
|
-
→ Conservative threshold: Not a concern
|
|
60
|
-
→ Reason: Speed doesn't matter for batch work
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**Question 3: How often is this aggregate read?**
|
|
64
|
-
```
|
|
65
|
-
"Very frequent" (> 100 reads/second)
|
|
66
|
-
→ Use threshold ÷ 5 (contention matters more)
|
|
67
|
-
→ Reason: Concurrent replays degrade badly
|
|
68
|
-
|
|
69
|
-
"Normal frequency" (1-10 reads/second)
|
|
70
|
-
→ Use stated threshold
|
|
71
|
-
→ Reason: Single-digit concurrency manageable
|
|
72
|
-
|
|
73
|
-
"Rare" (< 1 read per minute)
|
|
74
|
-
→ Use threshold × 2-3 (who cares about latency?)
|
|
75
|
-
→ Reason: Speed doesn't matter if rarely accessed
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### If User Doesn't Know (Most Common Case)
|
|
79
|
-
|
|
80
|
-
**Guidance**: Be conservative AND use conversation context
|
|
81
|
-
```
|
|
82
|
-
Default position:
|
|
83
|
-
→ Start with 100 events as safe threshold
|
|
84
|
-
→ This prevents 90% of problems
|
|
85
|
-
→ Better to redesign early than add snapshotting later
|
|
86
|
-
|
|
87
|
-
If user says "I don't know my requirements":
|
|
88
|
-
→ Use context from earlier conversation
|
|
89
|
-
→ Review: What did domain analysis say?
|
|
90
|
-
→ Check: What's the business criticality?
|
|
91
|
-
→ Ask: Is this user-facing or backend?
|
|
92
|
-
|
|
93
|
-
Example Decision Logic:
|
|
94
|
-
Domain: E-commerce (user-facing) + No explicit SLA
|
|
95
|
-
→ Use 100-event threshold (conservative for user-facing)
|
|
96
|
-
|
|
97
|
-
Domain: Bank transfers (critical) + No explicit SLA
|
|
98
|
-
→ Use 50-event threshold (very conservative, safety margin)
|
|
99
|
-
|
|
100
|
-
Domain: Analytics (batch) + No explicit SLA
|
|
101
|
-
→ Use 1000+ threshold (performance doesn't matter)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Snapshotting Downsides to Consider
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
Complexity Cost:
|
|
110
|
-
- Extra code path (snapshot loading logic)
|
|
111
|
-
- Testing complexity (snapshot + delta replay)
|
|
112
|
-
- Snapshot versioning challenges
|
|
113
|
-
- Potential for bugs in snapshot recovery
|
|
114
|
-
|
|
115
|
-
Operational Cost:
|
|
116
|
-
- Storage overhead (original events + snapshots)
|
|
117
|
-
- Cleanup and archival strategies
|
|
118
|
-
- Debugging difficulty (was it the snapshot?)
|
|
119
|
-
- Migration burden if snapshot format changes
|
|
120
|
-
|
|
121
|
-
Performance Cost:
|
|
122
|
-
- Snapshot creation cost
|
|
123
|
-
- Storage I/O for snapshots
|
|
124
|
-
- Memory usage during snapshot loading
|
|
125
|
-
- Synchronization between events and snapshots
|
|
126
|
-
|
|
127
|
-
Rule of Thumb:
|
|
128
|
-
Complexity of snapshotting ≈ 2-3x complexity of solving with better design
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Snapshotting Strategy (When Actually Needed)
|
|
134
|
-
|
|
135
|
-
### If You Decide Snapshotting is Necessary:
|
|
136
|
-
|
|
137
|
-
#### Snapshot Frequency Decision:
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
Rule: Snapshot every N events where N = √(Total Estimated Events)
|
|
141
|
-
|
|
142
|
-
Example:
|
|
143
|
-
If stream will eventually reach 10,000 events:
|
|
144
|
-
N = √10,000 = 100
|
|
145
|
-
Snapshot every 100 events
|
|
146
|
-
Result: 100 snapshots + max 100 events to replay = manageable
|
|
147
|
-
|
|
148
|
-
If stream reaches 100,000 events (red flag):
|
|
149
|
-
N = √100,000 = 316
|
|
150
|
-
Snapshot every 316 events
|
|
151
|
-
Result: 316 snapshots = storage issue, redesign needed
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**Better Rule**: Snapshot when read latency exceeds acceptable threshold
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
Measure:
|
|
158
|
-
1. Measure event replay time for current stream length
|
|
159
|
-
2. If > acceptable latency (e.g., 50ms), snapshot
|
|
160
|
-
3. Snapshot frequency = whatever makes latency acceptable
|
|
161
|
-
4. Re-measure after snapshot implementation
|
|
162
|
-
|
|
163
|
-
Example:
|
|
164
|
-
- Stream: 2000 events
|
|
165
|
-
- Replay time: 120ms (acceptable if reads are occasional)
|
|
166
|
-
- Snapshot needed? NO
|
|
167
|
-
- Decision: Monitor, implement snapshotting only if latency > 200ms
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
#### Snapshot Versioning:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
DON'T: Version snapshots, migrate old formats
|
|
174
|
-
DO: Version aggregates instead
|
|
175
|
-
|
|
176
|
-
Pattern:
|
|
177
|
-
Aggregate Version 1: Stream 1
|
|
178
|
-
Aggregate Version 2: New Stream with different structure
|
|
179
|
-
|
|
180
|
-
Reason: Snapshots are just optimization, not part of model
|
|
181
|
-
If snapshot format needs to change, it means your aggregate changed
|
|
182
|
-
→ Create new aggregate version with new stream instead
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
#### Snapshot Cleanup:
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
Good Strategy: Snapshot + Event Log
|
|
189
|
-
- Keep original events (immutable, source of truth)
|
|
190
|
-
- Keep snapshots (performance optimization)
|
|
191
|
-
- No special cleanup needed (both are authoritative together)
|
|
192
|
-
|
|
193
|
-
Bad Strategy: Snapshot + Purge Old Events
|
|
194
|
-
- Destroys event history
|
|
195
|
-
- Makes auditing impossible
|
|
196
|
-
- Complicates recovery
|
|
197
|
-
- Only do if regulatory rules require it
|
|
198
|
-
|
|
199
|
-
Alternative: Archive Old Events
|
|
200
|
-
- Keep all events for audit trail
|
|
201
|
-
- Archive to slower storage if needed
|
|
202
|
-
- Snapshot in hot storage for performance
|
|
203
|
-
- Best of both worlds
|
|
204
|
-
```
|