@cratis/pi 7.6.5 → 7.7.0

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 (212) hide show
  1. package/package/corpus/agents/backend-developer.md +14 -0
  2. package/package/corpus/agents/code-reviewer.md +16 -0
  3. package/package/corpus/agents/coordinator.md +17 -0
  4. package/package/corpus/agents/frontend-developer.md +17 -0
  5. package/package/corpus/agents/orchestrator.md +18 -0
  6. package/package/corpus/agents/planner.md +24 -0
  7. package/package/corpus/agents/screenplay-modeler.md +57 -0
  8. package/package/corpus/agents/screenplay-renderer.md +42 -0
  9. package/package/corpus/agents/screenplay-reviewer.md +45 -0
  10. package/package/corpus/agents/slice-implementer.md +32 -5
  11. package/package/corpus/agents/spec-writer.md +16 -3
  12. package/package/corpus/prompts/add-reactor.prompt.md +5 -3
  13. package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
  14. package/package/corpus/prompts/write-specs.prompt.md +12 -6
  15. package/package/corpus/rules/application-profile.md +7 -3
  16. package/package/corpus/rules/general.md +8 -3
  17. package/package/corpus/rules/glossary.md +1 -1
  18. package/package/corpus/rules/profiles.md +42 -4
  19. package/package/corpus/rules/reactors.md +30 -22
  20. package/package/corpus/rules/vertical-slices.md +3 -1
  21. package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
  22. package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
  23. package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
  24. package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
  25. package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
  26. package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
  27. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
  28. package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
  29. package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
  30. package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
  31. package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
  32. package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
  33. package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
  34. package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
  35. package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
  36. package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
  37. package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
  38. package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
  39. package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
  40. package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
  41. package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
  42. package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
  43. package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
  44. package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
  45. package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
  46. package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
  47. package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
  48. package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
  49. package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
  50. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
  51. package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
  52. package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
  53. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
  54. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
  55. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
  56. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
  57. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
  58. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
  59. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
  60. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
  61. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
  62. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
  63. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
  64. package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
  65. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
  66. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
  67. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
  68. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
  69. package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
  70. package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
  71. package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
  72. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
  73. package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
  74. package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
  75. package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
  76. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
  77. package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
  78. package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
  79. package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
  80. package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
  81. package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
  82. package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
  83. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
  84. package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
  85. package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
  86. package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
  87. package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
  88. package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
  89. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
  90. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
  91. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
  92. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
  93. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
  94. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
  95. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
  96. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
  97. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
  98. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
  99. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
  100. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
  101. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
  102. package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
  103. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +77 -57
  104. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
  105. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
  106. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +44 -6
  107. package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
  108. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -10
  109. package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
  110. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
  111. package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
  112. package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
  113. package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
  114. package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
  115. package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
  116. package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
  117. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
  118. package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
  119. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
  120. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
  121. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
  122. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
  123. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
  124. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
  125. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
  126. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
  127. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
  128. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
  129. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
  130. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
  131. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
  132. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
  133. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
  134. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
  135. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
  136. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
  137. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
  138. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
  139. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
  140. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
  141. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
  142. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
  143. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
  144. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
  145. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
  146. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
  147. package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
  148. package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
  149. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
  150. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
  151. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
  152. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
  153. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
  154. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
  155. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
  156. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
  157. package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
  158. package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
  159. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
  160. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
  161. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
  162. package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
  163. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
  164. package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
  165. package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
  166. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
  167. package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
  168. package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
  169. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
  170. package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
  171. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
  172. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
  173. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
  174. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
  175. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
  176. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
  177. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
  178. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
  179. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
  180. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
  181. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
  182. package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
  183. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
  184. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
  185. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
  186. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
  187. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
  188. package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
  189. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
  190. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
  191. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
  192. package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
  193. package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
  194. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
  195. package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
  196. package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
  197. package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
  198. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
  199. package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
  200. package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
  201. package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
  202. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
  203. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
  204. package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
  205. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
  206. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
  207. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
  208. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
  209. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
  210. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
  211. package/package/profile-catalog.json +11 -0
  212. package/package.json +1 -1
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: cratis-screenplay-toolchain
3
+ description: "Verified tool facts for checking Cratis Screenplay `.play` models: the pinned versions of the standalone `screenplay` tool and the bundled `cratis` compiler, the exact command behind each verdict V1 to V5, the executable and renderable subsets, a diagnostics fix guide, traps, documentation contradictions, and a compiled cheat-sheet. Use when choosing a compiler, running or reading a verdict, fixing a PLAY or STAGE diagnostic, or deciding whether syntax binds or renders. Not for: what to model or the phase workflow (use `cratis-screenplay-modeling-lifecycle`), the MCP editing loop (use `cratis-screenplay-model-authoring`), rendering workflow (use `cratis-screenplay-render-and-gap-fill`)."
4
+ license: MIT
5
+ ---
6
+
7
+ # Screenplay toolchain
8
+
9
+ Which tool to run, what its result means, and what each tool can and cannot admit. This
10
+ skill answers "does it compile, bind, render, and which compiler said so". The method
11
+ (what to model, in which order, with which gates) lives in
12
+ `cratis-screenplay-modeling-lifecycle`; construct syntax lives in the construct skills
13
+ (`cratis-screenplay-command-surface`, `-projections`, `-read-surface`,
14
+ `-captures-and-reactions`, `-specifications`, `-ui-composition`).
15
+
16
+ ## Locate the model
17
+
18
+ Look first in the model root: `.cratis/screenplay/` by default, or the root the project set with `mcpServers.screenplay.root` in `.cratis/ai.json`. A folder of `.play`
19
+ files is one application: always check the folder, never one file of it.
20
+
21
+ ## Verified product sources
22
+
23
+ The only version table is `references/versions.md`; other skills point to it.
24
+
25
+ | Package | Version | Purpose |
26
+ | --- | --- | --- |
27
+ | `Cratis.Screenplay.Tool` | `4.64.0` (`7e16162`) | standalone compiler, binder and MCP server |
28
+ | cratis CLI | `3.27.1` (`a327e89`) | bundles Screenplay 4.60.1 and Stage 4.24.0; `render`, `generate`, `prologue` |
29
+ | Stage | `4.24.0` (`fa48546`) | renders ESM v1 to v3 (C# backend plus a React/Vite scaffold on Arc 22.25.0) |
30
+ | Arc / Chronicle | `22.50.5` / `19.32.0` | code-level facts cited here |
31
+
32
+ Facts were read with `git show <tag>:<path>` and probed on the installed tools. Behaviour
33
+ was probed on 4.63.1; the 4.63.1 to 4.64.0 diff does not touch binding or execution.
34
+ Re-verify before claiming another version behaves the same.
35
+
36
+ ## Ground rules
37
+
38
+ 1. **Never invent syntax.** Copy shapes from `references/cheat-sheet.md` and the compiled
39
+ examples it names, or from a compiled documentation example. Construct keywords are
40
+ closed.
41
+ 2. **Check the folder, warnings as errors.** `screenplay <folder> --warnaserror` or
42
+ `cratis screenplay validate <folder> --warnings-as-errors`. Warnings hide defects:
43
+ PLAY0029 (a misspelt keyword or a `type` inside a slice) drops a construct silently.
44
+ 3. **Pick the compiler deliberately and name it.** Standalone `screenplay` for V1 to V3 on
45
+ the current language; `cratis` for `render` and as the V1 fallback. The bundled compiler
46
+ rejects ESM v6 and reports a false PLAY0285 on cascades (cli#242). Report tool and
47
+ version with every verdict.
48
+ 4. **Know the mode** (design, executable, renderable) and write from its subset.
49
+ 5. **Capability is not correctness.** The tool you ran decides what is accepted today; the
50
+ domain and the documented semantics decide what is correct. On conflict keep the correct
51
+ model and record a tool gap; never reshape a model to silence a tool.
52
+ 6. **Never remove `@pii`, `@sensitive`, authorization, list queries, automations or rules
53
+ to reach V3 or a render.** Report the verdict as blocked with the codes.
54
+ 7. **A clean verdict proves only its own layer.** "Not run" with the reason is a valid
55
+ result. Specifications written or bound are never specifications passing.
56
+ 8. **Let the tool resolve what it can.** Revisions, identities and renames come from the
57
+ tool, never from hand computation; discover tool, version and root once per session and
58
+ reuse them until the root, the tool or a call changes.
59
+
60
+ ## The two compilers
61
+
62
+ | | Standalone `screenplay` 4.64.0 | `cratis screenplay ...` 3.27.1 |
63
+ | --- | --- | --- |
64
+ | Check a folder | `screenplay <folder> --warnaserror --no-color` (exit 0 pass, 1 fail; an empty folder also exits 0, so read "N file(s) compiled") | `cratis screenplay validate <folder> --warnings-as-errors -o json-compact` (0 pass, 5 fail, 1 missing path or no files) |
65
+ | ESM admitted | v1 to v6 | v1 to v5 (bundled Screenplay 4.60.1) |
66
+ | Automation, Translate, reactions, captures, clocks, triggers | bind | PLAY0268, for example "Slice '<name>' of type '<type>' is not admitted by ESM v1." |
67
+ | Cascade specs | compile | false PLAY0285 (cli#242) |
68
+ | File argument | follows imports | ignores imports, false PLAY0165 warnings (cli#244): validate the folder |
69
+ | MCP | `screenplay mcp <folder>`; 29 tools | `cratis screenplay mcp [root]`; 29 tools; registered by `cratis ai install` |
70
+
71
+ Exact messages, exit codes and the MCP roots bug: `references/versions.md`.
72
+
73
+ ## Verdicts
74
+
75
+ Independent results, not a ladder. Commands and report format: `references/verdicts.md`.
76
+
77
+ | Verdict | Meaning | How |
78
+ | --- | --- | --- |
79
+ | V1 | authorable (compiles, warnings as errors) | the folder command above |
80
+ | V2 | executable diagnostics read | MCP `open-workspace`, then `read-workspace view=executable-diagnostics` |
81
+ | V3 | binding-ready (binds, no blocking executable diagnostics) | `executableReady` true and no error-severity diagnostic in V2; informational PLAY0269/0270 are reported separately |
82
+ | V4 | reference specifications run | the Screenplay reference execution route only (none ships in the pinned tools: `V4 not run: no route`); rendered Debug tests are V5.tests, never V4 |
83
+ | V5 | rendered and target-verified | `cratis render`, then Debug build and tests; report admission, publication, build and tests separately |
84
+
85
+ V2 and V3 need MCP: send `initialize`, then `notifications/initialized`, and start the
86
+ server with a fixed root (a dynamic root hits the roots bug on 4.63.1 and the bundled
87
+ 4.60.1). A subagent without MCP reports "V2 not run: no MCP in this agent".
88
+
89
+ One line per verdict, tool first, for example `V1 pass (screenplay 4.64.0, 3 files)` and
90
+ `V3 blocked: PLAY0268 x3 (list query, @pii)`. Name the source identity (commit plus the digest from
91
+ the source-identity helper (`cratis-screenplay-modeling-lifecycle` `references/verdicts-and-modes.md` "Source identity")) the verdict ran on; keep it apart from the MCP
92
+ `modelRevision`, which is semantic and, without `.screenplay/identities.json`,
93
+ changes with the root folder name.
94
+
95
+ ## Subsets (write from the one your mode needs)
96
+
97
+ - **Design**: every construct family parses; use it to model first. Compiled shapes:
98
+ `references/cheat-sheet.md`.
99
+ - **Executable** (binds, V3): `references/executable-subset.md`. Keyed optional queries
100
+ only; no handler (PLAY0268, with or without `implementation`/`hint`); `reads` and
101
+ `concurrency` do not bind (PLAY0271); no `@pii`; v6 constructs only on the standalone tool.
102
+ - **Renderable** (V5): `references/renderable-subset.md`. Stage 4.24 renders ESM v1 to v3
103
+ `StateChange`/`StateView` slices; Automation and Translate are gap-fill (Stage#79).
104
+
105
+ ## Edit strategy
106
+
107
+ - **Discover the capabilities available** (tool, version, `tools/list`, model root) once,
108
+ then prefer typed, identity-preserving MCP operations (`propose-ast`, `propose-rename`,
109
+ `propose-repair`, `propose-extract-inline-event`).
110
+ - **Bounded text edits** are for edits that leave catalog addresses unchanged (descriptions,
111
+ rule and expression bodies, mappings between existing members): a small `.play` diff
112
+ followed by V1. Without `.screenplay/identities.json`, plain text edits are fine. Never use a
113
+ text edit to get around an MCP refusal.
114
+ - **Catalog-changing edits** belong to the identity owner (the session that owns MCP). When
115
+ `.screenplay/identities.json` exists, adding, removing or renaming an addressed element
116
+ (declarations, properties of commands, events, read models, composite types and triggers,
117
+ queries, query arguments, specifications), moving declarations, creating, deleting, renaming
118
+ or moving a mapped `.play` document (`IdentityMappingConflict`) and persisted event contract
119
+ evolution go through MCP, and `id` pins alone
120
+ are not enough: a session without MCP returns the request to the owning session.
121
+ - AST JSON costs several times the text it replaces; use it where a typed operation is the
122
+ only identity-safe route.
123
+ - Proposals are connection-local (at most 16); `apply` writes `.screenplay/identities.json`
124
+ and is not crash-atomic; never retry `apply` after `ApplyOutcomeUnknown`. Loop details:
125
+ `cratis-screenplay-model-authoring`.
126
+
127
+ ## Top traps (all 44, with fixes: `references/traps.md`)
128
+
129
+ 1. Clean V1 is not executable: only MCP (V2) or `render` binds.
130
+ 2. Write `for <identifier>` on every `produces`.
131
+ 3. PLAY0029 is a warning: validate with warnings as errors.
132
+ 4. Validate the folder; name the compiler (cli#244, cli#242).
133
+ 5. Mappings to undeclared projection targets and undeclared events in `remove with`/capture
134
+ `append` pass V1 and fail binding (V2/V3, PLAY0273); a declared read-model property that
135
+ nothing maps is reported by no tool: run V3 and walk field lineage by hand.
136
+ 6. A reaction's `invokes` has no caller: a gated command rejects it; keep the gate.
137
+ 7. Read-model identity is one `query XById => RM optional` with `by xId XId`, and the identifier equal to the
138
+ projection's key (see trap 12); never `identifier` on a read model.
139
+ 8. Projection `key` routes only on `from`; joins never create; `all` is per source.
140
+ 9. `null` only for optional read-model properties in specifications.
141
+ 10. `then` events are exhaustive and ordered; after `when append` they list only what followed.
142
+ 11. Declare an event once, in its producing slice.
143
+ 12. Quoted `import "glob"` is your own files; unquoted `import Ctx.Event` is a foreign
144
+ contract and does not bind.
145
+ 13. A handler never binds; `numbers exact` never binds; descriptions are never rendered.
146
+
147
+ ## Gate
148
+
149
+ Before a verdict leaves this skill: tool and version named; the folder (not a file) was
150
+ checked; warnings were treated as errors; each verdict is a result or "not run" with the
151
+ reason; blocked verdicts list codes and keep the protection they blocked on.
152
+
153
+ ## Verify
154
+
155
+ - [ ] The command ran on the folder and its exit status was read, not inferred from output.
156
+ - [ ] `screenplay --version` and `cratis --version` were read; `which -a cratis` shows no
157
+ stale copy ahead on `PATH`.
158
+ - [ ] Every PLAY0029 and unresolved-name warning is fixed, not silenced.
159
+ - [ ] A V3 or render claim names the compiler that bound it.
160
+ - [ ] Nothing was removed to pass a verdict.
161
+ - [ ] Any new example fence compiles with the standalone tool; unmarked fences also pass
162
+ `cratis screenplay validate --warnings-as-errors`.
163
+
164
+ ## Route near misses
165
+
166
+ - What to model, phases, gates: `cratis-screenplay-modeling-lifecycle`.
167
+ - MCP editing loop, proposals, identities: `cratis-screenplay-model-authoring`.
168
+ - Construct depth: `cratis-screenplay-command-surface`, `cratis-screenplay-projections`,
169
+ `cratis-screenplay-read-surface`, `cratis-screenplay-captures-and-reactions`,
170
+ `cratis-screenplay-specifications`, `cratis-screenplay-ui-composition`.
171
+ - Rendering and gap-fill: `cratis-screenplay-render-and-gap-fill`,
172
+ `cratis-stage-rendering-and-sandbox`.
173
+ - Running systems (Chronicle server operations through the `cratis` CLI, with its authorization boundaries): `cratis-chronicle-cli-operations`.
174
+
175
+ ## Lineage
176
+
177
+ Attribution and sources: `references/provenance.md`.
@@ -0,0 +1,121 @@
1
+ # Automation and Translate example (ESM v6)
2
+
3
+ Executable Automation and Translate slices. Needs the standalone compiler: the cratis-bundled compiler rejects it (PLAY0268 at binding, false PLAY0285 at compile on the cascade spec in `SubscribingAMember`); see [versions.md](versions.md). Shows a reaction `produces` cascade, `invokes`, `where`, clock `at`, an application trigger, a capture with translate and a transition `when`, and v6 specifications.
4
+
5
+ The `Renew` command is ungated so that the reaction can invoke it: this is a syntax demonstration, not a safe production design. Reactions invoke with no caller, so a real model needs a trusted path (see [cratis-screenplay-automations-and-translations](../../cratis-screenplay-automations-and-translations/SKILL.md)).
6
+
7
+ ```screenplay
8
+ // Needs the standalone screenplay compiler (ESM v6)
9
+ // Automation and Translate: ESM v6 forms.
10
+ concept MemberId : Uuid
11
+
12
+ trigger RenewalFileArrived
13
+ memberId MemberId
14
+ months Int
15
+
16
+ module Membership
17
+ feature Subscriptions
18
+ slice StateChange Subscribe
19
+ command Subscribe
20
+ memberId MemberId identifier
21
+ produces MemberSubscribed
22
+ for memberId
23
+ subscribedAt = $context.occurred
24
+ event MemberSubscribed
25
+ subscribedAt DateTime
26
+ specification SubscribingAMember
27
+ given clock "2026-10-05T09:00:00Z"
28
+ when Subscribe
29
+ memberId = "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
30
+ then MemberSubscribed // v6: cascades are part of `then`
31
+ for "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
32
+ subscribedAt = "2026-10-05T09:00:00Z"
33
+ then WelcomeSent
34
+ for "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
35
+ sentAt = "2026-10-05T09:00:00Z"
36
+
37
+ slice StateChange Renew
38
+ command Renew // ungated for the demo only: reactions invoke with no caller
39
+ memberId MemberId identifier
40
+ months Int
41
+ validate
42
+ months > 0 message "Renew for at least one month"
43
+ produces MembershipRenewed
44
+ for memberId
45
+ months = months
46
+ event MembershipRenewed
47
+ months Int
48
+ specification RejectingAZeroRenewal
49
+ when Renew
50
+ memberId = "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
51
+ months = 0
52
+ then error "Renew for at least one month"
53
+
54
+ slice Automation Onboarding
55
+ reaction Welcomer
56
+ when MemberSubscribed
57
+ produces WelcomeSent // no `for`: lands on the trigger's source
58
+ sentAt = $context.occurred
59
+ reaction RenewalImporter
60
+ when RenewalFileArrived
61
+ memberId
62
+ months
63
+ invokes Renew
64
+ memberId = memberId
65
+ months = months
66
+ where months > 0
67
+ reaction WeeklyReport
68
+ at 07:30 on Monday
69
+ produces ReportIssued
70
+ for "weekly" // clock trigger needs an explicit `for`
71
+ issuedAt = $context.occurred
72
+ event WelcomeSent
73
+ sentAt DateTime
74
+ event ReportIssued
75
+ issuedAt DateTime
76
+ specification WelcomingAfterAnAppend
77
+ given clock "2026-10-05T09:00:00Z"
78
+ when append MemberSubscribed // `then` lists only what followed
79
+ for "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
80
+ subscribedAt = "2026-10-05T09:00:00Z"
81
+ then WelcomeSent
82
+ for "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
83
+ sentAt = "2026-10-05T09:00:00Z"
84
+ specification RenewingFromAFile
85
+ when trigger RenewalFileArrived
86
+ memberId = "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
87
+ months = 12
88
+ then MembershipRenewed
89
+ for "5b6c1f7e-2d3a-4e8b-9c0d-1a2b3c4d5e6f"
90
+ months = 12
91
+ specification IssuingTheWeeklyReport
92
+ given clock "2026-10-05T07:00:00Z"
93
+ when clock "2026-10-05T07:30:00Z"
94
+ then ReportIssued
95
+ for "weekly"
96
+ issuedAt = "2026-10-05T07:30:00Z"
97
+
98
+ slice Translate LegacyMembers
99
+ capture LegacyMemberCapture
100
+ key id
101
+ map
102
+ status = status translate
103
+ "aktiv" => active
104
+ "avsluttet" => cancelled
105
+ append LegacyMembershipCancelled
106
+ when status from "active" to "cancelled"
107
+ cancelledAt = $context.occurred
108
+ event LegacyMembershipCancelled
109
+ cancelledAt DateTime
110
+ specification SeeingALegacyCancellation
111
+ given clock "2026-10-05T12:00:00Z"
112
+ given capture LegacyMemberCapture
113
+ id = "m-42"
114
+ status = "aktiv"
115
+ when capture LegacyMemberCapture
116
+ id = "m-42"
117
+ status = "avsluttet"
118
+ then LegacyMembershipCancelled
119
+ for "m-42"
120
+ cancelledAt = "2026-10-05T12:00:00Z"
121
+ ```
@@ -0,0 +1,319 @@
1
+ # Cheat-sheet example (design mode)
2
+
3
+ One complete document with every construct family. Design mode, not executable. Prose rules: [cheat-sheet.md](cheat-sheet.md); tool versions: [versions.md](versions.md); what binds: [executable-subset.md](executable-subset.md).
4
+
5
+ Blocking on every compiler: unquoted import, `@pii`, `reads` (PLAY0271), `starts with`, observable/list/filter query. Also blocking on the cratis-bundled compiler only: trigger, `given clock`, Automation and Translate slices, reactions, capture. Executable shapes are in the sibling examples. The first line of the fence marks it standalone-only, so the cratis pass skips it: `RecordingAPayment` lists the `InvoiceClosed` cascade, which the cratis-bundled 4.60.1 compiler rejects with a false PLAY0285 ("outcome cannot be produced by 'RecordPayment'").
6
+
7
+ ```screenplay
8
+ // Needs the standalone screenplay compiler (ESM v6)
9
+ // Design-mode cheat-sheet: every construct family; compiles warning-free on the standalone tool.
10
+ domain Acme.Invoicing // optional; first line when present
11
+ import Customers.CustomerRegistered // unquoted = another bounded context's contract
12
+ // import "Shared/*.play" // quoted = my own files (PLAY0455 W if the glob matches nothing)
13
+
14
+ concept InvoiceId : Uuid // primitives: Uuid String Int Decimal Bool Date DateTime Enum
15
+ concept PaymentId : Uuid
16
+ concept Email : String @pii // @pii / @sensitive (blocks executability today)
17
+ pii reason "Identifies a person"
18
+ validate
19
+ not empty message "An email is required"
20
+ concept Status : Enum
21
+ draft
22
+ sent
23
+
24
+ type Line
25
+ sku String
26
+ quantity Int optional // Type[] / Type optional / Type[] optional
27
+
28
+ policy IsAuthenticated
29
+ require authenticated
30
+ policy CanManage
31
+ require role "Manager" or (role "Accountant" and claim "dept" matches "Finance")
32
+ persona Manager
33
+ description "Runs invoicing"
34
+ policy IsAuthenticated
35
+ policy CanManage
36
+ authentication
37
+ provider EntraId
38
+ provider OpenId name Partner
39
+ trigger NightlySync
40
+ batch Int
41
+
42
+ // ---------- structure ----------
43
+ module Billing
44
+ description "Invoices and payments"
45
+ authorize IsAuthenticated
46
+ feature Invoices
47
+ authorize CanManage
48
+ slice StateChange RegisterInvoice
49
+ description "Register a new invoice"
50
+
51
+ command RegisterInvoice
52
+ invoiceId InvoiceId identifier
53
+ number String
54
+ contact Email
55
+ lines Line[]
56
+ reads InvoiceRow as existing by invoiceId // legacy, unprotected (PLAY0271 at binding)
57
+ authorize CanManage
58
+ validate
59
+ number not empty message "A number is required"
60
+ number matches "^INV-[0-9]{6}$" severity warning message "Unusual number"
61
+ require number != "INV-000000"
62
+ message "Reserved number"
63
+ produces InvoiceRegistered
64
+ for invoiceId
65
+ tag audit
66
+ number = number
67
+ registeredAt = $context.occurred
68
+ produces when number starts with "INV-9"
69
+ SpecialInvoiceRegistered
70
+ for invoiceId
71
+
72
+ event InvoiceRegistered
73
+ number String
74
+ registeredAt DateTime
75
+
76
+ event SpecialInvoiceRegistered
77
+
78
+ constraint UniqueNumber
79
+ unique number on InvoiceRegistered
80
+
81
+ specification RegisteringAnInvoice
82
+ given caller
83
+ authenticated
84
+ role "Manager"
85
+ given clock "2026-10-02T09:00:00Z"
86
+ when RegisterInvoice
87
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
88
+ number = "INV-000123"
89
+ contact = "ada@example.com"
90
+ lines = [{"sku": "A-1", "quantity": 2}]
91
+ then InvoiceRegistered
92
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
93
+ number = "INV-000123"
94
+ registeredAt = "2026-10-02T09:00:00Z"
95
+
96
+ specification RejectingAReservedNumber
97
+ given caller
98
+ authenticated
99
+ role "Manager"
100
+ when RegisterInvoice
101
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
102
+ number = "INV-000000"
103
+ contact = "ada@example.com"
104
+ lines = []
105
+ then error "Reserved number"
106
+
107
+ specification RefusingAGuest
108
+ given caller
109
+ authenticated
110
+ role "Guest"
111
+ when RegisterInvoice
112
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
113
+ number = "INV-000123"
114
+ contact = "ada@example.com"
115
+ lines = []
116
+ then denied
117
+
118
+ specification RejectingAnEmptyEmail // one concept rejection spec, through this command
119
+ given caller
120
+ authenticated
121
+ role "Manager"
122
+ when RegisterInvoice
123
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
124
+ number = "INV-000123"
125
+ contact = ""
126
+ lines = []
127
+ then error "An email is required"
128
+
129
+ slice StateChange CancelInvoice
130
+ command CancelInvoice
131
+ invoiceId InvoiceId identifier
132
+ authorize CanManage
133
+ produces InvoiceCancelled
134
+ for invoiceId
135
+ event InvoiceCancelled
136
+ specification CancellingAnInvoice
137
+ given caller
138
+ authenticated
139
+ role "Manager"
140
+ when CancelInvoice
141
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
142
+ then InvoiceCancelled
143
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
144
+
145
+ specification RefusingAGuestCancellation // inherited gate: its own denial spec
146
+ given caller
147
+ authenticated
148
+ role "Guest"
149
+ when CancelInvoice
150
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
151
+ then denied
152
+
153
+ slice StateView InvoiceList
154
+ readmodel InvoiceRow
155
+ invoiceId InvoiceId
156
+ number String
157
+ query InvoiceById => InvoiceRow optional // keyed: the only executable query shape
158
+ by invoiceId InvoiceId
159
+ query ListInvoices => observable InvoiceRow[] // design mode only (PLAY0268 at binding)
160
+ filter number String optional
161
+ projection InvoiceList => InvoiceRow
162
+ from InvoiceRegistered
163
+ invoiceId = $eventSourceId
164
+ number = number
165
+ remove with InvoiceCancelled
166
+ screen InvoiceList
167
+ title "Invoices"
168
+ data InvoiceRow[] via query ListInvoices
169
+ table InvoiceRow
170
+ column number label "Number"
171
+ action RegisterInvoice
172
+ specification ListingAnInvoice
173
+ given caller // module + feature gates apply to the query too
174
+ authenticated
175
+ role "Manager"
176
+ given InvoiceRegistered
177
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
178
+ number = "INV-000123"
179
+ registeredAt = "2026-10-02T09:00:00Z"
180
+ then query InvoiceById
181
+ arguments
182
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
183
+ result
184
+ number = "INV-000123"
185
+ specification RefusingAGuestLookup // ListInvoices is design-only: its denial spec is a recorded mode gap
186
+ given caller
187
+ authenticated
188
+ role "Guest"
189
+ then query InvoiceById
190
+ arguments
191
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
192
+ then denied
193
+ specification RemovingACancelledInvoice
194
+ given caller
195
+ authenticated
196
+ role "Manager"
197
+ given InvoiceRegistered
198
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
199
+ number = "INV-000123"
200
+ registeredAt = "2026-10-02T09:00:00Z"
201
+ when append InvoiceCancelled
202
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
203
+ then no readmodel InvoiceRow for "9c858901-8a57-4791-81fe-4c455b099bc9"
204
+
205
+ feature Payments
206
+ authorize CanManage
207
+ slice StateChange RecordPayment
208
+ command RecordPayment
209
+ paymentId PaymentId identifier
210
+ invoiceId InvoiceId
211
+ amount Decimal
212
+ produces PaymentRecorded
213
+ for paymentId
214
+ invoiceId = invoiceId // cross-stream reference is payload
215
+ amount = amount
216
+ event PaymentRecorded
217
+ invoiceId InvoiceId
218
+ amount Decimal
219
+ specification RecordingAPayment
220
+ given caller
221
+ authenticated
222
+ role "Manager"
223
+ when RecordPayment
224
+ paymentId = "0b6f3f7e-3c1e-4a53-9f7e-2a1c3b4d5e6f"
225
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
226
+ amount = 100
227
+ then PaymentRecorded
228
+ for "0b6f3f7e-3c1e-4a53-9f7e-2a1c3b4d5e6f"
229
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
230
+ amount = 100
231
+ then InvoiceClosed // ESM v6: the Reconciler cascade (amount > 0)
232
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
233
+
234
+ module Housekeeping // no gates: a reaction's `invokes` has no caller
235
+ description "Background follow-up"
236
+ feature FollowUp
237
+ slice StateChange CloseInvoice
238
+ command CloseInvoice
239
+ invoiceId InvoiceId identifier
240
+ produces InvoiceClosed
241
+ for invoiceId
242
+ event InvoiceClosed
243
+ specification ClosingAnInvoice
244
+ when CloseInvoice
245
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
246
+ then InvoiceClosed
247
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
248
+
249
+ slice StateChange MarkOverdue
250
+ command MarkOverdue
251
+ invoiceId InvoiceId identifier
252
+ produces InvoiceMarkedOverdue
253
+ for invoiceId
254
+ overdueAt = $context.occurred
255
+ event InvoiceMarkedOverdue
256
+ overdueAt DateTime
257
+ // No command spec here: under ESM v6 it must list the ReminderSent cascade. The file is
258
+ // standalone-only because RecordingAPayment's cascade already gets a false PLAY0285 on cratis.
259
+ // The cascade form: automation-translate-example.md (SubscribingAMember).
260
+
261
+ slice Automation RemindOverdue
262
+ reaction Reminder
263
+ when InvoiceMarkedOverdue
264
+ overdueAt
265
+ produces ReminderSent // no `for`: lands on the trigger's source
266
+ sentAt = $context.occurred
267
+ at 08:00 on Monday
268
+ produces WeeklyDigestIssued
269
+ for "weekly" // clock trigger needs an explicit `for`
270
+ issuedAt = $context.occurred
271
+ reaction Reconciler
272
+ when PaymentRecorded
273
+ invoiceId
274
+ amount
275
+ invokes CloseInvoice
276
+ invoiceId = invoiceId
277
+ where amount > 0 // one per reaction; resolves from EVERY trigger's values
278
+ event ReminderSent
279
+ sentAt DateTime
280
+ event WeeklyDigestIssued
281
+ issuedAt DateTime
282
+ specification RemindingAnOverdueInvoice
283
+ given clock "2026-10-05T08:00:00Z"
284
+ when append InvoiceMarkedOverdue // v6: `then` lists only what followed the append
285
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
286
+ overdueAt = "2026-10-05T08:00:00Z"
287
+ then ReminderSent
288
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
289
+ sentAt = "2026-10-05T08:00:00Z"
290
+ specification ReconcilingAPayment
291
+ when append PaymentRecorded
292
+ for "0b6f3f7e-3c1e-4a53-9f7e-2a1c3b4d5e6f"
293
+ invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
294
+ amount = 100
295
+ then InvoiceClosed
296
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
297
+
298
+ slice Translate LegacySync
299
+ capture LegacyInvoices
300
+ source api
301
+ api LegacyApi
302
+ route /invoices
303
+ poll 5m
304
+ key id
305
+ map
306
+ status = status translate
307
+ "sendt" => sent
308
+ append ExternalInvoiceStatusObserved
309
+ when status
310
+ status = $.status
311
+ event ExternalInvoiceStatusObserved
312
+ status Status
313
+
314
+ seed
315
+ for "9c858901-8a57-4791-81fe-4c455b099bc9"
316
+ InvoiceRegistered
317
+ number = "INV-000042"
318
+ registeredAt = "2026-10-01T00:00:00Z"
319
+ ```