@eventmodelers/cli 2.0.1 → 2.0.2

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 (72) hide show
  1. package/README.md +26 -9
  2. package/cli.js +320 -29
  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/events-view.js +16 -3
  10. package/shared/build-kit/lib/ralph.js +19 -15
  11. package/shared/build-kit/lib/slice-run.js +2 -2
  12. package/shared/build-kit/lib/slice-state.js +5 -3
  13. package/shared/scaffold/LICENSE-em-scaffold +21 -0
  14. package/shared/scaffold/supabase/generate.mjs +290 -0
  15. package/shared/scaffold/supabase/template/scripts/create-user.mjs.tmpl +29 -0
  16. package/shared/scaffold/supabase/template/scripts/dev.mjs.tmpl +145 -0
  17. package/shared/scaffold/supabase/template/scripts/write-env.mjs.tmpl +44 -0
  18. package/shared/scaffold/supabase/template/server.ts.tmpl +168 -0
  19. package/shared/scaffold/supabase/template/src/common/extraEndpoints.ts.tmpl +5 -0
  20. package/shared/scaffold/supabase/template/src/common/notImplemented.test.ts.tmpl +58 -0
  21. package/shared/scaffold/supabase/template/src/common/notImplemented.ts.tmpl +29 -0
  22. package/shared/scaffold/supabase/template/supabase/migrations/_V0__supabase_stubs.sql.tmpl +34 -0
  23. package/shared/scaffold/supabase/template/web/src/App.tsx.tmpl +38 -0
  24. package/shared/scaffold/supabase/template/web/src/app/Layout.tsx.tmpl +48 -0
  25. package/shared/scaffold/supabase/template/web/src/app/NotFound.tsx.tmpl +12 -0
  26. package/shared/scaffold/supabase/template/web/src/app/SignIn.tsx.tmpl +42 -0
  27. package/shared/scaffold/supabase/template/web/src/app/TimelinePage.tsx.tmpl +73 -0
  28. package/shared/scaffold/supabase/template/web/src/app/pages.ts.tmpl +26 -0
  29. package/shared/scaffold/supabase/template/web/src/app/skeleton.css.tmpl +25 -0
  30. package/shared/scaffold/supabase/template/web/src/lib/NotBuilt.tsx.tmpl +12 -0
  31. package/shared/scaffold/supabase/template/web/src/lib/api.ts.tmpl +226 -0
  32. package/shared/scaffold/supabase/template/web/src/main.tsx.tmpl +13 -0
  33. package/shared/skills/learn-eventmodelers-api/SKILL.md +4 -4
  34. package/shared/skills/ui-contract/SKILL.md +6 -6
  35. package/shared/skills/update-slice-status/SKILL.md +1 -1
  36. package/stacks/axon/templates/build-kit/CLAUDE.md +4 -3
  37. package/stacks/axon/templates/build-kit/lib/backend-prompt.md +1 -1
  38. package/stacks/axon/templates/build-kit/lib/prompt.md +14 -0
  39. package/stacks/blank/templates/build-kit/CLAUDE.md +4 -3
  40. package/stacks/blank/templates/build-kit/lib/backend-prompt.md +1 -1
  41. package/stacks/blank/templates/build-kit/lib/prompt.md +14 -0
  42. package/stacks/classic/templates/build-kit/CLAUDE.md +6 -5
  43. package/stacks/classic/templates/build-kit/lib/backend-prompt.md +1 -1
  44. package/stacks/classic/templates/build-kit/lib/prompt.md +14 -0
  45. package/stacks/kurrent/templates/build-kit/CLAUDE.md +4 -3
  46. package/stacks/kurrent/templates/build-kit/lib/backend-prompt.md +1 -1
  47. package/stacks/kurrent/templates/build-kit/lib/prompt.md +14 -0
  48. package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +1 -1
  49. package/stacks/modeling-kit/templates/kit/CLAUDE.md +9 -4
  50. package/stacks/node/templates/build-kit/CLAUDE.md +4 -3
  51. package/stacks/node/templates/build-kit/lib/backend-prompt.md +1 -1
  52. package/stacks/opencqrs/templates/build-kit/CLAUDE.md +4 -3
  53. package/stacks/opencqrs/templates/build-kit/lib/backend-prompt.md +1 -1
  54. package/stacks/opencqrs/templates/build-kit/lib/prompt.md +14 -0
  55. package/stacks/react/templates/build-kit/CLAUDE.md +4 -3
  56. package/stacks/react/templates/build-kit/lib/AGENT.md +1 -1
  57. package/stacks/react/templates/build-kit/lib/backend-prompt.md +7 -7
  58. package/stacks/react/templates/build-kit/lib/kit.json +1 -1
  59. package/stacks/react/templates/build-kit/lib/prompt.md +29 -2
  60. package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +15 -0
  61. package/stacks/supabase/templates/build-kit/CLAUDE.md +4 -3
  62. package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +1 -1
  63. package/stacks/supabase-react/templates/.claude/skills/build-state-change/SKILL.md +78 -6
  64. package/stacks/supabase-react/templates/.claude/skills/build-state-view/SKILL.md +64 -11
  65. package/stacks/supabase-react/templates/build-kit/CLAUDE.md +5 -4
  66. package/stacks/supabase-react/templates/build-kit/lib/AGENT.md +1 -1
  67. package/stacks/supabase-react/templates/build-kit/lib/backend-prompt.md +7 -7
  68. package/stacks/supabase-react/templates/build-kit/lib/kit.json +1 -1
  69. package/stacks/supabase-react/templates/build-kit/lib/prompt.md +30 -3
  70. package/stacks/umadb/templates/build-kit/CLAUDE.md +4 -3
  71. package/stacks/umadb/templates/build-kit/lib/backend-prompt.md +1 -1
  72. package/stacks/umadb/templates/build-kit/lib/prompt.md +14 -0
@@ -0,0 +1,226 @@
1
+ import { supabase } from './supabase';
2
+
3
+ /**
4
+ * Common API client — the ONLY place that knows about base URLs, auth headers,
5
+ * correlation/causation tracing, and how to reach Supabase tables. Slice components
6
+ * must never call `fetch` directly, read the Supabase session, or import
7
+ * `./supabase` themselves — they call `postCommand`/`queryReadModel` and handle only
8
+ * the request/response shape their command/read model defines.
9
+ *
10
+ * Every call here has two implementations: a real one (Supabase) and a mock one that
11
+ * serves a numbered sample instead. This is what makes every slice component testable
12
+ * in isolation — flip `VITE_DATA_MODE` to `mock` and every read/write in the app is
13
+ * served from `samples/sample-<VITE_MOCK_SAMPLE>.json` files instead of a live backend.
14
+ */
15
+
16
+ export const API_BASE = import.meta.env.VITE_API_BASE ?? '';
17
+
18
+ /** `true` when reads/writes should be served from samples instead of Supabase/the backend. */
19
+ export function isMockMode(): boolean {
20
+ return import.meta.env.VITE_DATA_MODE === 'mock';
21
+ }
22
+
23
+ /** Which numbered sample set is active in mock mode, e.g. `"1"`, `"2"`. */
24
+ export function activeMockSample(): string {
25
+ return import.meta.env.VITE_MOCK_SAMPLE ?? '1';
26
+ }
27
+
28
+ async function getAuthHeaders(json = true): Promise<Record<string, string>> {
29
+ const {
30
+ data: { session },
31
+ } = await supabase.auth.getSession();
32
+
33
+ return {
34
+ // multipart bodies must leave Content-Type unset so the browser adds the boundary
35
+ ...(json ? { 'Content-Type': 'application/json' } : {}),
36
+ Authorization: session ? `Bearer ${session.access_token}` : '',
37
+ 'x-correlation-id': crypto.randomUUID(),
38
+ 'x-causation-id': crypto.randomUUID(),
39
+ };
40
+ }
41
+
42
+ /** 501 means the endpoint is modeled but its slice is not built yet (distinct from a 404 for a wrong URL). */
43
+ export const NOT_BUILT_MESSAGE = 'This feature is not built yet.';
44
+
45
+ function errorMessage(status: number, payload: { error?: string; message?: string } | undefined): string {
46
+ if (status === 501) return NOT_BUILT_MESSAGE;
47
+ return (payload && (payload.error || payload.message)) || `Request failed with status ${status}`;
48
+ }
49
+
50
+ /** True when an error from this module means "modeled, but its slice is not built yet" (HTTP 501). */
51
+ export function isNotBuilt(err: unknown): boolean {
52
+ return err instanceof ApiError && err.status === 501;
53
+ }
54
+
55
+ export class ApiError extends Error {
56
+ status: number;
57
+ body: unknown;
58
+
59
+ constructor(message: string, status: number, body?: unknown) {
60
+ super(message);
61
+ this.name = 'ApiError';
62
+ this.status = status;
63
+ this.body = body;
64
+ }
65
+ }
66
+
67
+ /**
68
+ * POST a command to `path` (taken verbatim from the command's API description in
69
+ * slice.json — never invented) with `body` as the JSON payload. Resolves with the
70
+ * parsed JSON response, or throws `ApiError` on a non-2xx response.
71
+ *
72
+ * In mock mode this never hits the network — it resolves with `{ ok: true }` so a
73
+ * command component can be exercised (submitting/success states) fully offline.
74
+ */
75
+ export async function postCommand<TResponse = unknown>(
76
+ path: string,
77
+ body: unknown,
78
+ ): Promise<TResponse> {
79
+ if (isMockMode()) {
80
+ return { ok: true } as TResponse;
81
+ }
82
+
83
+ const headers = await getAuthHeaders();
84
+ const res = await fetch(`${API_BASE}${path}`, {
85
+ method: 'POST',
86
+ headers,
87
+ body: JSON.stringify(body),
88
+ });
89
+
90
+ const payload = await res.json().catch(() => undefined);
91
+
92
+ if (!res.ok) {
93
+ throw new ApiError(errorMessage(res.status, payload), res.status, payload);
94
+ }
95
+
96
+ return payload as TResponse;
97
+ }
98
+
99
+ /**
100
+ * POST a multipart/form-data command (e.g. one carrying a file) to `path`. Same contract as
101
+ * `postCommand`: resolves with the parsed JSON response, throws `ApiError` on a non-2xx
102
+ * response, and resolves with `{ ok: true }` locally in mock mode.
103
+ */
104
+ export async function postForm<TResponse = unknown>(
105
+ path: string,
106
+ body: FormData,
107
+ ): Promise<TResponse> {
108
+ if (isMockMode()) {
109
+ return { ok: true } as TResponse;
110
+ }
111
+
112
+ const headers = await getAuthHeaders(false);
113
+ const res = await fetch(`${API_BASE}${path}`, { method: 'POST', headers, body });
114
+
115
+ const payload = await res.json().catch(() => undefined);
116
+
117
+ if (!res.ok) {
118
+ throw new ApiError(errorMessage(res.status, payload), res.status, payload);
119
+ }
120
+
121
+ return payload as TResponse;
122
+ }
123
+
124
+ export interface ReadModelParams {
125
+ /** `readmodel.apiEndpoint`, verbatim — the Postgres table/view name. */
126
+ table: string;
127
+ /** Column names to select, comma-separated (never `'*'`). */
128
+ select: string;
129
+ /** Simple equality filters, e.g. `{ customer_id: customerId }`. */
130
+ filters?: Record<string, unknown>;
131
+ /** `true` for a single-row read model (`.maybeSingle()`), `false` for a list. */
132
+ single?: boolean;
133
+ }
134
+
135
+ /**
136
+ * Read a read model's data — `params.table` via Supabase in the real implementation,
137
+ * or `samples[activeMockSample()]` in mock mode. `samples` is this component's own
138
+ * `samples/sample-*.json` map (see the component for how it's built); every read model
139
+ * component supplies its own, `queryReadModel` never reaches into a slice folder itself.
140
+ */
141
+ export async function queryReadModel<T>(
142
+ params: ReadModelParams,
143
+ samples?: Record<string, T>,
144
+ ): Promise<T> {
145
+ if (isMockMode()) {
146
+ return mockSample(samples, `table "${params.table}"`);
147
+ }
148
+
149
+ let query = supabase.from(params.table).select(params.select);
150
+ for (const [column, value] of Object.entries(params.filters ?? {})) {
151
+ query = query.eq(column, value);
152
+ }
153
+
154
+ const { data, error } = params.single ? await query.maybeSingle() : await query;
155
+ // A read-model table that does not exist yet means its slice is not built: same 501 as the backend fallback.
156
+ if (error && (error.code === '42P01' || error.code === 'PGRST205')) throw new ApiError(NOT_BUILT_MESSAGE, 501, error);
157
+ if (error) throw new ApiError(error.message, 500, error);
158
+ return data as T;
159
+ }
160
+
161
+ /**
162
+ * GET a read model from a backend query route, e.g. `/api/query/orderlist-collection` —
163
+ * for read models whose table has RLS on with no policies (kept off Supabase's Data API),
164
+ * so `queryReadModel` would only ever see an empty result. Resolves with the parsed JSON
165
+ * response, or throws `ApiError` on a non-2xx response; mock-aware like `queryReadModel`.
166
+ */
167
+ export async function getReadModel<T>(path: string, samples?: Record<string, T>): Promise<T> {
168
+ if (isMockMode()) {
169
+ return mockSample(samples, `"${path}"`);
170
+ }
171
+
172
+ const headers = await getAuthHeaders();
173
+ const res = await fetch(`${API_BASE}${path}`, { method: 'GET', headers });
174
+
175
+ const payload = await res.json().catch(() => undefined);
176
+
177
+ if (!res.ok) {
178
+ throw new ApiError(errorMessage(res.status, payload), res.status, payload);
179
+ }
180
+
181
+ return payload as T;
182
+ }
183
+
184
+ async function fetchFile(path: string): Promise<Blob> {
185
+ const headers = await getAuthHeaders(false);
186
+ const res = await fetch(`${API_BASE}${path}`, { method: 'GET', headers });
187
+ if (!res.ok) {
188
+ const payload = await res.json().catch(() => undefined);
189
+ throw new ApiError(errorMessage(res.status, payload), res.status, payload);
190
+ }
191
+ return res.blob();
192
+ }
193
+
194
+ /**
195
+ * GET a binary file (e.g. a generated PDF) from `path` with auth headers and open it in a new
196
+ * browser tab. In mock mode nothing is fetched; the call just resolves.
197
+ */
198
+ export async function openFile(path: string): Promise<void> {
199
+ if (isMockMode()) return;
200
+
201
+ const url = URL.createObjectURL(await fetchFile(path));
202
+ window.open(url, '_blank');
203
+ setTimeout(() => URL.revokeObjectURL(url), 60_000);
204
+ }
205
+
206
+ /**
207
+ * GET a file (e.g. a template logo) from `path` with auth headers and return a blob URL for an
208
+ * `<img src>`, which would send no bearer token itself. The caller revokes it with
209
+ * `URL.revokeObjectURL`. In mock mode nothing is fetched; resolves with `null`.
210
+ */
211
+ export async function fileUrl(path: string): Promise<string | null> {
212
+ if (isMockMode()) return null;
213
+
214
+ return URL.createObjectURL(await fetchFile(path));
215
+ }
216
+
217
+ function mockSample<T>(samples: Record<string, T> | undefined, source: string): T {
218
+ const n = activeMockSample();
219
+ const sample = samples?.[n];
220
+ if (sample === undefined) {
221
+ throw new Error(
222
+ `Mock mode is on (VITE_MOCK_SAMPLE=${n}) but no sample-${n}.json exists for ${source} — add one under this component's samples/ folder.`,
223
+ );
224
+ }
225
+ return sample;
226
+ }
@@ -0,0 +1,13 @@
1
+ import { StrictMode } from 'react'
2
+ import { createRoot } from 'react-dom/client'
3
+ __CSS_IMPORT__
4
+ import { BrowserRouter } from 'react-router-dom'
5
+ import App from './App.tsx'
6
+
7
+ createRoot(document.getElementById('root')!).render(
8
+ <StrictMode>
9
+ <BrowserRouter>
10
+ <App />
11
+ </BrowserRouter>
12
+ </StrictMode>,
13
+ )
@@ -646,7 +646,7 @@ Create a complete slice (1 column + its nodes automatically placed).
646
646
  interaction?: Partial<NodeData> & { rowId?: string, fields?: FieldDef[] }
647
647
  swimlane?: Partial<NodeData> & { rowId?: string, fields?: FieldDef[] }
648
648
  }
649
- status?: 'Created' | 'Ready' | 'Planned' | 'InProgress' | 'Handover' | 'Review' | 'Done' | 'Blocked' | 'Assigned' | 'Informational'
649
+ status?: 'Created' | 'Ready' | 'Planned' | 'InProgress' | 'Waiting' | 'Review' | 'Done' | 'Blocked' | 'Assigned' | 'Informational'
650
650
  }
651
651
  ```
652
652
 
@@ -673,7 +673,7 @@ Create a standalone SLICE_BORDER node spanning an **existing** column. Unlike th
673
673
  {
674
674
  columnId: string // id of an existing column on this timeline
675
675
  title: string // slice title — always taken from this field, never derived
676
- status?: 'Created' | 'Ready' | 'Planned' | 'InProgress' | 'Handover' | 'Review' | 'Done' | 'Blocked' | 'Assigned' | 'Informational'
676
+ status?: 'Created' | 'Ready' | 'Planned' | 'InProgress' | 'Waiting' | 'Review' | 'Done' | 'Blocked' | 'Assigned' | 'Informational'
677
677
  data?: Record<string, unknown> // optional node.data payload
678
678
  meta?: Record<string, unknown> // optional extra meta fields (type, colId, title are always set explicitly and cannot be overridden here)
679
679
  }
@@ -847,8 +847,8 @@ How much each slice of one context has been reworked — read-only, derived from
847
847
  for it.
848
848
 
849
849
  A slice's rework is read from its own SLICE_BORDER history. Going backwards means a step down the progress order
850
- (Created → Ready → Planned → Assigned → InProgress → Handover → Review → Done), or reaching `Blocked` from
851
- `Handover`/`Review`/`Done`;
850
+ (Created → Ready → Planned → Assigned → InProgress → Waiting → Review → Done), or reaching `Blocked` from
851
+ `Waiting`/`Review`/`Done`;
852
852
  `Informational` is never scored. `reopens` counts transitions leading away from `Done`, `changes` counts writes to the
853
853
  slice itself. This says nothing about edits to the elements inside a slice.
854
854
 
@@ -18,7 +18,7 @@ records that as a contract — the endpoint's **OpenAPI operation**, one per sli
18
18
 
19
19
  ## When
20
20
 
21
- **Only when handover is on** — the task request's `Handover: on|off` line (authoritative; the runner resolves `run --handover` over the project setting), else `"handover": true` in `.eventmodelers/config.json`. With handover **off/unset**, do nothing: publish no contract, write no `## UI Contract` section, and finish the slice as `Done` (Step 4). The contract exists only for the UI kit that picks up `Handover` slices.
21
+ **Only when handover is on** — the task request's `Handover: on|off` line (authoritative; the runner resolves `run --handover` over the project setting), else `"handover": true` in `.eventmodelers/config.json`. With handover **off/unset**, do nothing: publish no contract, write no `## UI Contract` section, and finish the slice as `Done` (Step 4). The contract exists only for the UI kit that picks up `Waiting` slices.
22
22
 
23
23
  At the end of building a slice, **after** the endpoint exists (so the contract describes the real
24
24
  route, not the plan), before the final commit:
@@ -99,7 +99,7 @@ every MARKDOWN node of the slice's column as a plain string in `slice.json` `not
99
99
  `outline` / `fields` / `specs` projections leave `notes` out). The UI build kit therefore needs no
100
100
  extra file and no board call.
101
101
 
102
- ## Step 4 — Completion status: `Handover` instead of `Done`
102
+ ## Step 4 — Completion status: `Waiting` instead of `Done`
103
103
 
104
104
  A slice with a UI is only finished once the UI kit has built its half. Whether this build kit hands
105
105
  over is decided per run, in this order: the task request's `Handover: on|off` line (authoritative — the
@@ -107,11 +107,11 @@ runner resolves `run --handover` over the project setting), else `"handover": tr
107
107
  `.eventmodelers/config.json` (saved by `init --handover` / `eventmodelers config --handover on|off`).
108
108
 
109
109
  - **On** — the build kit's "set the slice to `Done`" for a STATE_VIEW / STATE_CHANGE slice means
110
- **`Handover`** instead: after the contract is published and the commit/merge succeeded. Where the build
111
- kit's prompt says to call `update-slice-status` (a queued task), set `Handover` through it,
110
+ **`Waiting`** instead: after the contract is published and the commit/merge succeeded. Where the build
111
+ kit's prompt says to call `update-slice-status` (a queued task), set `Waiting` through it,
112
112
  mirrored in the local `index.json`. For a run-loop build (the task request names the slice), record it
113
- with `npx @eventmodelers/cli slice-status Handover` — the run loop pushes it to the board; do not call
114
- `update-slice-status`. The UI kit claims `Handover` slices and sets `Done` when its UI is built.
113
+ with `npx @eventmodelers/cli slice-status Waiting` — the run loop pushes it to the board; do not call
114
+ `update-slice-status`. The UI kit claims `Waiting` slices and sets `Done` when its UI is built.
115
115
  - **Off / unset** — nothing changes: `Done`.
116
116
  - Automations and translations have no UI → always `Done`.
117
117
 
@@ -26,7 +26,7 @@ Valid status values (case-sensitive):
26
26
  | `Ready` | Modeling is done — specified and ready to be planned for implementation |
27
27
  | `Planned` | Work is planned — queued for the backend build kit |
28
28
  | `InProgress` | Work is actively in progress |
29
- | `Handover` | Backend built and its UI contract published (`## UI Contract` in the slice's markdown note) — queued for the UI build kit |
29
+ | `Waiting` | Backend built and its UI contract published (`## UI Contract` in the slice's markdown note) — queued for the UI build kit |
30
30
  | `Review` | Ready for review |
31
31
  | `Done` | Completed |
32
32
  | `Blocked` | Blocked by something |
@@ -53,9 +53,10 @@ When asked to build a slice, always follow this flow:
53
53
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
54
54
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
55
55
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
56
- 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.
57
- 5. Run quality checks (`./mvnw compile -q`, then the slice tests only).
58
- 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.
56
+ 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.
57
+ 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.
58
+ 6. Run quality checks (`./mvnw compile -q`, then the slice tests only).
59
+ 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.
59
60
 
60
61
  After you are done, automatically run the tests for the slice that was edited.
61
62
 
@@ -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.
@@ -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:
@@ -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. 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.
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`. 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.
46
+ 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.
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. 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.
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`. 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.
49
50
 
50
51
  After you are done, automatically run the tests for the slice that was edited.
51
52
 
@@ -32,7 +32,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
32
32
  12. Only when `handover` is on (the task's `Handover: on` line), invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices; with handover off skip this step (publishes the UI Contract section to the slice's feedback-lane markdown node)
33
33
  13. Run quality checks — TODO: your stack's build command, TODO: your stack's test command (slice-scoped only; do not run all tests).
34
34
  14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
35
- 15. 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.
35
+ 15. 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.
36
36
  16. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
37
37
  17. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
38
38
  18. Finish the iteration.
@@ -56,6 +56,20 @@ 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
+ **Baseline gate** — before touching any code, run `npx @eventmodelers/cli build-baseline check --scope backend`.
60
+ It compares the board's node hashes of every element of the slice (commands, events, read models,
61
+ processors, specifications, ...) with what was recorded after the last successful build:
62
+ - `UNCHANGED` — nothing on the board changed. Do not rebuild or re-diff; run the slice's tests and
63
+ finish. Only now is "no code changes needed" a valid outcome.
64
+ - `NO_BASELINE` / `UNKNOWN` — no recorded build, or the board could not be read: do one full
65
+ field-by-field diff of slice.json against the code (never treat `UNKNOWN` as `UNCHANGED`).
66
+ - `CHANGED` — it lists the elements that changed, were added or were removed. Diff slice.json
67
+ against the code for exactly those and fix every drift; leave what matches alone.
68
+
69
+ When the checks pass, run `npx @eventmodelers/cli build-baseline record --scope backend` **before
70
+ committing**, so `ui-baseline.json` is committed with the slice. Never record without having done the
71
+ work the verdict asked for. Screens and UI prompts are not this kit's business and never trigger a build.
72
+
59
73
  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
74
 
61
75
  6. Run quality checks (TODO: your stack's build + test commands — slice-scoped tests only, not the full suite).
@@ -48,11 +48,12 @@ 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
  4. Invoke the matching skill and follow its instructions completely. Do not deviate.
51
- 5. **Verify against slice.json**: After the skill completes, check that every command field, event field, read model field and specification in slice.json has its counterpart 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
- 6. Run the quality checks from `.build-kit/ARCHITECTURE.md` (build/compile, then only the tests this slice touched).
53
- 7. If checks pass, make sure the slice's row in the Slice map is added/updated and commit with `feat: [Slice Name]`.
54
- 8. Invoke `/record-evidence` — it writes the implementation evidence (element → code mapping, files, specification → test mapping, seams, assumptions, commit) as a markdown note into the slice's column, in the chapter's `Implementation` feedback lane.
55
- 9. Set slice status to `Done`.
51
+ 5. **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.
52
+ 6. **Verify against slice.json**: After the skill completes, check that every command field, event field, read model field and specification in slice.json has its counterpart 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
+ 7. Run the quality checks from `.build-kit/ARCHITECTURE.md` (build/compile, then only the tests this slice touched).
54
+ 8. If checks pass, make sure the slice's row in the Slice map is added/updated and commit with `feat: [Slice Name]`.
55
+ 9. Invoke `/record-evidence` — it writes the implementation evidence (element → code mapping, files, specification → test mapping, seams, assumptions, commit) as a markdown note into the slice's column, in the chapter's `Implementation` feedback lane.
56
+ 10. Set slice status to `Done`.
56
57
 
57
58
  After you are done, automatically run the tests for the slice that was edited.
58
59
 
@@ -36,7 +36,7 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  13. Run the quality checks listed in `.build-kit/ARCHITECTURE.md` — build/compile, then only the tests touched by this slice (do not run all tests).
37
37
  14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
38
38
  15. Invoke `/record-evidence` to write the implementation evidence (element → code mapping, files, specification → test mapping, seams, assumptions, commit) as a note into the slice's column, in the chapter's `Implementation` feedback lane.
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,20 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
58
58
 
59
59
  5. 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
  6. **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
  7. Run the quality checks listed in `.build-kit/ARCHITECTURE.md` (build/compile, then only the tests touched by this slice — not the full suite).
@@ -87,13 +87,14 @@ When asked to build a slice, always follow this flow:
87
87
  - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
88
88
  - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
89
89
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
90
- 4. **Verify against slice.json**: After the skill completes, check that every command field, event field,
90
+ 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.
91
+ 5. **Verify against slice.json**: After the skill completes, check that every command field, event field,
91
92
  and specification in slice.json appears in the implementation. No invented fields — if it is not in
92
93
  slice.json, it must not be in the code. This applies even when the slice was previously `Done` and
93
94
  reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff
94
95
  slice.json against the code field by field and update the code to match every change.
95
- 5. Run quality checks (`./mvnw compile -q`, then the slice tests only).
96
- 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.
96
+ 6. Run quality checks (`./mvnw compile -q`, then the slice tests only).
97
+ 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.
97
98
 
98
99
  After you are done, automatically run the tests for the slice that was edited.
99
100
 
@@ -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.
@@ -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:
@@ -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
 
@@ -165,10 +165,13 @@ form, do the work another way or tell the person what you can't do.
165
165
  `$TOKEN` / `$EVENTMODELERS_TOKEN` only in a `-H` header; uuids with `uuidgen`, `$(uuidgen)`,
166
166
  `for i in $(seq <n>); do uuidgen; done` or `python3 -c` using only `uuid.uuid4()`; `jq`; `python3 -m json.tool`;
167
167
  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
168
+ `printf`, `mkdir`; `for NAME in …; do …; done` loops over these. `node` runs exactly one script, the `/prototype`
169
+ skill's `node .claude/skills/prototype/assets/prototype.mjs status|assemble|upload …` (relative path, no `cd`; the
170
+ skill gives the flags) — try it, don't assume it is refused. No other `$(…)`, no `while`/`if`, other `python3`
171
+ scripts, other `node`, `rm`, `cd`. Build a JSON payload with the Write tool in `/tmp`, then
170
172
  `curl … --data-binary @/tmp/<file>.json`.
171
- - **Files:** read and write in this directory and `/tmp`, read the code directory. Never `.claude/`, `.mcp.json`,
173
+ - **Files:** read and write in this directory and `/tmp`, read the code directory. Reading `.claude/skills/` is fine
174
+ (skills' templates and assets); never edit `.claude/`, never read `.claude/settings*.json`, `.mcp.json`,
172
175
  `.eventmodelers/*.json` or `.env` files (`.eventmodelers/interviews/` is fine). No web access.
173
176
 
174
177
  ## Chat turns — `CHAT`
@@ -254,7 +257,9 @@ for it. Instead:
254
257
  however small** — never change the board in a chat turn. Create one `create_prompt` per
255
258
  independent piece of work, each with `originMessageId` = this turn's `message_id` (for a
256
259
  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
260
+ the prompt turn can do it on its own (element names, chapter). A prompt needs a chapter: if the
261
+ board has none (no `timelineId` in the header, `get_chapter_bounds` empty), call `create_chapter`
262
+ yourself first and pass its id as `timelineId` — never ask the person to add one. The context and a handed-over
258
263
  comment (`comment_id`) carry over from the message by themselves. The prompts are addressed to
259
264
  you and are worked right after this turn.
260
265
  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.