@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-applying-conways-law/SKILL.md
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eventmodeling-applying-conways-law
|
|
3
|
+
description: "Step 6 of Event Modeling - Apply Conway's Law with swimlanes. Organize events into autonomous system parts that different teams can independently own. Use after defining inputs/outputs. Do not use for: planning feature slice implementation order (use eventmodeling-slicing-event-models) or defining command/read model boundaries (use eventmodeling-designing-event-models)."
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- AskUserQuestion
|
|
6
|
+
- Write
|
|
7
|
+
- Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Applying Conway's Law
|
|
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 specified: existing team structure, team responsibilities, and autonomous boundary preferences. Interview when team structure is unclear or organizational alignment hasn't been discussed.
|
|
17
|
+
|
|
18
|
+
**Interview Strategy**: Understand team organization and decision-making to design system boundaries that teams can own independently. Misalignment here creates bottlenecks and tight coupling later.
|
|
19
|
+
|
|
20
|
+
### Critical Questions
|
|
21
|
+
|
|
22
|
+
When team structure or boundaries are unclear:
|
|
23
|
+
|
|
24
|
+
1. **Team Structure & Ownership** (Impact: Determines how many swimlanes/systems to create)
|
|
25
|
+
- Question: "How is your organization structured? (A) Single team owns everything, (B) Separate teams by domain (payments, inventory, etc.), (C) Separate teams by function (backend, frontend, etc.)"
|
|
26
|
+
- Why it matters: Team structure directly shapes system boundaries; aligning them reduces coordination overhead
|
|
27
|
+
- Follow-up triggers: If (B) → ask what each team owns; if (C) → discuss how to organize by domain instead
|
|
28
|
+
|
|
29
|
+
2. **Boundary Autonomy Level** (Impact: Determines coupling and inter-team communication patterns)
|
|
30
|
+
- Question: "How much autonomy should each team have? (A) Very high (minimal cross-team communication), (B) Moderate (coordinate via events), (C) Low (frequent coupling acceptable)"
|
|
31
|
+
- Why it matters: Highly autonomous teams need clean event-based boundaries; low autonomy might accept more coupling
|
|
32
|
+
- Follow-up triggers: If (A) → strict event-driven design; if (C) → discuss why coupling is needed
|
|
33
|
+
|
|
34
|
+
3. **External System Integrations** (Impact: Determines if integrations become separate swimlanes or embedded in existing ones)
|
|
35
|
+
- Question: "Do you need to integrate with external systems? (A) Payment processor, (B) Shipping provider, (C) Multiple external systems, (D) No external integrations?"
|
|
36
|
+
- Why it matters: External systems often become separate swimlanes; knowing which ones matters for boundary design
|
|
37
|
+
- Follow-up triggers: For each integration → ask "Who owns the integration—existing team or new team?"
|
|
38
|
+
|
|
39
|
+
### Interview Flow
|
|
40
|
+
|
|
41
|
+
**Conditional Entry**:
|
|
42
|
+
```
|
|
43
|
+
If user has provided:
|
|
44
|
+
- Clear team structure (who owns what)
|
|
45
|
+
- AND specified desired level of autonomy
|
|
46
|
+
- AND identified external integrations
|
|
47
|
+
|
|
48
|
+
Then: Skip interview, proceed directly to swimlanes
|
|
49
|
+
|
|
50
|
+
Else: Conduct interview
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Phase 1: Organization Assessment** (Questions 1-2)
|
|
54
|
+
- Understand team structure
|
|
55
|
+
- Determine autonomy expectations
|
|
56
|
+
- Establish boundary philosophy
|
|
57
|
+
|
|
58
|
+
**Phase 2: Integration Mapping** (Question 3)
|
|
59
|
+
- Identify external systems
|
|
60
|
+
- Plan integration boundaries
|
|
61
|
+
- Finalize swimlane count
|
|
62
|
+
|
|
63
|
+
### Capturing Interview Findings
|
|
64
|
+
|
|
65
|
+
Append findings to the project's event modeling file:
|
|
66
|
+
|
|
67
|
+
**File**: `.trogonai/interviews/[project-name]/EVENTMODELING.md`
|
|
68
|
+
|
|
69
|
+
Use Write tool to add/update this section:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## 6. Conway's Law (eventmodeling-applying-conways-law)
|
|
73
|
+
|
|
74
|
+
### Team Structure
|
|
75
|
+
- Team 1: [Name] - Owns [domain]
|
|
76
|
+
- Team 2: [Name] - Owns [domain]
|
|
77
|
+
- Team 3: [Name] - Owns [domain]
|
|
78
|
+
|
|
79
|
+
### Autonomy Goals
|
|
80
|
+
[High / Moderate / Low]
|
|
81
|
+
|
|
82
|
+
### Swimlanes
|
|
83
|
+
- [Swimlane 1]: [Team] owns [events]
|
|
84
|
+
- [Swimlane 2]: [Team] owns [events]
|
|
85
|
+
- [Swimlane 3]: [Team] owns [events]
|
|
86
|
+
|
|
87
|
+
### Cross-Team Communication
|
|
88
|
+
- [Team A] → [Team B] via [event]
|
|
89
|
+
- [Team B] → [Team C] via [event]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Update Interview Trail:
|
|
93
|
+
```markdown
|
|
94
|
+
| 6 | eventmodeling-applying-conways-law | [today] | Swimlanes defined, team boundaries confirmed |
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Workflow
|
|
100
|
+
|
|
101
|
+
Given all events, inputs, and outputs, organize by ownership:
|
|
102
|
+
|
|
103
|
+
### 1. Identify System Boundaries
|
|
104
|
+
Determine what constitutes a separate system/bounded context:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
System Boundaries:
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Order Management System
|
|
111
|
+
- Owns: Order entity and its lifecycle
|
|
112
|
+
- Events: OrderCreated, OrderConfirmed, Cancelled
|
|
113
|
+
- Owns: Order state machine
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
Payment Processing System
|
|
118
|
+
- Owns: Payment authorization and processing
|
|
119
|
+
- Events: PaymentAuthorized, PaymentFailed
|
|
120
|
+
- Owns: Payment state machine
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
Inventory System
|
|
125
|
+
- Owns: Stock levels and reservations
|
|
126
|
+
- Events: InventoryReserved, InventoryAllocated
|
|
127
|
+
- Owns: Inventory state machine
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
Fulfillment System
|
|
132
|
+
- Owns: Shipments and delivery
|
|
133
|
+
- Events: OrderShipped, DeliveryConfirmed
|
|
134
|
+
- Owns: Shipment state machine
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 2. Create Swimlane Diagram
|
|
139
|
+
Visual representation of system boundaries:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Event Stream Timeline
|
|
143
|
+
→
|
|
144
|
+
|
|
145
|
+
Order Team OrderCreated OrderConfirmed OrderCancelled
|
|
146
|
+
|
|
147
|
+
Payment Team PaymentAuthorized PaymentFailed
|
|
148
|
+
|
|
149
|
+
Inventory Team InventoryReserved
|
|
150
|
+
|
|
151
|
+
Fulfillment Team OrderShipped DeliveryConfirmed
|
|
152
|
+
|
|
153
|
+
Each team owns their swimlane events
|
|
154
|
+
Coordination via events crossing swimlanes
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 3. Map Team Responsibilities
|
|
158
|
+
Define what each team owns:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Order Management Team
|
|
162
|
+
Commands they handle:
|
|
163
|
+
- CreateOrder
|
|
164
|
+
- ConfirmOrder
|
|
165
|
+
- CancelOrder
|
|
166
|
+
Events they produce:
|
|
167
|
+
- OrderCreated
|
|
168
|
+
- OrderConfirmed
|
|
169
|
+
- OrderCancelled
|
|
170
|
+
Read Models they maintain:
|
|
171
|
+
- OrderStatusView
|
|
172
|
+
- OrderListView
|
|
173
|
+
Systems they call:
|
|
174
|
+
- Payment System (to confirm payment)
|
|
175
|
+
- Inventory System (to check stock)
|
|
176
|
+
|
|
177
|
+
Payment Processing Team
|
|
178
|
+
Commands they handle:
|
|
179
|
+
- AuthorizePayment
|
|
180
|
+
- ProcessPayment
|
|
181
|
+
- RefundPayment
|
|
182
|
+
Events they produce:
|
|
183
|
+
- PaymentAuthorized
|
|
184
|
+
- PaymentFailed
|
|
185
|
+
- PaymentRefunded
|
|
186
|
+
Read Models they maintain:
|
|
187
|
+
- PaymentStatusView
|
|
188
|
+
- TransactionHistory
|
|
189
|
+
Systems they depend on:
|
|
190
|
+
- Payment Gateway (external)
|
|
191
|
+
- Order System (for context)
|
|
192
|
+
|
|
193
|
+
Inventory Team
|
|
194
|
+
Commands they handle:
|
|
195
|
+
- ReserveInventory
|
|
196
|
+
- ReleaseReservation
|
|
197
|
+
- AllocateStock
|
|
198
|
+
Events they produce:
|
|
199
|
+
- InventoryReserved
|
|
200
|
+
- ReservationReleased
|
|
201
|
+
- StockAllocated
|
|
202
|
+
Read Models they maintain:
|
|
203
|
+
- InventoryLevelView
|
|
204
|
+
- ReservationView
|
|
205
|
+
Systems they depend on:
|
|
206
|
+
- Order System (triggers)
|
|
207
|
+
- Warehouse System (stock source)
|
|
208
|
+
|
|
209
|
+
Fulfillment Team
|
|
210
|
+
Commands they handle:
|
|
211
|
+
- CreateShipment
|
|
212
|
+
- MarkShipped
|
|
213
|
+
- ConfirmDelivery
|
|
214
|
+
Events they produce:
|
|
215
|
+
- ShipmentCreated
|
|
216
|
+
- OrderShipped
|
|
217
|
+
- DeliveryConfirmed
|
|
218
|
+
Read Models they maintain:
|
|
219
|
+
- ShipmentTrackingView
|
|
220
|
+
- DeliveryScheduleView
|
|
221
|
+
Systems they depend on:
|
|
222
|
+
- Inventory System (items to ship)
|
|
223
|
+
- Carrier APIs (tracking)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 4. Identify Inter-System Communication
|
|
227
|
+
Show how systems talk to each other:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
Communication Patterns:
|
|
231
|
+
|
|
232
|
+
Order System → Payment System
|
|
233
|
+
Order System produces: OrderConfirmed event
|
|
234
|
+
Payment System consumes: OrderConfirmed
|
|
235
|
+
Payment System reacts: Issues AuthorizePayment command
|
|
236
|
+
Payment System produces: PaymentAuthorized event
|
|
237
|
+
|
|
238
|
+
Order System → Inventory System
|
|
239
|
+
Order System produces: PaymentAuthorized event (indirectly)
|
|
240
|
+
Inventory System consumes: PaymentAuthorized
|
|
241
|
+
Inventory System reacts: Issues ReserveInventory command
|
|
242
|
+
Inventory System produces: InventoryReserved event
|
|
243
|
+
|
|
244
|
+
Inventory System → Fulfillment System
|
|
245
|
+
Inventory System produces: InventoryReserved event
|
|
246
|
+
Fulfillment System consumes: InventoryReserved
|
|
247
|
+
Fulfillment System reacts: Issues CreateShipment command
|
|
248
|
+
Fulfillment System produces: OrderShipped event
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 5. Define System Interfaces
|
|
252
|
+
What each system exposes:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
Order System Interface
|
|
256
|
+
Commands it accepts:
|
|
257
|
+
- CreateOrder (from UI)
|
|
258
|
+
- ConfirmOrder (from UI)
|
|
259
|
+
- CancelOrder (from UI or Processors)
|
|
260
|
+
Events it produces:
|
|
261
|
+
- OrderCreated
|
|
262
|
+
- OrderConfirmed
|
|
263
|
+
- OrderCancelled
|
|
264
|
+
Read Models it provides:
|
|
265
|
+
- OrderStatusView
|
|
266
|
+
- OrderListView
|
|
267
|
+
|
|
268
|
+
Payment System Interface
|
|
269
|
+
Commands it accepts:
|
|
270
|
+
- AuthorizePayment (from Payment Processor/Order System)
|
|
271
|
+
- ProcessPayment (from Order System)
|
|
272
|
+
Events it produces:
|
|
273
|
+
- PaymentAuthorized
|
|
274
|
+
- PaymentFailed
|
|
275
|
+
- PaymentProcessed
|
|
276
|
+
|
|
277
|
+
Inventory System Interface
|
|
278
|
+
Commands it accepts:
|
|
279
|
+
- ReserveInventory (triggered by PaymentAuthorized event)
|
|
280
|
+
Events it produces:
|
|
281
|
+
- InventoryReserved
|
|
282
|
+
- InventoryFailed
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 6. Identify Processors vs Systems
|
|
286
|
+
Show where automation lives:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Processors (autonomous automation):
|
|
290
|
+
|
|
291
|
+
1. PaymentProcessor
|
|
292
|
+
Triggered by: OrderConfirmed event
|
|
293
|
+
Logic: Calls external payment gateway
|
|
294
|
+
Produces: AuthorizePayment command
|
|
295
|
+
Lives in: Payment System
|
|
296
|
+
|
|
297
|
+
2. InventoryProcessor
|
|
298
|
+
Triggered by: PaymentAuthorized event
|
|
299
|
+
Logic: Checks stock, reserves inventory
|
|
300
|
+
Produces: ReserveInventory command
|
|
301
|
+
Lives in: Inventory System
|
|
302
|
+
|
|
303
|
+
3. FulfillmentProcessor
|
|
304
|
+
Triggered by: InventoryReserved event
|
|
305
|
+
Logic: Creates shipment records
|
|
306
|
+
Produces: CreateShipment command
|
|
307
|
+
Lives in: Fulfillment System
|
|
308
|
+
|
|
309
|
+
4. NotificationProcessor
|
|
310
|
+
Triggered by: OrderCreated, OrderConfirmed, OrderShipped events
|
|
311
|
+
Logic: Sends emails/SMS
|
|
312
|
+
Produces: No commands (info-only)
|
|
313
|
+
Lives in: Notification System (cross-cutting)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Output Format
|
|
317
|
+
|
|
318
|
+
Present as:
|
|
319
|
+
|
|
320
|
+
```markdown
|
|
321
|
+
# System Organization: [Domain Name]
|
|
322
|
+
|
|
323
|
+
## System Boundaries
|
|
324
|
+
|
|
325
|
+
### System: Order Management
|
|
326
|
+
- **Team**: Order Team
|
|
327
|
+
- **Responsibilities**: Create, confirm, cancel orders
|
|
328
|
+
- **Commands**: CreateOrder, ConfirmOrder, CancelOrder
|
|
329
|
+
- **Events Produced**: OrderCreated, OrderConfirmed, OrderCancelled
|
|
330
|
+
- **Events Consumed**: PaymentAuthorized, InventoryReserved (for state updates)
|
|
331
|
+
- **Read Models**: OrderStatusView, OrderListView
|
|
332
|
+
- **Scope**: One stream type (Order)
|
|
333
|
+
|
|
334
|
+
### System: Payment Processing
|
|
335
|
+
- **Team**: Payment Team
|
|
336
|
+
- **Responsibilities**: Authorize and process payments
|
|
337
|
+
- **Commands**: AuthorizePayment, ProcessPayment, RefundPayment
|
|
338
|
+
- **Events Produced**: PaymentAuthorized, PaymentFailed, PaymentRefunded
|
|
339
|
+
- **Events Consumed**: OrderConfirmed (from Order System)
|
|
340
|
+
- **Read Models**: PaymentStatusView, TransactionHistory
|
|
341
|
+
- **Dependencies**: External payment gateway
|
|
342
|
+
- **Scope**: One stream type (Payment)
|
|
343
|
+
|
|
344
|
+
### System: Inventory Management
|
|
345
|
+
- **Team**: Inventory Team
|
|
346
|
+
- **Responsibilities**: Stock management and reservations
|
|
347
|
+
- **Commands**: ReserveInventory, ReleaseReservation, AllocateStock
|
|
348
|
+
- **Events Produced**: InventoryReserved, ReservationReleased, StockAllocated
|
|
349
|
+
- **Events Consumed**: PaymentAuthorized (from Payment System)
|
|
350
|
+
- **Read Models**: InventoryLevelView, ReservationView
|
|
351
|
+
- **Dependencies**: Warehouse system
|
|
352
|
+
- **Scope**: One stream type (InventoryReservation)
|
|
353
|
+
|
|
354
|
+
[Continue for each system]
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Event Flow Across System Boundaries
|
|
359
|
+
|
|
360
|
+
### Flow: Order → Payment → Inventory → Fulfillment
|
|
361
|
+
|
|
362
|
+
```
|
|
363
|
+
Time →
|
|
364
|
+
|
|
365
|
+
Order System
|
|
366
|
+
OrderCreated →
|
|
367
|
+
OrderConfirmed →
|
|
368
|
+
(triggers)
|
|
369
|
+
Payment System
|
|
370
|
+
PaymentAuthorized →
|
|
371
|
+
(triggers)
|
|
372
|
+
Inventory System
|
|
373
|
+
InventoryReserved →
|
|
374
|
+
(triggers)
|
|
375
|
+
Fulfillment System
|
|
376
|
+
OrderShipped
|
|
377
|
+
DeliveryConfirmed
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## Team Responsibilities Matrix
|
|
383
|
+
|
|
384
|
+
| Team | Creates Commands | Produces Events | Owns Read Models |
|
|
385
|
+
|------|-----------------|-----------------|------------------|
|
|
386
|
+
| Order | CreateOrder, ConfirmOrder | OrderCreated, OrderConfirmed | OrderStatusView |
|
|
387
|
+
| Payment | AuthorizePayment | PaymentAuthorized | PaymentStatusView |
|
|
388
|
+
| Inventory | ReserveInventory | InventoryReserved | InventoryLevelView |
|
|
389
|
+
| Fulfillment | CreateShipment | OrderShipped | ShipmentTrackingView |
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Inter-System Communication
|
|
394
|
+
|
|
395
|
+
### Order → Payment
|
|
396
|
+
- Trigger: OrderConfirmed event
|
|
397
|
+
- Action: Payment System listens via Processor
|
|
398
|
+
- Result: AuthorizePayment command issued
|
|
399
|
+
|
|
400
|
+
### Payment → Inventory
|
|
401
|
+
- Trigger: PaymentAuthorized event
|
|
402
|
+
- Action: Inventory System listens via Processor
|
|
403
|
+
- Result: ReserveInventory command issued
|
|
404
|
+
|
|
405
|
+
[Document all communication patterns]
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Dependencies
|
|
410
|
+
|
|
411
|
+
### External Systems
|
|
412
|
+
|
|
413
|
+
| System | Owns | Called By | Purpose |
|
|
414
|
+
|--------|------|-----------|---------|
|
|
415
|
+
| Payment Gateway | Payment provider | Payment System | Authorization |
|
|
416
|
+
| Warehouse | Inventory source | Inventory System | Stock info |
|
|
417
|
+
| Carrier API | Shipping | Fulfillment System | Tracking |
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Independent Development
|
|
422
|
+
|
|
423
|
+
Each system can:
|
|
424
|
+
- Develop independently
|
|
425
|
+
- Use different tech stacks
|
|
426
|
+
- Scale independently
|
|
427
|
+
- Deploy independently
|
|
428
|
+
- Own their events
|
|
429
|
+
- Maintain their read models
|
|
430
|
+
|
|
431
|
+
Coordination via:
|
|
432
|
+
- Events (async messaging)
|
|
433
|
+
- Processors (listen and react)
|
|
434
|
+
- Read models (shared views)
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Quality Checklist
|
|
438
|
+
|
|
439
|
+
- [ ] Each system has clear ownership
|
|
440
|
+
- [ ] System boundaries are well-defined
|
|
441
|
+
- [ ] Events map to systems
|
|
442
|
+
- [ ] Commands map to teams
|
|
443
|
+
- [ ] Cross-system communication is documented
|
|
444
|
+
- [ ] No circular dependencies
|
|
445
|
+
- [ ] Each team has independent scope
|
|
446
|
+
- [ ] Processors are explicitly assigned
|
|
447
|
+
- [ ] External systems identified
|
|
448
|
+
- [ ] System interfaces are clear
|
|
449
|
+
|
|
450
|
+
## Conway's Law Principle
|
|
451
|
+
|
|
452
|
+
**System architecture mirrors team structure**:
|
|
453
|
+
- Separate teams → Separate systems
|
|
454
|
+
- Each system owns events
|
|
455
|
+
- Communication through events
|
|
456
|
+
- Independent development possible
|
|
457
|
+
- Aligns with org chart
|
|
458
|
+
|
|
459
|
+
## Key Benefits
|
|
460
|
+
|
|
461
|
+
1. **Team Independence**: Each team owns their domain
|
|
462
|
+
2. **Clear Ownership**: No confusion about responsibility
|
|
463
|
+
3. **Scalable Architecture**: Systems can evolve independently
|
|
464
|
+
4. **Event-Driven**: Natural communication via events
|
|
465
|
+
5. **Deployment**: Each team deploys their system
|