@eventmodelers/cli 1.0.153 → 1.0.155

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 (57) hide show
  1. package/README.md +35 -1
  2. package/cli.js +51 -8
  3. package/package.json +1 -1
  4. package/shared/build-kit/lib/adapters/pocketbase-realtime-adapter.js +46 -20
  5. package/shared/build-kit/lib/ralph.js +31 -8
  6. package/shared/skills/connect/SKILL.md +1 -1
  7. package/shared/skills/learn-eventmodelers-api/SKILL.md +10 -4
  8. package/shared/skills/ui-contract/SKILL.md +128 -0
  9. package/shared/skills/update-slice-status/SKILL.md +3 -1
  10. package/stacks/axon/templates/.claude/skills/build-state-change/SKILL.md +6 -0
  11. package/stacks/axon/templates/.claude/skills/build-state-view/SKILL.md +6 -0
  12. package/stacks/axon/templates/build-kit/CLAUDE.md +1 -1
  13. package/stacks/axon/templates/build-kit/lib/backend-prompt.md +2 -2
  14. package/stacks/blank/templates/.claude/skills/build-state-change/SKILL.md +12 -0
  15. package/stacks/blank/templates/.claude/skills/build-state-view/SKILL.md +12 -0
  16. package/stacks/blank/templates/build-kit/CLAUDE.md +8 -1
  17. package/stacks/blank/templates/build-kit/lib/backend-prompt.md +2 -2
  18. package/stacks/classic/templates/.claude/skills/build-state-change/SKILL.md +6 -0
  19. package/stacks/classic/templates/.claude/skills/build-state-view/SKILL.md +6 -0
  20. package/stacks/classic/templates/build-kit/lib/backend-prompt.md +2 -2
  21. package/stacks/kurrent/templates/.claude/skills/build-state-change/SKILL.md +6 -0
  22. package/stacks/kurrent/templates/.claude/skills/build-state-view/SKILL.md +6 -0
  23. package/stacks/kurrent/templates/build-kit/CLAUDE.md +1 -1
  24. package/stacks/kurrent/templates/build-kit/lib/backend-prompt.md +2 -2
  25. package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +1 -1
  26. package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +1 -1
  27. package/stacks/modeling-kit/templates/kit/CLAUDE.md +4 -4
  28. package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +8 -0
  29. package/stacks/node/templates/.claude/skills/build-state-change/references/ui-contract-from-openapi.md +13 -0
  30. package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +8 -0
  31. package/stacks/node/templates/build-kit/CLAUDE.md +1 -1
  32. package/stacks/node/templates/build-kit/lib/backend-prompt.md +2 -2
  33. package/stacks/opencqrs/templates/.claude/skills/build-state-change/SKILL.md +6 -0
  34. package/stacks/opencqrs/templates/.claude/skills/build-state-view/SKILL.md +6 -0
  35. package/stacks/opencqrs/templates/build-kit/CLAUDE.md +1 -1
  36. package/stacks/opencqrs/templates/build-kit/lib/backend-prompt.md +2 -2
  37. package/stacks/react/templates/.claude/skills/build-state-change/SKILL.md +5 -0
  38. package/stacks/react/templates/.claude/skills/build-state-view/SKILL.md +5 -0
  39. package/stacks/react/templates/build-kit/lib/AGENT.md +1 -1
  40. package/stacks/react/templates/build-kit/lib/backend-prompt.md +11 -11
  41. package/stacks/react/templates/build-kit/lib/kit.json +3 -0
  42. package/stacks/react/templates/build-kit/lib/prompt.md +2 -2
  43. package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +8 -0
  44. package/stacks/supabase/templates/.claude/skills/build-state-change/references/ui-contract-from-openapi.md +13 -0
  45. package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +8 -0
  46. package/stacks/supabase/templates/build-kit/CLAUDE.md +1 -1
  47. package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +2 -2
  48. package/stacks/supabase-react/templates/.claude/skills/build-state-change/SKILL.md +10 -1
  49. package/stacks/supabase-react/templates/.claude/skills/build-state-view/SKILL.md +4 -0
  50. package/stacks/supabase-react/templates/build-kit/lib/AGENT.md +1 -1
  51. package/stacks/supabase-react/templates/build-kit/lib/backend-prompt.md +11 -11
  52. package/stacks/supabase-react/templates/build-kit/lib/kit.json +3 -0
  53. package/stacks/supabase-react/templates/build-kit/lib/prompt.md +2 -2
  54. package/stacks/umadb/templates/.claude/skills/build-state-change/SKILL.md +6 -0
  55. package/stacks/umadb/templates/.claude/skills/build-state-view/SKILL.md +6 -0
  56. package/stacks/umadb/templates/build-kit/CLAUDE.md +1 -1
  57. package/stacks/umadb/templates/build-kit/lib/backend-prompt.md +2 -2
@@ -23,8 +23,10 @@ Valid status values (case-sensitive):
23
23
  | Value | Meaning |
24
24
  |-------|---------|
25
25
  | `Created` | Default — slice has been created but not started |
26
- | `Planned` | Work is planned |
26
+ | `Ready` | Modeling is done — specified and ready to be planned for implementation |
27
+ | `Planned` | Work is planned — queued for the backend build kit |
27
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 |
28
30
  | `Review` | Ready for review |
29
31
  | `Done` | Completed |
30
32
  | `Blocked` | Blocked by something |
@@ -435,6 +435,12 @@ EVENT→READMODEL beats) belongs to `build-state-view`'s own storyline step, sin
435
435
  touches a projector. If the beat immediately after the command isn't an EVENT, don't force a test —
436
436
  leave it undocumented rather than fabricating an assertion.
437
437
 
438
+ ## UI Contract
439
+
440
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
441
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
442
+ (a build kit may override it).
443
+
438
444
  ## Final Verification
439
445
 
440
446
  Before considering the slice done:
@@ -319,6 +319,12 @@ class {SliceName}ProjectorTest {
319
319
  - **Assert with full objects**: Use `containsExactlyInAnyOrder(new Summary(...))` rather than
320
320
  field-by-field assertions — catches serialization mismatches.
321
321
 
322
+ ## UI Contract
323
+
324
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
325
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
326
+ (a build kit may override it).
327
+
322
328
  ## Final Verification: Does the Implementation Match slice.json?
323
329
 
324
330
  Before marking this slice as `Done`, verify the implementation against slice.json:
@@ -55,7 +55,7 @@ When asked to build a slice, always follow this flow:
55
55
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
56
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
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`.
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.
59
59
 
60
60
  After you are done, automatically run the tests for the slice that was edited.
61
61
 
@@ -36,14 +36,14 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  10. The slice in the json is always true, the code follows what is defined in the json
37
37
  11. slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it
38
38
  fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
39
- 12. make sure to write the ui-prompt.md as defined if defined in the skill
39
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
40
40
  13. Run quality checks — it is enough to run the tests for the slice only, not all tests:
41
41
  - Compile: `./mvnw compile -q`
42
42
  - Test: `./mvnw test -Dtest="<SliceName>*" -q`
43
43
  If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
44
44
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
45
45
  first )
46
- 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
46
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
47
47
  17. Append your progress to `progress.txt` after each step in the iteration.
48
48
  18. append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
49
49
  19. Finish the iteration.
@@ -41,3 +41,15 @@ TODO — file layout, naming conventions, framework idioms, how the handler/proj
41
41
  ## Quality gate
42
42
 
43
43
  TODO — this stack's build command and how to run only this slice's tests (not the full suite).
44
+
45
+ ## UI Contract
46
+
47
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes the contract
48
+ as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it.
49
+
50
+ TODO — **Source for this stack:** say where the contract is derived from. If your stack maintains a
51
+ machine-readable API description (OpenAPI, GraphQL schema, protobuf, ...), name it here and put the
52
+ mapping to the contract keys in a reference file (see `ui-contract-from-openapi.md` in
53
+ `stacks/node/templates/.claude/skills/build-state-change/references/`). If it has none, delete this
54
+ line — the skill then reads the endpoint's route/handler code. If your UI needs a different contract
55
+ shape or location, ship your own `.claude/skills/ui-contract/SKILL.md`; it replaces the shared one.
@@ -40,3 +40,15 @@ TODO — file layout, naming conventions, framework idioms, how the handler/proj
40
40
  ## Quality gate
41
41
 
42
42
  TODO — this stack's build command and how to run only this slice's tests (not the full suite).
43
+
44
+ ## UI Contract
45
+
46
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes the contract
47
+ as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it.
48
+
49
+ TODO — **Source for this stack:** say where the contract is derived from. If your stack maintains a
50
+ machine-readable API description (OpenAPI, GraphQL schema, protobuf, ...), name it here and put the
51
+ mapping to the contract keys in a reference file (see `ui-contract-from-openapi.md` in
52
+ `stacks/node/templates/.claude/skills/build-state-change/references/`). If it has none, delete this
53
+ line — the skill then reads the endpoint's route/handler code. If your UI needs a different contract
54
+ shape or location, ship your own `.claude/skills/ui-contract/SKILL.md`; it replaces the shared one.
@@ -45,7 +45,7 @@ When asked to build a slice, always follow this flow:
45
45
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
46
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
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`.
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.
49
49
 
50
50
  After you are done, automatically run the tests for the slice that was edited.
51
51
 
@@ -55,3 +55,10 @@ TODO — a short tree showing where one slice's files land, e.g.:
55
55
  ```
56
56
  TODO
57
57
  ```
58
+
59
+ ## UI Contract
60
+
61
+ `build-state-view` and `build-state-change` end by invoking the shared `ui-contract` skill (publishes the
62
+ slice's read/write contract for the UI build kit). Decide for your stack where it is derived from — see
63
+ the `UI Contract` section of those two skills — or override the skill entirely by shipping
64
+ `.claude/skills/ui-contract/SKILL.md`.
@@ -30,10 +30,10 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
30
30
  9. Analyze and Implement that single slice, making use of the skills in the skills directory plus your previously collected knowledge. Make a TODO list for what needs to be done, and adjust the implementation according to the JSON definition. Carefully inspect events, fields and compare against the implemented slice. JSON is the desired state. ATTENTION: a "planned" task can also be just added specifications. So always look at the slice itself, but also the specifications. If specifications were added in json which are not on code, you need to add them in code.
31
31
  10. The slice in the json is always true, the code follows what is defined in the json
32
32
  11. Slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it fulfills the slice.json. There must be no specification in json that has no equivalent in code.
33
- 12. Make sure to write the ui-prompt.md as defined if defined in the skill
33
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
34
34
  13. Run quality checks — TODO: your stack's build command, TODO: your stack's test command (slice-scoped only; do not run all tests).
35
35
  14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
36
- 15. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
36
+ 15. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
37
37
  16. Append your progress to `progress.txt` after each step in the iteration.
38
38
  17. Append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
39
39
  18. Finish the iteration.
@@ -101,6 +101,12 @@ After the commit, invoke `/record-evidence`: it writes this slice's element →
101
101
 
102
102
  ---
103
103
 
104
+ ## UI Contract
105
+
106
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
107
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
108
+ (a build kit may override it).
109
+
104
110
  ## Final Verification: Does the Implementation Match slice.json?
105
111
 
106
112
  - [ ] Every command field is received and used (validated, persisted or passed on)
@@ -105,6 +105,12 @@ After the commit, invoke `/record-evidence`: it writes this slice's element →
105
105
 
106
106
  ---
107
107
 
108
+ ## UI Contract
109
+
110
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
111
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
112
+ (a build kit may override it).
113
+
108
114
  ## Checklist
109
115
 
110
116
  - [ ] Every read model field is returned, sourced from where its feeding event's data is persisted
@@ -33,11 +33,11 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
33
33
  9. Analyze and Implement that single slice, making use of the skills in the skills directory plus your previously collected knowledge. Make a TODO list for what needs to be done, and adjust the implementation according to the JSON definition. Carefully inspect events, fields and compare against the implemented slice. JSON is the desired state. ATTENTION: a "planned" task can also be just added specifications. So always look at the slice itself, but also the specifications. If specifications were added in json which are not on code, you need to add them in code.
34
34
  10. The slice in the json is always true, the code follows what is defined in the json
35
35
  11. Slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it fulfills the slice.json. There must be no specification in json that has no equivalent in code.
36
- 12. Make sure to write the ui-prompt.md as defined if defined in the skill
36
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
37
37
  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).
38
38
  14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
39
39
  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.
40
- 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
40
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
41
41
  17. Append your progress to `progress.txt` after each step in the iteration.
42
42
  18. Append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
43
43
  19. Finish the iteration.
@@ -404,6 +404,12 @@ EVENT→READMODEL beats) belongs to `build-state-view`'s own storyline step. If
404
404
  after the command isn't an EVENT, don't force a test — leave it undocumented rather than fabricating an
405
405
  assertion.
406
406
 
407
+ ## UI Contract
408
+
409
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
410
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
411
+ (a build kit may override it).
412
+
407
413
  ## Final Verification
408
414
 
409
415
  Before considering the slice done:
@@ -379,6 +379,12 @@ If a beat between two read-model states is a `COMMAND` rather than an `EVENT`, t
379
379
  half. If a storyline segment involves a `SCREEN`/other untraceable beat, don't force a test — leave it
380
380
  undocumented rather than fabricating an assertion.
381
381
 
382
+ ## UI Contract
383
+
384
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
385
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
386
+ (a build kit may override it).
387
+
382
388
  ## Final Verification: Does the Implementation Match slice.json?
383
389
 
384
390
  Before marking this slice as `Done`, verify the implementation against slice.json:
@@ -94,7 +94,7 @@ When asked to build a slice, always follow this flow:
94
94
  reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff
95
95
  slice.json against the code field by field and update the code to match every change.
96
96
  5. Run quality checks (`./mvnw compile -q`, then the slice tests only).
97
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`.
97
+ 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.
98
98
 
99
99
  After you are done, automatically run the tests for the slice that was edited.
100
100
 
@@ -36,14 +36,14 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  10. The slice in the json is always true, the code follows what is defined in the json
37
37
  11. slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it
38
38
  fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
39
- 12. make sure to write the ui-prompt.md as defined if defined in the skill
39
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
40
40
  13. Run quality checks — it is enough to run the tests for the slice only, not all tests:
41
41
  - Compile: `./mvnw compile -q`
42
42
  - Test: `./mvnw test -Dtest="<SliceName>*" -q`
43
43
  If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
44
44
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
45
45
  first )
46
- 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
46
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
47
47
  17. Append your progress to `progress.txt` after each step in the iteration.
48
48
  18. append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
49
49
  19. Finish the 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`, `Planned`, `InProgress`, `Review`, `Done`, `Blocked`, `Assigned`, `Informational` |
42
+ | `Created`, `Ready`, `Planned`, `InProgress`, `Handover`, `Review`, `Done`, `Blocked`, `Assigned`, `Informational` |
43
43
 
44
44
  ---
45
45
 
@@ -122,7 +122,7 @@ report `sliceStatus`. Read it now, once: `mcp__eventmodelers__get_board_outline
122
122
  gives every column a `sliceStatus` when a slice spans it. Look up each chain node's column.
123
123
 
124
124
  - **Every node writable** (`Created`, or no `sliceStatus`) → continue with Step 4.
125
- - **Any node in a column with another status** (`Done`, `Review`, `InProgress`, `Blocked`, `Planned`, `Assigned`,
125
+ - **Any node in a column with another status** (`Done`, `Review`, `Handover`, `InProgress`, `Blocked`, `Ready`, `Planned`, `Assigned`,
126
126
  `Informational`) → **do not write that node.** If the task text says the person already confirmed changing
127
127
  that locked slice (*"The person confirmed changing the locked slice '…'"*, with an `origin_message_id`), you may
128
128
  change those elements and only those. Otherwise write **nothing** — not even the nodes that are writable, the
@@ -84,8 +84,8 @@ header's `standalone=on|off` tells you which mode they come in.
84
84
 
85
85
  At the start of every session, read `.agent-modeling-kit/AGENTS.md` if it exists to load accumulated learnings.
86
86
 
87
- **Only touch elements in a slice whose status is `Created` — unless the person explicitly confirmed it.** Every other status — `Planned`,
88
- `Assigned`, `InProgress`, `Review`, `Blocked`, `Done`, `Informational` — means someone is working
87
+ **Only touch elements in a slice whose status is `Created` — unless the person explicitly confirmed it.** Every other status — `Ready`, `Planned`,
88
+ `Assigned`, `InProgress`, `Handover`, `Review`, `Blocked`, `Done`, `Informational` — means someone is working
89
89
  on that slice: read it for context, but never change, move, rename or delete its elements, and
90
90
  never add scenarios, fields or examples to them. An element in no slice at all is not locked.
91
91
  `get_board_outline` returns `sliceStatus` per column (`get_nodes` does not carry it), so the
@@ -312,8 +312,8 @@ for it. Instead:
312
312
  - a **screen idea** in the conversation ("what could that screen look like?") → `screen`, a sandboxed HTML mock-up in the chat; putting a screen on the board is `/html-screen` work;
313
313
  - **where one piece of information comes from and where it is used** → `dataJourney` (the `/data-journey` skill);
314
314
  - **who does what with which work object, per chapter** → an `svg` domain story (the `/domain-story` skill);
315
- - **"draw" / "sketch" / "diagram" something** (a UML diagram, a flow, a class model) → a snippet in the chat (`svg`, or a
316
- `code` block with Mermaid/PlantUML/ASCII), **never** drawn on the board with stickies, arrows or `create_drawing`.
315
+ - **"draw" / "sketch" / "diagram" something** (a UML diagram, a flow, a class model) → a snippet in the chat (`mermaid` for a sequence/flow/state/ER/class diagram written as
316
+ Mermaid, `svg` for a picture you draw yourself, or a `code` block with PlantUML/ASCII), **never** drawn on the board with stickies, arrows or `create_drawing`.
317
317
  Only an explicit request to put it on the board changes that, and then as an image (`/domain-story` § board), not rebuilt from shapes;
318
318
  - **rows and columns** — a comparison, a matrix, a short list with a few attributes per item → `table`.
319
319
  - **a prototype you just built** (the `/prototype` skill) → `prototype`, the uploaded page running in the chat with a Full screen button;
@@ -417,6 +417,14 @@ import {api as {SliceName}Api} from './slices/{context}/{SliceName}/routes';
417
417
 
418
418
  ---
419
419
 
420
+ ## UI Contract
421
+
422
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
423
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
424
+ (a build kit may override it).
425
+
426
+ **Source for this stack:** derive the contract from the handler's `@openapi` block, using `references/ui-contract-from-openapi.md`.
427
+
420
428
  ## Files to create
421
429
 
422
430
  ```
@@ -0,0 +1,13 @@
1
+ # UI Contract — take the operation from the `@openapi` block
2
+
3
+ Used by the `ui-contract` skill. This stack's `routes.ts` carries an `@openapi` JSDoc block above every
4
+ handler (guarded by the `openapi-annotation` commit check). The contract **is** that operation —
5
+ publish it as is, don't translate it into another shape.
6
+
7
+ 1. Take the YAML from the handler's `@openapi` block (strip the ` * ` comment prefix) — one path, one verb.
8
+ 2. Keep it keyed by its path (`/api/...:` → `get:`/`post:`), with `summary`, `description`, `parameters`,
9
+ `requestBody` and every `responses` entry. Follow a `$ref` into `components.schemas` and inline it, so
10
+ the operation is self-contained.
11
+ 3. Drop `tags` and anything internal. Add nothing the block doesn't say — examples come from the block.
12
+ 4. Write it as the ```` ```yaml ui-contract ```` block of the `## UI Contract` section, with real line
13
+ breaks and 2-space indentation (see the skill's formatting rule).
@@ -484,6 +484,14 @@ import {api as {SliceName}Api} from './slices/{context}/{SliceName}/routes';
484
484
 
485
485
  ---
486
486
 
487
+ ## UI Contract
488
+
489
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
490
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
491
+ (a build kit may override it).
492
+
493
+ **Source for this stack:** derive the contract from the handler's `@openapi` block, using `../build-state-change/references/ui-contract-from-openapi.md`.
494
+
487
495
  ## Files to create / modify
488
496
 
489
497
  ```
@@ -50,7 +50,7 @@ When asked to build a slice, always follow this flow:
50
50
  3. Invoke the matching skill and follow its instructions completely. Do not deviate.
51
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
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`.
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.
54
54
 
55
55
  After you are done, automatically run the tests for the slice that was edited.
56
56
 
@@ -32,12 +32,12 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
32
32
  10. The slice in the json is always true, the code follows what is defined in the json
33
33
  11. slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it
34
34
  fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
35
- 12. make sure to write the ui-prompt.md as defined if defined in the skill
35
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
36
36
  13. Run quality checks ( npm run build, npm run test ) - Attention - it´s enough to run the tests for the slice. Do not run all tests.
37
37
  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
38
38
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
39
39
  first )
40
- 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
40
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
41
41
  17. Append your progress to `progress.txt` after each step in the iteration.
42
42
  18. append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
43
43
  19. Finish the iteration.
@@ -399,6 +399,12 @@ EVENT→READMODEL beats) belongs to `build-state-view`'s own storyline step, sin
399
399
  touches a projector. If the beat immediately after the command isn't an EVENT, don't force a test —
400
400
  leave it undocumented rather than fabricating an assertion.
401
401
 
402
+ ## UI Contract
403
+
404
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
405
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
406
+ (a build kit may override it).
407
+
402
408
  ## Final Verification
403
409
 
404
410
  Before considering the slice done:
@@ -342,6 +342,12 @@ to `build-state-change` (its own command-handler test), not here — only projec
342
342
  `READMODEL` half. If a storyline segment involves a `SCREEN`/other untraceable beat, don't force a
343
343
  test — leave it undocumented in code rather than fabricating an assertion.
344
344
 
345
+ ## UI Contract
346
+
347
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
348
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
349
+ (a build kit may override it).
350
+
345
351
  ## Final Verification: Does the Implementation Match slice.json?
346
352
 
347
353
  Before marking this slice as `Done`, verify the implementation against slice.json:
@@ -80,7 +80,7 @@ When asked to build a slice, always follow this flow:
80
80
  reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff
81
81
  slice.json against the code field by field and update the code to match every change.
82
82
  5. Run quality checks (`./mvnw compile -q`, then the slice tests only).
83
- 6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`.
83
+ 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.
84
84
 
85
85
  After you are done, automatically run the tests for the slice that was edited.
86
86
 
@@ -36,14 +36,14 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
36
36
  10. The slice in the json is always true, the code follows what is defined in the json
37
37
  11. slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it
38
38
  fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
39
- 12. make sure to write the ui-prompt.md as defined if defined in the skill
39
+ 12. Invoke the `ui-contract` skill for STATE_VIEW / STATE_CHANGE slices (publishes the UI Contract section to the slice's feedback-lane markdown node)
40
40
  13. Run quality checks — it is enough to run the tests for the slice only, not all tests:
41
41
  - Compile: `./mvnw compile -q`
42
42
  - Test: `./mvnw test -Dtest="<SliceName>*" -q`
43
43
  If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
44
44
  15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
45
45
  first )
46
- 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
46
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available). 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.
47
47
  17. Append your progress to `progress.txt` after each step in the iteration.
48
48
  18. append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
49
49
  19. Finish the iteration.
@@ -30,6 +30,11 @@ From the slice definition, extract:
30
30
  - **events[]** — list of events emitted by each command
31
31
  - **specifications[]** — test scenarios (given/when/then)
32
32
 
33
+ - **UI contract** — the backend slice's published write (`POST`) contract: look it up as described in the
34
+ `ui-contract` skill ("How the UI build kit looks the contract up": the `## UI Contract` entry in
35
+ `slice.json` `notes[]`, parse only its `ui-contract` block — an OpenAPI operation). It fixes the request: the path (+ path `parameters`), the exact `requestBody` properties, the 2xx `responses` entry, and every non-2xx response (status + description) — surface each error code as its own user-facing state, not one generic failure. When absent, the backend slice isn't
36
+ built or re-fetched yet: build against `slice.json` and note the assumption in `progress.txt`.
37
+
33
38
  > **Comments & description**: each element carries a `comments: string[]` array (board comments) and a `description` field — use them as implementation hints, and resolve consumed comments via `POST <BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/nodes/<nodeId>/comments/<commentId>/resolve`.
34
39
 
35
40
  ---
@@ -29,6 +29,11 @@ From the slice definition, extract:
29
29
  - **projections[]** / **queries[]** — the read model(s) this slice serves
30
30
  - **specifications[]** — test scenarios (given/when/then)
31
31
 
32
+ - **UI contract** — the backend slice's published read (`GET`) contract: look it up as described in the
33
+ `ui-contract` skill ("How the UI build kit looks the contract up": the `## UI Contract` entry in
34
+ `slice.json` `notes[]`, parse only its `ui-contract` block — an OpenAPI operation). It fixes the request: the path (+ path/query `parameters`), the exact 2xx response schema (object = `Single`, `type: array` = `List`), and every non-2xx response — render each error status as a distinct state. When absent, the backend slice isn't
35
+ built or re-fetched yet: build against `slice.json` and note the assumption in `progress.txt`.
36
+
32
37
  > **Comments & description**: each element carries a `comments: string[]` array (board comments) and a `description` field — use them as implementation hints, and resolve consumed comments via `POST <BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/nodes/<nodeId>/comments/<commentId>/resolve`.
33
38
 
34
39
  ---
@@ -44,4 +44,4 @@ These files are always up to date — read them directly before invoking any ski
44
44
  - The `boardId` and `organizationId` from each payload provide full context — pass them to skills.
45
45
  - Node events use `node:created`, `node:changed`, `node:deleted` — always POST to `/api/org/:orgId/boards/:boardId/nodes/events`.
46
46
  - Slice metadata (title, status) lives on the SLICE_BORDER node under `meta.sliceStatus` and `meta.title`.
47
- - `/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 `Planned` one instead of erroring out.
47
+ - `/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.
@@ -9,28 +9,28 @@ 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 "Planned" slices, and even if the current context has no work left.
13
- - A "Planned" slice in a *different* context is **NOT yours to build**. Ignore it completely.
14
- - If the current context has no "Planned" 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 planned work between iterations — never change it yourself.
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.
15
15
 
16
16
  ## Your Task
17
17
 
18
18
  0. Do not read the entire code base. Focus on the tasks in this description.
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 "planned" is a task.
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 the progress log at `progress.txt` **if it exists** (check Codebase Patterns section first) — it is absent until the first slice is built, which is not an error; create it when you write your first entry
21
21
  3. Make sure you are on the right branch "feature/<slicename>", if unsure, start from main.
22
- 5. Pick the **highest priority** slice where status is **exactly** "Planned" (case insensitive). This becomes your PRD. Set the status "InProgress" in the index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
23
- **IMPORTANT: Only work on slices with status "Planned" in the CURRENT context. Never pick up a slice that is "InProgress", "Done", "Blocked", "Created", or any other status — even if it looks incomplete. If no slice has status "Planned" in the current context, reply with:**
22
+ 5. Pick the **highest priority** slice where status is **exactly** "Handover" (case insensitive). This becomes your PRD. Set the status "InProgress" in the index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
23
+ **IMPORTANT: Only work on slices with status "Handover" in the CURRENT context. Never pick up a slice that is "InProgress", "Done", "Blocked", "Created", or any other status — even if it looks incomplete. If no slice has status "Handover" 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
- **Claim conflict**: the board rejects the status update if the slice is already in the target status — this is expected: another agent claimed it first, racing you for the same slice. This is NOT an error. Do not stop, do not retry the same slice. Re-read `index.json` (or re-fetch via `load-slice`), pick the next-highest-priority slice still "Planned", and try claiming that one instead. Repeat until a claim succeeds or no "Planned" slice remains, in which case reply `<promise>NO_TASKS</promise>`.
25
+ **Claim conflict**: the board rejects the status update if the slice is already in the target status — this is expected: another agent claimed it first, racing you for the same slice. This is NOT an error. Do not stop, do not retry the same slice. Re-read `index.json` (or re-fetch via `load-slice`), pick the next-highest-priority slice still "Handover", and try claiming that one instead. Repeat until a claim succeeds or no "Handover" slice remains, in which case reply `<promise>NO_TASKS</promise>`.
26
26
  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.
27
27
  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. If you use the additional prompt, add a line in progress.txt
28
28
  7. Determine the slice type and invoke the matching skill as defined in the **Building a Slice** section of `.build-kit/CLAUDE.md`. Do NOT implement manually.
29
29
  8. Write a short progress one liner after each step to progress.txt
30
- 9. Analyze and Implement that single slice, making use of the skills in the skills directory plus your previously collected knowledge. Make a TODO list for what needs to be done, and adjust the implementation according to the JSON definition. Carefully inspect events, fields and compare against the implemented slice. JSON is the desired state. ATTENTION: a "planned" task can also be just added specifications. So always look at the slice itself, but also the specifications. If specifications were added in json which are not on code, you need to add them in code.
30
+ 9. Analyze and Implement that single slice, making use of the skills in the skills directory plus your previously collected knowledge. Make a TODO list for what needs to be done, and adjust the implementation according to the JSON definition. Carefully inspect events, fields and compare against the implemented slice. JSON is the desired state. ATTENTION: a "handover" task can also be just added specifications. So always look at the slice itself, but also the specifications. If specifications were added in json which are not on code, you need to add them in code.
31
31
  10. The slice in the json is always true, the code follows what is defined in the json
32
32
  11. Slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it fulfills the slice.json. There must be no specification in json that has no equivalent in code.
33
- 12. Make sure to write the ui-prompt.md as defined if defined in the skill
33
+ 12. Build against the backend slice's published UI contract (see the `ui-contract` skill, "How the UI build kit looks the contract up") — the build-state-view / build-state-change skills say how to apply it
34
34
  13. Run quality checks — TODO: your stack's build command, TODO: your stack's test command (slice-scoped only; do not run all tests).
35
35
  14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
36
36
  15. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
@@ -107,12 +107,12 @@ A Slice is not complete if specifications are missing or can't be executed.
107
107
 
108
108
  ## Stop Condition
109
109
 
110
- **After completing ONE slice, always stop — regardless of whether more slices are Planned.** The ralph loop will invoke you again for the next slice. Never chain multiple slices in one iteration.
110
+ **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.
111
111
 
112
112
  If the slice was completed and committed successfully, reply with:
113
113
  <promise>DONE</promise>
114
114
 
115
- If no slice has status "Planned" in the current context, reply with:
115
+ If no slice has status "Handover" in the current context, reply with:
116
116
  <promise>NO_TASKS</promise>
117
117
  (Do NOT switch to another context to find work — stop here.)
118
118
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "pickupStatus": "Handover"
3
+ }
@@ -44,13 +44,13 @@ Run `/load-slice sliceId=<payload.sliceId>` to fetch full slice details (title,
44
44
 
45
45
  Inspect the `sliceStatus` in the payload:
46
46
 
47
- #### `Planned` — build the slice
47
+ #### `Handover` — build the slice
48
48
 
49
49
  This is the build trigger. Setting `InProgress` and building are one atomic step:
50
50
 
51
51
  1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
52
52
 
53
- **Claim conflict**: if this call reports the slice is already in `InProgress` (or any status other than `Planned`), another agent already claimed it first — this is expected, not an error. Log it in `progress.txt`, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
53
+ **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. Log it in `progress.txt`, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
54
54
 
55
55
  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.
56
56
 
@@ -424,6 +424,14 @@ import {api as {SliceName}Api} from './slices/{context}/{SliceName}/routes';
424
424
 
425
425
  ---
426
426
 
427
+ ## UI Contract
428
+
429
+ Once the command endpoint is built, invoke the `ui-contract` skill (write contract, `POST`): it publishes
430
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
431
+ (a build kit may override it).
432
+
433
+ **Source for this stack:** derive the contract from the handler's `@openapi` block, using `references/ui-contract-from-openapi.md`.
434
+
427
435
  ## Files to create
428
436
 
429
437
  ```
@@ -0,0 +1,13 @@
1
+ # UI Contract — take the operation from the `@openapi` block
2
+
3
+ Used by the `ui-contract` skill. This stack's `routes.ts` carries an `@openapi` JSDoc block above every
4
+ handler (guarded by the `openapi-annotation` commit check). The contract **is** that operation —
5
+ publish it as is, don't translate it into another shape.
6
+
7
+ 1. Take the YAML from the handler's `@openapi` block (strip the ` * ` comment prefix) — one path, one verb.
8
+ 2. Keep it keyed by its path (`/api/...:` → `get:`/`post:`), with `summary`, `description`, `parameters`,
9
+ `requestBody` and every `responses` entry. Follow a `$ref` into `components.schemas` and inline it, so
10
+ the operation is self-contained.
11
+ 3. Drop `tags` and anything internal. Add nothing the block doesn't say — examples come from the block.
12
+ 4. Write it as the ```` ```yaml ui-contract ```` block of the `## UI Contract` section, with real line
13
+ breaks and 2-space indentation (see the skill's formatting rule).
@@ -459,6 +459,14 @@ import {api as {SliceName}Api} from './slices/{context}/{SliceName}/routes';
459
459
 
460
460
  ---
461
461
 
462
+ ## UI Contract
463
+
464
+ Once the read endpoint is built, invoke the `ui-contract` skill (read contract, `GET`): it publishes
465
+ the endpoint's contract as the `## UI Contract` section of the slice's feedback-lane markdown node, which the slice export then carries in `slice.json` `notes[]`. Do not restate the format here — the skill owns it
466
+ (a build kit may override it).
467
+
468
+ **Source for this stack:** derive the contract from the handler's `@openapi` block, using `../build-state-change/references/ui-contract-from-openapi.md`.
469
+
462
470
  ## Files to create / modify
463
471
 
464
472
  ```