@eventmodelers/cli 1.0.114 → 1.0.115
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventmodelers/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.115",
|
|
4
4
|
"description": "Eventmodelers CLI — real-time Claude agent + skills for Claude Code, for any stack (Node, Supabase, Axon, OpenCQRS, UmaDB, Kurrent, or modeling-only)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -5,9 +5,9 @@ description: Uncover the business process behind an existing code base and build
|
|
|
5
5
|
|
|
6
6
|
# Analyze a Code Base
|
|
7
7
|
|
|
8
|
-
You are
|
|
8
|
+
You are the **orchestrator** of an interview. The code gives you a hypothesis; the person gives you the truth. **The board is the deliverable** — never hand over a JSON model, `config.json` or `high-level-analysis.json`.
|
|
9
9
|
|
|
10
|
-
This skill owns
|
|
10
|
+
This skill owns only what is specific to legacy code: reading the sources, mapping code to elements, the layering of passes, and recording decisions with code references. Every modeling rule (naming, element types, chaptering, ordering, screens, scenarios, interviewing) lives in the skill named at each step — **read and follow that skill, don't restate or re-implement it here**.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -21,53 +21,23 @@ Then invoke `connect` (if not already connected). Prefer `mcp__eventmodelers__*`
|
|
|
21
21
|
|
|
22
22
|
**One agent, one identity on the board.** The canvas shows one robot avatar per agent id, and a write without a valid `x-agent-id` is shown as a *second*, anonymous robot. So every board write of this run must carry the agent id `connect` resolved (`AGENT_ID`): MCP calls get it from `.mcp.json`, but every `curl` fallback, upload script (e.g. screenshots) and Playwright helper must send `x-agent-id` too, and any subagent that writes to the board must be handed `agent=<AGENT_ID>` inline (a subagent is a fresh session and resolves nothing). Do the board writes yourself where you can; use subagents only for reading code.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## The goal — a model business people *and* AI can both read
|
|
27
|
-
|
|
28
|
-
The finished board has two readers, and every element has to serve both:
|
|
24
|
+
## Step 1 — Is there a running UI? (once, when the analysis starts)
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
- **AI** (a later agent generating code, tests or docs from the board) reads fields, descriptions, edges and scenarios, and cannot ask what you meant. So it needs what a person would take for granted: identifying fields with types and realistic examples, edges that show where data comes from (every field has an origin), Given/When/Then rules for the decisions that matter, and a `description` that says in a sentence what the element means and links back to the legacy source (class, endpoint, table).
|
|
26
|
+
Ask once, before reading the sources, and only when starting fresh (no chapters from this analysis yet): *"Is there a running instance I can inspect? URL, and a login or test account if needed."* Wait for the answer. Record it (URL or "no running UI") in each chapter's `Legacy Sources` note and reuse it on later passes. Skip it when the request already answers it.
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
Ask again mid-way only when it helps — typically when the order isn't clear from the code: *"I can't tell the order of these steps from the code. Is there a running UI I can use to check? Otherwise, here are my questions: …"*
|
|
34
29
|
|
|
35
30
|
---
|
|
36
31
|
|
|
37
|
-
## Principles
|
|
38
|
-
|
|
39
|
-
- **What to model:** business processes, state transitions, business rules hidden in code and tests, domain flows.
|
|
40
|
-
- **What not to model:** databases, frameworks, caching/logging/monitoring, class structure, UI styling.
|
|
41
|
-
- **Evidence, not elements.** Controllers, repositories, entities and `@Transactional` services tell you a business step exists — they are not the step. Model the *decision* it represents.
|
|
42
|
-
- **Say it out loud test.** If you cannot say an element's name to a domain expert and be understood, you are modeling the implementation — rename it. Class names, packages and endpoints go in the element's `description` (the link back to the legacy source), never in its title.
|
|
43
|
-
- **The user outranks the code.** On a conflict, model what the person says and record what the code does instead as a decision row in the feedback lane (see *Recording decisions*). Leave a QUESTION comment (`/wdyt`, `handle-comment`) only if the conflict is still unresolved.
|
|
44
|
-
- **Every decision leaves a trace.** Whatever you decided (mapping, order, naming, leaving something out) goes into the chapter's **Decisions** feedback lane with a file / class / method reference (see *Recording decisions*).
|
|
45
|
-
- **Never invent to fill a gap.** Not in the sources and not said by the person → ask; if it stays open, leave a QUESTION comment, not a guess.
|
|
46
|
-
- **Stop when they say stop**, at any depth. A shallow, correct model beats a deep, invented one.
|
|
47
|
-
|
|
48
|
-
## How to interview
|
|
49
|
-
|
|
50
|
-
- **Build what the code shows; ask only what it can't tell you.** Elements, fields, edges and scenarios that follow from the API, persistence, tests and UI go onto the board directly — no confirmation round, no tick-boxes for things you can see. Ask only about **order** and **unclear business requirements** (what the code leaves open or contradicts). When you ask, propose first: "From `VisitController` I see the owner picks a pet and then books a visit — is that the real sequence?" — never an empty question.
|
|
51
|
-
- **One question at a time**, answerable in a sentence or two. Never a wall of questions.
|
|
52
|
-
- The recurring question is **"what happens next?"** — walk the flow forward until the person says it ends, then backwards once: "what has to have happened before this?"
|
|
53
|
-
- **Order before placement.** Place where the code or UI make the order clear; where they don't, ask first. The timeline is only as right as its sequence.
|
|
54
|
-
- **Draw as you go.** Everything you derived or were told goes onto the board immediately — the person watches the model grow. Never disappear for ten tool calls.
|
|
55
|
-
- **Ask before every descent.** Which flow next and how much deeper — never decide alone.
|
|
32
|
+
## Principles specific to legacy code
|
|
56
33
|
|
|
57
|
-
|
|
34
|
+
Naming, what to model and the anti-patterns are in `eventmodeling-core-rules` (read it once per session); how to ask is in `eventmodeling-interview-protocol` and `/timeline` (*Facilitator principles*). On top of that:
|
|
58
35
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
- Ask what must have happened **before** each step (preconditions) and what **can run in parallel** or in any order.
|
|
65
|
-
- Ask where the **ordering of chapters** comes from: which flow starts the story, which depends on another, which repeat.
|
|
66
|
-
- Ask when a step can happen **again** (a second visit, a re-booking) and what it means then.
|
|
67
|
-
- In a chat, put an order question as a `poll` with the candidate orders, or a `confirm` on your proposal (see Chat mode).
|
|
68
|
-
- Don't wait for gaps to surface: whenever the code leaves you guessing — what triggers an automation, who is allowed to act, what happens on failure, whether a step is optional — ask, with your best hypothesis attached. Still one question at a time: pick the one that unblocks the most.
|
|
69
|
-
|
|
70
|
-
Questions to keep in rotation: *What happens next? · Which comes first — and can it be the other way round? · What must be true before this can happen? · Who triggers this? · What do they see before they decide? · Can this fail — and what does the business do then? · Is that the word the business uses? · Which flow now? · Deeper, or enough?*
|
|
36
|
+
- **Evidence, not elements.** Controllers, tables and services show a business step exists — they are not the step. Code names go in `description`, never in titles. A model must serve business readers (titles, order) and AI readers (fields, edges, descriptions with the code reference) alike.
|
|
37
|
+
- **Build what the code shows; ask only what it can't tell you** — the **order** (code rarely shows it; see `eventmodeling-plotting-events`) and **unclear business requirements**. Propose first: *"From `VisitController` the owner picks a pet and then books a visit — is that the real sequence?"* One question at a time.
|
|
38
|
+
- **Never place at a guessed position.** Where neither code, UI nor person settles the order, ask (see *Step 1*) or leave a QUESTION comment.
|
|
39
|
+
- **The user outranks the code.** Model what the person says; record what the code does as a decision row (see *Recording decisions*).
|
|
40
|
+
- **Never invent to fill a gap**, and **stop when they say stop**, at any depth.
|
|
71
41
|
|
|
72
42
|
---
|
|
73
43
|
|
|
@@ -78,18 +48,9 @@ Every pass reads the code through the same four lenses; each produces *hypothese
|
|
|
78
48
|
1. **API** (look hardest here) — REST controllers, routes, handlers, message listeners, scheduled jobs, outbound clients. Each entry point is a candidate **screen + command** (a person writes), **screen + read model** (a person reads) or **automation** (jobs, listeners, calls to other systems). Request/response payloads hint at fields; the caller hints at who triggers it.
|
|
79
49
|
2. **Tests** — test names, fixtures, assertions. Names reveal the business vocabulary; arrange/act/assert becomes Given/When/Then; error cases reveal the rules that matter. Fixtures are the source of realistic example values.
|
|
80
50
|
3. **Persistence** (look hardest here, too — *what gets saved*) — entities, tables, migrations, repositories. Every write is a candidate **event**. Writes show which state changes exist (→ events); relations show aggregate boundaries; status/enum columns show lifecycles; derived or joined queries show read models. Tables are evidence, never elements.
|
|
81
|
-
4. **UI** — templates, views, components, forms, navigation. Forms and buttons are where a person triggers a command; list and detail pages are read models; the page order is the flow; visible labels are the business words.
|
|
82
|
-
|
|
83
|
-
**With a URL,
|
|
84
|
-
- Walk it like a user: start at the entry page, follow the navigation, and note each page, form, button and list. Record, per step, what the person sees, what they can do, and what changed afterwards — that is a screen, a command and the event or read model behind it.
|
|
85
|
-
- **The UI is the best source for what is possible and in which order.** Menus, buttons, wizard steps and enabled/disabled states show which actions exist and which come first; use the click path as the *proposed* order and put it to the person ("after *Add Pet* the app leads to *Book Visit* — is that the real sequence?"). The person still confirms the order before anything is placed.
|
|
86
|
-
- **Screenshot every step and paste it onto the board as an image.** Save each screenshot (`browser_take_screenshot`, or `page.screenshot()` in the script) to the scratchpad, then place it as a SCREEN in the chapter, at the column of the step it belongs to, in walk order:
|
|
87
|
-
`mcp__eventmodelers__create_screen { boardId, screens: [{ contentType: "image", chapterId, cellName, title: "<business name of the step>", imageBase64: "<base64 PNG, no data: URI prefix>", mimeType: "image/png", description: "Shows X. Arrived via: Y. Actions: A, B. Legacy: <URL / template>" }] }`
|
|
88
|
-
The image is the real legacy screen kept as evidence. Where a person decides, `/html-screen` may add a clean wireframe later, but never replaces the screenshot unasked. Screenshot only what you walked, never invent screens. Mask personal data (names, emails) in the shots, or use test data.
|
|
89
|
-
- Trigger a write (submit a form) only against a test or local system, or after the person agrees — it changes real data. Never on anything that looks like production without asking first. Create test data with a clear marker so it can be found again.
|
|
90
|
-
- Confirm what you observed against the code: the UI shows the flow, the API/persistence lenses show what really happens behind it.
|
|
91
|
-
- Not reachable, login missing or the page needs something you don't have: tell the person and carry on with the other lenses; never invent screens.
|
|
92
|
-
- **No UI, and the code doesn't make the flow or order clear: ask the business expert (the human in the loop).** Don't guess from the code. Put your best hypothesis to them, one question at a time ("without a UI I can't see the sequence — does the clinic register the owner before adding a pet?"), and ask them to describe or sketch what people see and do. Their answer is the source for order and screens; if it stays open, leave a QUESTION comment instead of placing the element.
|
|
51
|
+
4. **UI** — templates, views, components, forms, navigation. Forms and buttons are where a person triggers a command; list and detail pages are read models; the page order is the flow; visible labels are the business words. Whether a running UI exists is asked in **Step 1**. Without one, rely on the other three lenses and ask where the order stays unclear.
|
|
52
|
+
|
|
53
|
+
**With a URL, walk it via `discover-storyboard`** (URL already known — don't ask again; pass the flow as guidance and ask for screenshots). Its click path is the *proposed* order and its screens go into the chapter as evidence; confirm both against the API and persistence lenses. Submit forms only against a local or test system, or after the person agrees.
|
|
93
54
|
|
|
94
55
|
Where the lenses disagree (a route nobody calls, a table never written, a test for removed behaviour, a screen with no backend), that is a question for the person — not something to model.
|
|
95
56
|
|
|
@@ -109,36 +70,28 @@ Start with the **API** and **persistence** lenses; they carry the most signal. T
|
|
|
109
70
|
|
|
110
71
|
Rules of thumb: every API call is either a screen-driven command/read or an automation that does something; reaching out to other systems is typically an automation; a row that is only ever read, never written by this system, is reference data from outside — ask where it comes from instead of inventing an event. Class, table and endpoint names go in `description`, not titles.
|
|
111
72
|
|
|
112
|
-
### Use the kit's modeling knowledge, not just this file
|
|
113
|
-
|
|
114
|
-
Before proposing elements for a chapter, apply the rules of the skills that own them — read `eventmodeling-core-rules` once per session, and consult as the flow demands:
|
|
115
|
-
|
|
116
|
-
- `eventmodeling-core-rules` — what each element is, lanes, naming, causality, the translation chain, anti-patterns to reject (CRUD names, events as commands, read models without a source).
|
|
117
|
-
- `eventmodeling-brainstorming-events` / `eventmodeling-plotting-events` — are the persistence writes complete and in business order?
|
|
118
|
-
- `eventmodeling-identifying-inputs` / `eventmodeling-identifying-outputs` — who issues each command, what each read model must show.
|
|
119
|
-
- `eventmodeling-designing-automation-chains` — every automation needs a todo-list read model; outbound calls and webhooks get their chain.
|
|
120
|
-
- `eventmodeling-translating-external-events` — external systems and their payloads.
|
|
121
|
-
- `eventmodeling-elaborating-scenarios`, `eventmodeling-checking-completeness`, `eventmodeling-validating-event-models-checklist` — deeper layers and the end-of-pass check.
|
|
122
|
-
- `eventmodeling-interview-protocol` — when to ask and how to record what was decided.
|
|
123
|
-
|
|
124
73
|
---
|
|
125
74
|
|
|
126
75
|
## Progressive elaboration — all chapters first, then one chapter per pass
|
|
127
76
|
|
|
128
77
|
### Pass 0 — all chapters, high level
|
|
129
|
-
1. Read the sources broadly through the four lenses
|
|
130
|
-
2.
|
|
131
|
-
3.
|
|
132
|
-
4. Report the chapters back and **ask which chapter to start with**. Never pick for them.
|
|
78
|
+
1. Read the sources broadly through the four lenses to spot the business workflows — walking the running UI from Step 1 via `discover-storyboard` if there is one.
|
|
79
|
+
2. Group them into chapters and create them as `eventmodeling-brainstorming-events` (§ *Group events by workflow* / *Create one chapter per group*) does — a chapter is a workflow, never one endpoint or CRUD operation. Order the chapters per `eventmodeling-plotting-events`; ask where it is unclear. Inside each chapter sketch only the milestones (titles only). Add the **Decisions** lane and the `Legacy Sources` note (see *Recording decisions*).
|
|
80
|
+
3. Report the chapters and **ask which chapter to start with**. Never pick for them.
|
|
133
81
|
|
|
134
82
|
### Pass N — detail the chosen chapter
|
|
135
|
-
1.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
83
|
+
1. Work **in the chapter the person picked**, reusing what is already there. Model the **whole workflow**, not its first slice, by running the step skills on it in order:
|
|
84
|
+
- `eventmodeling-plotting-events` — the events in business order, start to outcome;
|
|
85
|
+
- `eventmodeling-storyboarding-events` — what the person sees after each event (e.g. *Owner Registered* → owner details page → add a pet);
|
|
86
|
+
- `eventmodeling-identifying-inputs` / `eventmodeling-identifying-outputs` — commands and read models;
|
|
87
|
+
- `eventmodeling-designing-automation-chains` / `eventmodeling-translating-external-events` — jobs, listeners, webhooks, outbound calls;
|
|
88
|
+
- `eventmodeling-elaborating-scenarios` — rules from the tests (layer 1+ only).
|
|
89
|
+
Feed each skill what the lenses and the mapping table give you; ask only where the code stops (see *Step 1* when the order is unclear).
|
|
90
|
+
2. Stay within the layer's detail budget (below). Every placement batch carries its decision rows (see *Recording decisions*).
|
|
91
|
+
3. Re-space the chapters (see *Keeping chapters apart*) after every batch.
|
|
92
|
+
4. Report, name the sub-flows found inside this chapter, and ask: which chapter next, go deeper here, or stop?
|
|
93
|
+
|
|
94
|
+
Repeat until the person says stop. Chapters not chosen stay at high level.
|
|
142
95
|
|
|
143
96
|
### Detail budget per layer
|
|
144
97
|
|
|
@@ -154,14 +107,7 @@ Never add detail that belongs to a deeper layer. Every element must trace to sou
|
|
|
154
107
|
|
|
155
108
|
## Keeping chapters apart
|
|
156
109
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
1. Read every chapter's position and size (`get_chapter_bounds`; over REST the CHAPTER nodes from `GET /nodes?type=CHAPTER`).
|
|
160
|
-
2. Sort by `y`. For each chapter, the next one must start at least `y + height + 600` (room for the title and a gap).
|
|
161
|
-
3. Where it doesn't, move that chapter **and every chapter below it** down by the missing distance, so the order is kept: `move_timeline_position { boardId, timelineId, x, y }` (REST: `PUT /timelines/$TL/position`). Move bottom-up or by the same offset, never one chapter on top of another.
|
|
162
|
-
4. Re-read the bounds once to confirm nothing overlaps. Don't touch chapters that already have room.
|
|
163
|
-
|
|
164
|
-
Do this after every batch of placements in a chapter and before the end-of-pass report; a pass is not done while two chapters overlap.
|
|
110
|
+
A chapter is sized when it is created, so detailing it later makes it overlap the chapter below. After every batch: read `get_chapter_bounds`, and wherever the next chapter starts above `y + height + 600`, move it **and every chapter below it** down by the missing distance (`move_timeline_position`), keeping their order. A pass isn't done while two chapters overlap.
|
|
165
111
|
|
|
166
112
|
---
|
|
167
113
|
|
|
@@ -236,7 +182,7 @@ Analysed at commit `a1b2c3d`, code root `petclinic/`.
|
|
|
236
182
|
|
|
237
183
|
The `Confirmed by` column shows how far to trust a decision: `code` (derived from the sources), `person` (they said so) or `assumed` (neither, still open). An `assumed` row whose question can't be settled from the model also gets a QUESTION comment on the node (see *Principles*); the row records the assumption, the comment asks the question.
|
|
238
184
|
|
|
239
|
-
Element `description`s still carry their own short code reference
|
|
185
|
+
Element `description`s still carry their own short code reference. The feedback notes add the *why* and the decisions that span several elements.
|
|
240
186
|
|
|
241
187
|
---
|
|
242
188
|
|
|
@@ -244,7 +190,7 @@ Element `description`s still carry their own short code reference (see *The goal
|
|
|
244
190
|
|
|
245
191
|
**When this run has a chat** (`CHAT_SESSION_ID` is set — the request came from the board's chat), a question the person answers with a pick is a **snippet** (`post_chat_message` with `snippet`; shapes in `/learn-eventmodelers-api` § 16 *Chat snippets*); an open question stays text. Without a chat, ask in prose.
|
|
246
192
|
|
|
247
|
-
**Snippets are not a confirmation gate.** Never post a `tasks` snippet to let the person tick what you derived from the code — you build that directly (see *
|
|
193
|
+
This overrides the `tasks`-snippet chat mode of `/timeline`. **Snippets are not a confirmation gate.** Never post a `tasks` snippet to let the person tick what you derived from the code — you build that directly (see *Principles*). Use a snippet only when you genuinely need the person (the Step 1 question about a running UI comes first, as plain text, and only when the analysis starts):
|
|
248
194
|
|
|
249
195
|
1. **Order** — *"Which comes first?"* → a `poll` with the candidate orders; *"I'd put A before B — right?"* → a `confirm`.
|
|
250
196
|
2. **Unclear business requirement** — the code leaves it open or contradicts itself (*"Can a visit be cancelled?"*, *"Is the specialty optional?"*) → a `confirm` or `poll` with your hypothesis; an open answer stays text.
|
|
@@ -254,20 +200,14 @@ One question per message, with the best hypothesis attached. The answer arrives
|
|
|
254
200
|
|
|
255
201
|
---
|
|
256
202
|
|
|
257
|
-
## Slice types (what to map the code to)
|
|
258
|
-
|
|
259
|
-
- **Write operation → STATE_CHANGE** — 1 Command + 1 Event (optional Screen, only after a STATE_VIEW).
|
|
260
|
-
- **Read operation → STATE_VIEW** — 1 Read Model (optional Screen, only after a STATE_CHANGE).
|
|
261
|
-
- **Background work → AUTOMATION** — 1 Processor + 1 Command + 1+ Events; never connects directly to an Event, always via an intermediate STATE_VIEW.
|
|
262
|
-
|
|
263
|
-
Naming, element types and edge rules: `eventmodeling-core-rules`. Fields can be single values or lists (cardinality "List"). Reuse before creating — query what is already on the board; never duplicate nodes.
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
203
|
## Delegate — which skill does what
|
|
268
204
|
|
|
269
205
|
| Intent | Skill |
|
|
270
206
|
|--------|-------|
|
|
207
|
+
| Group workflows into chapters | `eventmodeling-brainstorming-events` |
|
|
208
|
+
| Order events / chapters | `eventmodeling-plotting-events` |
|
|
209
|
+
| What the person sees after each event | `eventmodeling-storyboarding-events` |
|
|
210
|
+
| Walk a running UI | `discover-storyboard` |
|
|
271
211
|
| Build / adjust the timeline (chapters, milestones, flow sequence) live | `/timeline` |
|
|
272
212
|
| Place a single COMMAND / READMODEL / EVENT / SCREEN / AUTOMATION | `/place-element` |
|
|
273
213
|
| Make a timeline element's slice explicit | `/eventmodeling-slicing-event-models` |
|
|
@@ -289,7 +229,7 @@ Scenarios: only business rules found in tests and comments — not simple valida
|
|
|
289
229
|
|
|
290
230
|
## End every pass the same way
|
|
291
231
|
|
|
292
|
-
Re-read the board (do not trust your memory) and check:
|
|
232
|
+
Re-read the board (do not trust your memory) and run `eventmodeling-validating-event-models-checklist` on the chapter. On top of it, check what is specific to this skill: the chapter tells its workflow from trigger to outcome (not a single slice), layer discipline held, no chapters overlap, descriptions carry the code reference, every decision of this pass is a row in the **Decisions** lane. Then report:
|
|
293
233
|
|
|
294
234
|
1. what you put on the board — titles, node IDs, chapter;
|
|
295
235
|
2. what is still open or unanswered;
|