@cratis/pi 7.167.3 → 7.168.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.
@@ -23,6 +23,7 @@ construct syntax, source-versus-execution states and a complete compiled model.
23
23
 
24
24
  For screens, read `references/screen-authoring-workflow.md`; use the
25
25
  same model root or workspace export for all checks. Syntax: `cratis-screenplay-ui-composition`.
26
+ Read [free screens](references/free-screens-proposals.md) when a proposal touches shapes, screens declared outside a slice, `uses screen` or provisions.
26
27
 
27
28
  Record open modeling questions as `question` notes in committed
28
29
  `.screenplay/notes.json`, not chat or `description` text. Never put secrets or
@@ -0,0 +1,36 @@
1
+ # Free screens through typed proposals
2
+
3
+ Read this when a proposal adds, changes or removes a `shape`, a screen declared outside a slice, a need, a slice's adoption of a screen or the provision that supplies a need. The syntax, severities and diagnostics are in `cratis-screenplay-ui-composition` ([free screens](../../cratis-screenplay-ui-composition/references/free-screens.md)); the design decisions are in `cratis-screenplay-slice-design`.
4
+
5
+ Requires a Screenplay release whose MCP `syntax-schema` lists `ShapeSyntax` and `UsesScreenSyntax` (check `screenplay --version`; discover the members before constructing typed input).
6
+
7
+ ## The nodes
8
+
9
+ | Construct | `read-ast` kind | Edit it with |
10
+ | --- | --- | --- |
11
+ | A shape, the typed contract of a screen's data | `ShapeSyntax` | `add` a `PropertySyntax` to `properties`; `replace` a field's name or type; `remove` a field or the shape |
12
+ | A free screen at the top level, in a module or in a feature | `ScreenSyntax` | `add` to `screens` on an `ApplicationSyntax`, `ModuleSyntax` or `FeatureSyntax`; `replace` its directives; `remove` |
13
+ | A need a screen leaves to its adopters | `ScreenNeedSyntax` | `replace` the `type` or the `alias`; `add` to a screen's `directives`; `remove` |
14
+ | A slice's adoption of a screen | `UsesScreenSyntax` | `add` to `usedScreens` on a `SliceSyntax`; `replace` the `screen`; `remove` to stop adopting |
15
+ | The query that provides one need | `ScreenProvisionSyntax`, `ScreenProvisionMappingSyntax` | `add` to a `UsesScreenSyntax`'s `provisions` or a provision's `mappings`; `replace` the `need`, `query`, `by`, a mapping's `field` or `path`; `remove` |
16
+
17
+ Every member is omitted from the AST when empty, so a model with no free screens reads and writes the same AST as before. A screen a slice declares in its own body is a `ScreenSyntax` of that slice, as always.
18
+
19
+ ## One coherent proposal
20
+
21
+ 1. **Read first.** Read the existing shapes, screens and adoptions, and the target slice's read model and queries (`read-ast`, `declaration-details`, `find-references`), so a need is named after what exists and a provision targets a query that returns the right cardinality.
22
+ 2. **Propose the whole change together:** the shape, the screen with its needs, the adoption with its provisions. A reviewer cannot judge a need without the provision that supplies it, and a half-proposal reports `PLAY1155` for the missing part.
23
+ 3. **Use typed edits, not text.** `propose-ast` keeps identities and the proposal reports exact diagnostics; `propose-source` is for a whole-file rewrite. Never hand-edit a free screen's text to move or rename it.
24
+ 4. **Read the diagnostics by code and typed `arguments`, never by message text.** `read-proposal` shows them before and after.
25
+ 5. **Apply only the reviewed proposal** and fetch fresh handles afterwards: handles are revision-bound.
26
+
27
+ ## What a proposal accepts and refuses
28
+
29
+ - A proposal that adopts a screen without providing every need is **accepted with warning** `PLAY1155`, as it is on disk. Report it as unfinished, not as done; only the executable-model export refuses it, with a reason naming the screen and the shape.
30
+ - A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.
31
+ - A screen no slice adopts reports information `PLAY1164`: design-only, never an error and never in the executable model.
32
+ - A free screen's identity includes the module and feature it is declared in. Moving it to another scope changes its identity, so treat it as an identity-affecting edit and review the proposal's identity effects before applying.
33
+
34
+ ## Verify and report
35
+
36
+ Run `screenplay <model> --warnaserror` on the applied model: it must report no unprovided need. Report separately what is only authored (a design-only screen, a screen whose slice does not compile to an executable model) and what is executable. Never drop a need or a provision to make a diagnostic disappear.
@@ -17,6 +17,7 @@ storyline <Name> ["<title>"]
17
17
  - `<Name>` is unique among the application's storylines (`PLAY0943`); the optional title is what a board shows.
18
18
  - `<kind>` is `module`, `feature`, `slice`, `command`, `event`, `readmodel`, `query`, `screen` or `reaction`; line order is path order.
19
19
  - `<reference>` is the element's name; qualify it (`Returns.Requests`, `Requests.RequestReturn`) when several elements of that kind match (`PLAY0198`, warning).
20
+ - A `screen` step names any screen: one declared in a slice, or a free screen declared at the top level, in a module or in a feature, whether or not a slice has adopted it yet ([free screens](free-screens-proposals.md)).
20
21
  - A storyline is declared at the top level, in exactly one file of a folder model.
21
22
 
22
23
  ```screenplay expect PLAY0533
@@ -276,6 +276,11 @@
276
276
  {"kind":"skill-contains","value":"`slices`","file":"references/mcp-tools.md"},
277
277
  {"kind":"skill-contains","value":"list-storylines","file":"references/mcp-tools.md"},
278
278
  {"kind":"skill-contains","value":"storyline ReturnAnItem","file":"references/storylines.md"},
279
- {"kind":"skill-contains","value":"`direction`","file":"references/mcp-tools.md"}
279
+ {"kind":"skill-contains","value":"`direction`","file":"references/mcp-tools.md"},
280
+ {"kind":"skill-contains","value":"references/free-screens-proposals.md"},
281
+ {"kind":"skill-contains","value":"`ScreenProvisionSyntax`, `ScreenProvisionMappingSyntax`","file":"references/free-screens-proposals.md"},
282
+ {"kind":"skill-contains","value":"accepted with warning","file":"references/free-screens-proposals.md"},
283
+ {"kind":"skill-contains","value":"**cannot be applied**","file":"references/free-screens-proposals.md"},
284
+ {"kind":"skill-contains","value":"A `screen` step names any screen","file":"references/storylines.md"}
280
285
  ]
281
286
  }
@@ -199,7 +199,8 @@ PLAY0268, PLAY0468 and the reducer-view `PLAY0690` warning.
199
199
  ## `screen` — three levels
200
200
 
201
201
  Excerpts: each screen sits in a slice, and the queries, commands and screens it names are
202
- declared elsewhere.
202
+ declared elsewhere. A screen declared outside a slice states `data <Shape>[]` with no
203
+ `via query` (a need) and a slice provides it: `cratis-screenplay-ui-composition`, `references/free-screens.md`.
203
204
 
204
205
  **Level 1 — intent.** Data and actions; the tool generates the component.
205
206
 
@@ -100,7 +100,7 @@ Ask the batch below only for what the request leaves open: (1) origin of each ac
100
100
  components has one `data` line per component, each from its own read model
101
101
  (`references/read-model-design.md`). One actor's point of view
102
102
  per screen, at a real beat of the story, not one per persona for symmetry; know where the
103
- actor sees each state change's result. Beyond Level 1: `cratis-screenplay-ui-composition`.
103
+ actor sees each state change's result. A screen drawn before its slice is a free screen whose `data <Shape>[]` is a need the adopting slice provides: `references/screens-before-slices.md`. Beyond Level 1: `cratis-screenplay-ui-composition`.
104
104
  **Placement** (Screenplay 6): a State Change slice's screen says what it fits, in order of
105
105
  preference (`fits dialog, drawer, pane`); the hook that starts it (a `button` naming the slice
106
106
  in a template's actions outlet) picks the first fit the page has free, and names a place
@@ -207,6 +207,7 @@ Read [references/neighbouring-skills.md](references/neighbouring-skills.md) when
207
207
  - `references/slicing.md` - slice naming, dependencies, state table, generic edits, coverage,
208
208
  next slice.
209
209
  - `references/worked-example.md` - parcel lockers, design mode, complete and compiling.
210
+ - `references/screens-before-slices.md` - where a screen lives, design order for free screens, shape lineage, reporting.
210
211
 
211
212
  ## Lineage
212
213
 
@@ -0,0 +1,37 @@
1
+ # Screens before slices
2
+
3
+ Syntax, severities and diagnostics of free screens, shapes, `uses screen` and provisions are owned by `cratis-screenplay-ui-composition` ([free screens](../../cratis-screenplay-ui-composition/references/free-screens.md)). This page covers the design decisions: when to draw the screen first, what the contract is, and how the slice that serves it stays honest.
4
+
5
+ ## Where the screen lives
6
+
7
+ | Situation | Declare the screen |
8
+ | --- | --- |
9
+ | Exactly one slice serves it and nothing else needs it | In that slice (unchanged). |
10
+ | It is drawn before any slice exists, or a storyline walks through it | Free: top level, module or feature, with its data as needs. |
11
+ | Two or more slices render the same screen | Free, in the module or feature they share; each slice adopts it. |
12
+ | It belongs to one module or feature but is served by several slices | Free, in that module or feature. |
13
+
14
+ Never invent a slice only to host a screen, and never copy a screen into several slices to avoid adoption.
15
+
16
+ ## Design order
17
+
18
+ 1. **Level 1 first.** Decide what the screen shows and what the user can do (`data`, `action`), as for any screen. A screen with neither a need nor an action is still a gap.
19
+ 2. **Name the need as a shape, not as a read model.** The need says what the screen reads (`number`, `amount`, `dueDate`), in the business's words. A read model is chosen later, by the slice, so naming one now defeats the point.
20
+ 3. **Decide inferred or explicit.** Leave the shape inferred while the screen is a sketch. Declare a `shape` with typed fields when more than one slice will adopt the screen, when sample data must be checked against the contract, or when a reviewer needs the contract written down. An explicit shape is a promise: adopters must meet its types.
21
+ 4. **One need per purpose.** A screen that shows open and overdue invoices needs two lists. Use aliases (`data Invoice[] as overdue`) and two queries, never one read model with a flag that the screen filters.
22
+ 5. **Adopt from the slice that owns the view.** The adopting slice is a State View slice whose read model and query already answer the need, or one you add for it. Each need has its own purpose-built read model: specialization over reuse.
23
+ 6. **Provide, then map.** Provide each need from a query of the right cardinality. Add `from` only where names differ; if many names differ, the read model's names are probably wrong, not the shape's.
24
+
25
+ ## Lineage: a shape field is not an origin
26
+
27
+ Every field a screen reads still needs an origin ([field lineage](field-lineage.md)): a shape field resolves to a read model property, which resolves to the event property or state that fills it. The compiler checks the first hop (`PLAY1160`, `PLAY1161`); the rest is the lineage pass.
28
+
29
+ ```text
30
+ PLAY1160: Read model 'InvoiceRow' of query 'ListInvoices' has no 'dueDate' to provide 'dueDate' of 'Invoice'
31
+ ```
32
+
33
+ When this appears, add the property to the slice's read model and trace it to an event the slice already consumes, or add the fact that carries it. Never delete the field from the screen or the shape to make the diagnostic disappear, and never give the screen a default for a value no event knows.
34
+
35
+ ## Reporting
36
+
37
+ For each free screen, say in two or three sentences what it shows and what the user can do, and one of: **adopted by** a named slice (with the provided needs), or **design-only**, with the slice that should adopt it. A design-only screen is design intent: it is not in the UI contract, and a flow that depends on it is not delivered. A finished model has no unprovided need: `screenplay <model> --warnaserror` must report none.
@@ -65,6 +65,10 @@
65
65
  {
66
66
  "kind": "skill-contains",
67
67
  "value": "one `data` line per component"
68
- }
68
+ },
69
+ { "kind": "skill-contains", "value": "references/screens-before-slices.md" },
70
+ { "kind": "skill-contains", "value": "Name the need as a shape, not as a read model.", "file": "references/screens-before-slices.md" },
71
+ { "kind": "skill-contains", "value": "Never delete the field from the screen or the shape", "file": "references/screens-before-slices.md" },
72
+ { "kind": "skill-contains", "value": "A design-only screen is design intent", "file": "references/screens-before-slices.md" }
69
73
  ]
70
74
  }
@@ -26,6 +26,7 @@
26
26
  - Set once, dictionary keys and children ordering (PLAY0956-PLAY0963)
27
27
  - Development users (PLAY0888-PLAY0889)
28
28
  - Storylines (PLAY0940-PLAY0943)
29
+ - Free screens, shapes and adoptions
29
30
  - Screen visuals and slice placements (PLAY0950-PLAY0955)
30
31
  - Structural completeness and timeline checks
31
32
  - Editor versus C# verdicts
@@ -492,6 +493,29 @@ Requires Screenplay 6.6.0 or later (`screenplay --version`). Authoring metadata;
492
493
  | `PLAY0942` | W | A step names an element that no declaration of that kind matches; remove it or point it at its replacement. An ambiguous step is `PLAY0198`: qualify it. |
493
494
  | `PLAY0943` | E | Two storylines carry the same name. |
494
495
 
496
+ ## Free screens, shapes and adoptions
497
+
498
+ Requires a Screenplay release later than 6.31.0 that carries free screens (`screenplay --version`); earlier compilers reject a top-level `shape` or `screen` with `PLAY0001`, and `screenplay-contract.json` lists the codes only once the pin moves. Syntax, severities and fixes: `../../cratis-screenplay-ui-composition/references/free-screens.md`; the design decisions: `../../cratis-screenplay-slice-design/references/screens-before-slices.md`.
499
+
500
+ | Code | Severity | Meaning / fix |
501
+ | --- | --- | --- |
502
+ | `PLAY1149` | E | A `shape` is malformed, sits anywhere but the top level of a document, or has a field with a key, identifier, subject or generated modifier. Write `shape <Name>` with `<name> <Type>` fields at the top level. |
503
+ | `PLAY1150` | E | A `uses screen`, a provision or a mapping is malformed: `uses screen <Name>` directly in a slice, `data <Need> via query <Query> [by <param>]`, `<field> from <path>`. |
504
+ | `PLAY1151` | E | A `shape` is declared twice; declare it once at the top level. |
505
+ | `PLAY1152` | E | A screen is declared twice in one scope (document, module or feature); rename or remove one. |
506
+ | `PLAY1153` | E | A screen needs one shape twice or two needs share a name; tell them apart with `as <alias>` and provide each by its alias. |
507
+ | `PLAY1154` | E | A slice adopts one screen twice; keep one `uses screen` and put every provision under it. |
508
+ | `PLAY1155` | W | An adopted screen has a need the slice does not provide. Fails any warnings-as-errors gate and executable screen admission; add `data <Need> via query <Query>` under `uses screen`. |
509
+ | `PLAY1156` | E | A provision names a need the screen does not have; the message lists what it needs. |
510
+ | `PLAY1157` | E | A provision names data the screen already sources with its own `data <ReadModel> via query`; remove the provision. |
511
+ | `PLAY1158` | E | One need is provided twice in one adoption. |
512
+ | `PLAY1159` | E | A list query provides a single need, or a single-value query a list need; pick the query of the right cardinality. |
513
+ | `PLAY1160` | E | A field the screen reads, or the shape declares, is not on the providing read model, by name or through `from`; fix the read model or the mapping. |
514
+ | `PLAY1161` | E | A read model property has another type than the explicit shape declares (a concept stands for its primitive); fix the read model, not the shape. |
515
+ | `PLAY1162` | E | A provision's `by` is not a parameter of the query; use a declared parameter. |
516
+ | `PLAY1163` | E | A mapping names a field the screen does not read and the shape does not declare; remove or correct it. |
517
+ | `PLAY1164` | I | A screen no slice adopts is design-only: never fails any gate, and is absent from the executable model and the UI contract. Adopt it with `uses screen` when it must render. |
518
+
495
519
  ## Screen visuals and slice placements (PLAY0950-PLAY0955)
496
520
 
497
521
  Requires Screenplay 6.7.0 or later (`screenplay --version`). Both are presentation-only; neither
@@ -26,5 +26,481 @@
26
26
  "kind": "diagnostic",
27
27
  "value": "PLAY0686",
28
28
  "reason": "Explicit retirement notice, not an active diagnostic or repair recommendation. The published contract marks PLAY0686 retired. Remove when this notice is removed or replaced."
29
+ },
30
+ {
31
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
32
+ "text": "2. **Propose the whole change together:** the shape, the screen with its needs, the adoption with its provisions. A reviewer cannot judge a need without the provision that supplies it, and a half-proposal reports `PLAY1155` for the missing part.",
33
+ "kind": "diagnostic",
34
+ "value": "PLAY1155",
35
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
36
+ },
37
+ {
38
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
39
+ "text": "- A proposal that adopts a screen without providing every need is **accepted with warning** `PLAY1155`, as it is on disk. Report it as unfinished, not as done; only the executable-model export refuses it, with a reason naming the screen and the shape.",
40
+ "kind": "diagnostic",
41
+ "value": "PLAY1155",
42
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
43
+ },
44
+ {
45
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
46
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
47
+ "kind": "diagnostic",
48
+ "value": "PLAY1156",
49
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
50
+ },
51
+ {
52
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
53
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
54
+ "kind": "diagnostic",
55
+ "value": "PLAY1157",
56
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
57
+ },
58
+ {
59
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
60
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
61
+ "kind": "diagnostic",
62
+ "value": "PLAY1158",
63
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
64
+ },
65
+ {
66
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
67
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
68
+ "kind": "diagnostic",
69
+ "value": "PLAY1159",
70
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
71
+ },
72
+ {
73
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
74
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
75
+ "kind": "diagnostic",
76
+ "value": "PLAY1160",
77
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
78
+ },
79
+ {
80
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
81
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
82
+ "kind": "diagnostic",
83
+ "value": "PLAY1161",
84
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
85
+ },
86
+ {
87
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
88
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
89
+ "kind": "diagnostic",
90
+ "value": "PLAY1162",
91
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
92
+ },
93
+ {
94
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
95
+ "text": "- A proposal that provides a need wrongly (an unknown need, a query of the wrong cardinality, a field the read model lacks, a type that differs from the explicit shape, a `by` the query does not declare) reports `PLAY1156` to `PLAY1163` and **cannot be applied** under `Authoring` validation. Repair the slice (read model, query, mapping), not the shape.",
96
+ "kind": "diagnostic",
97
+ "value": "PLAY1163",
98
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
99
+ },
100
+ {
101
+ "file": ".cratis/ai/skills/cratis-screenplay-model-authoring/references/free-screens-proposals.md",
102
+ "text": "- A screen no slice adopts reports information `PLAY1164`: design-only, never an error and never in the executable model.",
103
+ "kind": "diagnostic",
104
+ "value": "PLAY1164",
105
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
106
+ },
107
+ {
108
+ "file": ".cratis/ai/skills/cratis-screenplay-slice-design/references/screens-before-slices.md",
109
+ "text": "Every field a screen reads still needs an origin ([field lineage](field-lineage.md)): a shape field resolves to a read model property, which resolves to the event property or state that fills it. The compiler checks the first hop (`PLAY1160`, `PLAY1161`); the rest is the lineage pass.",
110
+ "kind": "diagnostic",
111
+ "value": "PLAY1160",
112
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
113
+ },
114
+ {
115
+ "file": ".cratis/ai/skills/cratis-screenplay-slice-design/references/screens-before-slices.md",
116
+ "text": "Every field a screen reads still needs an origin ([field lineage](field-lineage.md)): a shape field resolves to a read model property, which resolves to the event property or state that fills it. The compiler checks the first hop (`PLAY1160`, `PLAY1161`); the rest is the lineage pass.",
117
+ "kind": "diagnostic",
118
+ "value": "PLAY1161",
119
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
120
+ },
121
+ {
122
+ "file": ".cratis/ai/skills/cratis-screenplay-slice-design/references/screens-before-slices.md",
123
+ "text": "PLAY1160: Read model 'InvoiceRow' of query 'ListInvoices' has no 'dueDate' to provide 'dueDate' of 'Invoice'",
124
+ "kind": "diagnostic",
125
+ "value": "PLAY1160",
126
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
127
+ },
128
+ {
129
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
130
+ "text": "| `PLAY1149` | E | A `shape` is malformed, sits anywhere but the top level of a document, or has a field with a key, identifier, subject or generated modifier. Write `shape <Name>` with `<name> <Type>` fields at the top level. |",
131
+ "kind": "diagnostic",
132
+ "value": "PLAY1149",
133
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
134
+ },
135
+ {
136
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
137
+ "text": "| `PLAY1150` | E | A `uses screen`, a provision or a mapping is malformed: `uses screen <Name>` directly in a slice, `data <Need> via query <Query> [by <param>]`, `<field> from <path>`. |",
138
+ "kind": "diagnostic",
139
+ "value": "PLAY1150",
140
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
141
+ },
142
+ {
143
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
144
+ "text": "| `PLAY1151` | E | A `shape` is declared twice; declare it once at the top level. |",
145
+ "kind": "diagnostic",
146
+ "value": "PLAY1151",
147
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
148
+ },
149
+ {
150
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
151
+ "text": "| `PLAY1152` | E | A screen is declared twice in one scope (document, module or feature); rename or remove one. |",
152
+ "kind": "diagnostic",
153
+ "value": "PLAY1152",
154
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
155
+ },
156
+ {
157
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
158
+ "text": "| `PLAY1153` | E | A screen needs one shape twice or two needs share a name; tell them apart with `as <alias>` and provide each by its alias. |",
159
+ "kind": "diagnostic",
160
+ "value": "PLAY1153",
161
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
162
+ },
163
+ {
164
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
165
+ "text": "| `PLAY1154` | E | A slice adopts one screen twice; keep one `uses screen` and put every provision under it. |",
166
+ "kind": "diagnostic",
167
+ "value": "PLAY1154",
168
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
169
+ },
170
+ {
171
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
172
+ "text": "| `PLAY1155` | W | An adopted screen has a need the slice does not provide. Fails any warnings-as-errors gate and executable screen admission; add `data <Need> via query <Query>` under `uses screen`. |",
173
+ "kind": "diagnostic",
174
+ "value": "PLAY1155",
175
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
176
+ },
177
+ {
178
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
179
+ "text": "| `PLAY1156` | E | A provision names a need the screen does not have; the message lists what it needs. |",
180
+ "kind": "diagnostic",
181
+ "value": "PLAY1156",
182
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
183
+ },
184
+ {
185
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
186
+ "text": "| `PLAY1157` | E | A provision names data the screen already sources with its own `data <ReadModel> via query`; remove the provision. |",
187
+ "kind": "diagnostic",
188
+ "value": "PLAY1157",
189
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
190
+ },
191
+ {
192
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
193
+ "text": "| `PLAY1158` | E | One need is provided twice in one adoption. |",
194
+ "kind": "diagnostic",
195
+ "value": "PLAY1158",
196
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
197
+ },
198
+ {
199
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
200
+ "text": "| `PLAY1159` | E | A list query provides a single need, or a single-value query a list need; pick the query of the right cardinality. |",
201
+ "kind": "diagnostic",
202
+ "value": "PLAY1159",
203
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
204
+ },
205
+ {
206
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
207
+ "text": "| `PLAY1160` | E | A field the screen reads, or the shape declares, is not on the providing read model, by name or through `from`; fix the read model or the mapping. |",
208
+ "kind": "diagnostic",
209
+ "value": "PLAY1160",
210
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
211
+ },
212
+ {
213
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
214
+ "text": "| `PLAY1161` | E | A read model property has another type than the explicit shape declares (a concept stands for its primitive); fix the read model, not the shape. |",
215
+ "kind": "diagnostic",
216
+ "value": "PLAY1161",
217
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
218
+ },
219
+ {
220
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
221
+ "text": "| `PLAY1162` | E | A provision's `by` is not a parameter of the query; use a declared parameter. |",
222
+ "kind": "diagnostic",
223
+ "value": "PLAY1162",
224
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
225
+ },
226
+ {
227
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
228
+ "text": "| `PLAY1163` | E | A mapping names a field the screen does not read and the shape does not declare; remove or correct it. |",
229
+ "kind": "diagnostic",
230
+ "value": "PLAY1163",
231
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
232
+ },
233
+ {
234
+ "file": ".cratis/ai/skills/cratis-screenplay-toolchain/references/diagnostics.md",
235
+ "text": "| `PLAY1164` | I | A screen no slice adopts is design-only: never fails any gate, and is absent from the executable model and the UI contract. Adopt it with `uses screen` when it must render. |",
236
+ "kind": "diagnostic",
237
+ "value": "PLAY1164",
238
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
239
+ },
240
+ {
241
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/SKILL.md",
242
+ "text": "- [ ] Every adopted free screen provides every need (no `PLAY1155`); unadopted screens are reported as design-only.",
243
+ "kind": "diagnostic",
244
+ "value": "PLAY1155",
245
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
246
+ },
247
+ {
248
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
249
+ "text": "Declare the screen outside a slice when it exists before the slice that serves it (a designer's screen, a storyline step), when two slices share it, or when it is a navigation target nothing implements yet. Keep it in the slice when exactly one slice serves it. A screen is declared once per scope (`PLAY1152`); two scopes may each declare a screen of the same name, and a reference then resolves from where it is written, then by unique match.",
250
+ "kind": "diagnostic",
251
+ "value": "PLAY1152",
252
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
253
+ },
254
+ {
255
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
256
+ "text": "- **Explicit.** A top-level `shape <Name>` tightens it with typed fields, written like a read model's properties: `<name> <Type> [optional]`, plus an optional `description`. A shape has **no key, identifier, subject or generated modifier** (it is a contract on data, not stored state), is declared once, and only at the top level of a document (`PLAY1149`, `PLAY1151`).",
257
+ "kind": "diagnostic",
258
+ "value": "PLAY1149",
259
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
260
+ },
261
+ {
262
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
263
+ "text": "- **Explicit.** A top-level `shape <Name>` tightens it with typed fields, written like a read model's properties: `<name> <Type> [optional]`, plus an optional `description`. A shape has **no key, identifier, subject or generated modifier** (it is a contract on data, not stored state), is declared once, and only at the top level of a document (`PLAY1149`, `PLAY1151`).",
264
+ "kind": "diagnostic",
265
+ "value": "PLAY1151",
266
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
267
+ },
268
+ {
269
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
270
+ "text": "The provision names the need without `[]`; the need's cardinality decides which query fits. The adoption is **many to many**: a slice adopts several screens and a screen is adopted by several slices. Every provision goes under the one `uses screen` line (`PLAY1154`). Hooks (`button ... slice X`) and \"the slice's screen\" for a State Change input work on an adopted screen exactly as on one declared inline.",
271
+ "kind": "diagnostic",
272
+ "value": "PLAY1154",
273
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
274
+ },
275
+ {
276
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
277
+ "text": "- the query exists and returns a list for a list need, a single value for a single one (`PLAY1159`);",
278
+ "kind": "diagnostic",
279
+ "value": "PLAY1159",
280
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
281
+ },
282
+ {
283
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
284
+ "text": "- every field the screen reads, and every field its explicit `shape` declares, is a property of the query's read model, by name or through `from` (`PLAY1160`), with the type the shape declares (`PLAY1161`);",
285
+ "kind": "diagnostic",
286
+ "value": "PLAY1160",
287
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
288
+ },
289
+ {
290
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
291
+ "text": "- every field the screen reads, and every field its explicit `shape` declares, is a property of the query's read model, by name or through `from` (`PLAY1160`), with the type the shape declares (`PLAY1161`);",
292
+ "kind": "diagnostic",
293
+ "value": "PLAY1161",
294
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
295
+ },
296
+ {
297
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
298
+ "text": "- `by` names a parameter the query declares (`PLAY1162`);",
299
+ "kind": "diagnostic",
300
+ "value": "PLAY1162",
301
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
302
+ },
303
+ {
304
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
305
+ "text": "- a `from` mapping names a field the screen reads or the shape declares (`PLAY1163`);",
306
+ "kind": "diagnostic",
307
+ "value": "PLAY1163",
308
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
309
+ },
310
+ {
311
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
312
+ "text": "- the provision targets a need the screen has (`PLAY1156`), never data the screen already sources with its own `data <ReadModel> via query` (`PLAY1157`), and provides it once (`PLAY1158`).",
313
+ "kind": "diagnostic",
314
+ "value": "PLAY1156",
315
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
316
+ },
317
+ {
318
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
319
+ "text": "- the provision targets a need the screen has (`PLAY1156`), never data the screen already sources with its own `data <ReadModel> via query` (`PLAY1157`), and provides it once (`PLAY1158`).",
320
+ "kind": "diagnostic",
321
+ "value": "PLAY1157",
322
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
323
+ },
324
+ {
325
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
326
+ "text": "- the provision targets a need the screen has (`PLAY1156`), never data the screen already sources with its own `data <ReadModel> via query` (`PLAY1157`), and provides it once (`PLAY1158`).",
327
+ "kind": "diagnostic",
328
+ "value": "PLAY1158",
329
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
330
+ },
331
+ {
332
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
333
+ "text": "A screen that needs the same shape twice tells the needs apart with `as <alias>`. The alias is the need's name in the screen's directives and in the provision. Two needs with one name are `PLAY1153`.",
334
+ "kind": "diagnostic",
335
+ "value": "PLAY1153",
336
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
337
+ },
338
+ {
339
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
340
+ "text": "| An adopted screen has a need no provision supplies | Warning `PLAY1155` while the model is being built |",
341
+ "kind": "diagnostic",
342
+ "value": "PLAY1155",
343
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
344
+ },
345
+ {
346
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
347
+ "text": "| A screen no slice adopts | Information `PLAY1164`; never fails any gate |",
348
+ "kind": "diagnostic",
349
+ "value": "PLAY1164",
350
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
351
+ },
352
+ {
353
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
354
+ "text": "There is no separate release flag: the release gate is the warnings-as-errors gate every Screenplay model already runs. A work-in-progress model keeps compiling with `PLAY1155`; a release does not.",
355
+ "kind": "diagnostic",
356
+ "value": "PLAY1155",
357
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
358
+ },
359
+ {
360
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
361
+ "text": "| `PLAY1149` | Error | A `shape` is malformed or not at the top level of a document, or a field carries a key, identifier, subject or generated modifier. |",
362
+ "kind": "diagnostic",
363
+ "value": "PLAY1149",
364
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
365
+ },
366
+ {
367
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
368
+ "text": "| `PLAY1150` | Error | A `uses screen`, provision or mapping is malformed. |",
369
+ "kind": "diagnostic",
370
+ "value": "PLAY1150",
371
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
372
+ },
373
+ {
374
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
375
+ "text": "| `PLAY1151` | Error | A `shape` is declared more than once. |",
376
+ "kind": "diagnostic",
377
+ "value": "PLAY1151",
378
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
379
+ },
380
+ {
381
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
382
+ "text": "| `PLAY1152` | Error | A screen is declared more than once in one scope. |",
383
+ "kind": "diagnostic",
384
+ "value": "PLAY1152",
385
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
386
+ },
387
+ {
388
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
389
+ "text": "| `PLAY1153` | Error | Two needs of a screen share a name; add `as <alias>`. |",
390
+ "kind": "diagnostic",
391
+ "value": "PLAY1153",
392
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
393
+ },
394
+ {
395
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
396
+ "text": "| `PLAY1154` | Error | A slice adopts the same screen twice. |",
397
+ "kind": "diagnostic",
398
+ "value": "PLAY1154",
399
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
400
+ },
401
+ {
402
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
403
+ "text": "| `PLAY1155` | Warning | An adopted screen has a need the slice does not provide. |",
404
+ "kind": "diagnostic",
405
+ "value": "PLAY1155",
406
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
407
+ },
408
+ {
409
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
410
+ "text": "| `PLAY1156` | Error | A provision names a need the screen does not have. |",
411
+ "kind": "diagnostic",
412
+ "value": "PLAY1156",
413
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
414
+ },
415
+ {
416
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
417
+ "text": "| `PLAY1157` | Error | A provision overrides data the screen already sources. |",
418
+ "kind": "diagnostic",
419
+ "value": "PLAY1157",
420
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
421
+ },
422
+ {
423
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
424
+ "text": "| `PLAY1158` | Error | A need is provided more than once. |",
425
+ "kind": "diagnostic",
426
+ "value": "PLAY1158",
427
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
428
+ },
429
+ {
430
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
431
+ "text": "| `PLAY1159` | Error | A list query provides a single need, or the reverse. |",
432
+ "kind": "diagnostic",
433
+ "value": "PLAY1159",
434
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
435
+ },
436
+ {
437
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
438
+ "text": "| `PLAY1160` | Error | A field the screen reads is not a property of the providing read model. |",
439
+ "kind": "diagnostic",
440
+ "value": "PLAY1160",
441
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
442
+ },
443
+ {
444
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
445
+ "text": "| `PLAY1161` | Error | A read model property has another type than the explicit shape declares. |",
446
+ "kind": "diagnostic",
447
+ "value": "PLAY1161",
448
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
449
+ },
450
+ {
451
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
452
+ "text": "| `PLAY1162` | Error | A provision's `by` is not a parameter of the query. |",
453
+ "kind": "diagnostic",
454
+ "value": "PLAY1162",
455
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
456
+ },
457
+ {
458
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
459
+ "text": "| `PLAY1163` | Error | A mapping names a field the screen does not read and the shape does not declare. |",
460
+ "kind": "diagnostic",
461
+ "value": "PLAY1163",
462
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
463
+ },
464
+ {
465
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
466
+ "text": "| `PLAY1164` | Information | A screen no slice adopts is design-only. |",
467
+ "kind": "diagnostic",
468
+ "value": "PLAY1164",
469
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
470
+ },
471
+ {
472
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
473
+ "text": "- **Shape inside a module.** A `shape` is a top-level declaration; nested in a module, feature or imported file it is `PLAY1149`.",
474
+ "kind": "diagnostic",
475
+ "value": "PLAY1149",
476
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
477
+ },
478
+ {
479
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
480
+ "text": "- **Provision for data the screen sources itself.** `data <ReadModel> via query` on the screen already binds it; a provision of it is `PLAY1157`. Drop the provision or make the screen's line a need.",
481
+ "kind": "diagnostic",
482
+ "value": "PLAY1157",
483
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
484
+ },
485
+ {
486
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
487
+ "text": "- **Adopting without providing.** `uses screen X` with no provision compiles with `PLAY1155` and fails a warnings-as-errors gate; it is never a finished adoption.",
488
+ "kind": "diagnostic",
489
+ "value": "PLAY1155",
490
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
491
+ },
492
+ {
493
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
494
+ "text": "- [ ] `screenplay <model> --warnaserror` reports no `PLAY1155`; remaining `PLAY1164` screens are deliberately unadopted.",
495
+ "kind": "diagnostic",
496
+ "value": "PLAY1155",
497
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
498
+ },
499
+ {
500
+ "file": ".cratis/ai/skills/cratis-screenplay-ui-composition/references/free-screens.md",
501
+ "text": "- [ ] `screenplay <model> --warnaserror` reports no `PLAY1155`; remaining `PLAY1164` screens are deliberately unadopted.",
502
+ "kind": "diagnostic",
503
+ "value": "PLAY1164",
504
+ "reason": "Free screens are not in the pinned Screenplay contract yet; the diagnostic is documented ahead of the pin bump that carries it. Remove with the bump."
29
505
  }
30
506
  ]
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-screenplay-ui-composition
3
- description: Use when declaring Screenplay shells, reusable templates, forms, navigation, interaction wiring, design systems or themes. Not for a screen's own query data and action contract; use cratis-screenplay-read-surface.
3
+ description: Use when declaring Screenplay shells, reusable templates, forms, navigation, interaction wiring, design systems, themes or free screens a slice adopts. Not for a screen's own query data and action contract; use cratis-screenplay-read-surface.
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -19,11 +19,9 @@ a trigger value named `file` is written `@file`.
19
19
 
20
20
  ## Locate the model
21
21
 
22
- Look first for the project's existing `.play` files: their folder is the model.
23
- Reuse existing model/workspace roots; code-only `Source/` or `src/` does not
24
- qualify. Otherwise use repository-root `Screenplay/` ([discovery/version gates](../cratis-screenplay-event-modeling/references/file-layout.md#locate-the-model)). Never put a model under `.cratis/` or hand-copy it between repositories.
25
- `cratis ai install` manages `.cratis/ai/`, never model files. Keep explanatory
26
- Markdown in project documentation; `.play` is the single flow model.
22
+ Look first for the project's existing `.play` files: their folder is the model;
23
+ code-only `Source/` or `src/` does not qualify. Otherwise use repository-root `Screenplay/` ([discovery/version gates](../cratis-screenplay-event-modeling/references/file-layout.md#locate-the-model)). Never put a model under `.cratis/` or hand-copy it between repositories;
24
+ `cratis ai install` manages `.cratis/ai/`, never model files. Keep explanatory Markdown in project documentation.
27
25
 
28
26
  ## Product sources
29
27
 
@@ -34,7 +32,7 @@ Tool versions: toolchain `SKILL.md`. UI statements come from Screenplay
34
32
  runtime sources: scaffold Scene tag, `Source/JavaScript/**`. See
35
33
  [Scene v4.82.0 runtime boundaries](references/scene-runtime-boundaries.md) for
36
34
  exact query registration/submission, root-profile serialization and interaction
37
- limits. These host APIs are not new `.play` syntax and do not verify UI rendering.
35
+ limits.
38
36
 
39
37
  Every construct on this page is deferred from the executable model with
40
38
  information `PLAY0269`: it never blocks binding, and it is not evidence that a
@@ -45,9 +43,8 @@ exposed template configuration, package/icon catalogs, manual form columns, hier
45
43
  routes, toolbars and dialog destinations, each with a separate support level
46
44
  (authoring accepted, executable admitted, runtime implemented). Discover the
47
45
  installed shape through MCP `syntax-schema`; details:
48
- `references/screen-composition-contract.md`.
49
-
50
- Absent editor highlighting is never evidence that a construct is wrong: check `screenplay`, not the editor (see [references/screen-composition-contract.md](references/screen-composition-contract.md)).
46
+ [references/screen-composition-contract.md](references/screen-composition-contract.md).
47
+ Absent editor highlighting is never evidence that a construct is wrong: check `screenplay`, not the editor.
51
48
 
52
49
 
53
50
  ## Compose in this order
@@ -79,7 +76,11 @@ work on a screen whose purpose is unsettled is rework.
79
76
  6. **Report each screen in two or three sentences**: what it shows and what the
80
77
  user can do. Not everyone reviewing can see a board.
81
78
 
82
- Read `references/worked-flow.md` when a complete example is needed before composing a flow; it contains two Level-1 screens, their command, read model and form, with the field trace.
79
+ Read `references/worked-flow.md` for a complete example: two Level-1 screens, their command, read model and form, with the field trace.
80
+
81
+ ## Free screens and Scene Design
82
+
83
+ A `screen` may be declared at the top level, in a module, a feature or a slice. A free screen states the data it needs (`data <Shape>[]`); a slice adopts it with `uses screen` and provides each need from a query. Read [references/free-screens.md](references/free-screens.md) before declaring, adopting or reviewing one: shapes, aliases, provisions, severities, design-only screens and their diagnostics. Read [references/scene-design.md](references/scene-design.md) when an agent designs screens through the Scene Design catalogue and operations or must refuse free styling.
83
84
 
84
85
  ## `layout` — the application shell
85
86
 
@@ -222,17 +223,13 @@ MCP editing and the review checklist.
222
223
 
223
224
  An interaction wires an `on <thing>` trigger to actions, inline or through named
224
225
  `behavior` + `uses`. This is closed UI wiring, not scripting; validation stays on
225
- the command. Trigger/action syntax is in [interaction example](references/interaction-example.md)
226
+ the command. Trigger/action syntax, including a named confirmation behavior with an inline
227
+ refresh, is in [interaction example](references/interaction-example.md)
226
228
  and [guarded interactions](references/guarded-interactions.md).
227
229
 
228
- Guarded alternatives and `where` deprecation:
229
- [guarded interactions](references/guarded-interactions.md).
230
230
  Read [change alternatives](references/change-alternatives.md) when a component's
231
231
  `on change` should choose an action list by the changed item, such as a kanban move.
232
232
 
233
- Read [interaction example](references/interaction-example.md) when wiring a
234
- named confirmation behavior and an inline refresh to the same screen.
235
-
236
233
  State every plain and toolbar `action`'s subject: `for item` (the chosen record fills its
237
234
  inputs) or `for screen` (no row does). Omitted, the compiler infers it from types, and a
238
235
  create action on a list can bind the selected row's id. Read
@@ -241,7 +238,7 @@ PLAY0817-PLAY0821 appear.
241
238
  Scalar/named `returns` bind and reference-execute (ESM v7).
242
239
  Renderer generation/response limits: command-surface `references/generated-values-and-responses.md`.
243
240
  Screenplay resolves response names in form submit and execute success (Requires Screenplay 4.148.0 or later);
244
- own failure use is PLAY0685. No ESM change; Scene runtime binding remains downstream.
241
+ own failure use is PLAY0685. No ESM change.
245
242
  An existing success continuation does not imply a response contract.
246
243
  Read [response continuations](references/response-continuations.md) for scope,
247
244
  precedence, PLAY0485 and examples.
@@ -267,7 +264,7 @@ Extension components: [reference](references/extension-components.md).
267
264
 
268
265
  ## `design system`, `theme` and `ui profile`
269
266
 
270
- The `design system` is the per-application contract; a `theme` implements it with values; a `ui profile` picks a theme, and `appearance` keeps only `color scheme` (`accent`, `corners`, `font`: `PLAY0929`). Read [references/design-system-and-themes.md](references/design-system-and-themes.md) first.
267
+ The `design system` is the per-application contract; a `theme` implements it with values; a `ui profile` picks a theme, and `appearance` keeps only `color scheme` (`accent`, `corners`, `font`: `PLAY0929`). Read [references/design-system-and-themes.md](references/design-system-and-themes.md) first; components are the rendering contract (anatomy and link conventions).
271
268
 
272
269
  A quoted theme name such as `theme "Scene Default Light"` needs Screenplay 4.227.0 (rules in the reference below).
273
270
 
@@ -302,6 +299,7 @@ A screen can also keep `sketch`, `mockup` and `image` lines: authoring metadata,
302
299
  no Screenplay 5 form (`navigation topbar|sidebar`, `contributes`, feature `toolbar`, region `outlet`) remains.
303
300
  - [ ] Every State Change screen says what it `fits`; a hook names a place only when the automatic choice is wrong.
304
301
  - [ ] No `dialog template` declares `fits slot`.
302
+ - [ ] Every adopted free screen provides every need (no `PLAY1155`); unadopted screens are reported as design-only.
305
303
  - [ ] Each `ui profile` names its shell with `root template`, not the legacy `layout` line (`PLAY0791`); a blueprint shell is listed under `packages` and its `version` pin is deliberate.
306
304
  - [ ] `packages` are ordered deliberately — later shadows earlier.
307
305
  - [ ] Every theme a profile selects is `compatible with` one of its packages.
@@ -5,6 +5,7 @@
5
5
  - The split: design system, theme, profile
6
6
  - A design system and its default theme
7
7
  - Tokens, components, words and rules
8
+ - Components are the rendering contract
8
9
  - A second theme and a profile that selects it
9
10
  - Which theme and mode a profile gets
10
11
  - Deprecated `appearance` members
@@ -103,6 +104,19 @@ theme Daylight
103
104
  - 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
105
  - Modes belong to the design system, never to a theme; a mode block for an undeclared mode is `PLAY0918`.
105
106
 
107
+ ## Components are the rendering contract
108
+
109
+ A renderer never reads a token by name. A component reads its look from its **anatomy**: "my `primary` variant's `background` in `hover`". The design system's `components` section is therefore what a renderer draws from, and the token names are the product's own: the categories are closed, the names inside them are free, and no renderer expects `color.primary` or any other name to exist.
110
+
111
+ - Declare, for each component, exactly the `parts`, `variant`s and `state`s it really has; a part, variant or state is a promise that a renderer can draw it. Shell and chrome (page, shell, sidebar, menu, card, text, button, input, status chip) are components like any other, so surfaces and text come from anatomy as well.
112
+ - **Link by name.** A design-system component finds the component that renders it by its name, through the profile's packages (the last package wins), compared without regard to case or separators: `StatusChip` finds `statusChip`. Name design-system components after the component they stand for and no override is needed.
113
+ - **Override with a mapping.** When names differ, Scene's component mapping states the target explicitly (`maps to <Package.Component>`). It is a Scene design-system mapping, not a `.play` line: the Screenplay `design system` has no `maps to`, so never write one in a model.
114
+ - **Variant to property.** The chosen variant reaches the component through its `variant` property, else `emphasis`, or through the property its anatomy names; a mapping may also state the property and the value each variant takes when the names differ (`variantProperty`, `variantValues`).
115
+ - **Mismatches are reported, never hidden.** Linking reports a component no package renders (`componentUnbound`), one that declares no anatomy (`componentWithoutAnatomy`), and a part, variant or state it does not support (`partUnsupported`, `variantUnsupported`, `stateUnsupported`), or several variants with no property to choose by (`variantPropertyMissing`). A component that does not restyle is diagnosed from these, not by adding raw values to a screen.
116
+ - **What the renderer emits.** Each part becomes a custom property per mode, `--ds-<component>-<variant>-<part>` and, for a state, `--ds-<component>-<variant>-<part>-<state>` (kebab-cased); raw token roles are `--ds-token-<category>-<name>` and are for blueprints authored against one design system. A package component reads only anatomy.
117
+
118
+ Scene Design grounds an agent's choices in these components and refuses what they do not declare: [scene-design.md](scene-design.md).
119
+
106
120
  ## A second theme and a profile that selects it
107
121
 
108
122
  ```screenplay
@@ -255,3 +269,4 @@ Source: [Design system](https://github.com/Cratis/Screenplay/blob/main/Documenta
255
269
  ## Checklist
256
270
 
257
271
  - [ ] 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`.
272
+ - [ ] Each component declares only the parts, variants and states a renderer draws, and is named after the component that renders it; a name that differs is a Scene mapping, not a `.play` line.
@@ -0,0 +1,237 @@
1
+ # Free screens: declare a screen first, let a slice adopt it
2
+
3
+ ## Contents
4
+
5
+ - When a screen is free
6
+ - Declare a free screen and its needs
7
+ - Shapes: inferred and explicit
8
+ - Adopt the screen and provide each need
9
+ - Two needs of one shape: aliases
10
+ - Names, navigation, storylines and sample data
11
+ - Severities and the release gate
12
+ - Design-only screens
13
+ - Diagnostics
14
+ - Traps
15
+ - Checklist
16
+
17
+ Requires a Screenplay release later than 6.31.0 whose contract lists the free-screen diagnostics (check `screenplay --version` and the toolchain skill's `screenplay-contract.json`). An older compiler rejects a top-level `shape` or `screen` with `PLAY0001`. Syntax the installed compiler rejects is never papered over with a stub: report the missing release.
18
+
19
+ ## When a screen is free
20
+
21
+ A `screen` is one construct that may be declared at the **top level of a document, in a module, in a feature or in a slice**. A screen declared inside a slice is simply a free screen declared in that slice's scope and adopted by it, so an existing model reads, prints and binds exactly as before.
22
+
23
+ Declare the screen outside a slice when it exists before the slice that serves it (a designer's screen, a storyline step), when two slices share it, or when it is a navigation target nothing implements yet. Keep it in the slice when exactly one slice serves it. A screen is declared once per scope (`PLAY1152`); two scopes may each declare a screen of the same name, and a reference then resolves from where it is written, then by unique match.
24
+
25
+ Which slice should serve a screen, and what its read model must supply: [screens before slices](../../cratis-screenplay-slice-design/references/screens-before-slices.md). Editing these constructs through MCP proposals: [free screens through typed proposals](../../cratis-screenplay-model-authoring/references/free-screens-proposals.md).
26
+
27
+ ## Declare a free screen and its needs
28
+
29
+ `data <Shape>[]` (a list) or `data <Shape>` (one value) with **no `via query`** is a **need**: data the screen reads and an adopting slice provides. A screen that names where its data comes from (`data <ReadModel> via query <Query>`) is an ordinary screen.
30
+
31
+ ```screenplay excerpt
32
+ shape Invoice
33
+ number String
34
+ customer String
35
+ amount Decimal
36
+ dueDate Date
37
+
38
+ screen InvoiceList
39
+ title "Invoices"
40
+ data Invoice[]
41
+ table Invoice
42
+ column number label "#"
43
+ column amount
44
+ on row-click navigate to InvoiceDetails by number
45
+
46
+ screen InvoiceDetails
47
+ title "Invoice"
48
+ data Invoice
49
+ summary Invoice
50
+ field number label "Number"
51
+ field customer label "Customer"
52
+ field amount label "Amount"
53
+ ```
54
+
55
+ A title is the `title` directive, never a quoted name after `screen` (`screen InvoiceList "Invoices"` is `PLAY0102`). The screen's other directives, its template, forms and interactions are written exactly as for a slice screen ([screen-composition-contract.md](screen-composition-contract.md)).
56
+
57
+ ## Shapes: inferred and explicit
58
+
59
+ The shape of a need is a contract with two sources:
60
+
61
+ - **Inferred.** The fields the screen reads of the need (table columns, summary fields, the key of a row click, bound paths) are the contract the compiler derives. Nothing else is required, so a screen can be drawn first.
62
+ - **Explicit.** A top-level `shape <Name>` tightens it with typed fields, written like a read model's properties: `<name> <Type> [optional]`, plus an optional `description`. A shape has **no key, identifier, subject or generated modifier** (it is a contract on data, not stored state), is declared once, and only at the top level of a document (`PLAY1149`, `PLAY1151`).
63
+
64
+ Declare the shape explicitly when the types matter: several adopters, sample data to check, or a reviewer who needs the contract written down. A concept (`InvoiceNumber`) stands for its underlying primitive when a provision's types are compared.
65
+
66
+ ## Adopt the screen and provide each need
67
+
68
+ A slice adopts a screen with `uses screen <Name>` and provides each need from one of its queries with `data <Need> via query <Query> [by <param>]`. Where the read model's property name differs from the shape's field, a nested `<field> from <path>` maps it; a name that matches needs no line.
69
+
70
+ ```screenplay excerpt
71
+ shape Invoice
72
+ number String
73
+ customer String
74
+ amount Decimal
75
+
76
+ screen InvoiceList
77
+ title "Invoices"
78
+ data Invoice[]
79
+ table Invoice
80
+ column number label "#"
81
+ column amount
82
+
83
+ screen InvoiceDetails
84
+ title "Invoice"
85
+ data Invoice
86
+ summary Invoice
87
+ field number label "Number"
88
+ field amount label "Amount"
89
+
90
+ module Invoicing
91
+ feature Paying
92
+ slice StateView ListInvoices
93
+ readmodel InvoiceRow
94
+ invoiceNumber String
95
+ customer String
96
+ amount Decimal
97
+ query ListInvoices => InvoiceRow[]
98
+ query GetInvoice => InvoiceRow optional
99
+ by invoiceNumber String
100
+ uses screen InvoiceList
101
+ data Invoice via query ListInvoices
102
+ number from invoiceNumber
103
+ uses screen InvoiceDetails
104
+ data Invoice via query GetInvoice by invoiceNumber
105
+ number from invoiceNumber
106
+ ```
107
+
108
+ The provision names the need without `[]`; the need's cardinality decides which query fits. The adoption is **many to many**: a slice adopts several screens and a screen is adopted by several slices. Every provision goes under the one `uses screen` line (`PLAY1154`). Hooks (`button ... slice X`) and "the slice's screen" for a State Change input work on an adopted screen exactly as on one declared inline.
109
+
110
+ What the compiler checks in a provision:
111
+
112
+ - the query exists and returns a list for a list need, a single value for a single one (`PLAY1159`);
113
+ - every field the screen reads, and every field its explicit `shape` declares, is a property of the query's read model, by name or through `from` (`PLAY1160`), with the type the shape declares (`PLAY1161`);
114
+ - `by` names a parameter the query declares (`PLAY1162`);
115
+ - a `from` mapping names a field the screen reads or the shape declares (`PLAY1163`);
116
+ - the provision targets a need the screen has (`PLAY1156`), never data the screen already sources with its own `data <ReadModel> via query` (`PLAY1157`), and provides it once (`PLAY1158`).
117
+
118
+ Fix a failure in the slice (the read model, the query, the mapping), not by loosening the shape until it passes. A field with no origin is a missing read model property, never a value invented in the screen.
119
+
120
+ ## Two needs of one shape: aliases
121
+
122
+ A screen that needs the same shape twice tells the needs apart with `as <alias>`. The alias is the need's name in the screen's directives and in the provision. Two needs with one name are `PLAY1153`.
123
+
124
+ ```screenplay excerpt
125
+ shape Invoice
126
+ number String
127
+ amount Decimal
128
+
129
+ screen Overview
130
+ title "Overview"
131
+ data Invoice[] as overdue
132
+ data Invoice[] as open
133
+ table overdue
134
+ column number
135
+ table open
136
+ column number
137
+
138
+ module Invoicing
139
+ feature Paying
140
+ slice StateView ListOverdue
141
+ readmodel Row
142
+ number String
143
+ amount Decimal
144
+ query ListOverdue => Row[]
145
+ query ListOpen => Row[]
146
+ uses screen Overview
147
+ data overdue via query ListOverdue
148
+ data open via query ListOpen
149
+ ```
150
+
151
+ ## Names, navigation, storylines and sample data
152
+
153
+ - **Names resolve from the declaration site.** A query, command or screen a free screen names resolves inside-out from where the screen is declared, then by unique match anywhere in the model. An adopting slice never changes what a name means. Ambiguous or unresolved names stay warnings, as for a slice screen; commands and screens a free screen names have no contract beyond that.
154
+ - **Navigation reaches every screen.** `navigate to`, `show` and a storyline `screen` step resolve to a free screen or a slice screen alike, adopted or not.
155
+ - **Sample data may name a shape.** `sample data ... shape <Name>` checks its rows against the declared `shape`'s typed fields (`PLAY0710`, `PLAY0711`), as it does against a read model; rows for a screen nobody has adopted can exist before any read model does.
156
+
157
+ ```screenplay excerpt
158
+ shape Invoice
159
+ number String
160
+ amount Decimal
161
+
162
+ screen InvoiceList
163
+ title "Invoices"
164
+ data Invoice[]
165
+ table Invoice
166
+ column number
167
+
168
+ screen InvoiceDetails
169
+ title "Invoice"
170
+ data Invoice
171
+ summary Invoice
172
+ field number label "Number"
173
+
174
+ storyline PayAnInvoice "A clerk pays an invoice"
175
+ screen InvoiceList "Pick the invoice"
176
+ screen InvoiceDetails "Check what is owed"
177
+
178
+ sample data Demo
179
+ shape Invoice
180
+ row
181
+ number = "INV-1001"
182
+ amount = 12.5
183
+ ```
184
+
185
+ ## Severities and the release gate
186
+
187
+ | Situation | Result |
188
+ | --- | --- |
189
+ | An adopted screen has a need no provision supplies | Warning `PLAY1155` while the model is being built |
190
+ | Warnings are errors (`screenplay <model> --warnaserror`, `cratis screenplay validate --warnings-as-errors`, a gate file's `warningsAsErrors`) | The same need fails the gate; exit 1 |
191
+ | Executable screen admission (the executable export that carries screens) | Refused with a reason naming the screen and the shape |
192
+ | A screen no slice adopts | Information `PLAY1164`; never fails any gate |
193
+ | A provision that does not hold, a malformed form, a duplicate shape, screen, need or adoption | Error (see Diagnostics) |
194
+
195
+ There is no separate release flag: the release gate is the warnings-as-errors gate every Screenplay model already runs. A work-in-progress model keeps compiling with `PLAY1155`; a release does not.
196
+
197
+ ## Design-only screens
198
+
199
+ A free screen no slice adopts is **design-only**. It never blocks the rest of the model, never enters the executable model, and is not part of the `screenplay-ui/1` contract, so the renderer does not draw it. A screen an adopting slice carries reaches the UI contract once per adopting slice, with the data that slice's provisions resolve mapped back to the screen's fields. Report design-only screens as design intent, not as delivered screens; adopt them before claiming a flow renders.
200
+
201
+ ## Diagnostics
202
+
203
+ | Code | Severity | Meaning |
204
+ | --- | --- | --- |
205
+ | `PLAY1149` | Error | A `shape` is malformed or not at the top level of a document, or a field carries a key, identifier, subject or generated modifier. |
206
+ | `PLAY1150` | Error | A `uses screen`, provision or mapping is malformed. |
207
+ | `PLAY1151` | Error | A `shape` is declared more than once. |
208
+ | `PLAY1152` | Error | A screen is declared more than once in one scope. |
209
+ | `PLAY1153` | Error | Two needs of a screen share a name; add `as <alias>`. |
210
+ | `PLAY1154` | Error | A slice adopts the same screen twice. |
211
+ | `PLAY1155` | Warning | An adopted screen has a need the slice does not provide. |
212
+ | `PLAY1156` | Error | A provision names a need the screen does not have. |
213
+ | `PLAY1157` | Error | A provision overrides data the screen already sources. |
214
+ | `PLAY1158` | Error | A need is provided more than once. |
215
+ | `PLAY1159` | Error | A list query provides a single need, or the reverse. |
216
+ | `PLAY1160` | Error | A field the screen reads is not a property of the providing read model. |
217
+ | `PLAY1161` | Error | A read model property has another type than the explicit shape declares. |
218
+ | `PLAY1162` | Error | A provision's `by` is not a parameter of the query. |
219
+ | `PLAY1163` | Error | A mapping names a field the screen does not read and the shape does not declare. |
220
+ | `PLAY1164` | Information | A screen no slice adopts is design-only. |
221
+
222
+ ## Traps
223
+
224
+ - **A quoted name after `screen`.** Write `title "..."`; `screen InvoiceList "Invoices"` is `PLAY0102`.
225
+ - **Shape inside a module.** A `shape` is a top-level declaration; nested in a module, feature or imported file it is `PLAY1149`.
226
+ - **Provision for data the screen sources itself.** `data <ReadModel> via query` on the screen already binds it; a provision of it is `PLAY1157`. Drop the provision or make the screen's line a need.
227
+ - **One query for a list need and a single need.** Provide a list need from a list query and a single need from a single-value query.
228
+ - **Adopting without providing.** `uses screen X` with no provision compiles with `PLAY1155` and fails a warnings-as-errors gate; it is never a finished adoption.
229
+ - **Counting a design-only screen as delivered.** It is not in the UI contract or the executable model.
230
+
231
+ ## Checklist
232
+
233
+ - [ ] Every free screen is declared once per scope, with a `title`; a shape is declared once at the top level.
234
+ - [ ] Every need has a shape; a screen that needs a shape twice uses aliases.
235
+ - [ ] Every adopted screen provides every need from a query of the right cardinality; names that differ are mapped with `from`.
236
+ - [ ] `screenplay <model> --warnaserror` reports no `PLAY1155`; remaining `PLAY1164` screens are deliberately unadopted.
237
+ - [ ] Storylines, `navigate to` and `show` name screens that exist, free or slice-declared.
@@ -0,0 +1,138 @@
1
+ # Scene Design: designing screens as an agent
2
+
3
+ ## Contents
4
+
5
+ - What Scene Design is and what it never does
6
+ - The loop
7
+ - Ground every choice in the catalogue
8
+ - Design operations
9
+ - Checks and refusals
10
+ - Free styling is refused
11
+ - Proposals into the design-system draft
12
+ - Screens, free screens and the session
13
+ - A worked turn
14
+ - Checklist
15
+
16
+ Requires the Scene Design packages, `@cratis/scene.design` (TypeScript) and `Cratis.Scene.Design` (C#), which share one catalogue, one operation vocabulary and one set of fixtures. The tools an agent calls are whatever the host registers: resolve their native names from the connected tool list and read their schemas instead of assuming the names below. This page describes the contract every host's tools follow.
17
+
18
+ ## What Scene Design is and what it never does
19
+
20
+ Scene Design sits between a designer (a person on a canvas or an agent with tools) and the Scene document, so that a design is always **made of what the design system and the component packages offer**. Screenplay text stays the source of truth: a designed screen is a [free screen](free-screens.md), and each revision of it is stored as Screenplay text.
21
+
22
+ - It never reads or writes Screenplay itself; the host converts text to a Scene document and back.
23
+ - It never owns commands, authorization or event streams; the host does.
24
+ - It never lets a design invent a component, variant, token, template, property or value.
25
+
26
+ Syntax for the screens a design produces: [free-screens.md](free-screens.md). The design system that grounds them: [design-system-and-themes.md](design-system-and-themes.md).
27
+
28
+ ## The loop
29
+
30
+ A design turn is a tool loop run by the host, not a single answer:
31
+
32
+ 1. **Read.** Ask the catalogue what exists instead of recalling it. Questions are answered from the catalogue and never contain anything it does not list.
33
+ 2. **Write.** Create a screen as whole Screenplay text, or change one with typed design operations, or ask for variations or tweaks.
34
+ 3. **Take the diagnostics.** Every write runs in a scratch session through the Screenplay compiler and the catalogue checks. The diagnostics or the refusal are the tool result.
35
+ 4. **Repair inside the loop.** Read the refusal, take one of its alternatives or fix the text, and write again. A refused operation changes nothing, and the operations after it still run against the design as it then is.
36
+ 5. **Finish.** End the turn with a short reply for the person. The host applies the result as a new revision of each touched screen (one turn id) and a revert is one action.
37
+
38
+ Do not finish with a design that still carries error diagnostics, and do not report an operation as applied unless its outcome says `applied`.
39
+
40
+ ## Ground every choice in the catalogue
41
+
42
+ The catalogue is built once, deterministically, from the resolved design system, its themes, the UI profile, the packages' component descriptors, the screen templates and, when the host supplies them, shapes, queries, commands and sample data. Read it on demand, one question at a time:
43
+
44
+ | Ask about | Answers |
45
+ | --- | --- |
46
+ | components (filtered by category, by the outlet or template they fit, or searched) and one component | properties with kinds and choices, placement, the variants and states the design system also declares |
47
+ | templates and one template | outlets and what each takes |
48
+ | tokens and one token | the value per theme and mode |
49
+ | the design system's components, themes, the profile, words | what the product declares |
50
+ | shapes, queries, commands | what a screen may bind to |
51
+
52
+ A component offers only the variants **both** its package and the design system declare. A session may be restricted to a **template set** (a story's chosen templates): the catalogue then lists only those, and a screen on any other template is refused with alternatives from the set.
53
+
54
+ ## Design operations
55
+
56
+ An operation is plain data with an `op` discriminator naming one change.
57
+
58
+ | `op` | Does |
59
+ | --- | --- |
60
+ | `addScreen` | Adds a screen on a catalogue template and appends it to the screen set. |
61
+ | `removeScreen`, `moveScreen` | Removes (warning `linkDangling` for links to it) or reorders; the default storyline follows. |
62
+ | `insert` | Puts a component in an outlet of a screen; its id is generated unless given. |
63
+ | `set`, `remove`, `move` | Changes, deletes or relocates an element. |
64
+ | `link` | Makes an element navigate to another screen of the design. |
65
+ | `profile` | Changes `theme`, `colorScheme`, `accent`, `corners`, `font`, `rootTemplate` or `newScreenTemplate`. |
66
+ | `variations` | Offers up to three layouts of a screen on other templates, saying what did not fit; changes nothing until one is chosen. |
67
+ | `tweaks` | Offers up to five controls (a hue or a choice) bound to a profile key, an element property or a token. |
68
+ | `refuse` | Says no, with a code, a reason and alternatives. |
69
+
70
+ Template mode adds `addTemplate`, `addSlot`, `removeSlot` and `arrange`, and `insert`, `set`, `remove`, `move` and `link` then name a `template` instead of a `screen`. Prefer operations for every change to an existing screen: they are deterministic, checked and one revision each. Write a whole screen as text only to create it.
71
+
72
+ ## Checks and refusals
73
+
74
+ | Check | Refusal code |
75
+ | --- | --- |
76
+ | The component, template, screen, element or outlet exists | `componentNotInCatalogue`, `templateNotInCatalogue`, `screenUnknown`, `elementUnknown`, `outletUnknown` |
77
+ | The outlet takes the component and has room | `outletDoesNotAccept`, `outletFull`, `overlayNeedsAction`, `shellComponent` |
78
+ | The property exists and takes the value | `propertyUnknown`, `valueNotAllowed`, `queryUnknown` |
79
+ | The variant is declared by the design system | `variantNotInDesignSystem` |
80
+ | No free styling | `freeStylingNotAllowed` |
81
+ | No value of its own | `offSystemValue` |
82
+ | Profile keys and values | `profileKeyUnknown`, `profileValueNotAllowed`, `noProfile` |
83
+ | The template set is respected | `templateNotInSet` |
84
+ | The engine accepts the Scene edit | `sceneRefused` |
85
+
86
+ A refusal carries `code`, `reason`, `alternatives` (the nearest accepted operations, and design-system proposals) and `diagnostics`. Alternatives are the outlets that do take the component, the variants it has, the queries that exist, the values a profile key takes, the templates of the set. Take an alternative when one fits the person's intent; otherwise tell them what was refused and why.
87
+
88
+ ## Free styling is refused
89
+
90
+ A design says *which* component, *which* variant and *where*; the design system says what it looks like. These are refused, never worked around:
91
+
92
+ - style properties (`background`, `color`, `padding`, `className`, `style`, ...): `freeStylingNotAllowed`;
93
+ - a value of its own (a hex colour, `linear-gradient(...)`, markup, an `accent` the design system has no colour for): `offSystemValue`.
94
+
95
+ Never retry a refused change under another property name, as raw markup or as text in a label. "Make the button red" is answered with a variant the design system declares, or with a proposal for one.
96
+
97
+ ## Proposals into the design-system draft
98
+
99
+ The canvas edits **screens only**. When a design needs something the design system lacks (a token, a variant, a word, a component), the agent does not edit the design system: a refusal carries, or the agent files, a design-system **proposal**, which the host routes into the product's design-system **draft**. The draft follows the product's review and activation; nothing reaches the screens until it is active. A tweak bound to a token is the same: it lowers to a proposal, not to a screen edit. Screen templates designed in template mode are saved into the draft the same way.
100
+
101
+ ```json
102
+ {
103
+ "applied": false,
104
+ "code": "variantNotInDesignSystem",
105
+ "reason": "The design system has no 'danger' variant of Button. Variants: primary, secondary.",
106
+ "alternatives": [
107
+ { "label": "Use primary", "operations": [{ "op": "set", "screen": "InvoiceDetails", "element": "pay", "prop": "variant", "value": "primary" }] },
108
+ { "label": "Propose it to the design system", "proposal": { "kind": "variant", "component": "Button", "variant": "danger", "summary": "Add the danger variant of Button" } }
109
+ ]
110
+ }
111
+ ```
112
+
113
+ A proposal names the need and the reason and applies nothing. Say plainly that it is a proposal and that the screen keeps its current look until the draft is activated.
114
+
115
+ ## Screens, free screens and the session
116
+
117
+ - **A new screen is a free screen.** It needs no slice and no event model. Its data needs are shapes ([free-screens.md](free-screens.md)); a slice adopts it later, in the model, with `uses screen` and its provisions, which is not part of the design turn.
118
+ - **Screens, links and storylines.** `link` sets a navigation destination on an element. The screen set keeps a default storyline that always lists every screen in order; write another storyline for an alternative path.
119
+ - **The session remembers, the model decides.** A session records revisions per screen (the text, the operations, the prompt, the author, the turn id, the design-system version), variation groups, tweak controls and comments. Only each screen's current revision is written into the model. A revert is a new revision, nothing is deleted.
120
+ - **Comments are addressed by element.** Read comments by the element's stable Screenplay `id` and answer them as operations on that element.
121
+ - **Variations and tweaks change nothing until chosen.** Offer them; do not apply one on the person's behalf.
122
+
123
+ ## A worked turn
124
+
125
+ The person asks for a red "Pay" button on `InvoiceDetails`.
126
+
127
+ 1. Read the design system's `Button` component: variants `primary` and `secondary`.
128
+ 2. A `set` of a colour property is refused (`freeStylingNotAllowed`); a `set` of `variant` to `danger` is refused (`variantNotInDesignSystem`) with the alternatives above.
129
+ 3. The alternative `primary` does not fit the intent, so apply nothing. Reply that the design system has no destructive variant, and offer to keep `primary` or to propose a `danger` variant to the design-system draft.
130
+ 4. If they want the proposal, file it. The screen keeps `primary` until the draft is activated.
131
+
132
+ ## Checklist
133
+
134
+ - [ ] Every component, template, token and variant came from a catalogue answer.
135
+ - [ ] Existing screens changed through operations, not rewritten; every outcome was read.
136
+ - [ ] No free styling, hex value or markup in any write; refusals were answered with an alternative or a proposal.
137
+ - [ ] A missing token, variant, word or component is a draft proposal, never a screen edit.
138
+ - [ ] New screens are free screens; adoption by a slice is left to the model, and a design-only screen is not reported as delivered.
@@ -269,6 +269,22 @@
269
269
  { "kind": "skill-contains", "value": "action-subjects.md#table-narrowing", "file": "references/guarded-interactions.md" },
270
270
  { "kind": "skill-contains", "value": "references/screen-visuals.md" },
271
271
  { "kind": "skill-contains", "value": "Requires Screenplay 6.7.0 or later", "file": "references/screen-visuals.md" },
272
- { "kind": "skill-contains", "value": "`PLAY0951` | Warning", "file": "references/screen-visuals.md" }
272
+ { "kind": "skill-contains", "value": "`PLAY0951` | Warning", "file": "references/screen-visuals.md" },
273
+ { "kind": "skill-contains", "value": "references/free-screens.md" },
274
+ { "kind": "skill-contains", "value": "references/scene-design.md" },
275
+ { "kind": "skill-contains", "value": "Requires a Screenplay release later than 6.31.0 whose contract lists", "file": "references/free-screens.md" },
276
+ { "kind": "skill-contains", "value": "with **no `via query`** is a **need**", "file": "references/free-screens.md" },
277
+ { "kind": "skill-contains", "value": "data overdue via query ListOverdue", "file": "references/free-screens.md" },
278
+ { "kind": "skill-contains", "value": "There is no separate release flag", "file": "references/free-screens.md" },
279
+ { "kind": "skill-contains", "value": "A free screen no slice adopts is **design-only**", "file": "references/free-screens.md" },
280
+ { "kind": "skill-contains", "value": "`PLAY1155` | Warning", "file": "references/free-screens.md" },
281
+ { "kind": "skill-contains", "value": "`PLAY1164` | Information", "file": "references/free-screens.md" },
282
+ { "kind": "skill-contains", "value": "A renderer never reads a token by name.", "file": "references/design-system-and-themes.md" },
283
+ { "kind": "skill-contains", "value": "the Screenplay `design system` has no `maps to`", "file": "references/design-system-and-themes.md" },
284
+ { "kind": "skill-contains", "value": "`variantProperty`, `variantValues`", "file": "references/design-system-and-themes.md" },
285
+ { "kind": "skill-contains", "value": "`freeStylingNotAllowed`", "file": "references/scene-design.md" },
286
+ { "kind": "skill-contains", "value": "The canvas edits **screens only**.", "file": "references/scene-design.md" },
287
+ { "kind": "skill-contains", "value": "design-system **draft**", "file": "references/scene-design.md" },
288
+ { "kind": "skill-contains", "value": "Repair inside the loop.", "file": "references/scene-design.md" }
273
289
  ]
274
290
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "7.167.3",
3
+ "version": "7.168.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [