@cratis/pi 8.0.1 → 8.1.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/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
- package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
- package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
- package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
- package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
- package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
- package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
- package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
- package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
- package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
- package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
- package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
- package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
- package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
- package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
- package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
- package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
- package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
- package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
- package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
- package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
- package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
- package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
- package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
- package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
- package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
- package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
- package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
- package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
- package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
- package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
- package/package/corpus/hooks/README.md +4 -7
- package/package/corpus/hooks/scripts/quality-gates.json +3 -5
- package/package/corpus/rules/ai-distribution.md +9 -102
- package/package/corpus/rules/authoring-skills.md +3 -5
- package/package/corpus/rules/browser.md +8 -49
- package/package/corpus/rules/code-health-policy.txt +4 -24
- package/package/corpus/rules/code-health.md +1 -1
- package/package/corpus/rules/code-quality.csharp.md +3 -84
- package/package/corpus/rules/code-quality.md +6 -51
- package/package/corpus/rules/code-quality.typescript.md +4 -81
- package/package/corpus/rules/codescene.md +5 -54
- package/package/corpus/rules/components.md +1 -1
- package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
- package/package/corpus/rules/csharp.md +7 -315
- package/package/corpus/rules/dialogs.md +1 -1
- package/package/corpus/rules/discoverability.md +3 -25
- package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
- package/package/corpus/rules/documentation.md +5 -104
- package/package/corpus/rules/editing-cratis-docs.md +5 -63
- package/package/corpus/rules/efcore.md +8 -55
- package/package/corpus/rules/efcore.specs.md +3 -33
- package/package/corpus/rules/elixir.md +6 -79
- package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
- package/package/corpus/rules/framework-dotnet.md +4 -6
- package/package/corpus/rules/framework.md +0 -2
- package/package/corpus/rules/frontend-quality.md +0 -1
- package/package/corpus/rules/frontend-testing.md +1 -1
- package/package/corpus/rules/general.md +2 -2
- package/package/corpus/rules/github-actions.md +7 -138
- package/package/corpus/rules/glossary.md +19 -19
- package/package/corpus/rules/go-engineering.md +1 -4
- package/package/corpus/rules/go.md +2 -7
- package/package/corpus/rules/guards-and-fuses.md +5 -6
- package/package/corpus/rules/java.md +7 -129
- package/package/corpus/rules/kotlin.md +8 -165
- package/package/corpus/rules/orleans.md +5 -98
- package/package/corpus/rules/profiles.md +9 -63
- package/package/corpus/rules/scripting.md +1 -1
- package/package/corpus/rules/specs.csharp.md +8 -148
- package/package/corpus/rules/specs.elixir.md +4 -37
- package/package/corpus/rules/specs.typescript.md +3 -1
- package/package/corpus/rules/storybook.md +7 -70
- package/package/corpus/rules/typescript.md +8 -98
- package/package/corpus/rules/writing-correct-examples.md +3 -47
- package/package/corpus/rules/writing-cratis-docs.md +3 -65
- package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
- package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
- package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
- package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
- package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
- package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
- package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
- package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
- package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
- package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
- package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
- package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
- package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
- package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
- package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
- package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
- package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
- package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
- package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
- package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
- package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
- package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
- package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
- package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
- package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
- package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
- package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
- package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
- package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
- package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
- package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
- package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
- package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
- package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
- package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
- package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
- package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
- package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
- package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
- package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
- package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
- package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
- package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
- package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
- package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
- package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
- package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
- package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
- package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
- package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
- package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
- package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
- package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
- package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
- package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
- package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
- package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
- package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
- package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
- package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
- package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
- package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
- package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
- package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
- package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
- package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
- package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
- package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
- package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
- package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
- package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
- package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
- package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
- package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
- package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
- package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
- package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
- package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
- package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
- package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
- package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
- package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
- package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
- package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
- package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
- package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
- package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
- package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
- package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
- package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
- package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
- package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
- package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
- package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
- package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
- package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
- package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
- package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
- package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
- package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
- package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
- package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
- package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
- package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +10 -0
- package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
- package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
- package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
- package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
- package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
- package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
- package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
- package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
- package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
- package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
- package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
- package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
- package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
- package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
- package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
- package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
- package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
- package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
- package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
- package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
- package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
- package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
- package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
- package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
- package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
- package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
- package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
- package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
- package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
- package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
- package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
- package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
- package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
- package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
- package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
- package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
- package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
- package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
- package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
- package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
- package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
- package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
- package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
- package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
- package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
- package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
- package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
- package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
- package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
- package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
- package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
- package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
- package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
- package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
- package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
- package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
- package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
- package/package.json +1 -1
- /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
|
@@ -7,105 +7,12 @@ profile: framework
|
|
|
7
7
|
---
|
|
8
8
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
9
9
|
|
|
10
|
-
# Orleans
|
|
10
|
+
# Orleans conventions
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
> If your project does not reference `Microsoft.Orleans` or any Orleans packages, **ignore this entire file**. These rules are irrelevant outside of Orleans contexts.
|
|
12
|
+
Apply only in Orleans projects. In Chronicle, keep grain interfaces and implementations in `Kernel/Core`; gRPC contracts belong in `Contracts`. Use default aliases for grain interfaces and methods. To support rolling upgrades within a major release, never move or rename a grain interface or class, or change or remove an existing interface method. Follow [Chronicle's grain compatibility guidance](https://github.com/Cratis/Chronicle/blob/main/Documentation/contributing/kernel/grain-interfaces.mdx) for additive changes. Preserve persisted identities when a rename is permitted.
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
For kernel state, register one keyed storage provider per concern in `StorageProviderExtensions.AddStorageProviders`. Use the `WellKnownGrainStorageProviders` constant in registration and `[PersistentState]`. Wrap providers with the existing resilience pipeline. Use kernel `IStorage`, not database-driver calls; the job providers belong to Choreography and use its `IJobsStorage` instead.
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
Configure clustering in the host, never the grain. Follow [Choreography's hosting guidance](https://github.com/Cratis/Choreography/blob/main/Documentation/hosting/index.md) when co-hosting a silo. Localhost clustering is the single-silo default; use `CratisChoreographyOptions.Local()` for in-memory storage as well. Use `ClusteringMode.MongoDB` for multi-silo membership, or `Enabled = false` in the hosting options for tests that must run without a silo.
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
- Clustering is chosen by the host, not the grain code: the server uses `UseLocalhostClustering(siloPort, gatewayPort, serviceId, clusterId)` for local development and the MongoDB storage integration switches on `UseMongoDBClustering` (`MongoDBMembershipStrategy.Multiple`) when clustering is enabled. A silo pointed at non-local shared storage while still on localhost clustering is logged as a **warning** at startup (each such node forms its own single-node cluster over the same data); `Cratis__Chronicle__Clustering__Type=MongoDB` on every node is what joins them.
|
|
21
|
-
- Do **not** add `[Alias]` to grain interfaces or grain methods — rely on the default alias Orleans generates. `[Alias(nameof(Type))]` is used only on `[GenerateSerializer]` **state and definition records** in `Kernel/Concepts` (`ReadModelDefinition`, `IndexDefinition`, `ReadModelChangeContext`, `ProjectionFuture`, `ClearPartitionQuarantineResult`), where a stable serialization alias must survive a rename.
|
|
22
|
-
|
|
23
|
-
## Grain storage providers
|
|
24
|
-
|
|
25
|
-
- Storage provider names are constants in `WellKnownGrainStorageProviders` (`Kernel/Core`), **one name per concern** — 23 of them in 19.50.0 (`Namespaces`, `EventSequences`, `ObserverDefinitions`, `ObserverState`, `FailedPartitions`, `Recommendations`, `Projections`, `ProjectionsManager`, `ProjectionFutures`, `Reactors`, `Reducers`, `ReducersManager`, `ReadModels`, `ReadModelsManager`, `ReadModelReplayManager`, `Constraints`, `EventStoreSubscriptionsManager`, `EventSeeding`, `Webhooks`, `WebhooksManager`, `DataProtectionKeys`, `PatchManager`, `System`). Reference a provider only through its constant — never a magic string, and there is no "default" provider.
|
|
26
|
-
- Each concern has its own `IGrainStorage` implementation (`EventSequencesStorageProvider`, `NamespacesStateStorageProvider`, …) taking the kernel's `IStorage` abstraction — **not** a MongoDB collection. The storage backend (MongoDB, SQL, in-memory) is selected behind `IStorage`, so a grain storage provider never references a database driver.
|
|
27
|
-
- Every provider is registered once, in `StorageProviderExtensions.AddStorageProviders(this ISiloBuilder)`, as a keyed singleton wrapped in `ResilientGrainStorage` (a Polly resilience pipeline configured from `Chronicle:ResilientStorage`). A new concern adds a constant, an `IGrainStorage` over `IStorage`, and one `AddKeyedSingleton(WellKnownGrainStorageProviders.<Name>, CreateResilientStorageFor<…>)` line there — nothing else.
|
|
28
|
-
- Grains declare their state with `[PersistentState(nameof(<StateType>), WellKnownGrainStorageProviders.<Name>)]`.
|
|
29
|
-
|
|
30
|
-
Registration excerpt inside Chronicle's `StorageProviderExtensions`; the provider
|
|
31
|
-
is `Cratis.Chronicle.EventSequences.EventSequencesStorageProvider(IStorage)`:
|
|
32
|
-
|
|
33
|
-
```csharp
|
|
34
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
35
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
36
|
-
|
|
37
|
-
services.AddKeyedSingleton(WellKnownGrainStorageProviders.EventSequences, CreateResilientStorageFor<Cratis.Chronicle.EventSequences.EventSequencesStorageProvider>);
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Jobs are the exception to the kernel's `IStorage` shape: `JobGrainStorageProvider`
|
|
41
|
-
and `JobStepGrainStorageProvider` live in `Cratis.Choreography.Jobs` and take
|
|
42
|
-
`Cratis.Choreography.Storage.IJobsStorage`. Chronicle registers them under
|
|
43
|
-
`Cratis.Choreography.WellKnownGrainStorageProviders.Jobs` and `.JobSteps`, still wrapped
|
|
44
|
-
in its resilient storage pipeline.
|
|
45
|
-
|
|
46
|
-
## Co-host a silo with Cratis.Choreography
|
|
47
|
-
|
|
48
|
-
For job/step authoring, stage barriers, recovery, storage scopes and state-machine
|
|
49
|
-
APIs, load **cratis-orleans-jobs** from `cratis/engineering/csharp`. These APIs are
|
|
50
|
-
framework/service guidance; they do not impose application slice architecture.
|
|
51
|
-
|
|
52
|
-
For service authors, `Cratis.Choreography` supplies hosting, grain serializers, and the
|
|
53
|
-
shared job system without requiring Chronicle. With `Cratis.Choreography` and
|
|
54
|
-
`Cratis.Choreography.Storage.MongoDB` 2.0.0 or newer, this host uses durable MongoDB membership
|
|
55
|
-
and jobs storage (a local MongoDB server is required):
|
|
56
|
-
|
|
57
|
-
```csharp
|
|
58
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
59
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
60
|
-
|
|
61
|
-
using Cratis.Choreography.Hosting;
|
|
62
|
-
using Cratis.Choreography.Setup;
|
|
63
|
-
using Microsoft.AspNetCore.Builder;
|
|
64
|
-
using MongoDB.Driver;
|
|
65
|
-
|
|
66
|
-
var builder = WebApplication.CreateBuilder(args);
|
|
67
|
-
var connectionString = builder.Configuration.GetConnectionString("Mongo")
|
|
68
|
-
?? throw new InvalidOperationException("Configure the Mongo connection string.");
|
|
69
|
-
builder.AddCratisChoreography(new CratisChoreographyOptions
|
|
70
|
-
{
|
|
71
|
-
ClusterId = "my-service",
|
|
72
|
-
ServiceId = "my-service",
|
|
73
|
-
Clustering = ClusteringMode.MongoDB,
|
|
74
|
-
DatabaseName = "my-service-orleans",
|
|
75
|
-
ConnectionString = connectionString
|
|
76
|
-
});
|
|
77
|
-
builder.Services.AddCratisChoreographyMongoDBJobsStorage(new MongoClient(connectionString));
|
|
78
|
-
|
|
79
|
-
var app = builder.Build();
|
|
80
|
-
app.Run();
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
- Register jobs storage separately: `AddCratisChoreographyMongoDBJobsStorage`,
|
|
84
|
-
`AddCratisChoreographySqlJobsStorage` (`Cratis.Choreography.Setup`), or
|
|
85
|
-
`AddCratisChoreographyInMemoryJobsStorage` (`Cratis.Choreography.Storage`).
|
|
86
|
-
- Use the local `IJobs` service to start/stop/delete typed jobs during rolling
|
|
87
|
-
upgrades; generic manager calls can land on a release that does not know the
|
|
88
|
-
type. Provide singleton `IJobsManagerKeys` on every silo for all host-owned
|
|
89
|
-
scope/namespace pairs; process-local discovery is not a recovery catalog.
|
|
90
|
-
- Controller and worker placement are separate opt-ins through `AddJobPlacement`
|
|
91
|
-
and `AddJobStepPlacement`. Enable them only after every silo supports the
|
|
92
|
-
strategies and register them identically. Worker throttling is not admission;
|
|
93
|
-
see **cratis-orleans-jobs** for drain-before-replacement and metadata limits.
|
|
94
|
-
- Give grain implementations a unique `[GrainType("unique-name")]`. Orleans'
|
|
95
|
-
default type name derives from the class name alone; a collision across
|
|
96
|
-
assemblies prevents silo startup.
|
|
97
|
-
- Silos configured by `AddCratisChoreography` deliberately use Orleans' in-memory
|
|
98
|
-
reminder service in both clustering modes; their reminders do not survive a
|
|
99
|
-
full restart. Jobs rehydrate from durable jobs storage and do not use
|
|
100
|
-
reminders. Do not point such a silo at the MongoDB reminder table merely
|
|
101
|
-
because clustering uses MongoDB: that provider is a 9.x binary, and on the
|
|
102
|
-
10.x runtime it made the reminder service stop responding in these hosts. Hosts that build their own silo choose separately; the
|
|
103
|
-
Chronicle kernel uses MongoDB reminders with MongoDB storage and in-memory
|
|
104
|
-
reminders with in-memory storage.
|
|
105
|
-
- `AddCratisChoreography` enables activity propagation itself. If a host keeps an
|
|
106
|
-
explicit `AddActivityPropagation()` call, it must be **before**, never after,
|
|
107
|
-
`AddCratisChoreography`, to avoid duplicate Orleans propagation filters/spans.
|
|
108
|
-
- Keep Orleans package versions aligned: the Release-build guard rejects a
|
|
109
|
-
`Microsoft.Orleans.Reminders`/`Microsoft.Orleans.Server` version mismatch.
|
|
110
|
-
- `Enabled = false` makes `AddCratisChoreography` a no-op for specification hosts;
|
|
111
|
-
it does not register the silo or its collaborators.
|
|
18
|
+
Use **cratis-orleans-jobs** for jobs. Configure durable jobs storage separately from clustering. `AddCratisChoreography` configures in-memory reminders even with durable clustering and enables activity propagation; do not add a second propagation registration. Keep Orleans package versions aligned.
|
|
@@ -7,71 +7,17 @@ paths:
|
|
|
7
7
|
|
|
8
8
|
# Profiles
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
In `.cratis/ai.json`, use the narrowest `profiles` and `languages` that cover the repository. Start with `cratis/application` for a product built on Cratis or `cratis/engineering` for a Cratis library or tool. Use `cratis ai profiles list --all` for other IDs. In `profile-catalog.json`, `availableTargets` lists a profile's skills; `composes` includes other profiles transitively. The selection is a union. A composed profile must match a configured language or be language-agnostic; direct selections and omitted `languages` bypass that filter.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
| Profile | Select it when |
|
|
15
|
-
|---|---|
|
|
16
|
-
| `cratis/application` | The repository builds an application on Cratis. |
|
|
17
|
-
| `cratis/engineering` | The repository is a Cratis library or tool. |
|
|
18
|
-
|
|
19
|
-
Plain and JSON profile listings show all profiles; none is featured. The mixed `cratis/v2/application` walkthrough is opt-in and does not by itself match the `application` rule alias. A repository records its selection in `.cratis/ai.json`:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"schemaVersion": "1.0.0",
|
|
24
|
-
"profiles": ["cratis/application/csharp", "cratis/engineering/csharp"],
|
|
25
|
-
"languages": ["csharp", "typescript"]
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Select the narrowest set that covers the work. Several profiles may be selected together; the installed skills are the union.
|
|
30
|
-
|
|
31
|
-
## Additional profiles
|
|
32
|
-
|
|
33
|
-
Select these by ID when needed, or get them through a composing profile. For example, the broad `cratis` profile composes documentation, content, review and governed releases. A profile marked *Explicit* is not composed by any other profile and must be named in `profiles`.
|
|
34
|
-
|
|
35
|
-
| Profile | Adds |
|
|
36
|
-
|---|---|
|
|
37
|
-
| `cratis/engineering/core` | Engineering process for Cratis repositories: CI gates and pipeline cost, cross-repository verification, issue and decision records, review rounds, release trains, post-mortems and session handoff. Composed by `cratis/engineering`. |
|
|
38
|
-
| `cratis/engineering/dotnet` | Vendored .NET skills in seven groups, each selectable alone: `performance`, `diagnostics`, `msbuild`, `orleans`, `testing`, `migrate-dotnet11`, `refactoring` (as `cratis/engineering/dotnet/<group>`). |
|
|
39
|
-
| `cratis/orchestration` | *Explicit.* Running several agent lanes and gating their merges. |
|
|
40
|
-
| `cratis/documentation` | Product documentation: reader-centered writing, checked examples, discoverability, release notes and voice. |
|
|
41
|
-
| `cratis/content` | Release notes, social posts, developer marketing, length and voice. |
|
|
42
|
-
| `cratis/review` | Code, security and performance review. |
|
|
43
|
-
| `cratis/codescene` | *Explicit.* CodeScene Code Health skills and the `codescene` MCP server declaration. |
|
|
44
|
-
| `cratis/playwright` | *Explicit.* The `playwright` MCP server declaration for exploratory browser checks. |
|
|
45
|
-
| `cratis/cli`, `cratis/cli/terminal-workbench` | Operating Chronicle from the CLI, environments and secrets, and the terminal Workbench. |
|
|
46
|
-
| `cratis/chronicle/mcp`, `cratis/chronicle/web-workbench` | Inspecting an event store through the Chronicle MCP server or the web Workbench. |
|
|
47
|
-
| `cratis/studio`, `cratis/lens`, `cratis/stage` | Studio MCP safety guidance, the Lens browser extension and the onboarding runtime. |
|
|
48
|
-
| `cratis/methodology/governed-releases` | The governed release methodology. |
|
|
49
|
-
|
|
50
|
-
### Code Health with CodeScene
|
|
51
|
-
|
|
52
|
-
`cratis/codescene` installs four upstream CodeScene skills: `safeguarding-ai-generated-code`, `guiding-refactoring-with-code-health`, `prioritizing-technical-debt` and `risk-based-testing-with-code-health`. The `codescene` rule, installed with the same profile, overrides those skills where they differ.
|
|
53
|
-
|
|
54
|
-
The profile declares the `codescene` stdio server (`cs-mcp`, no arguments) in `mcp-servers.json`. `cratis ai install` registers a selected profile's server in each managed harness's project configuration (Cratis CLI 3.90.0 or later; older CLIs register only Screenplay). Each user installs `cs-mcp`; the corpus does not. Pi's `cratis-mcp` extension enables the server through `cratis_enable_mcp`, or at session start with `mcpServers.codescene.eager: true`; `mcpServers.codescene.enabled: false` opts out in every harness. CodeScene needs an account and an OAuth login. Without an account or available CodeScene tools, skip its steps and say so rather than blocking the contributor.
|
|
55
|
-
|
|
56
|
-
### Browser automation with Playwright
|
|
57
|
-
|
|
58
|
-
`cratis/playwright` declares the `playwright` stdio server (`npx -y @playwright/mcp@0.0.83 --headless --isolated`) in `mcp-servers.json`. The flags keep the browser headless and isolated: no persistent profile, so no personal cookies or logins are reused.
|
|
59
|
-
|
|
60
|
-
`cratis ai install` registers it like any other selected server, and Pi's `cratis-mcp` extension can start it on demand. Use it for exploratory browser checks; repeatable checks stay in the repository's own Playwright tests. Without the server registered, skip browser steps and say so.
|
|
61
|
-
|
|
62
|
-
## Which rules a profile installs
|
|
63
|
-
|
|
64
|
-
A rule's frontmatter decides where it is installed and when it loads:
|
|
65
|
-
|
|
66
|
-
| Frontmatter | Installed when |
|
|
12
|
+
| Rule frontmatter | Profile condition |
|
|
67
13
|
|---|---|
|
|
68
|
-
|
|
|
69
|
-
| `profile: framework` |
|
|
70
|
-
| `profile: application` |
|
|
71
|
-
| `profile: cratis/<id>` |
|
|
14
|
+
| No `profile` | None. |
|
|
15
|
+
| `profile: framework` | Selection or composition includes `cratis/engineering` or a child. |
|
|
16
|
+
| `profile: application` | Selection or composition includes `cratis/application` or a child. The mixed `cratis/v2/application` profile alone is not a match. |
|
|
17
|
+
| `profile: cratis/<id>` | The repository directly selects that ID or a child; composition alone does not count. |
|
|
72
18
|
|
|
73
|
-
|
|
19
|
+
An installed rule must also pass language selection: unscoped or language-neutral `applyTo` is universal; language globs must match a configured language or select documentation through `cratis/documentation` for Markdown. Harnesses use `applyTo` or `paths` to scope loading by file.
|
|
74
20
|
|
|
75
|
-
|
|
21
|
+
Opt into `cratis/codescene` or `cratis/playwright` explicitly. `cratis ai install` registers selected MCP declarations in managed harnesses. Install `cs-mcp` separately for CodeScene and authenticate when required. Pi starts deferred servers through `cratis_enable_mcp`; `mcpServers.<id>.eager: true` starts them with the session. Set `mcpServers.<id>.enabled: false` to opt out. Report missing tools; exploratory browser checks are not substitutes for repository tests.
|
|
76
22
|
|
|
77
|
-
|
|
23
|
+
Change the canonical catalog or asset, not a consumer's managed copy or generated adapter. Keep linked skills reachable in every profile that installs their caller; the full plugin tree does not prove profile reachability.
|
|
@@ -17,6 +17,6 @@ paths:
|
|
|
17
17
|
|
|
18
18
|
- Write repository scripts, CI helpers and tooling in Node (`.mjs`, or `.ts` limited to erasable syntax: no enums, no parameter properties), using only `node:` built-ins (`fs.glob`, `util.parseArgs`, `fetch`, `node:test`). Node and the .NET SDK are the only runtimes every Cratis build machine and runner is guaranteed to have.
|
|
19
19
|
- Use a C# file-based app (`dotnet run --file tool.cs`, `#:package` pinned) when the script needs .NET or Cratis libraries or shares types with the product. Do not use one in hooks or on per-call hot paths.
|
|
20
|
-
- Hooks under `.cratis/ai/hooks`
|
|
20
|
+
- Hooks under `.cratis/ai/hooks` use Bash compatible with Bash 3.2 or Node. In a Bash hook, read the full stdin payload with `IFS= read -r -d '' x || true`, not `$(</dev/stdin)`.
|
|
21
21
|
- Do not add Python scripts or `python3` workflow steps to Cratis repositories unless the project itself is Python (for example the Chronicle Python client). Existing Python scripts are ported to Node opportunistically: when you substantially change one, port it in the same PR. There is no bulk port.
|
|
22
22
|
- Agents: edit files with the edit/write tools, query JSON with `gh --jq`/`jq`, and use `node -e` or `node --input-type=module - <<'EOF'` for trigger-free ad-hoc logic. Never `python3 -c`, and never rewrite files by script.
|
|
@@ -6,154 +6,14 @@ paths:
|
|
|
6
6
|
---
|
|
7
7
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# C# specs
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Name spec projects `<Source>.Specs`. For new projects use `Cratis.Specifications.XUnit.v3` and follow the repository's xUnit v3 project setup. Keep established runners in existing projects. Run an executable suite with the binary for the configuration and target framework you built. For a project configured to run under VSTest instead, use `dotnet test <project> --no-build`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- Use `Establish` for setup, `Because` for the one action, and `should_*` methods for observations. Use `[Fact]` for xUnit facts and follow the existing runner's discovery convention elsewhere (for example, `[Test]` in NUnit or TUnit, or parameterless `should_*` methods without an attribute in the native runner). Put shared setup in `given/`: `all_dependencies` creates substitutes and a derived context can construct the subject. The lifecycle runs setup base-first; never call base lifecycle methods explicitly. A shared context has no `Because` or observations.
|
|
14
|
+
- Keep shared xUnit lifecycle enabled. Eligible facts share one instance; facts must not mutate it, even through a helper. Use `[PerFactSpecificationLifecycle]` on a class only when isolation genuinely requires it. Do not suppress lifecycle diagnostics; check teardown failures as well as fact results. When migrating a runner, account for all previously discovered cases and skips.
|
|
15
|
+
- Use NSubstitute at collaborator boundaries and `Cratis.Specifications` assertions. Match ordered collections in order unless the contract is unordered. When changing a widely substituted interface, check the whole affected spec project.
|
|
16
|
+
- Reuse `GlobalUsings.Specs.cs` where present. Prefer expression-bodied single-statement facts and the concept's own sentinel over a convertible empty primitive.
|
|
17
|
+
- Await observable completion with a deadline. Do not sleep or poll to give the system time to catch up. A deliberately slow test double, infrastructure retry backoff or an interleaving aid is not a completion signal; state its purpose. In Chronicle specs, distinguish observer readiness from processing the event you asserted.
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
for_<TypeUnderTest>/
|
|
19
|
-
├── given/
|
|
20
|
-
│ ├── all_dependencies.cs ← common substitute setup
|
|
21
|
-
│ └── a_<descriptive_name>.cs ← reusable context
|
|
22
|
-
├── when_<behavior>/ ← folder for a behavior with several outcomes
|
|
23
|
-
│ ├── and_<condition>.cs ← one outcome per file
|
|
24
|
-
│ ├── with_<data_state>.cs
|
|
25
|
-
│ └── without_<requirement>.cs
|
|
26
|
-
└── when_<simple_behavior>.cs ← single file for a single outcome
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
- Outcome files and classes start with `and_`, `with_`, `without_`, `having_` or `given_`. Use a folder with the same prefix only when that condition has several outcomes of its own.
|
|
30
|
-
- `when` appears only in a `when_<behavior>` name. A name such as `with_a_registered_migration_when_appending` puts two "whens" in the sentence: fold the context into the `when_` folder name instead.
|
|
31
|
-
- A name starting `when_getting_` or `when_returning_` usually specifies a plain getter, which needs no spec.
|
|
32
|
-
|
|
33
|
-
`Cratis.Specifications` keeps the approach of Machine.Specifications (MSpec): `Establish → Because → should_` maps to "Given → When → Then" and keeps each spec focused on *one setup, one action, one set of assertions*.
|
|
34
|
-
|
|
35
|
-
## Frameworks
|
|
36
|
-
|
|
37
|
-
- [xUnit v3](https://xunit.net/docs/getting-started/v3/migration) is the house default for new and migrated spec projects, **run as the built executable**. Reference `Cratis.Specifications.XUnit.v3` **5.0** with `xunit.v3.mtp-off`, `Microsoft.NET.Test.Sdk` and `xunit.runner.visualstudio`, and set `<OutputType>Exe</OutputType>` in the project. The package supplies the `Specification` base, convention lifecycle and `ShouldXxx` assertions; the namespace remains `Cratis.Specifications`. Its `Cratis.Specifications` dependency supplies `Catch` and `SpecificationMethods`.
|
|
38
|
-
- Specifications 5.0–5.2 target `net10.0` only; 5.3.0 targets `net10.0` and `net11.0`. A spec project that must stay on net8.0/net9.0 stays on 4.x, and net48 on 3.x. A project that stays on xUnit v2 uses `Cratis.Specifications.XUnit`, with the same base and conventions.
|
|
39
|
-
- `.NUnit`/`.NUnit5`, `.TUnit` and the experimental `.Runner` are alternatives for repositories already built on them.
|
|
40
|
-
- [NSubstitute](https://nsubstitute.github.io/) for mocking collaborators.
|
|
41
|
-
- Spec projects are named `<Source>.Specs`.
|
|
42
|
-
|
|
43
|
-
## BDD pattern
|
|
44
|
-
|
|
45
|
-
`Establish` sets up the world, `Because` performs the single action under test, `should_*` facts verify individual outcomes. Any method can be `async Task`.
|
|
46
|
-
|
|
47
|
-
```csharp
|
|
48
|
-
public class when_combining_parts : Specification
|
|
49
|
-
{
|
|
50
|
-
object[] _parts;
|
|
51
|
-
string _result;
|
|
52
|
-
|
|
53
|
-
void Establish() => _parts = ["First", "Second", "Third"];
|
|
54
|
-
void Because() => _result = KeyHelper.Combine(_parts);
|
|
55
|
-
|
|
56
|
-
[Fact] void should_combine_all_parts() => _result.ShouldEqual("First+Second+Third");
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
| Method | Purpose | Notes |
|
|
61
|
-
|---|---|---|
|
|
62
|
-
| `void Establish()` | setup, before `Because()` | each class in the chain has its own, run base-first — never call `base.Establish()` |
|
|
63
|
-
| `void Because()` | the single action under test | only in concrete spec files, never in a reusable context |
|
|
64
|
-
| `[Fact] void should_*()` | one assertion per fact | use the `ShouldXxx()` extension methods |
|
|
65
|
-
| `void Destroy()` | teardown once per eligible class by default | after each fact when per-fact lifecycle is selected |
|
|
66
|
-
|
|
67
|
-
The shared lifecycle is the default on xUnit v2 and v3 since 5.0; the package registers the framework, so delete any hand-written `[assembly: Xunit.TestFramework(...)]` (it fails with `CS0579`). Eligible classes derive from `Specification`, have one public constructor with no arguments or only framework-managed fixture arguments, and contain only plain facts. Construction, Establish/Because and Destroy run once; all facts share the instance and must not mutate it. `IDisposable` specifications also share the lifecycle since Cratis.Specifications 4.4.0: one construction and one `Dispose` after the last fact. Initialization failure fails every fact. Theories and `ITestOutputHelper` constructors keep per-fact execution. Keep shared lifecycle on; `[PerFactSpecificationLifecycle]` opts out only the class whose facts genuinely mutate shared state and cannot move the mutation into `Because`. `CRSPEC0008` (a fact modifies the shared context) is an error by default: move the change into `Establish` or `Because`.
|
|
68
|
-
|
|
69
|
-
- `CRSPEC0008` catches provable mutation and `CRSPEC0012` warns on likely mutating calls. Inspect helpers and fixtures reachable from facts for indirect writes; passing analysis is not proof of isolation.
|
|
70
|
-
- With the native runner, check the run summary for separate class teardown failures from `Destroy` or disposal. Completed facts can be green while teardown fails the run.
|
|
71
|
-
- When moving from 4.x to 5.0 or upgrading an adapter, compare the discovered class and method inventory before and after; require no lost tests or new skips.
|
|
72
|
-
- NUnit 4's `ShouldEqual(params)` ignored order; 5.0 compares in order. Use `ShouldEqualInAnyOrder` only for an unordered contract. For the native runner, change `async void` facts and phases to `Task` or `ValueTask` (`CRSPEC0010`).
|
|
73
|
-
|
|
74
|
-
Run xUnit v3, TUnit and native-runner specifications as each project's built executable: restore and build once, then run its matching configuration/TFM output. Only identified VSTest projects use `dotnet test <project> --no-build`. Never default to solution-wide `dotnet test` in a mixed suite.
|
|
75
|
-
|
|
76
|
-
CRSPEC0001–CRSPEC0007 are warnings. Since 4.5 the analyzers ship only in `Cratis.Specifications`, transitively used by the framework packages; excluding analyzers on a framework package does not remove them. Derived xUnit/NUnit test attributes are recognized since 4.1.2. `Given`/`When` are aliases since 4.4 (declaring both aliases for one phase is CRSPEC0009), but house style stays `Establish`/`Because`. With warnings as errors, a non-`should_` fact, multiple specs per file (given contexts exempt), a fact on a given context, a `should_` without a test attribute, explicit base lifecycle calls, non-public specs with facts, or `Because` on a given context fail the build. Do not suppress these diagnostics.
|
|
77
|
-
|
|
78
|
-
## Reusable layered contexts
|
|
79
|
-
|
|
80
|
-
Layered contexts (`all_dependencies → a_<sut> → when_*`) capture shared setup base-first: the base mocks dependencies, the next builds the system under test, each spec adds only what's unique.
|
|
81
|
-
|
|
82
|
-
```csharp
|
|
83
|
-
// given/all_dependencies.cs — mocks all deps
|
|
84
|
-
public class all_dependencies : Specification
|
|
85
|
-
{
|
|
86
|
-
protected IEventStore _eventStore;
|
|
87
|
-
void Establish() => _eventStore = Substitute.For<IEventStore>();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// given/a_reactor_handler.cs — builds the system under test
|
|
91
|
-
public class a_reactor_handler : all_dependencies
|
|
92
|
-
{
|
|
93
|
-
protected ReactorHandler _handler;
|
|
94
|
-
void Establish() => _handler = new(_eventStore);
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Put the action under test only in the concrete spec's `Because()`, never in a reusable context.
|
|
99
|
-
|
|
100
|
-
## NSubstitute patterns
|
|
101
|
-
|
|
102
|
-
```csharp
|
|
103
|
-
_service.GetValue(Arg.Any<string>()).Returns("result");
|
|
104
|
-
Arg.Is<Request>(r => r.Id == expectedId) // matcher
|
|
105
|
-
_service.Received(1).DoSomething(Arg.Any<string>()); // verify
|
|
106
|
-
_service.DidNotReceive().DoSomethingElse(Arg.Any<int>());
|
|
107
|
-
_handler.Handle(Arg.Any<CommandContext>()).Throws(new Exception("fail"));
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
A change to a widely substituted interface runs the whole affected spec project,
|
|
111
|
-
not one spec. Grep for `Substitute.For<IThatInterface>` to find every substitute
|
|
112
|
-
that needs updating.
|
|
113
|
-
|
|
114
|
-
Catch exceptions for a unit under test with `Catch.Exception`:
|
|
115
|
-
|
|
116
|
-
```csharp
|
|
117
|
-
async Task Because() => _error = await Catch.Exception(_sut.DoSomething);
|
|
118
|
-
[Fact] void should_not_fail() => _error.ShouldBeNull();
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Assertion extension methods
|
|
122
|
-
|
|
123
|
-
Since 5.0 assertions live in `Cratis.Specifications`, with types forwarded by each framework package (namespace `Cratis.Specifications`); recompile and keep core/framework packages on the same version: `.ShouldEqual(expected)`, `.ShouldBeTrue()`, `.ShouldBeFalse()`, `.ShouldBeNull()`, `.ShouldNotBeNull()`, `.ShouldBeEmpty()`, `.ShouldNotBeEmpty()`, `.ShouldContain(item)`, `.ShouldNotContain(item)`, `.ShouldContainOnly(items)`, `.ShouldBeOfExactType<T>()`, `.ShouldBeGreaterThan(n)`, `.ShouldBeLessThan(n)`.
|
|
124
|
-
|
|
125
|
-
Additional helpers include `ShouldNotEqual`, `ShouldBeSame`/`ShouldNotBeSame`, `ShouldMatch(Func<T, bool>)`, `ShouldBeInRange`, inclusive comparisons `ShouldBeGreaterThanOrEqual`/`ShouldBeLessThanOrEqual`, `ShouldContainSingleItem`, `ShouldEachConformTo`, ordered collection `ShouldEqual(IEnumerable<T>)`, collection `ShouldContain(Func<T, bool>)` (adapt a typed `Predicate<T>` with `x => predicate(x)`), `ShouldBeAssignableFrom<T>`, and string `ShouldContain(substring, StringComparison)`. `Catch.Exception` accepts `Action` or `Func<Task>`; `Catch.Exception<T>(Action)` catches only T.
|
|
126
|
-
|
|
127
|
-
## Conventions
|
|
128
|
-
|
|
129
|
-
- Common usings come from `GlobalUsings.Specs.cs` (`Xunit`, `NSubstitute`, `Cratis.Specifications`, …) — don't duplicate them, and don't add a using for the system-under-test namespace.
|
|
130
|
-
- **`using` ordering (SA1210/SA1211):** non-aliased namespaces first, then a blank line, then `using <alias> = …` aliases sorted by alias name. Alias a type whose short name collides with a namespace segment (CS0118) — `using RegisterAuthorCmd = …` style, with a domain-meaningful alias, never a technical `Command`/`Event`/`Component` suffix.
|
|
131
|
-
- Single-statement assertion lambdas use expression-body form (RCS1021) — `[Fact] void should_x() => result.ShouldEqual(...)`, not a `{ … }` block. Don't break long `should_` lines; don't add blank lines between `should_` methods.
|
|
132
|
-
- **Prefer a concept's sentinel over a raw empty primitive.** When a `ConceptAs<T>` / `EventSourceId<T>` value is expected — as an argument, a mock setup, or an assertion — use its `NotSet` (or `Empty` / `New()`) static rather than a `string.Empty` / `Guid.Empty` / `0` that implicitly converts. It states intent and survives a sentinel-value change. Reserve raw `string.Empty` for genuinely non-concept `string` values (e.g. asserting a decrypted-to-empty JSON payload).
|
|
133
|
-
|
|
134
|
-
## Never sleep — await a fact, not a duration
|
|
135
|
-
|
|
136
|
-
**A spec never waits on the clock for the system under test.** `Thread.Sleep`, a bare `Task.Delay`, or a `SpinWait` before an assertion makes the spec pass because the machine happened to be fast enough, and it writes today's latency into the suite: the next change that shifts timing breaks specs that have nothing to do with it.
|
|
137
|
-
|
|
138
|
-
Wait on a signal instead. Use the completion or state helper the framework under test provides. Where none exists, build the signal: a `SemaphoreSlim` or `TaskCompletionSource` released by the code that observes the outcome, awaited under a timeout and never polled.
|
|
139
|
-
|
|
140
|
-
A **deadline** is not a sleep: a timeout is what turns a hang into a named failure. Sleeping *between* re-checks is: a poll loop is a completion signal you have not built yet, so add the signal rather than another `while` + `Task.Delay`.
|
|
141
|
-
|
|
142
|
-
Three delays are not waits at all and stay allowed — say which one it is in a comment: a test double that is **slow on purpose** so the test can observe it mid-flight (`Task.Delay(HandleTime)`), an **infrastructure readiness backoff** between retries of a connect/start that can legitimately fail, and a `Task.Delay(1)` / `Task.Yield()` that **widens an interleaving window** in a concurrency spec.
|
|
143
|
-
|
|
144
|
-
## What NOT to spec
|
|
145
|
-
|
|
146
|
-
Simple properties are compiler-verified. Save spec effort for business logic, coordination between dependencies, and complex transformations.
|
|
147
|
-
|
|
148
|
-
```csharp
|
|
149
|
-
// ❌ Do NOT spec these
|
|
150
|
-
public string TableName => tableName; // returns constructor parameter
|
|
151
|
-
public IEnumerable<Property> Properties => mapper.Properties; // simple delegation
|
|
152
|
-
|
|
153
|
-
// ✅ Spec complex business logic
|
|
154
|
-
public decimal TotalCost => Items.Sum(i => i.Cost * i.Quantity * (1 + i.TaxRate));
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Also don't spec logging or trivial getters.
|
|
158
|
-
|
|
159
|
-
For Chronicle integration specs, await the observer signal that proves the assertion’s precondition: `WaitTillActive`, `WaitTillSubscribed`, `WaitTillReachesEventSequenceNumber` or `WaitForState`. Readiness is not proof of processing a particular event.
|
|
19
|
+
Use **cratis-specifications-isolate-behavior** and **cratis-specifications-exercise-backend** to choose the boundary and scenario APIs.
|
|
@@ -8,43 +8,10 @@ paths:
|
|
|
8
8
|
---
|
|
9
9
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Elixir specs
|
|
12
12
|
|
|
13
|
-
Use ExUnit
|
|
13
|
+
Use ExUnit. Call pure functions directly; exercise Arc command pipelines through `Cratis.Arc.Test` and Chronicle scenarios through `Cratis.Chronicle.Testing.Case`. Do not infer external delivery from an in-memory test. Build fresh state in `setup`; reserve `setup_all` for immutable inputs.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Follow the repository's discovery layout. Released Arc and Chronicle clients discover both `test/**/*_test.exs` and scripts in `test/**/for_*/` via `test_load_filters`; exclude `given/` via `test_ignore_filters` and load those contexts explicitly. Compile `test/support` only in `:test`. If a project colocates scripts under `lib/`, include `lib` in `test_paths`, start ExUnit from `lib/test_helper.exs`, and add a `test_load_filters` entry matching `lib/**/for_*/**/*.exs` even without the `_test.exs` suffix. Keep `given/` excluded. Preserve existing paths and load filters, including the usual `*_test.exs` match, until migration is complete. Verify a real scoped `mix test` discovers cases, then account for the full suite after a discovery change.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```elixir
|
|
20
|
-
# Entries in project/0
|
|
21
|
-
elixirc_paths: elixirc_paths(Mix.env()),
|
|
22
|
-
test_paths: ["lib"],
|
|
23
|
-
test_load_filters: [~r{^lib/(?!.*?/given/)(?!given/)(?:.*/)?for_[^/]+/.*\.exs$}],
|
|
24
|
-
test_ignore_filters: [~r{/given/}, ~r{^lib/test_helper\.exs$}],
|
|
25
|
-
|
|
26
|
-
# Module-level helpers
|
|
27
|
-
defp elixirc_paths(:test), do: ["lib", "test/support"]
|
|
28
|
-
defp elixirc_paths(_), do: ["lib"]
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Put `ExUnit.start()` in `lib/test_helper.exs`, then load shared `given/*.exs` once with `Path.wildcard("lib/**/given/*.exs") |> Enum.sort() |> Enum.each(&Code.require_file/1)`. Keep the default `test_pattern`; the load filter replaces the default `_test.exs` suffix check. Preserve any legacy test paths and their load filters until migration is complete. Use the existing `test/` layout with `*_test.exs` where custom filters are unavailable. A script outside `for_*` is not loaded by this filter. Run `mix test lib/<slice>/for_<unit>` with the real directory and require a nonzero count, then run `mix test` after a discovery change and account for every previously discovered test. Include `lib` and `test` scripts in the formatter inputs.
|
|
32
|
-
|
|
33
|
-
## Choose the boundary
|
|
34
|
-
|
|
35
|
-
Call pure functions directly. For shared `given` setup use a helper that returns a fresh context per test; perform the action in the concrete case. Use `setup_all` only for immutable inputs, never for a mutable Chronicle or application session. For example, build fresh scenario data from module-scoped constants:
|
|
36
|
-
|
|
37
|
-
```elixir
|
|
38
|
-
setup_all do
|
|
39
|
-
%{title: "Aster"}
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
setup %{title: title} do
|
|
43
|
-
given = %{title: title} |> AuthorsGiven.given_author() |> AuthorsGiven.given_catalog()
|
|
44
|
-
%{given: given}
|
|
45
|
-
end
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Each app-owned `given_*` function takes the previous context and returns the next. When givens append history, count only events appended after the action starts.
|
|
49
|
-
|
|
50
|
-
Use `Phoenix.LiveViewTest.render_component/2` for static component behavior and `Phoenix.LiveViewTest.live/2` when the result depends on a mounted view, such as form validation or submission.
|
|
17
|
+
For Phoenix use `Phoenix.LiveViewTest.render_component/2` for component rendering and `Phoenix.LiveViewTest.live/2` when behavior depends on a mounted view.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: "**/for_*/**/*.ts, **/when_*/**/*.ts"
|
|
2
|
+
applyTo: "**/for_*/**/*.ts, **/when_*/**/*.ts, **/for_*/**/*.tsx, **/when_*/**/*.tsx"
|
|
3
3
|
paths:
|
|
4
4
|
- "**/for_*/**/*.ts"
|
|
5
5
|
- "**/when_*/**/*.ts"
|
|
6
|
+
- "**/for_*/**/*.tsx"
|
|
7
|
+
- "**/when_*/**/*.tsx"
|
|
6
8
|
---
|
|
7
9
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
8
10
|
|
|
@@ -6,75 +6,12 @@ paths:
|
|
|
6
6
|
---
|
|
7
7
|
<!-- cratis-ai: generated Copilot instructions. Do not edit; rules/ is the source. -->
|
|
8
8
|
|
|
9
|
-
# Storybook
|
|
9
|
+
# Storybook stories
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Colocate stories with reusable presentational components. Use deterministic props, not live Arc hooks or a backend. Use **cratis-specifications-observe-ui** for application behavior; stories are visual coverage and documentation.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Preview infrastructure (what you get for free)
|
|
20
|
-
|
|
21
|
-
A configured `.storybook/preview` should wrap every story in `CratisComponentsProvider` (from `@cratis/components`) with `toaster` when stories show notifications. Import one `index.css` containing `@import '@cratis/components/tokens'`, `@import '@cratis/components/styles'` and (for the baseline look) `@import '@cratis/components/theme'`, each terminated by a semicolon — the same entries as the app. CSS imports from TypeScript need ambient declarations on TypeScript 6; keeping the subpaths in CSS avoids TS2882. Mount only one toaster. With that in place:
|
|
22
|
-
|
|
23
|
-
- **Auto prop tables** via `react-docgen-typescript` — a component's `interface` + per-prop JSDoc renders as a Docs prop table, and union props become `select` controls automatically. Keep a JSDoc comment on every prop. **`argTypes` is an override layer** (change control type, group under `table.category`, disable a control) — don't re-list every prop.
|
|
24
|
-
- **Accessibility panel** (`@storybook/addon-a11y`) scans each story with axe-core. Treat new violations as defects.
|
|
25
|
-
|
|
26
|
-
## Meta block
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
30
|
-
import { MyComponent } from './MyComponent';
|
|
31
|
-
|
|
32
|
-
const meta = {
|
|
33
|
-
title: 'Components/MyComponent', // sidebar path
|
|
34
|
-
component: MyComponent,
|
|
35
|
-
parameters: { layout: 'centered' }, // 'centered' | 'padded' | 'fullscreen'
|
|
36
|
-
tags: ['autodocs'], // always include
|
|
37
|
-
} satisfies Meta<typeof MyComponent>;
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof meta>;
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Use `satisfies Meta<typeof Component>` — never `: Meta<T>` (better inference). `layout`: `centered` for atoms, `padded` for compound/container components, `fullscreen` for layout shells.
|
|
44
|
-
|
|
45
|
-
## Required stories
|
|
46
|
-
|
|
47
|
-
Adapt depth to the component — rich for complex/stateful, trimmed for atoms:
|
|
48
|
-
|
|
49
|
-
1. **`Playground`** — controllable: `args` for the happy path, all props tweakable. Use `fn()` from `storybook/test` for callbacks (not `() => {}`).
|
|
50
|
-
2. **Showcase** — one or more `render:` stories covering the meaningful axes (`Variants`/`Tones`, `Sizes`, `States`, `WithIcons`). Use the Arc story-kit (`StoryContainer`, `StorySection`, `StoryGrid`, `StoryDivider`, `StoryBadge` from `@cratis/arc.react/stories`) for layout. Note: `StorySection` has no `label` prop (use an `<h3>` inside); `StoryGrid` has no `columns` prop (it auto-wraps).
|
|
51
|
-
3. **`InContext`** — the component in a small realistic composition.
|
|
52
|
-
4. **`Interactive`** — for **stateful** components: a local `const Demo: React.FC` owning `useState`, plus a `play:` test. **Omit for presentational atoms.**
|
|
53
|
-
|
|
54
|
-
Add a one-line `/** … */` doc above each story; set `parameters.docs.description.component` on the meta.
|
|
55
|
-
|
|
56
|
-
## Interaction tests (`play:`) — stateful components only
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
60
|
-
|
|
61
|
-
export const Interactive: Story = {
|
|
62
|
-
render: () => <Demo />,
|
|
63
|
-
play: async ({ canvasElement }) => {
|
|
64
|
-
const canvas = within(canvasElement);
|
|
65
|
-
await userEvent.click(canvas.getAllByRole('tab')[1]);
|
|
66
|
-
await expect(canvas.getAllByRole('tab')[1]).toHaveAttribute('aria-selected', 'true');
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
- **Stateful only** — presentational atoms get no `play:`. Components' own overlay components (dialogs, dropdowns, toasts) are excluded — their behavior is the library's, not yours.
|
|
72
|
-
- Prefer role/structure queries over localized text. `play:` runs in the Interactions panel (documentation/QA); the enforced behavioral gate is the Vitest spec.
|
|
73
|
-
|
|
74
|
-
## Router-dependent components
|
|
75
|
-
|
|
76
|
-
Wrap with `MemoryRouter` via a story decorator when a component uses `Link`/`useNavigate`.
|
|
77
|
-
|
|
78
|
-
## Gate
|
|
79
|
-
|
|
80
|
-
`build-storybook` should be green in CI — it compiles every story and `play:` function (catching broken imports/decorators) but does not execute play assertions.
|
|
13
|
+
- Use the app's Cratis Components styles and `CratisComponentsProvider` in the preview. The CSS exports are `@cratis/components/tokens`, `@cratis/components/styles` and `@cratis/components/theme`. Add one toaster when showing notifications. Decorate router-dependent stories with a `MemoryRouter`.
|
|
14
|
+
- Use `satisfies Meta<typeof Component>`, `StoryObj<typeof meta>` and the `autodocs` tag. Document props in their source; use `argTypes` for overrides, not to repeat inferred controls. Fix new accessibility violations.
|
|
15
|
+
- Start with a controllable happy-path story. Showcase meaningful variants, state or composition without a story quota. If using the Arc story kit (`@cratis/arc.react/stories`), import `@cratis/arc.react/stories/styles.css` once in the preview. `StoryGrid` wraps automatically; `StorySection` takes child content, not a `label` prop.
|
|
16
|
+
- Use `fn()` from `storybook/test` for tracked callbacks. Add a `play` interaction for meaningful owned state, not for static atoms or third-party overlay internals. Query by role where possible.
|
|
17
|
+
- Run the repository's Storybook build for build-time coverage. It does not execute `play` assertions; report the interaction or behavior check separately.
|