@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contract, precedence and conflicting evidence
|
|
2
|
+
|
|
3
|
+
## Which contract
|
|
4
|
+
First the opt-in decision (master: `cratis-screenplay-modeling-lifecycle`, "Decide the level
|
|
5
|
+
first"; `SKILL.md` step 1 suffices when it is not installed): an accepted model under the model
|
|
6
|
+
root covers the slice (accepted means the `.play` file is in the committed tree:
|
|
7
|
+
`git ls-tree -r --name-only HEAD -- <root>` lists it), or the root holds a committed `.play`
|
|
8
|
+
file or was explicitly set in `.cratis/ai.json` (even if empty). Staged or untracked files under
|
|
9
|
+
the root are drafts. A committed file with uncommitted working-tree edits is a model change
|
|
10
|
+
in progress; its HEAD version is the contract until the change is committed. An empty directory, install
|
|
11
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count. Otherwise stay code-first.
|
|
12
|
+
|
|
13
|
+
| Situation | Contract | Code's role |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| The slice is in a `.play` model | the `.play` slice and its specifications | derived; the model stays the oracle for hand-written or gap-filled code |
|
|
16
|
+
| Opted in, scope unmodeled | discovery and slice design first; then the `.play` slice | none until modeled |
|
|
17
|
+
| An accepted model under the model root exists (the repository is opted in) but lacks this behaviour; a `.play` file outside the root is ignored here | propose adding it to the model first; code first only if the user chooses, or `.play` cannot express it; then say the model lags the code | provisional |
|
|
18
|
+
| No model, not opted in (or declined) | the agreed outline (Module/Feature, slice type, fields, events, rules, scenarios), recorded where the team tracks work, if anywhere | derived |
|
|
19
|
+
|
|
20
|
+
Hand-written code is right for scope the renderer rejects, adapters and infrastructure.
|
|
21
|
+
Never hand-edit Stage-managed output (`cratis-stage-rendering-and-sandbox`); change the `.play`
|
|
22
|
+
or the unmanaged extension code.
|
|
23
|
+
|
|
24
|
+
## Precedence (highest first)
|
|
25
|
+
1. Executable parts: specifications, mappings, constraints, authorization, rules.
|
|
26
|
+
2. The slice `description` and realization notes: they explain intent and never license a
|
|
27
|
+
contradiction or an undocumented default.
|
|
28
|
+
3. Issue or ticket text.
|
|
29
|
+
4. Existing code: no authority.
|
|
30
|
+
|
|
31
|
+
## Conflicting evidence: stop, record, ask
|
|
32
|
+
Triggers: prose contradicts a mapping or spec; two specifications disagree; a spec contradicts
|
|
33
|
+
its own description; a requirement is ambiguous or missing a decision.
|
|
34
|
+
1. Read the contract and the slice-type skills fully first; most slices raise no question.
|
|
35
|
+
2. Do not guess and do not build the contested part anyway.
|
|
36
|
+
3. Stop that scope with `Status: blocked`. Write both readings with their addresses.
|
|
37
|
+
4. For a `.play` contract return an **edit request**: address, change, reason. For an outline,
|
|
38
|
+
ask one specific question.
|
|
39
|
+
5. Finish unaffected scope only if it stands on its own; otherwise report `partial`.
|
|
40
|
+
|
|
41
|
+
An edit request that touches a persisted name is identity-affecting; route it to the identity
|
|
42
|
+
owner (`cratis-screenplay-modeling-lifecycle`, `references/identity-and-edits.md`).
|
|
43
|
+
|
|
44
|
+
## Template versus repository
|
|
45
|
+
The repository's established pattern wins over a skill's generic template. Record each
|
|
46
|
+
mismatch as a reusable learning for the parent; do not edit shared notes yourself.
|
|
47
|
+
Reusable learnings are conventions, gotchas, cross-file couplings and test setup that apply
|
|
48
|
+
beyond this slice (0 to 3 bullets). Not slice details, debugging notes or anything already
|
|
49
|
+
documented in the repository.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
## Moved and rewritten (Cratis)
|
|
4
|
+
- The fallback-conformance checklist of the model render workflow: contract reconciliation,
|
|
5
|
+
State Change, State View, Chronicle runtime guarantees, evidence. Now `references/checklists.md`;
|
|
6
|
+
the render workflow links here and keeps no second copy. References renamed to the corpus skills.
|
|
7
|
+
|
|
8
|
+
## Ideas only (written independently)
|
|
9
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.claude/skills/build-state-change/SKILL.md`,
|
|
10
|
+
`build-state-view/SKILL.md`, `build-automation/SKILL.md`, written independently: a final
|
|
11
|
+
verification list per slice type with "nothing invented, nothing missing"
|
|
12
|
+
(`SKILL.md` steps 2-3, `references/checklists.md`).
|
|
13
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.build-kit/lib/backend-prompt.md`,
|
|
14
|
+
written independently: the slice description is the truth and code follows; one executable
|
|
15
|
+
specification per modeled specification; a re-delivery can be only added specifications;
|
|
16
|
+
escalate ambiguity instead of guessing, after reading the contract fully
|
|
17
|
+
(`SKILL.md` steps 4-6, `references/contract-and-precedence.md`).
|
|
18
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.build-kit/CLAUDE.md`, written independently:
|
|
19
|
+
do not change files with tests unless instructed; the repository pattern wins over a
|
|
20
|
+
template; reusable learnings with a do-not-add filter. Precedence differs on purpose:
|
|
21
|
+
executable parts beat prose here.
|
|
22
|
+
|
|
23
|
+
No TrogonStack/agentskills text is used in this skill.
|
package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Worked example: re-delivering a marina berth slice
|
|
2
|
+
|
|
3
|
+
The contract is this model (complete document). It compiles in design mode: the `ListBerths` list
|
|
4
|
+
query blocks binding (V3, `PLAY0268`: a query must declare one caller-supplied `by` argument), so no
|
|
5
|
+
specification runs against it here, and the list stays because the domain asks for a list. After delivery one, the model changes: the
|
|
6
|
+
harbourmaster wants to retire berths, and the list must stop showing them.
|
|
7
|
+
|
|
8
|
+
```screenplay
|
|
9
|
+
concept BerthId : Uuid
|
|
10
|
+
concept BerthName : String
|
|
11
|
+
concept BoatLength : Int
|
|
12
|
+
policy IsHarbourmaster
|
|
13
|
+
require role "Harbourmaster"
|
|
14
|
+
|
|
15
|
+
module Moorings
|
|
16
|
+
feature Berths
|
|
17
|
+
slice StateChange RegisterBerth
|
|
18
|
+
description "A harbourmaster adds a berth to the marina."
|
|
19
|
+
command RegisterBerth
|
|
20
|
+
berthId BerthId identifier
|
|
21
|
+
name BerthName
|
|
22
|
+
maxLength BoatLength
|
|
23
|
+
authorize IsHarbourmaster
|
|
24
|
+
produces event BerthRegistered
|
|
25
|
+
for berthId
|
|
26
|
+
name BerthName = name
|
|
27
|
+
maxLength BoatLength = maxLength
|
|
28
|
+
specification RegisteringABerth
|
|
29
|
+
given caller
|
|
30
|
+
authenticated
|
|
31
|
+
role "Harbourmaster"
|
|
32
|
+
when RegisterBerth
|
|
33
|
+
berthId = "9c858901-8a57-4791-81fe-4c455b099bc9"
|
|
34
|
+
name = "A-12"
|
|
35
|
+
maxLength = 9
|
|
36
|
+
then BerthRegistered
|
|
37
|
+
for "9c858901-8a57-4791-81fe-4c455b099bc9"
|
|
38
|
+
name = "A-12"
|
|
39
|
+
maxLength = 9
|
|
40
|
+
|
|
41
|
+
slice StateView BerthList
|
|
42
|
+
readmodel BerthSummary
|
|
43
|
+
berthId BerthId
|
|
44
|
+
name BerthName
|
|
45
|
+
maxLength BoatLength
|
|
46
|
+
projection BerthList => BerthSummary
|
|
47
|
+
from BerthRegistered
|
|
48
|
+
berthId = $eventSourceId
|
|
49
|
+
query ListBerths => BerthSummary[]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Delivery one: inventory and reconciliation
|
|
53
|
+
```text
|
|
54
|
+
RegisterBerth command berthId, name, maxLength code: berthId, name, maxLength, Notes -> Notes INVENTED
|
|
55
|
+
event BerthRegistered name, maxLength code: name, maxLength ok
|
|
56
|
+
auth IsHarbourmaster code: authorized ok
|
|
57
|
+
spec RegisteringABerth spec class: when_registering/and_berth_is_new ok
|
|
58
|
+
BerthList property berthId, name, maxLength code: berthId, name, maxLength ok
|
|
59
|
+
events BerthRegistered code: BerthRegistered ok
|
|
60
|
+
query list of BerthSummary code: keyed lookup by id -> cardinality WRONG
|
|
61
|
+
```
|
|
62
|
+
Action: remove `Notes` (propose it for the model if the business needs it); restore the list
|
|
63
|
+
query. Status after the fix: `done`.
|
|
64
|
+
|
|
65
|
+
## Delivery two: delta after the model change
|
|
66
|
+
The model gains a `RetireBerth` command with event `BerthRetired`, a projection that removes
|
|
67
|
+
the berth on that event, and a specification (not shown; the model syntax is in
|
|
68
|
+
`cratis-screenplay-model-authoring`). The work list is only what changed:
|
|
69
|
+
```text
|
|
70
|
+
NEW command RetireBerth (berthId, authorize IsHarbourmaster) -> add command
|
|
71
|
+
NEW event BerthRetired -> add event
|
|
72
|
+
NEW spec RetiringABerth -> add spec class, named after it
|
|
73
|
+
CHANGE BerthList subscribes to BerthRetired; berth leaves list -> add subscription, removal spec
|
|
74
|
+
```
|
|
75
|
+
Then steps 3 and 4 run over the whole slice again; the existing spec `RegisteringABerth` is
|
|
76
|
+
unchanged. One old spec fails because the new removal rule is not yet implemented: the code is
|
|
77
|
+
fixed, the spec is not edited.
|
|
78
|
+
|
|
79
|
+
## The report
|
|
80
|
+
```text
|
|
81
|
+
Contract: .play slice Moorings/Berths (RegisterBerth, RetireBerth, BerthList)
|
|
82
|
+
Specification map: RegisteringABerth -> when_registering/and_berth_is_new (pass)
|
|
83
|
+
RetiringABerth -> when_retiring/and_berth_exists (pass)
|
|
84
|
+
Invented removed: RegisterBerth.Notes
|
|
85
|
+
Edit request: none
|
|
86
|
+
Status: done
|
|
87
|
+
Learnings: slice folders here keep specs beside the slice file
|
|
88
|
+
```
|
|
89
|
+
If the harbourmaster's note had said "retired berths stay visible in the list" while the
|
|
90
|
+
model's specification removed them, the report would instead end `Status: blocked` with the
|
|
91
|
+
two readings and an edit request against the `BerthList` slice description.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "cratis-application-slice-conformance",
|
|
3
|
+
"input": "The marina berth model changed: RegisterBerth now rejects lengths over 25 metres and a new BerthRetired event removes a berth from the list. Re-deliver the slice code against the updated .play slice and tell me whether it is done.",
|
|
4
|
+
"fixtures": [],
|
|
5
|
+
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "Executable parts of the contract beat prose" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "Never edit, skip or delete a specification derived from the contract" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "Status: done | partial | blocked" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "Delta delivery" },
|
|
10
|
+
{ "kind": "skill-contains", "value": "nothing invented" },
|
|
11
|
+
{ "kind": "skill-contains", "value": "edit request" },
|
|
12
|
+
{ "kind": "skill-contains", "value": "Reconcile in both directions" }
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -44,6 +44,34 @@ repository before claiming support for another version.
|
|
|
44
44
|
`cratis-chronicle-read-model-specifications`.
|
|
45
45
|
- The question is what the slice *should do*: settle the behavior first. A
|
|
46
46
|
specification records a decision; it does not make one.
|
|
47
|
+
- The scope is model-first (the `specification` blocks of the `.play` slice are
|
|
48
|
+
the contract for this skill). Decide this with the decision rule in
|
|
49
|
+
`cratis-screenplay-modeling-lifecycle`: model-first only when an accepted
|
|
50
|
+
model under the model root covers this scope, or the repository is opted in
|
|
51
|
+
(the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set `mcpServers.screenplay.root`
|
|
52
|
+
in `.cratis/ai.json`); an empty directory, install output, a `.play` file
|
|
53
|
+
outside the root or an uncommitted draft does not count, and framework, infrastructure, client, adapter and not-opted-in
|
|
54
|
+
brownfield work stays code-first. Opted in but no model for this scope: model
|
|
55
|
+
it first (`cratis-screenplay-discovery`, then `cratis-screenplay-slice-design`)
|
|
56
|
+
before writing specifications. If those Screenplay skills are not installed,
|
|
57
|
+
say so and stop; never author `.play` from memory. Never edit Stage-managed
|
|
58
|
+
output, and never change a model specification to match existing code. Author or change model
|
|
59
|
+
specifications with `cratis-screenplay-specifications` and
|
|
60
|
+
`cratis-screenplay-scenario-coverage`; check finished code against the model
|
|
61
|
+
with `cratis-application-slice-conformance`.
|
|
62
|
+
|
|
63
|
+
## Step 0 — Take the list from the contract
|
|
64
|
+
|
|
65
|
+
When the slice has a contract — a `.play` slice with its `specification`
|
|
66
|
+
blocks, or an agreed outline — its specifications are the **minimum list**: each
|
|
67
|
+
one becomes a specification class here, named after it. Steps 3–7 then add what
|
|
68
|
+
the code reveals (each validator rule, each constraint). A rule found in the code
|
|
69
|
+
with no contract specification is a proposal for the contract (the `.play` model when one covers the slice, otherwise the agreed outline), not silent coverage:
|
|
70
|
+
list it in the report and, where a model exists, route it to
|
|
71
|
+
`cratis-screenplay-scenario-coverage`.
|
|
72
|
+
|
|
73
|
+
Without a contract (code-first scope), derive the list from Step 3 and say that
|
|
74
|
+
you did.
|
|
47
75
|
|
|
48
76
|
## Step 1 — Place the files
|
|
49
77
|
|
|
@@ -88,6 +116,17 @@ One specification class for **each** of:
|
|
|
88
116
|
4. **Each constraint violation** — one class per constraint, written with
|
|
89
117
|
`EventScenario`, because a constraint is enforced at the append and not by
|
|
90
118
|
the command.
|
|
119
|
+
5. **Repeat execution**, when a reactor invokes the command: the same command
|
|
120
|
+
twice for the same source. Specify whether the second is rejected, a no-op, or
|
|
121
|
+
appends again — recovery can re-deliver an event, so the answer must be a
|
|
122
|
+
decision, not an accident.
|
|
123
|
+
|
|
124
|
+
**Use the contract's example values.** When the contract gives concrete values
|
|
125
|
+
(the `when` and `then` values of a `.play` specification), use them, so the code
|
|
126
|
+
specification and the contract describe the same example. Where isolation needs
|
|
127
|
+
it, substitute a fresh identifier or uniqueness value (see *What breaks*) and keep
|
|
128
|
+
the example's relationships and behavior. Invent values only where the contract
|
|
129
|
+
is silent.
|
|
91
130
|
|
|
92
131
|
## Step 4 — `CommandScenario<TCommand>`
|
|
93
132
|
|
|
@@ -155,7 +194,16 @@ the concrete validator itself is discovered automatically.
|
|
|
155
194
|
|
|
156
195
|
`ShouldNotBeSuccessful()` alone cannot distinguish a validation rejection from an
|
|
157
196
|
unhandled exception, so both facts are required. **Never assert on a message
|
|
158
|
-
string** — it is presentation text.
|
|
197
|
+
string** — it is presentation text. A `.play` specification may pin the message
|
|
198
|
+
(`then error "<message>"`); the C# specification for the same rejection pins the
|
|
199
|
+
*kind* instead, and the two together cover the rule.
|
|
200
|
+
|
|
201
|
+
**Isolate the rule.** Each rejection specification violates **only** the rule it
|
|
202
|
+
is named after: build the command valid in every other respect. Otherwise
|
|
203
|
+
`ShouldHaveValidationErrors()` passes when a neighbouring rule fires. Use
|
|
204
|
+
`ShouldHaveValidationErrorBecauseOf(reason)` where the reason distinguishes the
|
|
205
|
+
rule, and always run the "remove the rule, see it go red" check under *How it is
|
|
206
|
+
proven*.
|
|
159
207
|
|
|
160
208
|
`CommandResult` assertions, from `Cratis.Arc.Testing.Commands`, throwing
|
|
161
209
|
`CommandResultAssertionException`:
|
|
@@ -202,6 +250,11 @@ and the `IChronicleSetupFixture` extension in `Cratis.Chronicle.XUnit.Integratio
|
|
|
202
250
|
Sequence numbers are **zero-based**: the first event is `0`, and the tail after a
|
|
203
251
|
single append is `0`, never `1`.
|
|
204
252
|
|
|
253
|
+
## Lineage
|
|
254
|
+
|
|
255
|
+
Step 0, repeat execution and rule isolation are adapted in our own words from
|
|
256
|
+
ideas recorded in `references/provenance.md`.
|
|
257
|
+
|
|
205
258
|
## What breaks
|
|
206
259
|
|
|
207
260
|
- **A specification passes alone and fails in the suite.** A hard-coded value
|
|
@@ -215,6 +268,9 @@ single append is `0`, never `1`.
|
|
|
215
268
|
was never seeded, so the handler saw a default or `null` instance and rejected
|
|
216
269
|
on that instead of on the rule. Seed, then confirm the specification fails when
|
|
217
270
|
the seeding is removed.
|
|
271
|
+
- **A rejection specification stays green when its rule is deleted.** The
|
|
272
|
+
command was invalid in a second way, so another rule produced the error. Make
|
|
273
|
+
the command valid except for the one rule, then repeat the red check.
|
|
218
274
|
- **The command scenario reports success but nothing was appended.** The
|
|
219
275
|
assertion is on `CommandResult` only; add a
|
|
220
276
|
`ShouldHaveAppendedEvent<TCommand, TEvent>` fact.
|
package/package/corpus/skills/cratis-application-slice-specifications/references/provenance.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Provenance
|
|
2
|
+
|
|
3
|
+
Lineage of the #493 additions to `cratis-application-slice-specifications`. No third-party
|
|
4
|
+
text is reproduced and no TrogonStack material was adapted, so no third-party notice applies.
|
|
5
|
+
|
|
6
|
+
## Ideas written independently
|
|
7
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.claude/skills/build-automation/SKILL.md`
|
|
8
|
+
(checklist question "what happens if the command fires twice"), written independently:
|
|
9
|
+
Step 3 item 5, repeat execution.
|
|
10
|
+
- Idea from Nebulit-GmbH/agentic-engineer@07b0f30:`.claude/skills/build-automation/SKILL.md`
|
|
11
|
+
and its slice-specification examples (one error specification per rule), written
|
|
12
|
+
independently: Step 6 rule isolation.
|
|
13
|
+
- Contract-first specification list (Step 0) and contract example values: written
|
|
14
|
+
independently from the Cratis Screenplay model-first method; the idea of building from a
|
|
15
|
+
slice definition is from Nebulit-GmbH/agentic-engineer@07b0f30:`.claude/skills/build-automation/SKILL.md`,
|
|
16
|
+
written independently.
|
|
@@ -290,6 +290,16 @@ Components guidance, not to this skill.
|
|
|
290
290
|
- Append-time uniqueness or concurrency constraints: the Chronicle event
|
|
291
291
|
constraints guidance.
|
|
292
292
|
- Choosing the concept or identity type for a value: `cratis-fundamentals-concept`.
|
|
293
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
294
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
295
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
296
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
297
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
298
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
299
|
+
say so and do not author `.play` from memory.
|
|
300
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
301
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
302
|
+
never edit Stage-managed output.
|
|
293
303
|
|
|
294
304
|
## Verify
|
|
295
305
|
|
|
@@ -214,3 +214,13 @@ mis-marking it to silence the warning.
|
|
|
214
214
|
`cratis-arc-command-operation`.
|
|
215
215
|
- Adding or changing a rule: the Arc command validation guidance.
|
|
216
216
|
- Designing what a reactor should observe: the Chronicle reactor guidance.
|
|
217
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
218
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
219
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
220
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
221
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
222
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
223
|
+
say so and do not author `.play` from memory.
|
|
224
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
225
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
226
|
+
never edit Stage-managed output.
|
|
@@ -44,6 +44,16 @@ another version.
|
|
|
44
44
|
validator. Use `cratis-arc-authentication-authorization-and-identity`.
|
|
45
45
|
- Writing the specification for the rejection: use
|
|
46
46
|
`cratis-application-slice-specifications`.
|
|
47
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
48
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
49
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
50
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
51
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
52
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
53
|
+
say so and do not author `.play` from memory.
|
|
54
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
55
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
56
|
+
never edit Stage-managed output.
|
|
47
57
|
|
|
48
58
|
## Step 1 — Choose the mechanism by what the decision *is*
|
|
49
59
|
|
|
@@ -162,3 +162,13 @@ apply. Do not construct or suggest credentials.
|
|
|
162
162
|
- Operating or recovering a Chronicle store: the Chronicle CLI guidance.
|
|
163
163
|
- Diagnosing a whole slice rather than one endpoint: the slice diagnostics
|
|
164
164
|
guidance.
|
|
165
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
166
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
167
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
168
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
169
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
170
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
171
|
+
say so and do not author `.play` from memory.
|
|
172
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
173
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
174
|
+
never edit Stage-managed output.
|
|
@@ -181,3 +181,13 @@ pinning, keep it in a method a specification can supply arguments to.
|
|
|
181
181
|
- Creating the read model or its projection: the Chronicle read-model guidance.
|
|
182
182
|
- Inspecting an observable query over HTTP: `cratis-arc-observable-query-http`.
|
|
183
183
|
- Whole-slice performance work: the performance review guidance.
|
|
184
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
185
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
186
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
187
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
188
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
189
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
190
|
+
say so and do not author `.play` from memory.
|
|
191
|
+
Edit code here only for infrastructure, clients, adapters, Screenplay code
|
|
192
|
+
attachments, or gap-fill scope (`cratis-screenplay-render-and-gap-fill`);
|
|
193
|
+
never edit Stage-managed output.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-arc-react-page
|
|
3
|
-
description: Build a React page in a Cratis Arc application with Cratis Components — DataPage lists, columns, toolbar menu items, command dialogs, confirmation and busy-indicator dialogs, row selection, details panes, snapshot and observable queries, paging, and MVVM view models. Use when building or changing a page that lists or displays data, wiring Add/Edit/Delete actions, connecting a component to a generated Arc query or command proxy,
|
|
3
|
+
description: "Build a React page in a Cratis Arc application with Cratis Components — DataPage lists, columns, toolbar menu items, command dialogs, confirmation and busy-indicator dialogs, row selection, details panes, snapshot and observable queries, paging, and MVVM view models. Use when building or changing a page that lists or displays data, wiring Add/Edit/Delete actions, connecting a component to a generated Arc query or command proxy, asking the user to confirm something, or implementing a `.play` screen or form as a page. Not for: a multi-step wizard dialog alone (use `cratis-components-stepper-command-dialog`), a canvas tool palette (use `cratis-components-toolbar`), theming (use `cratis-components-styling`), backend commands and read models (use `cratis-arc-command`, `cratis-chronicle-read-model`), or editing the `.play` model itself (use `cratis-screenplay-event-modeling`)."
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -61,7 +61,31 @@ import { DialogProps, DialogResult, useDialog } from '@cratis/arc.react/dialogs'
|
|
|
61
61
|
|
|
62
62
|
See the **cratis-components-styling** skill for the full theming contract.
|
|
63
63
|
|
|
64
|
-
## Step 2 —
|
|
64
|
+
## Step 2 — Trace every field to its origin
|
|
65
|
+
|
|
66
|
+
Before writing JSX, list every value the page shows or captures, and where it
|
|
67
|
+
comes from. A value with no origin gets faked on the client or invented as a
|
|
68
|
+
proxy property, so find the gap before the page exists.
|
|
69
|
+
|
|
70
|
+
| Origin | Written as | Bound through |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| Query result | `<Query>.<property>` | `DataPage` `query`, `Column field`, `detailsComponent` |
|
|
73
|
+
| Command input | `<Command>.<property>` | a `CommandForm` field `value` accessor |
|
|
74
|
+
| Route parameter | `route:<name>` | the view model's route parameters (Step 9) |
|
|
75
|
+
| Display-only calculation | `derived:<expression>` | a view-model getter, with a spec |
|
|
76
|
+
|
|
77
|
+
- The caller's identity is never a command input. Take it on the server, not
|
|
78
|
+
from a form field.
|
|
79
|
+
- A value with no origin is a gap in the backend or the model, not in the page.
|
|
80
|
+
Do not compute it from other queries on the client and do not add a property to
|
|
81
|
+
a generated proxy. Stop building that part of the page and add the property to
|
|
82
|
+
the read model or command first (`cratis-arc-command`,
|
|
83
|
+
`cratis-chronicle-read-model`) or, where one exists, to the `.play` model.
|
|
84
|
+
- A component that shows one part of a page lists only that part's fields.
|
|
85
|
+
- When the page implements a `.play` screen or form, the model is the source of
|
|
86
|
+
the list: follow [from-screenplay.md](references/from-screenplay.md).
|
|
87
|
+
|
|
88
|
+
## Step 3 — The DataPage shell
|
|
65
89
|
|
|
66
90
|
`DataPage` owns the query subscription, paging, selection, action menubar, and
|
|
67
91
|
the optional details split. Do not pre-fetch rows and pass an array.
|
|
@@ -92,7 +116,7 @@ See [data-page.md](references/data-page.md) for every prop, and
|
|
|
92
116
|
[data-tables.md](references/data-tables.md) when you need a table without the
|
|
93
117
|
page chrome.
|
|
94
118
|
|
|
95
|
-
## Step
|
|
119
|
+
## Step 4 — Toolbar actions
|
|
96
120
|
|
|
97
121
|
Menu items go in `<DataPage.MenuItems>`. `MenuItem` takes `command`, not
|
|
98
122
|
`onClick`, and its `icon` is a **React component type**, not an icon class
|
|
@@ -121,7 +145,7 @@ const [CreateAccountWrapper, showCreateAccount] = useDialog(CreateAccountDialog)
|
|
|
121
145
|
Render the wrapper returned by `useDialog` once in the tree. See
|
|
122
146
|
[dialogs.md](references/dialogs.md) for the full dialog contract.
|
|
123
147
|
|
|
124
|
-
## Step
|
|
148
|
+
## Step 5 — Command dialogs
|
|
125
149
|
|
|
126
150
|
A dialog that runs a command is its own component built on `CommandDialog`.
|
|
127
151
|
Bind each input with a `CommandForm` field whose `value` accessor selects the
|
|
@@ -154,7 +178,7 @@ command dialog for a command value — it is not bound to the command, so
|
|
|
154
178
|
validation never re-runs and the submit button stays disabled. Seed values that must be present for validity with
|
|
155
179
|
`initialValues`, not `onBeforeExecute`.
|
|
156
180
|
|
|
157
|
-
## Step
|
|
181
|
+
## Step 6 — Confirming, and showing that work is in progress
|
|
158
182
|
|
|
159
183
|
Do not build a confirmation or busy dialog into a page. `ConfirmationDialog` and
|
|
160
184
|
`BusyIndicatorDialog` are registered once at the app root through
|
|
@@ -189,7 +213,7 @@ showBusy();
|
|
|
189
213
|
try { await importEverything(); } finally { closeBusy(); }
|
|
190
214
|
```
|
|
191
215
|
|
|
192
|
-
## Step
|
|
216
|
+
## Step 7 — Row selection and a details pane
|
|
193
217
|
|
|
194
218
|
`selection` and `onSelectionChange` are controlled. The change event carries
|
|
195
219
|
`value`, which is `null` when the selection is cleared.
|
|
@@ -216,7 +240,7 @@ const [selected, setSelected] = useState<AccountSummary | null>(null);
|
|
|
216
240
|
`detailsComponent` receives `IDetailsComponentProps<T>` — `{ item, onRefresh? }`
|
|
217
241
|
— and renders beside the table for the selected row.
|
|
218
242
|
|
|
219
|
-
## Step
|
|
243
|
+
## Step 8 — Snapshot or observable query
|
|
220
244
|
|
|
221
245
|
The **same `query` prop** takes a snapshot query or an observable query. There
|
|
222
246
|
is no separate `observableQuery` prop: `DataPage` inspects the query prototype
|
|
@@ -228,7 +252,7 @@ Read [queries-and-commands.md](references/queries-and-commands.md) for the
|
|
|
228
252
|
generated proxy hooks, their exact return tuples, paging, and how to read a
|
|
229
253
|
command result.
|
|
230
254
|
|
|
231
|
-
## Step
|
|
255
|
+
## Step 9 — MVVM for pages with real logic
|
|
232
256
|
|
|
233
257
|
Extract a view model as soon as the component has three or more `useState`
|
|
234
258
|
calls, a state-synchronizing `useEffect`, or derived values. Keep the component
|
|
@@ -273,6 +297,7 @@ props handling, and teardown.
|
|
|
273
297
|
| Multi-step wizard dialog | the **cratis-components-stepper-command-dialog** skill |
|
|
274
298
|
| Canvas tool palette | the **cratis-components-toolbar** skill |
|
|
275
299
|
| Complex page state | `withViewModel` |
|
|
300
|
+
| A `.play` `screen` or `form` is the spec | [from-screenplay.md](references/from-screenplay.md) |
|
|
276
301
|
|
|
277
302
|
## Verify
|
|
278
303
|
|
|
@@ -290,5 +315,40 @@ props handling, and teardown.
|
|
|
290
315
|
- Confirmations and busy indicators are raised by hook, registered once at the
|
|
291
316
|
app root.
|
|
292
317
|
- Every `showBusy()` has a matching close in a `finally`.
|
|
318
|
+
- Every displayed or captured value has an origin from the Step 2 table; none
|
|
319
|
+
is computed from another query on the client.
|
|
320
|
+
- Each page's states are designed: empty (`emptyMessage`), loading, a command
|
|
321
|
+
that fails (read through the granular `CommandResult` flags in
|
|
322
|
+
[queries-and-commands.md](references/queries-and-commands.md)), denied (a
|
|
323
|
+
persona that can reach the page but whose policy refuses the action), and the
|
|
324
|
+
state after success.
|
|
325
|
+
- When a `.play` model describes the page, the page matches it element by
|
|
326
|
+
element and adds no data or action the model lacks
|
|
327
|
+
([from-screenplay.md](references/from-screenplay.md)).
|
|
293
328
|
- No generated proxy file was edited.
|
|
294
329
|
- Lint, the frontend test gate, and the TypeScript build all pass.
|
|
330
|
+
|
|
331
|
+
## Route near misses
|
|
332
|
+
|
|
333
|
+
- A multi-step wizard dialog: `cratis-components-stepper-command-dialog`.
|
|
334
|
+
- A canvas tool palette: `cratis-components-toolbar`.
|
|
335
|
+
- Colors, tokens and theming: `cratis-components-styling`.
|
|
336
|
+
- The backend command or read model behind the page: `cratis-arc-command`,
|
|
337
|
+
`cratis-chronicle-read-model`.
|
|
338
|
+
- Specifying page behavior with specs: `cratis-application-react-specifications`.
|
|
339
|
+
- An accepted `.play` model under the model root covers the behavior, or the
|
|
340
|
+
repository is opted in (the root holds a committed `.play` file (`git ls-tree -r --name-only HEAD -- <root>` lists it), or the project set
|
|
341
|
+
`mcpServers.screenplay.root` in `.cratis/ai.json`; an empty directory, install
|
|
342
|
+
output, an uncommitted `.play` draft or a `.play` file outside the root does not count; master definition:
|
|
343
|
+
`cratis-screenplay-modeling-lifecycle`): change the model first with
|
|
344
|
+
`cratis-screenplay-event-modeling`. If the Screenplay skills are not installed,
|
|
345
|
+
say so and do not author `.play` from memory.
|
|
346
|
+
Read the model's `screen` and `form` with
|
|
347
|
+
[from-screenplay.md](references/from-screenplay.md). Edit code here only for
|
|
348
|
+
infrastructure, clients, adapters, Screenplay code attachments, or gap-fill
|
|
349
|
+
scope (`cratis-screenplay-render-and-gap-fill`); never edit Stage-managed
|
|
350
|
+
output.
|
|
351
|
+
|
|
352
|
+
## Lineage
|
|
353
|
+
|
|
354
|
+
See [references/provenance.md](references/provenance.md).
|