@cratis/pi 7.6.0 → 7.6.1
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.
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +30 -8
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +8 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +14 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +4 -0
- package/package.json +1 -1
|
@@ -165,12 +165,32 @@ Reviewability, not an arbitrary line count, triggers the next split. In a large
|
|
|
165
165
|
model, one slice per file makes a scripted edit's blast radius visible in the
|
|
166
166
|
diff instead of hiding cross-reference defects in a single enormous file.
|
|
167
167
|
|
|
168
|
-
At the most granular layout, folders mirror the language, one folder per level
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
At the most granular layout, folders mirror the language, one folder per level,
|
|
169
|
+
and every level above the slices is a **barrel file** that declares its scope
|
|
170
|
+
and imports what is beneath it:
|
|
171
|
+
|
|
172
|
+
- `application.play` at the root holds `domain` and imports the rest:
|
|
173
|
+
`import "Shared/*.play"` for the files of `concept`, `type`, `policy`,
|
|
174
|
+
`persona`, `authentication` and `seed`, then one import per module file.
|
|
175
|
+
- `<Module>/<Module>.play` declares the module - `description`, `authorize`,
|
|
176
|
+
templates, forms - and its features. Either declare each feature inline and
|
|
177
|
+
import its folder (`feature Orders` / `import "Orders/*.play"`), or import one
|
|
178
|
+
`<Feature>/<Feature>.play` per feature.
|
|
179
|
+
- `<Feature>/<Feature>.play`, when a feature has its own file, declares the
|
|
180
|
+
feature and imports its slice files (`import "*.play"`) and any nested
|
|
181
|
+
feature's file.
|
|
182
|
+
- A slice file holds just its `slice`, at the top level. The import that brings
|
|
183
|
+
it in places it in its feature, so it does **not** restate `module` or
|
|
184
|
+
`feature` - the barrel above it already says where it belongs.
|
|
185
|
+
|
|
186
|
+
The root then reads as a table of contents, and every file is reachable from
|
|
187
|
+
it: `screenplay application.play` compiles exactly what the imports reach, and
|
|
188
|
+
a file no import reaches is not part of the application. Do not hand-write the
|
|
189
|
+
older merge-only layout, where barrels import nothing and every slice file
|
|
190
|
+
restates `module` and `feature` so the folder merges into one model. It compiles
|
|
191
|
+
as a folder, but the root says nothing about what the application holds and
|
|
192
|
+
every slice file repeats where it lives. The MCP `expand-layout` tool still
|
|
193
|
+
writes that layout; compose its output with imports when you take it over.
|
|
174
194
|
|
|
175
195
|
**Compose focused files with imports** (v4.48.0, checked at tag `v4.48.0`,
|
|
176
196
|
commit `3baf4a4`). `import "<path or glob>"` imports `.play` files relative to
|
|
@@ -197,8 +217,10 @@ module Ordering
|
|
|
197
217
|
|
|
198
218
|
Every file is imported once. When a root glob and a module file both match a
|
|
199
219
|
file, the deepest placement wins; two placements where neither lies inside the
|
|
200
|
-
other are an error (`PLAY0457`), and so is a file
|
|
201
|
-
|
|
220
|
+
other are an error (`PLAY0457`), and so is a file that declares a module other
|
|
221
|
+
than the one it is placed in (`PLAY0459`). A placed file's top level holds only
|
|
222
|
+
what its scope can hold (`PLAY0460`) - a `screen template` belongs in the
|
|
223
|
+
module file, not in a slice file placed in a feature. `import Customers.CustomerRegistered` without quotes still
|
|
202
224
|
names a contract from another bounded context.
|
|
203
225
|
|
|
204
226
|
⚠️ **Compile the folder, or its root file, as one application.**
|
|
@@ -42,6 +42,14 @@
|
|
|
42
42
|
{
|
|
43
43
|
"kind": "skill-contains",
|
|
44
44
|
"value": "are accepted but\n**not available**"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "skill-contains",
|
|
48
|
+
"value": "every level above the slices is a **barrel file**"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "skill-contains",
|
|
52
|
+
"value": "it does **not** restate `module` or"
|
|
45
53
|
}
|
|
46
54
|
]
|
|
47
55
|
}
|
|
@@ -117,8 +117,21 @@ proposal. Layout is not application semantics.
|
|
|
117
117
|
- Use one file per feature when nested features need separate review.
|
|
118
118
|
- Use one file per slice when a large model needs isolated diffs.
|
|
119
119
|
|
|
120
|
+
Compose split files with quoted imports (`import "<path or glob>"`, v4.48.0).
|
|
121
|
+
Each level above the slices is a barrel file: `application.play` holds `domain`
|
|
122
|
+
and imports `Shared/*.play` and each module file; a module file declares the
|
|
123
|
+
module and its features, each feature importing its folder
|
|
124
|
+
(`import "Orders/*.play"`); a slice file holds only its `slice`, because the
|
|
125
|
+
import places it in its feature. When you write or reorganize files yourself,
|
|
126
|
+
do not restate `module`/`feature` in a slice file, and do not leave a barrel
|
|
127
|
+
that declares a scope but imports nothing. `expand-layout` still writes that
|
|
128
|
+
older merge-only layout; it compiles as a folder, and you can compose it with
|
|
129
|
+
imports afterwards. See the
|
|
130
|
+
[language reference](references/language-reference.md) for placement rules.
|
|
131
|
+
|
|
120
132
|
Parent scaffolding carries no duplicated module forms or contributions. Compile
|
|
121
|
-
and validate the whole `.cratis/screenplay/` folder,
|
|
133
|
+
and validate the whole `.cratis/screenplay/` folder, or its root file, not just
|
|
134
|
+
the edited fragment.
|
|
122
135
|
|
|
123
136
|
## Preserve state and recover explicitly
|
|
124
137
|
|