@eventmodelers/cli 2.0.1 → 2.0.3

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.
Files changed (80) hide show
  1. package/README.md +27 -9
  2. package/cli.js +369 -36
  3. package/lib/build-kits.js +23 -0
  4. package/lib/scaffold-model.js +71 -0
  5. package/lib/scaffold.js +224 -0
  6. package/lib/supervise.js +60 -0
  7. package/lib/ui-baseline.js +123 -0
  8. package/package.json +1 -1
  9. package/shared/build-kit/lib/build-log-share.js +149 -0
  10. package/shared/build-kit/lib/events-view.js +18 -3
  11. package/shared/build-kit/lib/ralph.js +27 -16
  12. package/shared/build-kit/lib/slice-events.js +42 -2
  13. package/shared/build-kit/lib/slice-info.js +52 -0
  14. package/shared/build-kit/lib/slice-run.js +2 -2
  15. package/shared/build-kit/lib/slice-state.js +6 -4
  16. package/shared/scaffold/LICENSE-em-scaffold +21 -0
  17. package/shared/scaffold/supabase/generate.mjs +290 -0
  18. package/shared/scaffold/supabase/template/scripts/create-user.mjs.tmpl +29 -0
  19. package/shared/scaffold/supabase/template/scripts/dev.mjs.tmpl +145 -0
  20. package/shared/scaffold/supabase/template/scripts/write-env.mjs.tmpl +44 -0
  21. package/shared/scaffold/supabase/template/server.ts.tmpl +168 -0
  22. package/shared/scaffold/supabase/template/src/common/extraEndpoints.ts.tmpl +5 -0
  23. package/shared/scaffold/supabase/template/src/common/notImplemented.test.ts.tmpl +58 -0
  24. package/shared/scaffold/supabase/template/src/common/notImplemented.ts.tmpl +29 -0
  25. package/shared/scaffold/supabase/template/supabase/migrations/_V0__supabase_stubs.sql.tmpl +34 -0
  26. package/shared/scaffold/supabase/template/web/src/App.tsx.tmpl +38 -0
  27. package/shared/scaffold/supabase/template/web/src/app/Layout.tsx.tmpl +48 -0
  28. package/shared/scaffold/supabase/template/web/src/app/NotFound.tsx.tmpl +12 -0
  29. package/shared/scaffold/supabase/template/web/src/app/SignIn.tsx.tmpl +42 -0
  30. package/shared/scaffold/supabase/template/web/src/app/TimelinePage.tsx.tmpl +73 -0
  31. package/shared/scaffold/supabase/template/web/src/app/pages.ts.tmpl +26 -0
  32. package/shared/scaffold/supabase/template/web/src/app/skeleton.css.tmpl +25 -0
  33. package/shared/scaffold/supabase/template/web/src/lib/NotBuilt.tsx.tmpl +12 -0
  34. package/shared/scaffold/supabase/template/web/src/lib/api.ts.tmpl +226 -0
  35. package/shared/scaffold/supabase/template/web/src/main.tsx.tmpl +13 -0
  36. package/shared/skills/learn-eventmodelers-api/SKILL.md +4 -4
  37. package/shared/skills/ui-contract/SKILL.md +6 -6
  38. package/shared/skills/update-slice-status/SKILL.md +1 -1
  39. package/stacks/axon/templates/build-kit/CLAUDE.md +4 -3
  40. package/stacks/axon/templates/build-kit/lib/backend-prompt.md +11 -1
  41. package/stacks/axon/templates/build-kit/lib/prompt.md +24 -0
  42. package/stacks/blank/templates/build-kit/CLAUDE.md +4 -3
  43. package/stacks/blank/templates/build-kit/lib/backend-prompt.md +11 -1
  44. package/stacks/blank/templates/build-kit/lib/prompt.md +24 -0
  45. package/stacks/classic/templates/build-kit/CLAUDE.md +6 -5
  46. package/stacks/classic/templates/build-kit/lib/backend-prompt.md +11 -1
  47. package/stacks/classic/templates/build-kit/lib/prompt.md +24 -0
  48. package/stacks/kurrent/templates/build-kit/CLAUDE.md +4 -3
  49. package/stacks/kurrent/templates/build-kit/lib/backend-prompt.md +11 -1
  50. package/stacks/kurrent/templates/build-kit/lib/prompt.md +24 -0
  51. package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +1 -1
  52. package/stacks/modeling-kit/templates/.claude/skills/prototype/SKILL.md +2 -0
  53. package/stacks/modeling-kit/templates/.claude/skills/prototype/assets/prototype.mjs +7 -5
  54. package/stacks/modeling-kit/templates/kit/CLAUDE-STANDALONE.md +1 -1
  55. package/stacks/modeling-kit/templates/kit/CLAUDE.md +11 -5
  56. package/stacks/node/templates/build-kit/CLAUDE.md +4 -3
  57. package/stacks/node/templates/build-kit/lib/backend-prompt.md +11 -1
  58. package/stacks/node/templates/build-kit/lib/prompt.md +10 -0
  59. package/stacks/opencqrs/templates/build-kit/CLAUDE.md +4 -3
  60. package/stacks/opencqrs/templates/build-kit/lib/backend-prompt.md +11 -1
  61. package/stacks/opencqrs/templates/build-kit/lib/prompt.md +24 -0
  62. package/stacks/react/templates/build-kit/CLAUDE.md +4 -3
  63. package/stacks/react/templates/build-kit/lib/AGENT.md +1 -1
  64. package/stacks/react/templates/build-kit/lib/backend-prompt.md +17 -7
  65. package/stacks/react/templates/build-kit/lib/kit.json +1 -1
  66. package/stacks/react/templates/build-kit/lib/prompt.md +39 -2
  67. package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +15 -0
  68. package/stacks/supabase/templates/build-kit/CLAUDE.md +4 -3
  69. package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +11 -1
  70. package/stacks/supabase/templates/build-kit/lib/prompt.md +10 -0
  71. package/stacks/supabase-react/templates/.claude/skills/build-state-change/SKILL.md +78 -6
  72. package/stacks/supabase-react/templates/.claude/skills/build-state-view/SKILL.md +64 -11
  73. package/stacks/supabase-react/templates/build-kit/CLAUDE.md +5 -4
  74. package/stacks/supabase-react/templates/build-kit/lib/AGENT.md +1 -1
  75. package/stacks/supabase-react/templates/build-kit/lib/backend-prompt.md +17 -7
  76. package/stacks/supabase-react/templates/build-kit/lib/kit.json +1 -1
  77. package/stacks/supabase-react/templates/build-kit/lib/prompt.md +40 -3
  78. package/stacks/umadb/templates/build-kit/CLAUDE.md +4 -3
  79. package/stacks/umadb/templates/build-kit/lib/backend-prompt.md +11 -1
  80. package/stacks/umadb/templates/build-kit/lib/prompt.md +24 -0
@@ -42,7 +42,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
42
42
  If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
43
43
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
44
44
  first )
45
- 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Handover`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
45
+ 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
46
46
  17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
47
47
  18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
48
48
  19. Finish the iteration.
@@ -64,6 +64,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
64
64
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
65
65
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
66
66
 
67
+ ### Recording Info
68
+
69
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
70
+
71
+ ```
72
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
73
+ ```
74
+
75
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
76
+
67
77
  ## Update AGENTS.md Files
68
78
 
69
79
  Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
@@ -58,6 +58,20 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
58
58
 
59
59
  4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
60
60
 
61
+ **Baseline gate** — before touching any code, run `npx @eventmodelers/cli build-baseline check --scope backend`.
62
+ It compares the board's node hashes of every element of the slice (commands, events, read models,
63
+ processors, specifications, ...) with what was recorded after the last successful build:
64
+ - `UNCHANGED` — nothing on the board changed. Do not rebuild or re-diff; run the slice's tests and
65
+ finish. Only now is "no code changes needed" a valid outcome.
66
+ - `NO_BASELINE` / `UNKNOWN` — no recorded build, or the board could not be read: do one full
67
+ field-by-field diff of slice.json against the code (never treat `UNKNOWN` as `UNCHANGED`).
68
+ - `CHANGED` — it lists the elements that changed, were added or were removed. Diff slice.json
69
+ against the code for exactly those and fix every drift; leave what matches alone.
70
+
71
+ When the checks pass, run `npx @eventmodelers/cli build-baseline record --scope backend` **before
72
+ committing**, so `ui-baseline.json` is committed with the slice. Never record without having done the
73
+ work the verdict asked for. Screens and UI prompts are not this kit's business and never trigger a build.
74
+
61
75
  5. **Verify against slice.json**: Cross-check the implementation — every command field, event field, and specification in slice.json must appear in the code. No invented fields — if it is not in slice.json, it must not be in the code.
62
76
 
63
77
  6. Run quality checks:
@@ -98,6 +112,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
98
112
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
99
113
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
100
114
 
115
+ ### Recording Info
116
+
117
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
118
+
119
+ ```
120
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
121
+ ```
122
+
123
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
124
+
101
125
  ## Important
102
126
 
103
127
  - Process **one task per iteration**.
@@ -39,7 +39,7 @@ Save the full slice list. Count total slices and group by status:
39
39
 
40
40
  | Status values |
41
41
  |---------------|
42
- | `Created`, `Ready`, `Planned`, `InProgress`, `Handover`, `Review`, `Done`, `Blocked`, `Assigned`, `Informational` |
42
+ | `Created`, `Ready`, `Planned`, `InProgress`, `Waiting`, `Review`, `Done`, `Blocked`, `Assigned`, `Informational` |
43
43
 
44
44
  ---
45
45
 
@@ -35,6 +35,8 @@ From `$ARGUMENTS`: the context (a MODEL_CONTEXT name or a timeline name) and opt
35
35
 
36
36
  The unit is the **effective context**: a timeline assigned to or connected with a MODEL_CONTEXT belongs to that context; a timeline with neither is its own context. Either name returns the whole effective context — every timeline in it, each slice carrying its `chapter`.
37
37
 
38
+ **Pass the id, not the name, whenever you have it** — the turn's `timelineId` (or a MODEL_CONTEXT's id) goes straight into `--context "<id>"`. A chapter may have no name at all; never rename a chapter to make the lookup work, and never ask about it.
39
+
38
40
  No context given, or a name that matches nothing: list the options once —
39
41
 
40
42
  ```
@@ -97,10 +97,12 @@ async function status() {
97
97
  return res.json();
98
98
  };
99
99
 
100
- const ctx = encodeURIComponent(args.context);
100
+ // --context is a name, or the id of a MODEL_CONTEXT / timeline (a chapter without a name has only that).
101
+ const contextIsId = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(args.context);
102
+ const ctx = `${contextIsId ? 'contextId' : 'contextName'}=${encodeURIComponent(args.context)}`;
101
103
  const [fields, specs] = await Promise.all([
102
- get(`/slicedata?contextName=${ctx}&projection=fields&format=json`),
103
- get(`/slicedata?contextName=${ctx}&projection=specs&format=json`),
104
+ get(`/slicedata?${ctx}&projection=fields&format=json`),
105
+ get(`/slicedata?${ctx}&projection=specs&format=json`),
104
106
  ]);
105
107
  const specsById = Object.fromEntries((specs.slices || []).map((s) => [s.id, s]));
106
108
 
@@ -127,7 +129,7 @@ async function status() {
127
129
  // The baseline whose blocks can be kept: the page the platform stores for this context — what everyone
128
130
  // plays, and there in any session or folder (its sanitizer leaves the blocks byte for byte) — else a
129
131
  // local one, from an earlier run whose upload failed. Neither: every slice is new.
130
- const contextId = args['context-id'] || (await contextIdOf(get, args.context));
132
+ const contextId = contextIsId ? args.context : await contextIdOf(get, args.context);
131
133
  const storedRes = await fetch(`${api}/prototype/${encodeURIComponent(contextId)}`, { headers });
132
134
  if (!storedRes.ok && storedRes.status !== 404) fail(`GET /prototype/${contextId} → ${storedRes.status} ${await storedRes.text()}`);
133
135
  const stored = storedRes.ok ? await storedRes.text() : null;
@@ -158,7 +160,7 @@ async function status() {
158
160
  const removed = existing.filter((b) => !current.has(b.id)).map(({ id, title }) => ({ id, title }));
159
161
  const cssFramework = Object.entries(frameworkVotes).sort((a, b) => b[1] - a[1])[0]?.[0] || 'bulma';
160
162
 
161
- const report = { context: args.context, contextId, baseline, cssFramework, mixedFrameworks: Object.keys(frameworkVotes).length > 1, slices, removed };
163
+ const report = { context: fields.contextName || args.context, contextId, baseline, cssFramework, mixedFrameworks: Object.keys(frameworkVotes).length > 1, slices, removed };
162
164
  writeFileSync(join(WORK, 'status.json'), JSON.stringify(report, null, 2));
163
165
  for (const s of slices) console.log(`${s.state.padEnd(9)} ${s.hash} ${s.id} ${s.title}`);
164
166
  for (const r of removed) console.log(`removed ${''.padEnd(16)} ${r.id} ${r.title}`);
@@ -199,7 +199,7 @@ Steps:
199
199
  ever get here in a `standalone=on` session, which is ad-hoc: its kit dir is shared across
200
200
  every board and nobody reads it afterwards. The board is the only place anything is kept, so
201
201
  anything reusable — including what a subagent reported back — goes there, as a comment on the
202
- node it concerns.
202
+ node it concerns. The exception: end the reply with `Info [limitation|decision|note]: <one terse line>` for anything you could not change (and why) or decided — the CLI records it as an event, standalone included.
203
203
  8. Reply `<promise>DONE</promise>`, naming what you dispatched and what each agent did, or —
204
204
  when step 2 turned up nothing worth doing — change nothing at all and reply
205
205
  `<promise>NOOP</promise>`. A NOOP is a perfectly good outcome, and the CLI widens the gap
@@ -19,7 +19,7 @@ session: it belongs to no project, its kit dir is a `~/.eventmodelers/kit` share
19
19
  and nobody goes looking in there afterwards. So in a `standalone=on` session the **board is the
20
20
  only place anything is kept** — comments, elements, slice statuses, scenarios. Write no file at
21
21
  all: no `Learning:` lines in your reply (step 8), no `.agent-modeling-kit/AGENTS.md`, and nothing a skill's
22
- own instructions suggest writing down either. Anything worth keeping goes on the board, as a
22
+ own instructions suggest writing down either. The one exception is `Info [kind]:` lines (step 8): the CLI records those as events in every session, standalone included. Anything worth keeping goes on the board, as a
23
23
  comment on the node it concerns. This overrides every "write it down" instruction elsewhere in this
24
24
  file and in any skill.
25
25
 
@@ -151,6 +151,7 @@ mention it in the `DONE` comment, and leave it for a self-directed turn (or for
151
151
  6. **Mark the prompt as finished** — invoke `/update-prompt-status` with this turn's `prompt_id`, `newStatus=DONE`, and a `comment` that summarizes what you actually did (e.g. "Added the OrderPlaced event and wired it to the read model"). Do this once, right after the work is done — not per skill call within the turn.
152
152
  7. If this turn has a `comment_id` field, invoke `/handle-comment` with `action=resolve`, `nodeId` from the resolved `NODE_ID` (step 3), `commentId` from `comment_id`.
153
153
  8. **`standalone=off` only** — if you noticed something reusable this turn (a pattern, a gotcha, useful context about this model), end your reply with one line per learning: `Learning [<topic>]: <one terse line>` (the topic is optional, at most five lines). The CLI records them — never write them into a file yourself, and add nothing that is already in `.agent-modeling-kit/AGENTS.md`. In a `standalone=on` session skip this: that session writes no files (see Mode), so note anything worth keeping as a board comment instead.
154
+ **In every session, `standalone=on` too:** anything that is *not* a reusable learning — something you could not change and why, a decision you took — goes the same way as `Info [limitation|decision|note]: <one terse line>` (at most five lines). The CLI records each as an event; never leave it only in prose.
154
155
  9. Reply `<promise>DONE</promise>` and wait for the next turn.
155
156
 
156
157
 
@@ -165,10 +166,13 @@ form, do the work another way or tell the person what you can't do.
165
166
  `$TOKEN` / `$EVENTMODELERS_TOKEN` only in a `-H` header; uuids with `uuidgen`, `$(uuidgen)`,
166
167
  `for i in $(seq <n>); do uuidgen; done` or `python3 -c` using only `uuid.uuid4()`; `jq`; `python3 -m json.tool`;
167
168
  read-only `git` (`git -C <code dir> …`); `cat`/`head`/`tail`/`wc`/`sort`/`uniq`/`grep`/`cut`/`tr`/`ls`, `echo`,
168
- `printf`, `mkdir`; `for NAME in …; do …; done` loops over these. No other `$(…)`, no `while`/`if`, other `python3`
169
- scripts, `node`, `rm`, `cd`. Build a JSON payload with the Write tool in `/tmp`, then
169
+ `printf`, `mkdir`; `for NAME in …; do …; done` loops over these. `node` runs exactly one script, the `/prototype`
170
+ skill's `node .claude/skills/prototype/assets/prototype.mjs status|assemble|upload …` (relative path, no `cd`; the
171
+ skill gives the flags) — try it, don't assume it is refused. No other `$(…)`, no `while`/`if`, other `python3`
172
+ scripts, other `node`, `rm`, `cd`. Build a JSON payload with the Write tool in `/tmp`, then
170
173
  `curl … --data-binary @/tmp/<file>.json`.
171
- - **Files:** read and write in this directory and `/tmp`, read the code directory. Never `.claude/`, `.mcp.json`,
174
+ - **Files:** read and write in this directory and `/tmp`, read the code directory. Reading `.claude/skills/` is fine
175
+ (skills' templates and assets); never edit `.claude/`, never read `.claude/settings*.json`, `.mcp.json`,
172
176
  `.eventmodelers/*.json` or `.env` files (`.eventmodelers/interviews/` is fine). No web access.
173
177
 
174
178
  ## Chat turns — `CHAT`
@@ -254,7 +258,9 @@ for it. Instead:
254
258
  however small** — never change the board in a chat turn. Create one `create_prompt` per
255
259
  independent piece of work, each with `originMessageId` = this turn's `message_id` (for a
256
260
  confirmation, that is the yes), phrased so
257
- the prompt turn can do it on its own (element names, chapter). The context and a handed-over
261
+ the prompt turn can do it on its own (element names, chapter). A prompt needs a chapter: if the
262
+ board has none (no `timelineId` in the header, `get_chapter_bounds` empty), call `create_chapter`
263
+ yourself first and pass its id as `timelineId` — never ask the person to add one. The context and a handed-over
258
264
  comment (`comment_id`) carry over from the message by themselves. The prompts are addressed to
259
265
  you and are worked right after this turn.
260
266
  4. **Reply exactly once** — `post_chat_message` with `replyTo` = this turn's `message_id`. It is the
@@ -48,9 +48,10 @@ When asked to build a slice, always follow this flow:
48
48
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
49
49
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
50
50
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
51
- 4. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code. This applies even when the slice was previously `Done` and reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff slice.json against the code field by field and update the code to match every change.
52
- 5. Run quality checks (`npm run build`, then the slice tests only).
53
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Handover`, not `Done` — see the `ui-contract` skill, Step 4.
51
+ 4. **Baseline gate**: run `npx @eventmodelers/cli build-baseline check --scope backend` first and act only on its verdict — `UNCHANGED` means nothing on the board changed since the last recorded build: do not rebuild, just run the slice's tests and finish; `NO_BASELINE`/`UNKNOWN` mean one full field-by-field diff of slice.json against the code; `CHANGED` (`ELEMENTS_CHANGED`) means the same diff, to fix every drift. After the checks pass and before committing, run `build-baseline record --scope backend`. A screen or UI prompt change never triggers a backend build.
52
+ 5. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code. This applies even when the slice was previously `Done` and reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff slice.json against the code field by field and update the code to match every change.
53
+ 6. Run quality checks (`npm run build`, then the slice tests only).
54
+ 7. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4.
54
55
 
55
56
  After you are done, automatically run the tests for the slice that was edited.
56
57
 
@@ -36,7 +36,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  14. even if the slice is fully implemented, run your test-analyzer skill and provide the code-slice.json file as defined in the skill
37
37
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
38
38
  first )
39
- 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Handover`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
39
+ 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
40
40
  17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
41
41
  18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
42
42
  19. Finish the iteration.
@@ -58,6 +58,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
58
58
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
59
59
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
60
60
 
61
+ ### Recording Info
62
+
63
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
64
+
65
+ ```
66
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
67
+ ```
68
+
69
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
70
+
61
71
  ## Update AGENTS.md Files
62
72
 
63
73
  Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
@@ -94,6 +94,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
94
94
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
95
95
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
96
96
 
97
+ ### Recording Info
98
+
99
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
100
+
101
+ ```
102
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
103
+ ```
104
+
105
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
106
+
97
107
  ## Important
98
108
 
99
109
  - Process **one task per iteration**.
@@ -73,13 +73,14 @@ When asked to build a slice, always follow this flow:
73
73
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
74
74
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
75
75
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
76
- 4. **Verify against slice.json**: After the skill completes, check that every command field, event field,
76
+ 4. **Baseline gate**: run `npx @eventmodelers/cli build-baseline check --scope backend` first and act only on its verdict — `UNCHANGED` means nothing on the board changed since the last recorded build: do not rebuild, just run the slice's tests and finish; `NO_BASELINE`/`UNKNOWN` mean one full field-by-field diff of slice.json against the code; `CHANGED` lists exactly which elements changed, were added or removed — diff and fix only those. After the checks pass and before committing, run `build-baseline record --scope backend`. A screen or UI prompt change never triggers a backend build.
77
+ 5. **Verify against slice.json**: After the skill completes, check that every command field, event field,
77
78
  and specification in slice.json appears in the implementation. No invented fields — if it is not in
78
79
  slice.json, it must not be in the code. This applies even when the slice was previously `Done` and
79
80
  reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff
80
81
  slice.json against the code field by field and update the code to match every change.
81
- 5. Run quality checks (`./mvnw compile -q`, then the slice tests only).
82
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Handover`, not `Done` — see the `ui-contract` skill, Step 4.
82
+ 6. Run quality checks (`./mvnw compile -q`, then the slice tests only).
83
+ 7. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4.
83
84
 
84
85
  After you are done, automatically run the tests for the slice that was edited.
85
86
 
@@ -42,7 +42,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
42
42
  If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
43
43
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
44
44
  first )
45
- 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Handover`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
45
+ 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
46
46
  17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
47
47
  18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
48
48
  19. Finish the iteration.
@@ -64,6 +64,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
64
64
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
65
65
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
66
66
 
67
+ ### Recording Info
68
+
69
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
70
+
71
+ ```
72
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
73
+ ```
74
+
75
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
76
+
67
77
  ## Update AGENTS.md Files
68
78
 
69
79
  Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
@@ -58,6 +58,20 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
58
58
 
59
59
  4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
60
60
 
61
+ **Baseline gate** — before touching any code, run `npx @eventmodelers/cli build-baseline check --scope backend`.
62
+ It compares the board's node hashes of every element of the slice (commands, events, read models,
63
+ processors, specifications, ...) with what was recorded after the last successful build:
64
+ - `UNCHANGED` — nothing on the board changed. Do not rebuild or re-diff; run the slice's tests and
65
+ finish. Only now is "no code changes needed" a valid outcome.
66
+ - `NO_BASELINE` / `UNKNOWN` — no recorded build, or the board could not be read: do one full
67
+ field-by-field diff of slice.json against the code (never treat `UNKNOWN` as `UNCHANGED`).
68
+ - `CHANGED` — it lists the elements that changed, were added or were removed. Diff slice.json
69
+ against the code for exactly those and fix every drift; leave what matches alone.
70
+
71
+ When the checks pass, run `npx @eventmodelers/cli build-baseline record --scope backend` **before
72
+ committing**, so `ui-baseline.json` is committed with the slice. Never record without having done the
73
+ work the verdict asked for. Screens and UI prompts are not this kit's business and never trigger a build.
74
+
61
75
  5. **Verify against slice.json**: Cross-check the implementation — every command field, event field, and specification in slice.json must appear in the code. No invented fields — if it is not in slice.json, it must not be in the code.
62
76
 
63
77
  6. Run quality checks:
@@ -98,6 +112,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
98
112
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
99
113
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
100
114
 
115
+ ### Recording Info
116
+
117
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
118
+
119
+ ```
120
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
121
+ ```
122
+
123
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
124
+
101
125
  ## Important
102
126
 
103
127
  - Process **one task per iteration**.
@@ -43,9 +43,10 @@ When asked to build a slice, always follow this flow:
43
43
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
44
44
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
45
45
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
46
- 4. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code.
47
- 5. Run quality checks (TODO: this stack's build + test commands), then the slice tests only.
48
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`.
46
+ 4. **UI baseline gate**: run `npx @eventmodelers/cli ui-baseline check` first and act only on its verdict — `UNCHANGED` means skip all UI work; `NO_BASELINE`/`UNKNOWN` mean one full screen diff and every `codeGen.uiPrompts` entry; `CHANGED` names the elements that changed, were added or removed (work on exactly those) and flags `SCREEN_CHANGED` (re-fetch the screen node and adjust the components to it), `ELEMENTS_CHANGED` (diff slice.json against the code) and `PROMPTS_CHANGED` (apply the printed prompts). Details in `lib/prompt.md`, Step 4. After the checks pass and before committing, run `ui-baseline record`.
47
+ 5. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code.
48
+ 6. Run quality checks (TODO: this stack's build + test commands), then the slice tests only.
49
+ 7. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`.
49
50
 
50
51
  After you are done, automatically run the tests for the slice that was edited.
51
52
 
@@ -43,4 +43,4 @@ These files are always up to date — read them directly before invoking any ski
43
43
  - The `boardId` and `organizationId` from each payload provide full context — pass them to skills.
44
44
  - Node events use `node:created`, `node:changed`, `node:deleted` — always POST to `/api/org/:orgId/boards/:boardId/nodes/events`.
45
45
  - Slice metadata (title, status) lives on the SLICE_BORDER node under `meta.sliceStatus` and `meta.title`.
46
- - `/update-slice-status` rejects moving a slice into a status it's already in — this is a concurrency guard, not a bug. It means another agent already claimed the slice. Treat it as `ALREADY_IN_STATUS`, skip that slice, and move on to the next `Handover` one instead of erroring out. This applies to queued tasks only: when the task request names the slice to build, the run loop owns its status — never call `/update-slice-status` there.
46
+ - `/update-slice-status` rejects moving a slice into a status it's already in — this is a concurrency guard, not a bug. It means another agent already claimed the slice. Treat it as `ALREADY_IN_STATUS`, skip that slice, and move on to the next `Waiting` one instead of erroring out. This applies to queued tasks only: when the task request names the slice to build, the run loop owns its status — never call `/update-slice-status` there.
@@ -9,9 +9,9 @@ The structure defined in the Project-Skills is relevant.
9
9
  You work within **exactly ONE context at a time** — the one named in `.build-kit/.slices/current_context.json` (the runner picks it).
10
10
 
11
11
  - **ONLY** look for and build slices inside `.build-kit/.slices/<currentContext>/`.
12
- - **NEVER** read, scan, or build slices from any other context directory, even if it has "Handover" slices, and even if the current context has no work left.
13
- - A "Handover" slice in a *different* context is **NOT yours to build**. Ignore it completely.
14
- - If the current context has no "Handover" slice, you are **done for this iteration** — reply `<promise>NO_TASKS</promise>` and stop. Do not go looking elsewhere. The runner moves `current_context.json` on to the next context with Handover work between iterations — never change it yourself.
12
+ - **NEVER** read, scan, or build slices from any other context directory, even if it has "Waiting" slices, and even if the current context has no work left.
13
+ - A "Waiting" slice in a *different* context is **NOT yours to build**. Ignore it completely.
14
+ - If the current context has no "Waiting" slice, you are **done for this iteration** — reply `<promise>NO_TASKS</promise>` and stop. Do not go looking elsewhere. The runner moves `current_context.json` on to the next context with Waiting work between iterations — never change it yourself.
15
15
 
16
16
  ## Your Task
17
17
 
@@ -19,8 +19,8 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
19
19
  1. Read `.build-kit/.slices/current_context.json` to find the active context name, then read `.build-kit/.slices/<contextName>/index.json`. Every item in status "handover" is a task.
20
20
  2. Read `.build-kit/AGENTS.md` **if it exists** — the project's accumulated learnings, generated from what earlier builds recorded. If the slice's `slice.json` has a `lastAttempt`, an earlier attempt at it failed: read its `reason`, `lastReply`, `branch` and `changed`, and do not repeat what failed.
21
21
  3. Make sure you are on the right branch "feature/<slicename>", if unsure, start from main.
22
- 5. Your slice is the one the task request names (the run loop picked the highest priority slice with status "Handover"); it becomes your PRD. The run loop has already claimed it — its status is "InProgress" in index.json and on the board. Build that slice and do not call `update-slice-status`: the run loop owns the slice's status on the board.
23
- **IMPORTANT: Only work on the slice named in the task request. Never switch to another slice, whatever its status. If the task request names no slice and no slice has status "Handover" in the current context, reply with:**
22
+ 5. Your slice is the one the task request names (the run loop picked the highest priority slice with status "Waiting"); it becomes your PRD. The run loop has already claimed it — its status is "InProgress" in index.json and on the board. Build that slice and do not call `update-slice-status`: the run loop owns the slice's status on the board.
23
+ **IMPORTANT: Only work on the slice named in the task request. Never switch to another slice, whatever its status. If the task request names no slice and no slice has status "Waiting" in the current context, reply with:**
24
24
  <promise>NO_TASKS</promise> and stop immediately. Do not work on other slices and do not switch to another context.
25
25
  6. Pick the slice definition from `.build-kit/.slices/<contextName>/<folder>/slice.json` as defined in the prd. Never work on more than one slice per iteration.
26
26
  7. A slice can define additional prompts as codegen/backendPrompt. Any additional prompts defined in backend are hints for the implementation of the slice and have to be taken into account.
@@ -54,6 +54,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
54
54
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
55
55
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
56
56
 
57
+ ### Recording Info
58
+
59
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
60
+
61
+ ```
62
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
63
+ ```
64
+
65
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
66
+
57
67
  ## Update AGENTS.md Files
58
68
 
59
69
  Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files — API patterns/conventions, gotchas, dependencies between files, testing approaches, configuration/environment requirements.
@@ -90,12 +100,12 @@ A Slice is not complete if specifications are missing or can't be executed.
90
100
 
91
101
  ## Stop Condition
92
102
 
93
- **After completing ONE slice, always stop — regardless of whether more slices are in Handover.** The ralph loop will invoke you again for the next slice. Never chain multiple slices in one iteration.
103
+ **After completing ONE slice, always stop — regardless of whether more slices are in Waiting.** The ralph loop will invoke you again for the next slice. Never chain multiple slices in one iteration.
94
104
 
95
105
  If the slice was completed and committed successfully, reply with:
96
106
  <promise>DONE</promise>
97
107
 
98
- If no slice has status "Handover" in the current context, reply with:
108
+ If no slice has status "Waiting" in the current context, reply with:
99
109
  <promise>NO_TASKS</promise>
100
110
  (Do NOT switch to another context to find work — stop here.)
101
111
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "pickupStatus": "Handover"
2
+ "pickupStatus": "Waiting"
3
3
  }
@@ -38,13 +38,13 @@ Run `/load-slice sliceId=<payload.sliceId>` to fetch full slice details (title,
38
38
 
39
39
  Inspect the `sliceStatus` in the payload:
40
40
 
41
- #### `Handover` — build the slice
41
+ #### `Waiting` — build the slice
42
42
 
43
43
  This is the build trigger. Setting `InProgress` and building are one atomic step:
44
44
 
45
45
  1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
46
46
 
47
- **Claim conflict**: if this call reports the slice is already in `InProgress` (or any status other than `Handover`), another agent already claimed it first — this is expected, not an error. Say so in your reply, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
47
+ **Claim conflict**: if this call reports the slice is already in `InProgress` (or any status other than `Waiting`), another agent already claimed it first — this is expected, not an error. Say so in your reply, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
48
48
 
49
49
  2. Run `/load-slice sliceId=<payload.sliceId>` to fetch the full slice, then read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json`. The runner keeps a `slice.json` fresh from a summary endpoint, so a file holding only `id`, `title`, `status` and `sliceType` is that stub, not an empty slice — never conclude a slice has no elements from it. Only if the full fetch itself returns no commands/events/read models/fields is the slice actually empty.
50
50
 
@@ -56,6 +56,33 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
56
56
 
57
57
  4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
58
58
 
59
+ **UI baseline gate** — before touching any code, run `npx @eventmodelers/cli ui-baseline check`. It
60
+ compares the board's node hashes (the slice's screen and every element) and `codeGen.uiPrompts` with
61
+ what was recorded after the last UI build, and decides what this build has to do:
62
+ - `UNCHANGED` — nothing on the board changed since the last UI build. Skip all UI work; do not
63
+ re-fetch or diff the screen. Only now is "no code changes needed" a valid outcome.
64
+ - `NO_BASELINE` — no UI build recorded yet (first build, or the slice predates the baseline). Do one
65
+ full screen diff (below), apply every UI prompt.
66
+ - `UNKNOWN` — the board could not be read. Treat it as `NO_BASELINE`; never as `UNCHANGED`.
67
+ - `CHANGED` — it also lists, per element, what changed, was added or was removed since the last recorded
68
+ build (e.g. `changed: Contact Details (screen), Assign Tag (command)`). Work on exactly those nodes
69
+ and leave what matches alone. Act on the parts it flags:
70
+ - `SCREEN_CHANGED`: re-fetch the live screen node (`get_node`, its `meta.pages` / `meta.marks`) —
71
+ never trust the JSX already in the repo — and diff the existing component(s) against the marked
72
+ (or whole, if unmarked) HTML: tags, classes, layout, copy, fields/buttons added, removed or
73
+ reordered, and `cssFrameworks`. Edit the components (and `src/pages/<ScreenTitle>.tsx`, for this
74
+ slice's marked position only) until they match 1:1 and update `samples/`. Keep what already
75
+ matches; do not regenerate the slice from scratch.
76
+ - `ELEMENTS_CHANGED`: diff slice.json against the code field by field (fields,
77
+ `apiEndpoint`/UI contract) and fix every drift.
78
+ - `PROMPTS_CHANGED`: apply the UI prompts it prints — each is an instruction the user typed on the
79
+ board for this slice's UI (e.g. "adjust the UI to the new layout!") — to the component(s) and
80
+ screen markup. Name each prompt and the change you made for it in your final reply.
81
+
82
+ When the UI work is done and the checks in step 6 pass, run `npx @eventmodelers/cli ui-baseline record`
83
+ **before committing**, so `ui-baseline.json` is committed with the slice. Never record without having
84
+ done the work the verdict asked for.
85
+
59
86
  5. **Verify against slice.json**: cross-check the implementation — every command field, event field, and specification in slice.json must appear in the code. No invented fields — if it is not in slice.json, it must not be in the code.
60
87
 
61
88
  6. Run quality checks (TODO: your stack's build + test commands — slice-scoped tests only, not the full suite).
@@ -98,6 +125,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
98
125
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
99
126
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
100
127
 
128
+ ### Recording Info
129
+
130
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
131
+
132
+ ```
133
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
134
+ ```
135
+
136
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
137
+
101
138
  ## Important
102
139
 
103
140
  - Process **one task per iteration**.
@@ -42,8 +42,22 @@ CREATE TABLE IF NOT EXISTS "public"."{tablename}"
42
42
  -- use snake_case for all column names
43
43
  created_at TIMESTAMP DEFAULT NOW()
44
44
  );
45
+
46
+ -- The UI reads this table DIRECTLY through Supabase (no read endpoint in between), so it must be readable.
47
+ -- RLS on with no policy returns an EMPTY list, not an error - always ship the policy with the table.
48
+ ALTER TABLE "public"."{tablename}" ENABLE ROW LEVEL SECURITY;
49
+ GRANT SELECT ON "public"."{tablename}" TO authenticated;
50
+ CREATE POLICY "{tablename}_select" ON "public"."{tablename}"
51
+ FOR SELECT TO authenticated USING (true);
45
52
  ```
46
53
 
54
+ **The UI reads the read-model table directly.** The frontend never goes through the `GET` route for a
55
+ read model: it selects from this table with the user's session, and Row Level Security decides which
56
+ rows come back. `USING (true)` is the default (every signed-in user sees every row); when the read
57
+ model is per user or per tenant (an owner/user/tenant column, or `description`/`comments[]` say so),
58
+ narrow the policy to it, e.g. `USING (owner_id = auth.uid()::text)`. The `GET` route in Step 5 stays
59
+ for API consumers and tests; the UI does not depend on it.
60
+
47
61
  **Column type guide** — field `type` values are the canonical set from the [event-modeling-spec schema](https://github.com/dilgerma/event-modeling-spec/blob/main/eventmodeling.schema.json):
48
62
 
49
63
  | Field type | SQL type |
@@ -487,6 +501,7 @@ src/common/
487
501
  ## Checklist
488
502
 
489
503
  - [ ] Migration file created with correct version number and all columns
504
+ - [ ] Migration enables RLS, grants `SELECT` to `authenticated` and creates a select policy: the UI reads the table directly, and no policy means an empty list
490
505
  - [ ] `tableName` constant matches the migration table name exactly
491
506
  - [ ] Projection registered in `loadPostgresEventstore.ts`
492
507
  - [ ] `canHandle` lists every event type the projection reacts to
@@ -49,9 +49,10 @@ When asked to build a slice, always follow this flow:
49
49
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
50
50
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
51
51
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
52
- 4. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code. This applies even when the slice was previously `Done` and reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff slice.json against the code field by field and update the code to match every change.
53
- 5. Run quality checks (`npm run build`, then the slice tests only).
54
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Handover`, not `Done` — see the `ui-contract` skill, Step 4.
52
+ 4. **Baseline gate**: run `npx @eventmodelers/cli build-baseline check --scope backend` first and act only on its verdict — `UNCHANGED` means nothing on the board changed since the last recorded build: do not rebuild, just run the slice's tests and finish; `NO_BASELINE`/`UNKNOWN` mean one full field-by-field diff of slice.json against the code; `CHANGED` lists exactly which elements changed, were added or removed — diff and fix only those. After the checks pass and before committing, run `build-baseline record --scope backend`. A screen or UI prompt change never triggers a backend build.
53
+ 5. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code. This applies even when the slice was previously `Done` and reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff slice.json against the code field by field and update the code to match every change.
54
+ 6. Run quality checks (`npm run build`, then the slice tests only).
55
+ 7. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4.
55
56
 
56
57
  After you are done, automatically run the tests for the slice that was edited.
57
58
 
@@ -36,7 +36,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  14. even if the slice is fully implemented, run your test-analyzer skill and provide the code-slice.json file as defined in the skill
37
37
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
38
38
  first )
39
- 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Handover`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
39
+ 16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
40
40
  17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
41
41
  18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
42
42
  19. Finish the iteration.
@@ -58,6 +58,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
58
58
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
59
59
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
60
60
 
61
+ ### Recording Info
62
+
63
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
64
+
65
+ ```
66
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
67
+ ```
68
+
69
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
70
+
61
71
  ## Update AGENTS.md Files
62
72
 
63
73
  Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
@@ -95,6 +95,16 @@ npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
95
95
  - `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
96
96
  - One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
97
97
 
98
+ ### Recording Info
99
+
100
+ Something that is **not** a reusable learning — you cannot change something and why, a decision you took, a note for whoever reads the board — is an info, not a learning. Never leave it only in your reply:
101
+
102
+ ```
103
+ npx @eventmodelers/cli info "<one terse line>" --kind limitation|decision|note
104
+ ```
105
+
106
+ It is recorded as an event and posted as a comment on the slice you are building (`--slice <id>` to name another). Reusable knowledge stays a `learn`.
107
+
98
108
  ## Important
99
109
 
100
110
  - Process **one task per iteration**.