@eventmodelers/cli 2.0.47 → 2.0.48

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": "2.0.47",
3
+ "version": "2.0.48",
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": {
@@ -36,6 +36,13 @@ INFOGRAPHIC // Pinned infographic poster (an `infographic` chat snippet saved
36
36
  REPORT // Pinned report chart (a `report` chat snippet saved to the board): `meta.reportJson` (the snippet's JSON
37
37
  // as a string, without `kind`/`confirm`), `meta.title`. Free-floating, view only. To change it, send a
38
38
  // `node:changed` that sets `meta.reportJson` (the `/regenerate-report` skill does).
39
+ PDF // A PDF pasted onto the board (Ctrl/Cmd+V of a PDF file, ≤ 2 MB): `meta.title` is the file name. The file
40
+ // itself is a blob in the board's image storage under the node id (like an image, `images/<nodeId>`; a
41
+ // `GET .../images/<nodeId>` returns the PDF bytes) — there is no text, field or data on the node.
42
+ // Free-floating, resizable, in no chapter or cell, never part of a slice. Ignore it when building slices,
43
+ // wiring edges or counting elements; it is reference material for people. To put one on the board, upload
44
+ // the file to `POST .../images/<nodeId>` (the server keeps a PDF as it is) and create the node with
45
+ // `submit_node_events` (type `PDF`, position, no chapterId/cellId). A picture pasted the same way becomes an OUTLINE.
39
46
  TIMELINE_REFERENCE // Read-only view of a timeline (chapter) from ANOTHER board:
40
47
  // `meta.data.reference = {boardId, timelineId}`. Created in the UI only. It is not a real
41
48
  // chapter: no children, no handles, nothing can connect to it, and it is never part of a
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  name: analyze-code-base
3
- description: Uncover the business process behind an existing code base and build it on the board as an interview, iteratively — all chapters at high level first, then one chapter per pass, the person choosing which. Reads the code for hypotheses, asks one question at a time, draws as answers land. Use for "analyze this code base", "analyze this existing system", "reverse-engineer the model from the code", "model the legacy app".
3
+ description: Uncover the business process behind an existing code base and build it on the board as an interview, iteratively — all chapters at high level first, then one chapter per pass, the person choosing which. Reads the code and its documentation (README, docs, ADRs, API specs, diagrams, feature files) for hypotheses, asks one question at a time, draws as answers land. Use for "analyze this code base", "analyze this existing system", "reverse-engineer the model from the code", "model the legacy app".
4
4
  ---
5
5
 
6
6
  # Analyze a Code Base
7
7
 
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`.
8
+ You are the **orchestrator** of an interview. The code and its documentation give you hypotheses; 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 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**.
10
+ This skill owns only what is specific to legacy code: reading the sources (code **and** documentation), mapping them 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
 
14
14
  ## Step 0 — Is there a code base?
15
15
 
16
- Resolve the directory to analyse: `$EVENTMODELERS_CODE_DIR` if set (treat it as the repository root for every step below), otherwise the current directory. It must contain source code (`src/`, `pom.xml`, `build.gradle*`, `package.json`, `*.csproj`, …).
16
+ Resolve the directory to analyse: `$EVENTMODELERS_CODE_DIR` if set (treat it as the repository root for every step below), otherwise the current directory. It must contain source code (`src/`, `pom.xml`, `build.gradle*`, `package.json`, `*.csproj`, …). Documentation alongside it (`README*`, `docs/`, ADRs, specs) is read too, but documentation alone is not a code base — without source code, stop as below.
17
17
 
18
18
  If it does not (an empty folder, a modeling-only workspace holding just `.claude/`, `.eventmodelers/` or `.agent-modeling-kit/`), **stop and answer in one or two plain sentences** — "There is no legacy code here to analyse; run this in the code base" — and do nothing else.
19
19
 
@@ -66,9 +66,9 @@ Naming, what to model and the anti-patterns are in `eventmodeling-core-rules` (r
66
66
 
67
67
  ---
68
68
 
69
- ## Reading the sources — four lenses
69
+ ## Reading the sources — five lenses
70
70
 
71
- Every pass reads the code through the same four lenses; each produces *hypotheses* to put to the person, never elements on its own. Read only as deep as the current layer needs.
71
+ Every pass reads the code and its documentation through the same five lenses; each produces *hypotheses* to put to the person, never elements on its own. Read only as deep as the current layer needs.
72
72
 
73
73
  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.
74
74
  2. **Tests** — test names, fixtures, assertions. Names reveal the business vocabulary; arrange/act/assert is a *hint* for Given/When/Then, not its shape — which element goes into Given, When and Then is decided by `eventmodeling-elaborating-scenarios`, never by the test's structure (see *Scenarios* below); error cases reveal the rules that matter. Fixtures are the source of realistic example values.
@@ -81,13 +81,22 @@ Every pass reads the code through the same four lenses; each produces *hypothese
81
81
 
82
82
  If the code is a generic engine (templates, schemas, configurable entities), model one real case it handles, not the engine (see *Concrete Over Generic* in `eventmodeling-core-rules`).
83
83
 
84
- 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.
84
+ 5. **Documentation & other artifacts** — everything that explains the system without being executable. Look for it in the code root and its parents' obvious places: `README*`, `docs/`, `doc/`, `wiki/`, `adr/` / `docs/decisions/` (architecture decision records), `CHANGELOG*` / release notes, `CONTRIBUTING*`, API specs (OpenAPI/Swagger, AsyncAPI, GraphQL schemas, Postman collections, `.http` files), diagrams (PlantUML, Mermaid, draw.io, C4, images in `docs/`), BDD/acceptance material (`*.feature` Gherkin files, acceptance criteria), requirements, user stories and specs (Markdown, `.docx`/PDF exports), runbooks, DB documentation, and in-repo ticket or issue exports. Also read what configures behaviour: CI/CD pipelines, infra (Docker, Helm, Terraform), feature-flag and environment config — they show integrations and jobs the code alone hides.
85
+ - **No fixed list of file types.** Anything that could plausibly carry business meaning is a candidate: Markdown, text, PDFs, Word/Excel/PowerPoint, CSV and spreadsheets (reference data, rate tables, code lists), JSON/YAML/XML samples and fixtures, HTML pages, images and diagrams, email or chat exports, notebooks. The lists above are examples, not a filter. Judge by what the file may tell you, and treat the unclear ones through the relevance question below.
86
+ - **Find it by what is committed, not only by name.** List the tracked documents (`git ls-files` filtered to everything that is not source code, lock files or build output; without git, find them) and skim titles and file names. Any committed Markdown, text or PDF file can hold requirements, specs, notes or a glossary — but also changelogs of dependencies, licences, generated output or stale scratch notes.
87
+ - **In doubt, ask whether a document is relevant** — one question, listing the candidates: *"I found `docs/visits.md`, `NOTES.txt` and `design/old-flow.md`. Which of these describe the business and should I use? Anything to ignore?"* Like the Step 1 question this is **not a gate**: post it, carry on with the code, and use only the unambiguous documents (README, `docs/`, ADRs, API specs) until the answer arrives. Record the answer (relevant / ignored) in the chapter's `Legacy Sources` note and reuse it on later passes. Never read a document as authoritative just because it is committed.
88
+ - **What it gives you**: the **vocabulary** and the *intent* — glossary terms, personas and roles, the stated purpose of a flow, the rules in prose, the order in user stories and sequence diagrams, the systems around this one, and the *why* behind decisions (ADRs). Often the quickest source for the order and for the business term behind a code name.
89
+ - **Trust it least on "what the system does today".** Documentation goes stale; code and tests show behaviour, docs show intent. Where a document and the code disagree, that is a question for the person (see below) — and the date, version or commit of the document is part of the evidence. A document is also a *summary*: a flow it describes still has to be found in the code, or marked as documented-only.
90
+ - **PDFs** (specs, requirement documents, manuals, exported wiki pages) are read like any other document: with the Read tool page by page (`pages`, max 20 per request), starting with the table of contents and the pages relevant to the current chapter. They are subject to the same relevance question as `.md`/`.txt` files.
91
+ - Documents too large or too binary to read fully (very long PDFs, Word files, a diagram image): skim headings and the parts for the current chapter, and for a whole document to be modelled use `summarize` instead of re-implementing it here.
92
+
93
+ Where the lenses disagree (a route nobody calls, a table never written, a test for removed behaviour, a screen with no backend, a document describing a flow the code no longer has, or code doing something the documentation never mentions), that is a question for the person — not something to model.
85
94
 
86
95
  ---
87
96
 
88
97
  ## From code to elements — the mapping rules
89
98
 
90
- Start with the **API** and **persistence** lenses; they carry the most signal. Tests and UI then confirm and name what they found.
99
+ Start with the **API** and **persistence** lenses; they carry the most signal. Tests, UI and documentation then confirm, name and order what they found — documentation is the first place to look for the business word and the sequence.
91
100
 
92
101
  | In the code | On the board |
93
102
  |-------------|--------------|
@@ -96,6 +105,7 @@ Start with the **API** and **persistence** lenses; they carry the most signal. T
96
105
  | **Inbound API call nobody types in** — a webhook, a message/queue listener, a scheduled job, a call from another system | an **AUTOMATION** (+ its COMMAND). A webhook or message from another system goes through the translation chain: external EVENT → todo-list READMODEL → translation AUTOMATION → internal EVENT. |
97
106
  | **Outbound call to another system** — HTTP client, SDK, mail/SMS/payment/queue publish | an **AUTOMATION**: it reacts to an event (via its todo-list READMODEL), makes the call, and its COMMAND records the outcome as an EVENT (`Confirmation Mail Sent`, `Payment Failed`). |
98
107
  | **Read endpoint / query / join** | a **READMODEL**, fed by the events behind the tables it reads. |
108
+ | **Documentation** — a user story, sequence diagram, ADR, glossary entry, API spec, `.feature` file | no element on its own: it **names** (glossary → titles), **orders** (stories, sequence diagrams → column order), **explains** (ADRs, rules in prose → decision rows, scenario candidates) and **corroborates** the elements derived from code. An API spec lists entry points and payloads like the *API* lens; a documented step with no counterpart in the code is documented-only — ask. |
99
109
 
100
110
  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.
101
111
 
@@ -104,7 +114,7 @@ Rules of thumb: every API call is either a screen-driven command/read or an auto
104
114
  ## Progressive elaboration — all chapters first, then one chapter per pass
105
115
 
106
116
  ### Pass 0 — all chapters, high level
107
- 1. Read the sources broadly through the four lenses to spot the business workflows — don't wait for the Step 1 answer; walk the running UI via `discover-storyboard` once a URL has been given (also when it arrives after Pass 0).
117
+ 1. Read the sources broadly through the five lenses — start with the README and `docs/` for the overview and vocabulary — to spot the business workflows — don't wait for the Step 1 answer; walk the running UI via `discover-storyboard` once a URL has been given (also when it arrives after Pass 0).
108
118
  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 user journey, never one endpoint, controller or CRUD operation. Code is split by operation (`OwnerController#initCreationForm`, `#processFindForm`, `#showOwner`, `#processUpdateOwnerForm`); the story is not — registering, finding, viewing and updating an owner are **one** chapter. Order the chapters per `eventmodeling-plotting-events`; ask where it is unclear. Add the **Decisions** lane, put the `Legacy Sources` note into **column 0** (see *The analysis log*), then sketch only the milestones (titles only) **from column 1 on**.
109
119
  3. Report the chapters and **ask which chapter to start with**. Never pick for them.
110
120
 
@@ -151,7 +161,8 @@ Every decision you make while turning code into the model is recorded **on the t
151
161
  | Decision | Example |
152
162
  |----------|---------|
153
163
  | Code construct → element | `VisitController#processNewVisitForm` + `visits` insert → *Book Visit* / *Visit Booked* |
154
- | Order | *Owner Registered* before *Pet Added* — from the UI click path, confirmed by the person |
164
+ | Order | *Owner Registered* before *Pet Added* — from the UI click path or `docs/user-stories.md`, confirmed by the person |
165
+ | Code vs. documentation conflict | `docs/visits.md` says visits can be cancelled, the code has no cancel path → asked; recorded as the person answered |
155
166
  | Code term → business term | `PetType` → *Species*, the person's word |
156
167
  | Person overrides the code | Code allows cancelling a visit; the person says it never happens → not modeled |
157
168
  | Merged / split | Two writes in `OwnerService#save` → one event; one endpoint → two commands |
@@ -206,6 +217,7 @@ Code root `petclinic/` · running UI: http://localhost:8080 (test account `georg
206
217
  | API | `src/main/java/org/acme/visit/` | `VisitController` |
207
218
  | Persistence | `src/main/resources/db/schema.sql` | `visits` table, `VisitRepository` |
208
219
  | Tests | `src/test/java/org/acme/visit/` | `VisitControllerTests` |
220
+ | Docs | `docs/visits.md`, `docs/adr/0007-visit-scheduling.md` | user story *Book a Visit*, ADR 7 |
209
221
  | UI | `src/main/resources/templates/pets/` | `createOrUpdateVisitForm.html` |
210
222
 
211
223
  ## Chapter decisions
@@ -233,7 +245,7 @@ Code root `petclinic/` · running UI: http://localhost:8080 (test account `georg
233
245
  | `description` (Visit) | *Reason for Visit* |
234
246
  ```
235
247
 
236
- 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.
248
+ The `Confirmed by` column shows how far to trust a decision: `code` (derived from the sources), `docs` (taken from documentation only, not seen in the code — say which document), `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.
237
249
 
238
250
  Element `description`s still carry their own short code reference. The feedback notes add the *why* and the decisions that span several elements.
239
251