@cratis/pi 7.6.5 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/agents/backend-developer.md +14 -0
- package/package/corpus/agents/code-reviewer.md +16 -0
- package/package/corpus/agents/coordinator.md +17 -0
- package/package/corpus/agents/frontend-developer.md +17 -0
- package/package/corpus/agents/orchestrator.md +18 -0
- package/package/corpus/agents/planner.md +24 -0
- package/package/corpus/agents/screenplay-modeler.md +57 -0
- package/package/corpus/agents/screenplay-renderer.md +42 -0
- package/package/corpus/agents/screenplay-reviewer.md +45 -0
- package/package/corpus/agents/slice-implementer.md +32 -5
- package/package/corpus/agents/spec-writer.md +16 -3
- package/package/corpus/prompts/add-reactor.prompt.md +5 -3
- package/package/corpus/prompts/new-vertical-slice.prompt.md +16 -5
- package/package/corpus/prompts/write-specs.prompt.md +12 -6
- package/package/corpus/rules/application-profile.md +7 -3
- package/package/corpus/rules/general.md +8 -3
- package/package/corpus/rules/glossary.md +1 -1
- package/package/corpus/rules/profiles.md +42 -4
- package/package/corpus/rules/reactors.md +30 -22
- package/package/corpus/rules/vertical-slices.md +3 -1
- package/package/corpus/skills/cratis-application-react-specifications/SKILL.md +13 -0
- package/package/corpus/skills/cratis-application-slice-conformance/LICENSE +2 -0
- package/package/corpus/skills/cratis-application-slice-conformance/SKILL.md +173 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/checklists.md +66 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/contract-and-precedence.md +49 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/provenance.md +23 -0
- package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +91 -0
- package/package/corpus/skills/cratis-application-slice-conformance/verification.json +14 -0
- package/package/corpus/skills/cratis-application-slice-specifications/SKILL.md +57 -1
- package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md +16 -0
- package/package/corpus/skills/cratis-arc-command/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-execution/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-command-validation/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-observable-query-http/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-query-paging/SKILL.md +10 -0
- package/package/corpus/skills/cratis-arc-react-page/SKILL.md +68 -8
- package/package/corpus/skills/cratis-arc-react-page/references/from-screenplay.md +199 -0
- package/package/corpus/skills/cratis-arc-react-page/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-chronicle-event-constraints/SKILL.md +10 -0
- package/package/corpus/skills/cratis-chronicle-event-modeling/SKILL.md +38 -10
- package/package/corpus/skills/cratis-chronicle-event-type-migration/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-projection/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-reactor/SKILL.md +58 -6
- package/package/corpus/skills/cratis-chronicle-reactor/references/provenance.md +9 -0
- package/package/corpus/skills/cratis-chronicle-read-model/SKILL.md +13 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/SKILL.md +47 -0
- package/package/corpus/skills/cratis-chronicle-read-model-specifications/references/provenance.md +11 -0
- package/package/corpus/skills/cratis-chronicle-reducer/SKILL.md +13 -0
- package/package/corpus/skills/cratis-components-stepper-command-dialog/SKILL.md +13 -0
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +35 -16
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/LICENSE +28 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/SKILL.md +166 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/audit-format.md +31 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/automation-patterns.md +139 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/cases-to-specify.md +69 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/effects-and-idempotency.md +88 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/integration-contracts.md +64 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/realization-and-gap-fill.md +34 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +208 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +126 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translation-patterns.md +93 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/worked-integration.md +98 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/SKILL.md +267 -50
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +185 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/verification.json +60 -12
- package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +42 -12
- package/package/corpus/skills/cratis-screenplay-discovery/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-discovery/SKILL.md +229 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/divergent-sweep.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +64 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/facilitation.md +62 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/human-workshop.md +222 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/interview-questions.md +66 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +152 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/plotting-and-handoff.md +111 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/provenance.md +37 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/storming-loop.md +119 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/worked-session.md +87 -0
- package/package/corpus/skills/cratis-screenplay-discovery/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/SKILL.md +140 -77
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +51 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/nine-steps.md +114 -28
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/parsed-not-runnable.md +50 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/verification.json +28 -3
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/chronicle-observations.md +25 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/evidence-table-template.md +79 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/expert-verification.md +48 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/generate-notes.md +75 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +164 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/interview-findings.md +88 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/loss-report-template.md +47 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/prologue-safety.md +147 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/provenance.md +10 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/rule-modeling.md +36 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/side-car-migration.md +126 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/signal-to-intent.md +57 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/ui-observation.md +52 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/verification.json +17 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +77 -57
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +50 -20
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-loop.md +211 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +44 -6
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +64 -10
- package/package/corpus/skills/cratis-screenplay-model-review/LICENSE +34 -0
- package/package/corpus/skills/cratis-screenplay-model-review/SKILL.md +209 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/anti-patterns.md +89 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/business-questions.md +128 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/checklist.md +176 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/provenance.md +36 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/report-template.md +149 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/review-questions.md +59 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +255 -0
- package/package/corpus/skills/cratis-screenplay-model-review/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/LICENSE +32 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +239 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/code-reading-and-tokens.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/handoff-template.md +124 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/identity-and-edits.md +84 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/opt-in.md +48 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phase-report-inventories.md +25 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/phases.md +162 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/principles.md +53 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/provenance.md +63 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/reasoning-notes.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/safety.md +31 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/stop-or-assume.md +46 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/verdicts-and-modes.md +204 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/vocabulary-map.md +55 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +86 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +16 -0
- package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +14 -3
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +15 -1
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +179 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/delivery-protocol.md +99 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/drift-and-ledger.md +67 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/gap-fill-handoff.md +72 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/provenance.md +27 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +56 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +124 -0
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/LICENSE +31 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/SKILL.md +200 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +579 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/chronicle-verification.md +24 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/coverage-matrix.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/provenance.md +41 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-catalogue.md +196 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/scenario-workshop.md +102 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/spec-forms-by-mode.md +71 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/view-and-story-specs.md +91 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/verification.json +13 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/LICENSE +30 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +236 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +107 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +130 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/provenance.md +20 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +201 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/review-questions.md +23 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/rule-layers.md +41 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +122 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/worked-example.md +305 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/verification.json +43 -0
- package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +217 -36
- package/package/corpus/skills/cratis-screenplay-specifications/verification.json +28 -4
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/LICENSE +33 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +154 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +54 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +191 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +70 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +65 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +128 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +378 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/verification.json +14 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/LICENSE +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +177 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +121 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +319 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet.md +96 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +107 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/doc-contradictions.md +48 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +113 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +148 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +267 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/provenance.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/renderable-subset.md +88 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +51 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/verdicts.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/versions.md +134 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/verification.json +15 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +53 -5
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/flow-review.md +56 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/provenance.md +13 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +65 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +4 -1
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +44 -1
- package/package/corpus/skills/cratis-specifications-csharp/SKILL.md +10 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/SKILL.md +186 -219
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +177 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +150 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/rendered-application.md +87 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/sandbox-and-specrunner.md +98 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/verification.json +19 -0
- package/package/profile-catalog.json +11 -0
- package/package.json +1 -1
|
@@ -1,22 +1,75 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-screenplay-event-modeling
|
|
3
|
-
description:
|
|
3
|
+
description: "Entry point and router for model-first Cratis work: the short decision rule (model, or code), the nine-step workflow per behavior, the four slice types, the Cratis divergences from the generic method, the quick validation gate, file layout and what parsed-but-not-runnable means, then the phase skill to load next. Use when designing an information system, mapping a business process or information flow, deciding the event vocabulary or stream boundaries, turning a whiteboard model into `.play`, or when a request may change behavior in an application with a Screenplay model. Not for: Screenplay syntax and the compiler alone (use `cratis-screenplay-toolchain`), the lifecycle, verdicts and handoffs (use `cratis-screenplay-modeling-lifecycle`), or rendering a settled model (use `cratis-screenplay-render-and-gap-fill`)."
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Event modeling with Screenplay
|
|
7
|
+
# Event modeling with Screenplay (start here)
|
|
8
8
|
|
|
9
9
|
Event Modeling is the **method**: walk a business process left to right and write
|
|
10
10
|
down every behavior as a command that changes the system, a view that reads it,
|
|
11
11
|
an automation that runs off it, or a translation of outside data. Screenplay is
|
|
12
|
-
the **artifact**: one language that holds that whole model
|
|
13
|
-
events, read models, queries, screens, specifications
|
|
12
|
+
the **artifact**: one language that holds that whole model - concepts, commands,
|
|
13
|
+
events, read models, queries, screens, specifications - in files that compile.
|
|
14
14
|
|
|
15
15
|
You are a **facilitator, not a stenographer.** Ask probing questions. Challenge
|
|
16
16
|
assumptions. Keep asking *"and then what happens?"* after every event, every
|
|
17
17
|
command, every answer. Use business language. Do not discuss databases, APIs, or
|
|
18
18
|
frameworks during modeling.
|
|
19
19
|
|
|
20
|
+
## Start here
|
|
21
|
+
|
|
22
|
+
**1. Decide the level (short form; master copy in `cratis-screenplay-modeling-lifecycle`).**
|
|
23
|
+
Check first that the method skills are installed; installing them never opts a
|
|
24
|
+
repository in. The work is **model-first** only in an opted-in repository: the model
|
|
25
|
+
root (default `.cratis/screenplay/`) holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project explicitly set
|
|
26
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`. An empty directory, install output,
|
|
27
|
+
an installed skill, a `.play` file outside the root or an untracked or uncommitted draft is not
|
|
28
|
+
opt-in; staged or untracked files under the root are drafts. A committed file with uncommitted
|
|
29
|
+
working-tree edits is a model change in progress; its HEAD version is the contract until the
|
|
30
|
+
change is committed. A behavior is a contract only when an accepted model under the root covers it.
|
|
31
|
+
Otherwise stay code-first. Only the entry-point session proposes a model (at most once
|
|
32
|
+
per session, never for trivial, bug-fix, infrastructure, client, framework or
|
|
33
|
+
brownfield-maintenance work; unattended: record the recommendation in the final report).
|
|
34
|
+
Framework repositories and brownfield work that has not opted in stay code-first.
|
|
35
|
+
|
|
36
|
+
- **Model:** change the `.play`, verify, review, then render or gap-fill.
|
|
37
|
+
- **Code is right for** infrastructure, clients, Screenplay code attachments and
|
|
38
|
+
handlers, adapters, and scope Stage cannot render yet (the model stays the contract).
|
|
39
|
+
- **Never:** use code as a shortcut around the model; change the model to match
|
|
40
|
+
existing code; edit Stage-managed output; leave a modeled rule living only in
|
|
41
|
+
code; weaken protection (authorization, `@pii`, rules) so a model compiles or renders.
|
|
42
|
+
|
|
43
|
+
**2. Run the lifecycle.** Load `cratis-screenplay-modeling-lifecycle` for modes, the
|
|
44
|
+
independent verdicts V1-V5, the P0-P9 phases with their gates, stop-or-assume,
|
|
45
|
+
identity ownership and handoffs. Then load **one** phase skill. Small changes enter
|
|
46
|
+
at the phase where they belong and run the downstream gates for the changed scope.
|
|
47
|
+
|
|
48
|
+
**3. Pick the phase skill.**
|
|
49
|
+
|
|
50
|
+
| Phase | Skill |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| P0-P1 intake, timeline, personas, events | `cratis-screenplay-discovery` |
|
|
53
|
+
| P2 commands, read models, screens, field lineage | `cratis-screenplay-slice-design` |
|
|
54
|
+
| P2 stream identity, consistency, evolution | `cratis-screenplay-streams-and-consistency` |
|
|
55
|
+
| P2 reactions, work queues, clocks, captures | `cratis-screenplay-automations-and-translations` |
|
|
56
|
+
| P3 specifications and coverage | `cratis-screenplay-scenario-coverage` |
|
|
57
|
+
| P4-P5 self-check and independent review | `cratis-screenplay-model-review` |
|
|
58
|
+
| Existing system into a model (replaces P1-P2) | `cratis-screenplay-legacy-extraction` |
|
|
59
|
+
| P7-P9 execute, render, fall back, verify | `cratis-screenplay-render-and-gap-fill` |
|
|
60
|
+
| Tools, versions, verdict commands, diagnostics | `cratis-screenplay-toolchain` |
|
|
61
|
+
|
|
62
|
+
**4. Nine steps to phase skill.** [references/nine-steps.md](references/nine-steps.md)
|
|
63
|
+
keeps the activities, Screenplay output and facilitation questions of each step:
|
|
64
|
+
|
|
65
|
+
| Step | Activity | Phase skill |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| 1-3 | Goal, brainstorm events, order them | `cratis-screenplay-discovery` |
|
|
68
|
+
| 4-6 | Wireframes, commands, read models | `cratis-screenplay-slice-design` |
|
|
69
|
+
| 7-8 | Automations, external integrations | `cratis-screenplay-automations-and-translations` |
|
|
70
|
+
| 9 | Decompose into vertical slices | `cratis-screenplay-slice-design` |
|
|
71
|
+
| after 9 | Specifications, then review | `cratis-screenplay-scenario-coverage`, `cratis-screenplay-model-review` |
|
|
72
|
+
|
|
20
73
|
## Locate the model
|
|
21
74
|
|
|
22
75
|
Look first in `.cratis/screenplay/` at the repository root. This is the
|
|
@@ -35,61 +88,55 @@ source is the single flow model.
|
|
|
35
88
|
| `Cratis.Screenplay` | `4.31.0` | Compiler: parser, validator, diagnostics, folder merge, semantic binder |
|
|
36
89
|
| `Cratis.Screenplay.Tool` | `4.31.0` | The `screenplay` dotnet tool |
|
|
37
90
|
| `Cratis.Screenplay` | main `fd18129` | Inline contracts and event context; changed nine-step examples compiled |
|
|
91
|
+
| `Cratis.Screenplay.Tool` | `4.64.0` (`7e16162`) | Current pin: the Step 7 clock example compiles and binds; persona, generated, operation and stream dispositions below were read at this tag |
|
|
38
92
|
|
|
39
|
-
The
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`Documentation/screenplay/{slices,commands,folders,printing,interactions,specifications}.md`,
|
|
44
|
-
`projections/keys.md`, and decisions 0001 to 0014
|
|
45
|
-
|
|
46
|
-
main commit above; do not attribute their verification to the old tag.
|
|
93
|
+
The pin set for the whole Screenplay family, and which tool reports what, lives only in
|
|
94
|
+
`cratis-screenplay-toolchain` `references/versions.md`. The `fd18129` update follows
|
|
95
|
+
`commands.md`, `events.md` and decision 0023 at that main commit (after v4.52.0);
|
|
96
|
+
compilation does not establish reference execution. The original baseline was checked at
|
|
97
|
+
tag `v4.31.0` (commit `355dffb`): `Documentation/screenplay/{slices,commands,folders,printing,interactions,specifications}.md`,
|
|
98
|
+
`projections/keys.md`, and decisions 0001 to 0014. Changed [nine-step examples](references/nine-steps.md)
|
|
99
|
+
use the newer commit and the 4.64.0 tool; do not attribute them to the old tag.
|
|
47
100
|
|
|
48
101
|
> **Method lineage.** The two-phase process, the nine steps, the four patterns and
|
|
49
102
|
> the GWT discipline follow **Event Modeling** (Adam Dymitruk; Martin Dilger,
|
|
50
103
|
> *Understanding Eventsourcing*), as structured in
|
|
51
104
|
> [jwilger/agent-skills `event-modeling`](https://github.com/jwilger/agent-skills/tree/main/skills/event-modeling).
|
|
52
|
-
> Screenplay adopts that vocabulary directly: *"Slices are the atom
|
|
105
|
+
> Screenplay adopts that vocabulary directly: *"Slices are the atom - everything
|
|
53
106
|
> lives inside a typed slice aligned with Event Modeling's vocabulary."*
|
|
54
107
|
> Where Cratis deliberately diverges, this skill says so.
|
|
55
108
|
|
|
56
|
-
## Two phases
|
|
109
|
+
## Two phases - discovery, then design
|
|
57
110
|
|
|
58
|
-
**Never jump into detailed workflow design without broad domain understanding.**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
most critical? *Ask the user; do not assume answers.* Lands as the `module` set,
|
|
64
|
-
`persona` declarations, and the `import` list.
|
|
65
|
-
|
|
66
|
-
**Phase 2 — Workflow design.** One workflow at a time, all nine steps, before
|
|
67
|
-
starting the next. Read **[nine-steps.md](references/nine-steps.md)** — it carries
|
|
68
|
-
each step's activities, its Screenplay output, and the facilitation questions.
|
|
111
|
+
**Never jump into detailed workflow design without broad domain understanding.** Phase 1
|
|
112
|
+
maps the territory (actors, processes, outside systems, the most critical workflow; ask,
|
|
113
|
+
do not assume; it lands as `module`, `persona` and `import`; protocol in
|
|
114
|
+
`cratis-screenplay-discovery`). Phase 2 designs one workflow at a time through all nine steps
|
|
115
|
+
([nine-steps.md](references/nine-steps.md): activities, Screenplay output, questions).
|
|
69
116
|
|
|
70
117
|
## The prime directive: do not lose information
|
|
71
118
|
|
|
72
119
|
Store what happened (events), not just current state. Events are immutable
|
|
73
120
|
past-tense facts in business language. **Every read-model field must trace back to
|
|
74
|
-
an event.** If a field has no source event, something is missing from the model
|
|
121
|
+
an event.** If a field has no source event, something is missing from the model -
|
|
75
122
|
it is not an optional column.
|
|
76
123
|
|
|
77
|
-
## The four patterns
|
|
124
|
+
## The four patterns -> the four slice types
|
|
78
125
|
|
|
79
126
|
Every behavior is exactly one. An unknown slice type is a compile error:
|
|
80
127
|
*Unknown slice type '<x>' - expected StateChange, StateView, Automation or Translate*.
|
|
81
128
|
|
|
82
129
|
| Pattern | Slice type | Screenplay constructs |
|
|
83
130
|
| --- | --- | --- |
|
|
84
|
-
| Command
|
|
85
|
-
| Events
|
|
86
|
-
| Event
|
|
87
|
-
| External data
|
|
131
|
+
| Command -> Event | `StateChange` | `command` -> `produces` -> `event`, plus `validate`, `authorize`, `constraint` |
|
|
132
|
+
| Events -> Read Model | `StateView` | `readmodel`, `projection` or `reducer`, `query`, `screen` |
|
|
133
|
+
| Event -> decision -> Command/Event | `Automation` | `reaction` |
|
|
134
|
+
| External data -> Event | `Translate` | `capture` |
|
|
88
135
|
|
|
89
136
|
**A slice is one behavior, not one artifact of each kind.** Every construct may
|
|
90
137
|
appear as many times as the behavior needs. Only `description` is limited to one.
|
|
91
138
|
|
|
92
|
-
**Automation has four required components**
|
|
139
|
+
**Automation has four required components** - a triggering occurrence, the state
|
|
93
140
|
it consults (the trigger's `reads`), conditional logic, and a resulting command
|
|
94
141
|
or event. If the events are always unconditionally co-produced, it is **not** an
|
|
95
142
|
automation: model it as one `StateChange` slice with several `produces` blocks.
|
|
@@ -102,22 +149,27 @@ workflow needs (event persistence, message transport) is not a `Translate` slice
|
|
|
102
149
|
Two divergences matter, and getting them wrong produces a model that will not
|
|
103
150
|
compile or will not be safe. Both are deliberate.
|
|
104
151
|
|
|
105
|
-
- **A command may read state.** The generic method forbids `ReadModel
|
|
152
|
+
- **A command may read state.** The generic method forbids `ReadModel -> Command`
|
|
106
153
|
edges. Screenplay ships `reads <ReadModel> [as <alias>] [by <property>]` so the
|
|
107
154
|
model shows what a state-dependent decision consulted. **It is not a protected
|
|
108
155
|
read today:** nothing checks at append time that the state is still current,
|
|
109
156
|
the executable model rejects `reads` and `concurrency` (`PLAY0271`), and adding
|
|
110
157
|
`concurrency` does not make the decision safe (decision 0003, Screenplay #129).
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
158
|
+
Write a state-dependent rule as `reads <View>` plus `require <expr> message "..."`
|
|
159
|
+
and mark it in the slice `description` as **not enforced in the model today**,
|
|
160
|
+
naming the target that must enforce it (Arc `[ProtectedDecision]` with
|
|
161
|
+
`DecisionRead<T>`, Chronicle's dynamic consistency boundary, or a constraint where
|
|
162
|
+
one fits). Model uniqueness as a `unique` constraint. Never copy state into a
|
|
163
|
+
command input, add an attestation flag, or hide the rule in `handler` prose. Do not
|
|
164
|
+
use `reads` to fetch data the command could carry as input. A reaction trigger
|
|
165
|
+
declares the views an automation decides from with the same `reads`, and the same
|
|
166
|
+
caveat applies.
|
|
116
167
|
- **Some validation *does* belong in the model.** The generic method routes format
|
|
117
168
|
rules to the type system. Screenplay's type system *is* the `concept`, and a
|
|
118
|
-
concept carries its own `validate` block
|
|
119
|
-
and travels with every use
|
|
120
|
-
|
|
169
|
+
concept carries its own `validate` block - so a format rule lives on the concept
|
|
170
|
+
and travels with every use. A state-dependent rule is not a format rule: it needs
|
|
171
|
+
the modeled `reads` + `require` intent, specifications, and the recorded
|
|
172
|
+
target-enforcement gap described above.
|
|
121
173
|
|
|
122
174
|
## Naming the primitives is the highest-value work
|
|
123
175
|
|
|
@@ -128,9 +180,9 @@ compile or will not be safe. Both are deliberate.
|
|
|
128
180
|
- **Classify personal data at the concept**, with a reason:
|
|
129
181
|
`concept PersonName : String @pii` plus an indented `pii reason "..."`. Every
|
|
130
182
|
usage inherits it; a reason for an attribute the concept does not declare is an
|
|
131
|
-
error. Decide this before fixing event shapes
|
|
183
|
+
error. Decide this before fixing event shapes - erasure follows the subject and
|
|
132
184
|
the subject follows the stream.
|
|
133
|
-
- **Events are past tense and self-describing**
|
|
185
|
+
- **Events are past tense and self-describing** - `InvoiceRegistered`, never
|
|
134
186
|
`Created`. One purpose per event; an event needing an optional property to cover
|
|
135
187
|
two situations is two events.
|
|
136
188
|
- **The event-source identity is never an event property.** The command binds it
|
|
@@ -146,10 +198,12 @@ compile or will not be safe. Both are deliberate.
|
|
|
146
198
|
- **Domain facts, not runtime context.** Test: would this field have the same value
|
|
147
199
|
if the event were replayed on a different machine? If not, it does not belong.
|
|
148
200
|
|
|
149
|
-
##
|
|
201
|
+
## Quick gate - before specifications are called done
|
|
150
202
|
|
|
151
203
|
Run this after the GWT specifications are written. **Do not proceed with gaps.**
|
|
152
204
|
When one is found, ask the user to clarify, create the missing element, re-validate.
|
|
205
|
+
The full critic pass (evidence, severity, business-question review) is
|
|
206
|
+
`cratis-screenplay-model-review`.
|
|
153
207
|
|
|
154
208
|
1. Every `readmodel` property traces to an `event` (**backward trace**).
|
|
155
209
|
2. Every `event` feeds a projection, reaction, or capture target (**forward trace**).
|
|
@@ -158,7 +212,7 @@ When one is found, ask the user to clarify, create the missing element, re-valid
|
|
|
158
212
|
5. No `given`/`when`/`then` clause references an undefined element.
|
|
159
213
|
6. Every behavior is exactly one slice type.
|
|
160
214
|
7. Read-model fields use collection types where the domain allows concurrent
|
|
161
|
-
instances
|
|
215
|
+
instances - ask *"can there be more than one of these at once?"* for each field.
|
|
162
216
|
8. No cross-cutting infrastructure is modeled as a `Translate` slice.
|
|
163
217
|
|
|
164
218
|
## Choose a file layout
|
|
@@ -212,14 +266,16 @@ there, so a file holds only its part of the story - a slice file is just the
|
|
|
212
266
|
`slice`. A root file that imports everything says what the application is made
|
|
213
267
|
of:
|
|
214
268
|
|
|
215
|
-
|
|
269
|
+
Layout sketches (file contents, not standalone documents):
|
|
270
|
+
|
|
271
|
+
```text
|
|
216
272
|
domain Acme.Commerce
|
|
217
273
|
|
|
218
274
|
import "Shared/*.play"
|
|
219
275
|
import "Ordering/Ordering.play"
|
|
220
276
|
```
|
|
221
277
|
|
|
222
|
-
```
|
|
278
|
+
```text
|
|
223
279
|
module Ordering
|
|
224
280
|
description "Orders, from basket to doorstep"
|
|
225
281
|
feature Orders
|
|
@@ -255,16 +311,22 @@ order of modules, features or slices.
|
|
|
255
311
|
screenplay .cratis/screenplay/ --warnaserror
|
|
256
312
|
```
|
|
257
313
|
|
|
314
|
+
(The standalone tool; `cratis screenplay validate .cratis/screenplay --warnings-as-errors`
|
|
315
|
+
is the fallback, and neither names the other's verdict. Versions and commands:
|
|
316
|
+
`cratis-screenplay-toolchain`.)
|
|
317
|
+
|
|
258
318
|
- [ ] Zero errors **and zero warnings**. An unrecognized construct inside a slice
|
|
259
|
-
is only a warning (`PLAY0029`) and its block is **silently dropped**
|
|
319
|
+
is only a warning (`PLAY0029`) and its block is **silently dropped** - a typo
|
|
260
320
|
can delete a whole projection while the exit code stays `0`.
|
|
261
321
|
- [ ] Every behavior is exactly one slice type, and the whole model validates
|
|
262
322
|
against the eight checks above.
|
|
263
323
|
- [ ] Every event is past tense, single-purpose, and carries no event-source id.
|
|
264
324
|
- [ ] Personal data is classified on the `concept`, with a reason.
|
|
265
325
|
- [ ] Specifications name the rejections, not only the happy path.
|
|
266
|
-
- [ ] If the model must reach a runtime,
|
|
267
|
-
|
|
326
|
+
- [ ] If the model must reach a runtime, check it binds with the tool that will
|
|
327
|
+
consume it. The standalone 4.64.0 binder admits Automation and Translate slices
|
|
328
|
+
(ESM v6); Stage 4.24.0 admits ESM v1 to v3 and renders only `StateChange` and
|
|
329
|
+
`StateView` slices, so automations and translations are gap-fill there.
|
|
268
330
|
|
|
269
331
|
## Parsed is not runnable
|
|
270
332
|
|
|
@@ -274,44 +336,45 @@ what it cannot represent reports `PLAY0268` or `PLAY0271` and the model does not
|
|
|
274
336
|
bind. Keep four states apart when you report on a model: **parsed** (the
|
|
275
337
|
`screenplay` tool), **bound** (ESM), **reference-executed** (specifications pass
|
|
276
338
|
the reference runner) and **target-executed** (Stage or a rendered application).
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
- `
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
The full disposition table
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
339
|
+
The independent verdicts V1 to V5 that report them are in
|
|
340
|
+
`cratis-screenplay-modeling-lifecycle`.
|
|
341
|
+
|
|
342
|
+
What binds depends on **which tool** you ask, so name the tool and its version:
|
|
343
|
+
|
|
344
|
+
- `Automation` and `Translate` slices, reactions, captures and triggers: the
|
|
345
|
+
standalone `screenplay` 4.64.0 binds them (ESM v6). The `cratis` 3.27.1 bundle
|
|
346
|
+
(Screenplay 4.60.1) reports *Slice '<name>' of type '<type>'
|
|
347
|
+
is not admitted by ESM v1.* Stage 4.24.0 admits only ESM v1 to v3 and renders none of them.
|
|
348
|
+
- `reads` and `concurrency` on a command do not bind (`PLAY0271`), so no decision is
|
|
349
|
+
protected against stale state. A reaction trigger's `reads` that only `invokes` is
|
|
350
|
+
report-only intent (`PLAY0270`); one that `produces` directly fails binding (`PLAY0268`).
|
|
351
|
+
- `persona` declarations are report-only and never block; `@pii` and `@sensitive`
|
|
352
|
+
concepts do block binding (`PLAY0268`). Keep them anyway: the classification is
|
|
353
|
+
part of the model. Report the block.
|
|
354
|
+
- Generated values and responses, operations and systems, and event sources and
|
|
355
|
+
streams are authorable but non-executable (`PLAY0268`); a command `handler` never binds.
|
|
356
|
+
|
|
357
|
+
The ESM versions, the full disposition table and the Step 7 clock example's binding
|
|
358
|
+
result are in [references/parsed-not-runnable.md](references/parsed-not-runnable.md)
|
|
359
|
+
and `cratis-screenplay-toolchain` (`references/executable-subset.md`). Model the wider
|
|
360
|
+
language freely when the `.play` file **is** the deliverable - documentation,
|
|
361
|
+
review, a shared description of a system. Never read a clean `screenplay` run as
|
|
362
|
+
evidence a construct works downstream.
|
|
299
363
|
|
|
300
364
|
Decision 0006 shipped in Screenplay 4.31.0: a reaction trigger can declare the
|
|
301
365
|
views it decides from with `reads` (see `cratis-screenplay-captures-and-reactions`),
|
|
302
366
|
but nothing enforces them yet. Event generations and typed repairs now ship;
|
|
303
367
|
generations do not supply deployed migrations. Do not treat every accepted
|
|
304
|
-
decision as implemented:
|
|
305
|
-
external origin and richer query delivery remain unavailable. Decision 0023's
|
|
306
|
-
responses, operations, streams and derived/provided values are planned, not
|
|
307
|
-
available yet; do not turn their examples into usable syntax.
|
|
368
|
+
decision as implemented: check the construct's own page and the versions table.
|
|
308
369
|
|
|
309
370
|
## Route near misses
|
|
310
371
|
|
|
372
|
+
The lifecycle, toolchain and phase skills are in "Start here" above. Construct and neighbouring skills:
|
|
373
|
+
|
|
311
374
|
| Need | Skill |
|
|
312
375
|
| --- | --- |
|
|
313
376
|
| Commands, validation, authorization, `produces`, concurrency, `$context` | `cratis-screenplay-command-surface` |
|
|
314
|
-
| Projections
|
|
377
|
+
| Projections - PDL keys, joins, children, removal, arithmetic | `cratis-screenplay-projections` |
|
|
315
378
|
| Read models, queries, screens | `cratis-screenplay-read-surface` |
|
|
316
379
|
| Layouts, templates, forms, contributions, themes, i18n | `cratis-screenplay-ui-composition` |
|
|
317
380
|
| Captures (CDL), reactions, triggers | `cratis-screenplay-captures-and-reactions` |
|
package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Complete invoicing example (parent of the Step 5 and Step 6 excerpts)
|
|
2
|
+
|
|
3
|
+
One compiling document, in design mode (the `ListInvoices` list query blocks V3; the document
|
|
4
|
+
declares no specification, so nothing is lost for running), holding the `RegisterInvoice` slice
|
|
5
|
+
(Step 5) and the `InvoiceList` slice (Step 6) with the concepts, policy and events they rely on. The excerpts in
|
|
6
|
+
[nine-steps.md](nine-steps.md) are these slices, verbatim.
|
|
7
|
+
|
|
8
|
+
```screenplay
|
|
9
|
+
domain Acme.Invoicing
|
|
10
|
+
|
|
11
|
+
concept InvoiceId : Uuid
|
|
12
|
+
concept InvoiceNumber : String
|
|
13
|
+
concept InvoiceStatus : String
|
|
14
|
+
|
|
15
|
+
policy CanManageInvoice
|
|
16
|
+
require role "Accountant"
|
|
17
|
+
|
|
18
|
+
module Invoicing
|
|
19
|
+
feature InvoiceManagement
|
|
20
|
+
description "Registering and managing the lifecycle of invoices"
|
|
21
|
+
|
|
22
|
+
slice StateChange RegisterInvoice
|
|
23
|
+
command RegisterInvoice
|
|
24
|
+
invoiceId InvoiceId identifier
|
|
25
|
+
invoiceNumber InvoiceNumber
|
|
26
|
+
authorize CanManageInvoice
|
|
27
|
+
validate
|
|
28
|
+
invoiceNumber not empty message "Invoice number is required"
|
|
29
|
+
produces InvoiceRegistered
|
|
30
|
+
for invoiceId
|
|
31
|
+
invoiceNumber = invoiceNumber
|
|
32
|
+
registeredAt = $context.occurred
|
|
33
|
+
event InvoiceRegistered
|
|
34
|
+
invoiceNumber InvoiceNumber
|
|
35
|
+
registeredAt DateTime
|
|
36
|
+
event InvoiceSent
|
|
37
|
+
|
|
38
|
+
slice StateView InvoiceList
|
|
39
|
+
readmodel InvoiceListReadModel
|
|
40
|
+
invoiceId InvoiceId
|
|
41
|
+
invoiceNumber InvoiceNumber
|
|
42
|
+
status InvoiceStatus
|
|
43
|
+
projection InvoiceList => InvoiceListReadModel
|
|
44
|
+
from InvoiceRegistered
|
|
45
|
+
invoiceId = $eventSourceId
|
|
46
|
+
status = "draft"
|
|
47
|
+
from InvoiceSent
|
|
48
|
+
invoiceId = $eventSourceId
|
|
49
|
+
status = "sent"
|
|
50
|
+
query ListInvoices => InvoiceListReadModel[]
|
|
51
|
+
```
|