@cratis/pi 7.138.1 → 7.140.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 (81) hide show
  1. package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +2 -0
  2. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +2 -0
  3. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/statemachines-and-workflows.md +12 -1
  4. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +2 -0
  5. package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +2 -0
  6. package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +4 -0
  7. package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +2 -0
  8. package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +2 -0
  9. package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +2 -0
  10. package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +2 -0
  11. package/package/corpus/skills/cratis-screenplay-command-surface/references/enum-numbers.md +2 -0
  12. package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +2 -0
  13. package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +2 -0
  14. package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +2 -0
  15. package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +2 -0
  16. package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +4 -0
  17. package/package/corpus/skills/cratis-screenplay-command-surface/references/uuid-equality.md +6 -0
  18. package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +2 -0
  19. package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +2 -0
  20. package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +2 -0
  21. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +4 -0
  22. package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +4 -0
  23. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +2 -2
  24. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +3 -1
  25. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +5 -2
  26. package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +43 -28
  27. package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +4 -0
  28. package/package/corpus/skills/cratis-screenplay-model-review/references/walkthrough.md +2 -0
  29. package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +8 -0
  30. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +5 -1
  31. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/version-migration.md +50 -0
  32. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +2 -0
  33. package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +2 -0
  34. package/package/corpus/skills/cratis-screenplay-projections/references/reducer-identity.md +4 -0
  35. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +5 -4
  36. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +6 -2
  37. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +2 -0
  38. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
  39. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +7 -0
  40. package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +9 -0
  41. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +8 -0
  42. package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +2 -0
  43. package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -1
  44. package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +2 -0
  45. package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -0
  46. package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +2 -0
  47. package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +2 -0
  48. package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +2 -0
  49. package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +2 -0
  50. package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +2 -0
  51. package/package/corpus/skills/cratis-screenplay-specifications/references/whitespace-rules.md +4 -0
  52. package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +2 -0
  53. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +6 -0
  54. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +2 -0
  55. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +8 -0
  56. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -0
  57. package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +2 -0
  58. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +6 -0
  59. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +1 -1
  60. package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +26 -3
  61. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +2 -0
  62. package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +4 -0
  63. package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +4 -0
  64. package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +1 -1
  65. package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +16 -0
  66. package/package/corpus/skills/cratis-screenplay-toolchain/references/preferred-syntax.md +2 -1
  67. package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +2 -0
  68. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +22173 -17449
  69. package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
  70. package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +2 -0
  71. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +61 -78
  72. package/package/corpus/skills/cratis-screenplay-ui-composition/references/action-subjects.md +4 -1
  73. package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md +304 -136
  74. package/package/corpus/skills/cratis-screenplay-ui-composition/references/design-system-and-themes.md +257 -0
  75. package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +46 -31
  76. package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +10 -10
  77. package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +12 -9
  78. package/package/corpus/skills/cratis-specification-by-example/SKILL.md +2 -0
  79. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +4 -0
  80. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +4 -0
  81. package/package.json +1 -1
@@ -0,0 +1,257 @@
1
+ # Design system and themes
2
+
3
+ ## Contents
4
+
5
+ - The split: design system, theme, profile
6
+ - A design system and its default theme
7
+ - Tokens, components, words and rules
8
+ - A second theme and a profile that selects it
9
+ - Which theme and mode a profile gets
10
+ - Deprecated `appearance` members
11
+ - Diagnostics
12
+ - Reading and editing the design
13
+ - Checklist
14
+
15
+ Requires a Screenplay release that carries design systems (6.3.0 or later; check `screenplay --version`). Earlier compilers reject `design system` and a `theme` with `implements`. The `ui profile` that selects a theme and the shell are in [ui-profile-and-theme.md](ui-profile-and-theme.md).
16
+
17
+ ## The split: design system, theme, profile
18
+
19
+ | Construct | Role | How many |
20
+ | --- | --- | --- |
21
+ | `design system` | The contract: modes, tokens and what each is for, components built from tokens, words, contrast rules. No values. | Exactly one per application (a second is `PLAY0917`) |
22
+ | `theme ... implements` | An implementation: palette, token values, per-mode values. Never redefines components. | Several; one is the design system's `default theme` |
23
+ | `ui profile` | Picks a theme with `theme <Name>`; without one it is drawn in the `default theme`. `appearance` keeps only `color scheme`, which picks the mode. | One per target |
24
+
25
+ A theme with only `compatible with` lines and no `implements` is a compatibility-only theme and keeps working; a profile may select it only when the application declares no design system.
26
+
27
+ ## A design system and its default theme
28
+
29
+ ```screenplay
30
+ design system ShopDesign
31
+ modes light, dark
32
+ default theme Daylight
33
+
34
+ tokens
35
+ color
36
+ surface "page background"
37
+ text "body text"
38
+ primary "primary action"
39
+ on-primary "text on a primary action"
40
+ space
41
+ md "default gap between elements"
42
+ radius
43
+ control "inputs and buttons"
44
+ font
45
+ sans "interface text"
46
+
47
+ components
48
+ Button
49
+ parts text, background, radius
50
+ variant primary
51
+ text = color.on-primary
52
+ background = color.primary
53
+ radius = radius.control
54
+ state disabled
55
+ text = color.text
56
+ background = color.surface
57
+
58
+ words
59
+ voice
60
+ tone = "Plain and exact"
61
+ naming
62
+ customer = "Client"
63
+
64
+ rules
65
+ contrast text on background at least 4.5
66
+
67
+ theme Daylight
68
+ implements ShopDesign
69
+ compatible with core
70
+
71
+ palette
72
+ indigo = "#4338CA"
73
+ white = "#FFFFFF"
74
+ ink = "#111827"
75
+
76
+ values
77
+ space.md = "12px"
78
+ radius.control = "8px"
79
+ font.sans = "inter"
80
+
81
+ light
82
+ color.surface = palette.white
83
+ color.text = palette.ink
84
+ color.primary = palette.indigo
85
+ color.on-primary = palette.white
86
+
87
+ dark
88
+ color.surface = palette.ink
89
+ color.text = palette.white
90
+ color.primary = palette.indigo
91
+ color.on-primary = palette.white
92
+ ```
93
+
94
+ - `default theme` is required (`PLAY0927`): a profile without a `theme` line resolves to it.
95
+ - A theme assigns every `color` token a value in every mode, from `values` or from the mode block (`PLAY0921`). Other categories need a value where a component uses the token (`PLAY0922`).
96
+ - A value is a quoted literal, `palette.<name>` or another token (`<category>.<name>`). Reference loops are `PLAY0923`.
97
+
98
+ ## Tokens, components, words and rules
99
+
100
+ - Categories are closed: `color`, `space`, `size`, `radius`, `border`, `shadow`, `font`, `type`, `motion`, `opacity`, `z` (anything else is `PLAY0916`). A token is `<name> "<what it is for>"`; the description is the contract a theme author reads. Address a token as `<category>.<name>`.
101
+ - A component declares `parts` from `text`, `background`, `border`, `radius`, `height`, `padding`, `shadow`, `font`, then `variant`s assigning each part one token of a category the part takes (`background = space.md` is `PLAY0924`). `state` (`default`, `hover`, `focus`, `active`, `disabled`, `selected`) overrides only what changes.
102
+ - `words` holds `voice` and `naming` as `<key> = "<text>"` lines, once each; they travel with the design system.
103
+ - The one rule form is `contrast <part> on <part> at least <ratio>`. The compiler checks it for every theme, mode, variant and state except `disabled`, and warns `PLAY0928` naming the pair. Only hex and `rgb(...)` colors are measured; a named color is not checked.
104
+ - Modes belong to the design system, never to a theme; a mode block for an undeclared mode is `PLAY0918`.
105
+
106
+ ## A second theme and a profile that selects it
107
+
108
+ ```screenplay
109
+ design system ShopDesign
110
+ modes light, dark
111
+ default theme Daylight
112
+
113
+ tokens
114
+ color
115
+ surface "page background"
116
+ text "body text"
117
+ primary "primary action"
118
+ on-primary "text on a primary action"
119
+ space
120
+ md "default gap between elements"
121
+ radius
122
+ control "inputs and buttons"
123
+ font
124
+ sans "interface text"
125
+
126
+ components
127
+ Button
128
+ parts text, background, radius
129
+ variant primary
130
+ text = color.on-primary
131
+ background = color.primary
132
+ radius = radius.control
133
+ state disabled
134
+ text = color.text
135
+ background = color.surface
136
+
137
+ words
138
+ voice
139
+ tone = "Plain and exact"
140
+ naming
141
+ customer = "Client"
142
+
143
+ rules
144
+ contrast text on background at least 4.5
145
+
146
+ theme Daylight
147
+ implements ShopDesign
148
+ compatible with core
149
+
150
+ palette
151
+ indigo = "#4338CA"
152
+ white = "#FFFFFF"
153
+ ink = "#111827"
154
+
155
+ values
156
+ space.md = "12px"
157
+ radius.control = "8px"
158
+ font.sans = "inter"
159
+
160
+ light
161
+ color.surface = palette.white
162
+ color.text = palette.ink
163
+ color.primary = palette.indigo
164
+ color.on-primary = palette.white
165
+
166
+ dark
167
+ color.surface = palette.ink
168
+ color.text = palette.white
169
+ color.primary = palette.indigo
170
+ color.on-primary = palette.white
171
+
172
+ theme Square
173
+ implements ShopDesign
174
+
175
+ palette
176
+ indigo = "#4338CA"
177
+ white = "#FFFFFF"
178
+ ink = "#111827"
179
+
180
+ values
181
+ space.md = "12px"
182
+ radius.control = "0px"
183
+ font.sans = "inter"
184
+
185
+ light
186
+ color.surface = palette.white
187
+ color.text = palette.ink
188
+ color.primary = palette.indigo
189
+ color.on-primary = palette.white
190
+
191
+ dark
192
+ color.surface = palette.ink
193
+ color.text = palette.white
194
+ color.primary = palette.indigo
195
+ color.on-primary = palette.white
196
+
197
+ ui profile Desktop
198
+ target platform web
199
+ appearance
200
+ color scheme dark
201
+
202
+ ui profile Compact
203
+ target platform web
204
+ theme Square
205
+ appearance
206
+ color scheme light
207
+ ```
208
+
209
+ `Desktop` has no `theme` line, so it gets `Daylight` (the default) in the `dark` mode. `Compact` overrides with `Square` and draws in `light`. The selected theme must implement the application's design system (`PLAY0926`). With no `color scheme`, or one that is not a mode (`system`), the first mode is used.
210
+
211
+ ## Which theme and mode a profile gets
212
+
213
+ `DesignSystemResolver` in `Cratis.Screenplay.Design` offers `SelectTheme`, `SelectMode` and `Resolve(application, profile)`; the result is a flat `<category>.<name>` map with palette and token references followed, plus each component's variants and states merged over the variant's parts. A host reads that, not the syntax.
214
+
215
+ ## Deprecated `appearance` members
216
+
217
+ `appearance` keeps only `color scheme`. `accent`, `corners` and `font` still read but warn `PLAY0929`; move the value into the theme:
218
+
219
+ | Was in `appearance` | Becomes, in the theme |
220
+ | --- | --- |
221
+ | `accent "#4F46E5"` | a `color` token value, such as `color.primary = "#4F46E5"` |
222
+ | `corners round` | a `radius` token value, such as `radius.control = "8px"` |
223
+ | `font inter` | a `font` token value, such as `font.sans = "inter"` |
224
+
225
+ Do not carry raw colors, radii or fonts in a profile: declare the token in the design system and give it a value in each theme.
226
+
227
+ ## Diagnostics
228
+
229
+ | Code | Severity | Meaning |
230
+ | --- | --- | --- |
231
+ | `PLAY0916` | Error | Malformed `design system`: unknown section, token category, component part or state, bad line, a part the component does not declare, or a section twice. |
232
+ | `PLAY0917` | Error | A second `design system`. |
233
+ | `PLAY0918` | Error | A theme block for a mode the design system does not declare. |
234
+ | `PLAY0919` | Error | A mode, token, component, variant, part, palette entry, value or word declared twice. |
235
+ | `PLAY0920` | Error | A theme assigns a token the design system does not declare. |
236
+ | `PLAY0921` | Error | An implementing theme gives a `color` token no value in a declared mode. |
237
+ | `PLAY0922` | Error | A design reference names something undeclared, or a token with no value. |
238
+ | `PLAY0923` | Error | Design references loop. |
239
+ | `PLAY0924` | Error | A part takes a token of a category it cannot take. |
240
+ | `PLAY0925` | Error | A theme `implements` an undeclared design system. |
241
+ | `PLAY0926` | Error | A profile selects a theme that does not implement the design system. |
242
+ | `PLAY0927` | Error | No `default theme`, or it is undeclared or does not implement the design system. |
243
+ | `PLAY0928` | Warning | A theme and mode resolve a text/background pair below a `contrast` rule (`disabled` not checked). |
244
+ | `PLAY0929` | Warning | `accent`, `corners` or `font` in `appearance` is deprecated. |
245
+ | `PLAY0930` | Error | A theme's `implements`, `palette`, `values` or mode block is malformed or repeated. |
246
+
247
+ The executable semantic model defers the design system as UI configuration (`PLAY0269` on binding); it is not an error.
248
+
249
+ ## Reading and editing the design
250
+
251
+ The MCP `ui-profiles` read tool (no new tool) also returns the design system, every theme with its palette, values and per-mode values, each theme's resolved tokens and components per mode, the theme and mode each profile resolves to (`resolvedTheme`), the diagnostics `PLAY0916` to `PLAY0930` and the closed vocabulary of categories, parts and states. Edit with `propose-ast` on `DesignSystemSyntax`, `DesignTokenCategorySyntax`, `DesignTokenSyntax`, `DesignComponentSyntax`, `DesignVariantSyntax`, `DesignStateSyntax`, `DesignAssignmentSyntax`, `DesignWordsSyntax`, `DesignContrastRuleSyntax`, `ThemeModeValuesSyntax` and `ThemeSyntax` (`implements`, `palette`, `values`, `modeValues`); the compiler refuses an invalid edit with its code. Node details: [model-authoring MCP tools](../../cratis-screenplay-model-authoring/references/mcp-tools.md).
252
+
253
+ Source: [Design system](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/design-system.md) and [Theme](https://github.com/Cratis/Screenplay/blob/main/Documentation/screenplay/theme.md).
254
+
255
+ ## Checklist
256
+
257
+ - [ ] One `design system` with a `default theme`; each selected theme implements it and sets every `color` token in each mode; no profile carries `accent`, `corners` or `font`.
@@ -11,7 +11,7 @@
11
11
  - Exposed template configuration
12
12
  - Forms and columns
13
13
  - Packages, icons and template catalogs
14
- - Routes, outlets, toolbars and dialogs
14
+ - Routes, slots, toolbars and dialogs
15
15
  - Design-time generation results
16
16
  - Canonical fixture ownership
17
17
 
@@ -75,7 +75,7 @@ component <Package.Component> <instanceName>
75
75
  icon <IconName>
76
76
  presentation <key> "value"
77
77
  exposes <name> from component <stable-id>.<outputPath>
78
- outlet <name>
78
+ slot <name>
79
79
  ...nested screen directives...
80
80
  on click
81
81
  open dialog <DialogTemplate>
@@ -101,9 +101,13 @@ Rules for agents:
101
101
  - `presentation` keys are renderer/package inputs. They are authoring data, not a
102
102
  styling escape hatch; unknown keys must be surfaced by the consumer contract,
103
103
  not ignored.
104
- - An `outlet` is a nested replacement surface; it can hold screen directives and
104
+ - A `slot` is a nested replacement surface; it can hold screen directives and
105
105
  can be targeted by navigation or a dialog route when the runtime contract
106
- supports it.
106
+ supports it. Screenplay 5 wrote it `outlet <name>`; that form is `PLAY0890`
107
+ since Screenplay 6 (run `screenplay migrate --from 5 --to 6`).
108
+ - A component on a slice screen bound to nothing and given no value can only show
109
+ sample text, so it warns (`PLAY0912`): bind it, or give it static text with
110
+ `property <path> = "..."`.
107
111
 
108
112
  ## Guarded actions
109
113
 
@@ -127,16 +131,17 @@ unsupported screen actions with STAGE-SCENE-ACTION-001; a current Stage evaluate
127
131
 
128
132
  ## Exposed template configuration
129
133
 
130
- Reusable templates can expose configuration and typed outlets:
134
+ Reusable templates can expose configuration, recursive slots and outlets:
131
135
 
132
136
  ```screenplay excerpt
133
137
  screen template MasterDetail
134
138
  category workflow
135
139
  type master-detail
136
140
  exposes selectedInvoice InvoiceId
137
- outlet toolbar
138
- sidebar
139
- main
141
+ slot details
142
+ sidebar pane routed by invoiceId optional
143
+ main panel
144
+ outlet toolbar of actions in main
140
145
  ```
141
146
 
142
147
  - `category` is used for template discovery and scope-aware catalogs. Suggested
@@ -144,8 +149,13 @@ screen template MasterDetail
144
149
  - `type` is the template kind a runtime/package recognizes.
145
150
  - `exposes` declares values that slot bodies or nested components may bind to; a
146
151
  use site must provide or derive each required exposed value.
147
- - `outlet` declares an addressable child surface. It is different from a static
148
- slot such as `sidebar` or `main`.
152
+ - `slot <name>` declares an addressable, recursive child surface for package
153
+ components and design-time tools. A plain line such as `sidebar` or `main` is a
154
+ static slot; its role (`page`, `pane`, `panel`), `routed [by <param>]`,
155
+ `primary` and `optional` say what goes in it.
156
+ - `outlet <name> of actions|filters|tabs|stats|navigation` declares a list of items
157
+ the template offers; lower levels inherit, extend or override it (see
158
+ `application-shell.md`). Screenplay 5's kindless `outlet <name>` is `PLAY0893`.
149
159
 
150
160
  A template may also declare `content <slot>` (screen directives the template renders in that slot itself;
151
161
  the slot must be declared, `PLAY0629`; templates may not nest in a cycle, `PLAY0656`), `display` and
@@ -154,7 +164,7 @@ the slot must be declared, `PLAY0629`; templates may not nest in a cycle, `PLAY0
154
164
  top-level **exposure** (`exposure for <Owner>`, owner a layout or template, `PLAY0622`; `reexposes <Owner>`,
155
165
  `PLAY0623`/`PLAY0624`), and a screen or template configures it with a top-level `instance <Screen>`
156
166
  (`set <component>.<path> = <value>`, `items <component>.<path>` with `item <id>` lines; `PLAY0626` to
157
- `PLAY0628`). Layouts take `category`, `type`, `exposes` and `outlet` too.
167
+ `PLAY0628`). Layouts take `category`, `type`, `exposes`, `slot` and `outlet` too.
158
168
 
159
169
  A module, feature or slice may select a default template for contained screens:
160
170
 
@@ -216,24 +226,29 @@ ui profile Desktop
216
226
  - Template categories are scope-aware: application templates, module templates and
217
227
  package templates can share labels. Qualify where the tool reports ambiguity.
218
228
 
219
- ## Routes, outlets, toolbars and dialogs
229
+ ## Routes, slots, toolbars and dialogs
220
230
 
221
231
  Navigation and toolbar items target the same typed destination contract: screen,
222
- named outlet, optional route parameters, and optionally a dialog.
232
+ named slot, optional route parameters, and optionally a dialog. A State Change
233
+ slice's hook instead lets the slice's `fits` choose the place (see
234
+ `application-shell.md`).
223
235
 
224
236
  ```screenplay excerpt
225
- toolbar InvoiceToolbar
226
- item register action RegisterInvoice
227
- label "Register"
228
- icon Add
229
- item details navigate to InvoiceDetails
230
- parameter invoiceId from component invoices.selectedItem.id
231
- item compose dialog InvoiceComposer
237
+ screen InvoiceList
238
+ toolbar InvoiceToolbar
239
+ item register action RegisterInvoice for screen
240
+ label "Register"
241
+ icon Add
242
+ item details navigate to InvoiceDetails
243
+ parameter invoiceId from component invoices.selectedItem.id
244
+ item compose dialog InvoiceComposer
232
245
  ```
233
246
 
234
- A toolbar item is `item <name> action <Command>`, `item <name> navigate to <Screen>` or
235
- `item <name> dialog <DialogTemplate>`. Use a toolbar for reusable groups of actions; use inline `action`
236
- when a single screen owns the button. A parameter that reads a selection is a typed
247
+ A screen's toolbar item is `item <name> action <Command>`, `item <name> navigate to <Screen>` or
248
+ `item <name> dialog <DialogTemplate>`. Use a screen toolbar for a group of actions one screen owns, and
249
+ inline `action` for a single button. A group of actions a layout or template offers to every screen below
250
+ it is an `outlet <name> of actions` instead (see `application-shell.md`); a feature or module `toolbar` is
251
+ the Screenplay 5 form and reports `PLAY0896`. A parameter that reads a selection is a typed
237
252
  `from component <stableId>.<path>` binding (the bare `selected.invoiceId` form parses only as a legacy
238
253
  data-context path). A dialog destination must state every input with a typed `with`/`parameter`
239
254
  binding; a runtime default is not an authored contract.
@@ -261,13 +276,13 @@ release. The current Stage scaffold pins a newer Scene release (Stage skill
261
276
  announce `cratis.scene.command` with resolved parameters; Navigate/Dialog
262
277
  items execute through the navigation host (or announce a navigation event
263
278
  outside one). This is not a promise that the command executes without a host.
264
- - **Nested outlets.** A `core:outlet` component declares a named nested outlet on a
265
- screen. A destination into it opens its screen there and keeps the declaring
266
- screen on the page; the opened screen may declare outlets of its own, so
267
- composition nests to any depth. A deep link to the innermost level composes
268
- every level above it, and back closes the innermost level only. An outlet
269
- declares the template types it accepts; a destination into a missing or
270
- incompatible outlet is a navigation diagnostic, not a fallback.
279
+ - **Nested slots.** A `core:slot` component (Scene 4 named it `core:outlet`)
280
+ declares a named nested slot on a screen. A destination into it opens its screen
281
+ there and keeps the declaring screen on the page; the opened screen may declare
282
+ slots of its own, so composition nests to any depth. A deep link to the innermost
283
+ level composes every level above it, and back closes the innermost level only. A
284
+ slot declares the template types it accepts; a destination into a missing or
285
+ incompatible slot is a navigation diagnostic, not a fallback.
271
286
  - **Toolbar buttons open destinations.** The Cratis Components toolbar button runs
272
287
  its attached interactions and opens its authored `destination` (a dialog or a
273
288
  slice screen) through the enclosing navigation host. Label, icon, text and
@@ -318,7 +333,7 @@ an agent:
318
333
 
319
334
  Generated design-time output is evidence only when it is compared with the model:
320
335
 
321
- - every screen, template, form, toolbar, component instance and outlet has an
336
+ - every screen, template, form, toolbar, component instance, slot and outlet has an
322
337
  entry in the generated plan/report;
323
338
  - every unsupported construct is reported as a blocking diagnostic, not silently
324
339
  dropped;
@@ -6,12 +6,14 @@
6
6
  - `ui profile` and `theme`
7
7
  - Reading and editing the shell
8
8
 
9
+ A `design system` (the contract) and a `theme` that implements it (the values) are in [design-system-and-themes.md](design-system-and-themes.md). `appearance` keeps only `color scheme`; `accent`, `corners` and `font` are deprecated (`PLAY0929`, `PLAY0789` and `PLAY0797` no longer describe them).
10
+
9
11
  This reference holds the `ui profile` and `theme` excerpts and their rules: the root template that names the application shell, shell options, appearance, the new screens default, platforms, sizes, package order and theme compatibility. Requires Screenplay 4.200.0 or later (`screenplay --version`) for the diagnostics `PLAY0790` to `PLAY0799`; 4.197.0 reads the syntax.
10
12
 
11
13
  ## The shell: `root template`
12
14
 
13
15
  A `ui profile` names the template the whole application is drawn in with `root template`. Every screen's template chain is placed in the
14
- shell's primary outlet (`content`). The reference is the one a `template` assignment uses: an own `layout` or application-scope
16
+ shell's primary slot (the one marked `primary`, such as `content page routed primary`). The reference is the one a `template` assignment uses: an own `layout` or application-scope
15
17
  screen template by name, or a template a blueprint ships, `blueprint <Blueprint> <Name>`, with an optional `version "<range>"` pin.
16
18
  `ui profile` is the only place that selects the shell; a screen never names it.
17
19
 
@@ -45,9 +47,6 @@ ui profile Desktop
45
47
 
46
48
  appearance
47
49
  color scheme dark
48
- accent "#4F46E5"
49
- corners round
50
- font inter
51
50
 
52
51
  new screens use template Sheet
53
52
 
@@ -77,8 +76,7 @@ ui profile Web
77
76
  `logo initials "<AB>"` (1-2 characters), `logo icon <icon>` (`box`, `layers`, `home`, `users`, `receipt`, `package`, `database` or `palette`) or
78
77
  `logo image "<data:image/png|jpeg|svg+xml|webp;base64,...>"` (400 KB at most; the logo travels inside the document, never as a file beside it),
79
78
  and `show name true|false`. One block per profile, each line once. Give each application its own `identity` so Studio and Stage draw its logo.
80
- - `appearance`: `color scheme` is `light`, `dark` or `system`; `accent` is a quoted `#RGB`, `#RRGGBB` or `#RRGGBBAA`; `corners` is `sharp`,
81
- `default` or `round`; `font` is an id of Scene's font catalog (`inter`, `ibm-plex-sans`, `source-serif-4`, `system-ui`). One block per profile.
79
+ - `appearance`: `color scheme` is `light`, `dark` or `system` (with a design system it selects the mode of that name). `accent`, `corners` and `font` are deprecated (`PLAY0929`): they still read, but the value belongs in the selected theme. One block per profile.
82
80
  - `new screens use template`: the template a new screen starts from in a designer. It is an authoring default, it changes no existing
83
81
  screen, and it has to be able to start a screen in a feature (not a layout or an application-scope root; a `scopes` list that leaves
84
82
  out `feature` is refused).
@@ -89,7 +87,7 @@ ui profile Web
89
87
  | Code | Severity | Cause | Fix |
90
88
  | --- | --- | --- | --- |
91
89
  | `PLAY0788` | Error | A `root template` or `new screens use template` line is malformed, or it pins a version on an own template | Write `[blueprint <B>] <Name> [version "<range>"]`; drop the version on an own template |
92
- | `PLAY0789` | Error | A malformed `identity` or `appearance` line, a repeated line, or two `identity` / `appearance` blocks | `color scheme <word>`, `accent "<colour>"`, `corners <word>`, `font <id>`, `name "<text>"`, `logo initials|icon|image <value>`, `show name <true|false>`, each once, one block each |
90
+ | `PLAY0789` | Error | A malformed `identity` or `appearance` line, a repeated line, or two `identity` / `appearance` blocks | `color scheme <word>`, deprecated `accent "<colour>"`, `corners <word>` and `font <id>` (`PLAY0929`), `name "<text>"`, `logo initials|icon|image <value>`, `show name <true|false>`, each once, one block each |
93
91
  | `PLAY0790` | Error | The template is not declared in the document (or the blueprint does not ship it) | Declare `layout <Name>` or `screen template <Name>`, or take it from a blueprint |
94
92
  | `PLAY0791` | Warning | The profile still selects its shell with the legacy `layout <Name>` line | Write `root template <Name>`; remove the `layout` line when a `root template` is present (the quick fix does either) |
95
93
  | `PLAY0792` | Error | The blueprint is not listed in the profile's `packages` (or not installed) | Add it under `packages` |
@@ -97,12 +95,12 @@ ui profile Web
97
95
  | `PLAY0794` | Error | The root template cannot be the shell: a dialog or ordinary screen template, a slot-fitting template, `scopes` without `application` | Choose a layout or an application-scope template |
98
96
  | `PLAY0795` | Error | The root template has no `content` slot | Add the line `content` to it |
99
97
  | `PLAY0796` | Warning | An `option` the shell does not expose | Use a name the shell exposes, or add the property to its `exposure` |
100
- | `PLAY0797` | Error | An invalid color scheme, accent, corners or identity value | `light`, `dark` or `system`; a quoted hex colour; `sharp`, `default` or `round`; 1-2 initials, a listed icon, an image data URI of at most 400 KB |
98
+ | `PLAY0797` | Error | An invalid color scheme or identity value (the deprecated `accent` and `corners` are still checked while they read) | `light`, `dark` or `system`; 1-2 initials, a listed icon, an image data URI of at most 400 KB |
101
99
  | `PLAY0798` | Error | More than one `root template` in one profile | Keep one |
102
100
  | `PLAY0799` | Error | The `new screens use template` default cannot start a screen in a feature | Name a feature-scope screen template |
103
101
 
104
102
  What a blueprint ships is only known where the blueprint is installed, so its checks (`PLAY0790` for a template it lacks, `PLAY0793`,
105
- the options and outlets of its templates) come from the host that has the catalog (Stage, the `cratis` CLI, the MCP server); the compiler
103
+ the options, slots and outlets of its templates) come from the host that has the catalog (Stage, the `cratis` CLI, the MCP server); the compiler
106
104
  decides everything the document alone decides.
107
105
 
108
106
  ### Negative example: the legacy `layout` line
@@ -176,6 +174,8 @@ Empty, blank or unterminated quoted names are `PLAY0229`. Repeating a profile's
176
174
  parse acceptance does not prove that an installed package provides the theme.
177
175
  Source: [UI profile parser](https://github.com/Cratis/Screenplay/blob/main/Source/DotNET/Screenplay/Parsing/UiProfileParser.cs).
178
176
 
177
+ When the application declares a `design system`, a profile without `theme` is drawn in its `default theme`, a `theme` line must name a theme that implements it (`PLAY0926`) and `color scheme` selects the mode. See [design-system-and-themes.md](design-system-and-themes.md).
178
+
179
179
  - `target platform` takes a comma-separated list. `web`, `ios` and `android` are
180
180
  the documented examples; ⚠️ **the parser accepts any identifier** — there is no
181
181
  enforced list, so a typo is silent.
@@ -192,4 +192,4 @@ Source: [UI profile parser](https://github.com/Cratis/Screenplay/blob/main/Sourc
192
192
 
193
193
  ## Reading and editing the shell
194
194
 
195
- `ui-profiles` (MCP, Screenplay 4.201.0 or later) returns every profile's root template, options, appearance and new screens default with the shell diagnostics, and the own templates that could be the root template or the new screens default. Edit with `propose-ast` on `RootTemplateSyntax`, `ShellOptionSyntax` (`syntaxKind` is the value's kind), `ProfileAppearanceSyntax` and `NewScreenTemplateSyntax`; an invalid reference is refused with its code.
195
+ `ui-profiles` (MCP, Screenplay 4.201.0 or later) returns every profile's root template, options, appearance, theme and the theme and mode it resolves to, and new screens default with the shell diagnostics, and the own templates that could be the root template or the new screens default. Edit with `propose-ast` on `RootTemplateSyntax`, `ShellOptionSyntax` (`syntaxKind` is the value's kind), `ProfileAppearanceSyntax` and `NewScreenTemplateSyntax`; an invalid reference is refused with its code. The same read returns the design system and themes; edit those with the `Design*Syntax` nodes in [design-system-and-themes.md](design-system-and-themes.md).
@@ -11,6 +11,9 @@
11
11
  { "kind": "skill-contains", "value": "theme \"Scene Default Light\"", "file": "references/ui-profile-and-theme.md" },
12
12
  { "kind": "skill-contains", "value": "Empty, blank or unterminated quoted names are `PLAY0229`", "file": "references/ui-profile-and-theme.md" },
13
13
  { "kind": "skill-contains", "value": "package compatibility check", "file": "references/ui-profile-and-theme.md" },
14
+ { "kind": "skill-contains", "value": "design system", "file": "SKILL.md" },
15
+ { "kind": "skill-contains", "value": "implements", "file": "references/design-system-and-themes.md" },
16
+ { "kind": "skill-contains", "value": "default theme", "file": "references/design-system-and-themes.md" },
14
17
  {
15
18
  "kind": "skill-contains",
16
19
  "value": "PLAY0685",
@@ -124,7 +127,7 @@
124
127
  },
125
128
  {
126
129
  "kind": "skill-contains",
127
- "value": "hierarchical outlets"
130
+ "value": "hierarchical slots"
128
131
  },
129
132
  {
130
133
  "kind": "skill-contains",
@@ -140,15 +143,15 @@
140
143
  },
141
144
  {
142
145
  "kind": "skill-contains",
143
- "value": "application navigation regions (topbar/sidebar, module inherit/extend/override)"
146
+ "value": "navigation outlets (topbar/sidebar, inherit/extend/override)"
144
147
  },
145
148
  {
146
149
  "kind": "skill-contains",
147
- "value": "toolbar slice buttons"
150
+ "value": "`contribute to`, hooks and placement"
148
151
  },
149
152
  {
150
153
  "kind": "skill-contains",
151
- "value": "## The application shell: regions, slice buttons, blueprint references, sample data"
154
+ "value": "## The application shell: slots, outlets, hooks, blueprint references, sample data"
152
155
  },
153
156
  {
154
157
  "kind": "skill-contains",
@@ -186,22 +189,22 @@
186
189
  },
187
190
  {
188
191
  "kind": "skill-contains",
189
- "value": "`navigation <region> extends`",
192
+ "value": "`outlet <name> extends`",
190
193
  "file": "references/application-shell.md"
191
194
  },
192
195
  {
193
196
  "kind": "skill-contains",
194
- "value": "`navigation <region> overrides`",
197
+ "value": "`outlet <name> overrides`",
195
198
  "file": "references/application-shell.md"
196
199
  },
197
200
  {
198
201
  "kind": "skill-contains",
199
- "value": "Hierarchy is sidebar only",
202
+ "value": "`hide <id>` drops an",
200
203
  "file": "references/application-shell.md"
201
204
  },
202
205
  {
203
206
  "kind": "skill-contains",
204
- "value": "retargeted to\n the module's own features",
207
+ "value": "retarget the copied items to the module's own features",
205
208
  "file": "references/application-shell.md"
206
209
  },
207
210
  {
@@ -211,7 +214,7 @@
211
214
  },
212
215
  {
213
216
  "kind": "skill-contains",
214
- "value": "Stage refuses a screen that\nmixes a top-level `template` directive with other top-level directives",
217
+ "value": "Stage refuses a screen mixing a top-level `template`",
215
218
  "file": "references/application-shell.md"
216
219
  },
217
220
  {
@@ -203,6 +203,8 @@ module Invoicing
203
203
  invoiceNumber not empty message "Invoice number is required"
204
204
  produces event InvoiceRegistered
205
205
  invoiceNumber InvoiceNumber = invoiceNumber
206
+ screen RegisterInvoice
207
+ action RegisterInvoice for screen
206
208
  specification RejectingAnEmptyInvoiceNumber
207
209
  when RegisterInvoice
208
210
  invoiceId = "9c858901-8a57-4791-81fe-4c455b099bc9"
@@ -40,6 +40,8 @@ module Projects
40
40
  name = name
41
41
  event ProjectRegistered
42
42
  name ProjectName
43
+ screen Register
44
+ action RegisterProject for screen
43
45
  specification Registering
44
46
  parameter name ProjectName
45
47
  case Small name = "small"
@@ -93,6 +95,8 @@ module Inventory
93
95
  quantity = quantity
94
96
  event StockRecorded
95
97
  quantity Quantity
98
+ screen Record
99
+ action RecordStock for screen
96
100
  specification RecordingLargeQuantity
97
101
  when RecordStock
98
102
  stockId = "stock-1"
@@ -39,6 +39,8 @@ module Berths
39
39
  boatName = boatName
40
40
  event BerthReserved
41
41
  boatName BoatName
42
+ screen ReserveBerth
43
+ action ReserveBerth for screen
42
44
  specification ReservingABerth
43
45
  given caller
44
46
  authenticated
@@ -73,6 +75,8 @@ module Berths
73
75
  produces BerthReleased
74
76
  for berthId
75
77
  event BerthReleased
78
+ screen ReleaseBerth
79
+ action ReleaseBerth for screen
76
80
  specification ReleasingABerth
77
81
  given caller
78
82
  authenticated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.138.1",
3
+ "version": "7.140.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [