@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.
Files changed (486) hide show
  1. package/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
  2. package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
  3. package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
  4. package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
  5. package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
  6. package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
  7. package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
  8. package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
  9. package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
  10. package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
  11. package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
  12. package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
  13. package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
  14. package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
  15. package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
  16. package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
  17. package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
  18. package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
  19. package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
  20. package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
  21. package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
  22. package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
  23. package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
  24. package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
  25. package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
  26. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
  27. package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
  28. package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
  29. package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
  30. package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
  31. package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
  32. package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
  33. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
  34. package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
  35. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
  36. package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
  37. package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
  38. package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
  39. package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
  40. package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
  41. package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
  42. package/package/corpus/hooks/README.md +4 -7
  43. package/package/corpus/hooks/scripts/quality-gates.json +3 -5
  44. package/package/corpus/rules/ai-distribution.md +9 -102
  45. package/package/corpus/rules/authoring-skills.md +3 -5
  46. package/package/corpus/rules/browser.md +8 -49
  47. package/package/corpus/rules/code-health-policy.txt +4 -24
  48. package/package/corpus/rules/code-health.md +1 -1
  49. package/package/corpus/rules/code-quality.csharp.md +3 -84
  50. package/package/corpus/rules/code-quality.md +6 -51
  51. package/package/corpus/rules/code-quality.typescript.md +4 -81
  52. package/package/corpus/rules/codescene.md +5 -54
  53. package/package/corpus/rules/components.md +1 -1
  54. package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
  55. package/package/corpus/rules/csharp.md +7 -315
  56. package/package/corpus/rules/dialogs.md +1 -1
  57. package/package/corpus/rules/discoverability.md +3 -25
  58. package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
  59. package/package/corpus/rules/documentation.md +5 -104
  60. package/package/corpus/rules/editing-cratis-docs.md +5 -63
  61. package/package/corpus/rules/efcore.md +8 -55
  62. package/package/corpus/rules/efcore.specs.md +3 -33
  63. package/package/corpus/rules/elixir.md +6 -79
  64. package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
  65. package/package/corpus/rules/framework-dotnet.md +4 -6
  66. package/package/corpus/rules/framework.md +0 -2
  67. package/package/corpus/rules/frontend-quality.md +0 -1
  68. package/package/corpus/rules/frontend-testing.md +1 -1
  69. package/package/corpus/rules/general.md +2 -2
  70. package/package/corpus/rules/github-actions.md +7 -138
  71. package/package/corpus/rules/glossary.md +19 -19
  72. package/package/corpus/rules/go-engineering.md +1 -4
  73. package/package/corpus/rules/go.md +2 -7
  74. package/package/corpus/rules/guards-and-fuses.md +5 -6
  75. package/package/corpus/rules/java.md +7 -129
  76. package/package/corpus/rules/kotlin.md +8 -165
  77. package/package/corpus/rules/orleans.md +5 -98
  78. package/package/corpus/rules/profiles.md +9 -63
  79. package/package/corpus/rules/scripting.md +1 -1
  80. package/package/corpus/rules/specs.csharp.md +8 -148
  81. package/package/corpus/rules/specs.elixir.md +4 -37
  82. package/package/corpus/rules/specs.typescript.md +3 -1
  83. package/package/corpus/rules/storybook.md +7 -70
  84. package/package/corpus/rules/typescript.md +8 -98
  85. package/package/corpus/rules/writing-correct-examples.md +3 -47
  86. package/package/corpus/rules/writing-cratis-docs.md +3 -65
  87. package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
  88. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
  89. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
  90. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  91. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
  92. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
  93. package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
  94. package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
  95. package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
  96. package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
  97. package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
  98. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
  99. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  100. package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
  101. package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
  102. package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
  103. package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
  104. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
  105. package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
  106. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
  107. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
  108. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
  109. package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
  110. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
  111. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
  112. package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
  113. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
  114. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  115. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
  116. package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
  117. package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
  118. package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
  119. package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
  120. package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
  121. package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
  122. package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
  123. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
  124. package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
  125. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
  126. package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
  127. package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
  128. package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
  129. package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
  130. package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
  131. package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
  132. package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
  133. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
  134. package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
  135. package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
  136. package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
  137. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
  138. package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
  139. package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
  140. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
  141. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
  142. package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
  143. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
  144. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
  145. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
  146. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
  147. package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
  148. package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
  149. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
  150. package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
  151. package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
  152. package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
  153. package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
  154. package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
  155. package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
  156. package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
  157. package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
  158. package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
  159. package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
  160. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
  161. package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
  162. package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
  163. package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
  164. package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
  165. package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
  166. package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
  167. package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
  168. package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
  169. package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
  170. package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
  171. package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
  172. package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
  173. package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
  174. package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
  175. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
  176. package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
  177. package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
  178. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
  179. package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
  180. package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
  181. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
  182. package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
  183. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
  184. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
  185. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
  186. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
  187. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
  188. package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
  189. package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
  190. package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
  191. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
  192. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
  193. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
  194. package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
  195. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
  196. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
  197. package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
  198. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
  199. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
  200. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
  201. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
  202. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
  203. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
  204. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
  205. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
  206. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
  207. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
  208. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
  209. package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
  210. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
  211. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
  212. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
  213. package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
  214. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
  215. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
  216. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
  217. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
  218. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
  219. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
  220. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
  221. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
  222. package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
  223. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  224. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
  225. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
  226. package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
  227. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
  228. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
  229. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
  230. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
  231. package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
  232. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
  233. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
  234. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
  235. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
  236. package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
  237. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
  238. package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
  239. package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
  240. package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
  241. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
  242. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
  243. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
  244. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
  245. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
  246. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
  247. package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
  248. package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
  249. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
  250. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
  251. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
  252. package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
  253. package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
  254. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
  255. package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
  256. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
  257. package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
  258. package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
  259. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
  260. package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
  261. package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
  262. package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
  263. package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
  264. package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
  265. package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
  266. package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
  267. package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
  268. package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
  269. package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
  270. package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
  271. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
  272. package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
  273. package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
  274. package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
  275. package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
  276. package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
  277. package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
  278. package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
  279. package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
  280. package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
  281. package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
  282. package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
  283. package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
  284. package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
  285. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
  286. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
  287. package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
  288. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
  289. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
  290. package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
  291. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
  292. package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
  293. package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
  294. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
  295. package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
  296. package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
  297. package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
  298. package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
  299. package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
  300. package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
  301. package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
  302. package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
  303. package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
  304. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
  305. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
  306. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
  307. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
  308. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
  309. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
  310. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
  311. package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
  312. package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
  313. package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
  314. package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
  315. package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
  316. package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
  317. package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
  318. package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
  319. package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
  320. package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
  321. package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
  322. package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
  323. package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
  324. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
  325. package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
  326. package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
  327. package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
  328. package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
  329. package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
  330. package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
  331. package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
  332. package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
  333. package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
  334. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
  335. package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
  336. package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
  337. package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
  338. package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
  339. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
  340. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
  341. package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
  342. package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
  343. package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
  344. package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
  345. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
  346. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
  347. package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
  348. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
  349. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
  350. package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
  351. package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
  352. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
  353. package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
  354. package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
  355. package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
  356. package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
  357. package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
  358. package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
  359. package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
  360. package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
  361. package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
  362. package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
  363. package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
  364. package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
  365. package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +10 -0
  366. package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
  367. package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
  368. package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
  369. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
  370. package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
  371. package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
  372. package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
  373. package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
  374. package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
  375. package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
  376. package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
  377. package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
  378. package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
  379. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
  380. package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
  381. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
  382. package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
  383. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
  384. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
  385. package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
  386. package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
  387. package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
  388. package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
  389. package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
  390. package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
  391. package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
  392. package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
  393. package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
  394. package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
  395. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
  396. package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
  397. package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
  398. package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
  399. package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
  400. package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
  401. package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
  402. package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
  403. package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
  404. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
  405. package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
  406. package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
  407. package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
  408. package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
  409. package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
  410. package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
  411. package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
  412. package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
  413. package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
  414. package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
  415. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
  416. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
  417. package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
  418. package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
  419. package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
  420. package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
  421. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
  422. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
  423. package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
  424. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
  425. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
  426. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
  427. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
  428. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
  429. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
  430. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
  431. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
  432. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
  433. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
  434. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
  435. package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
  436. package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
  437. package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
  438. package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
  439. package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
  440. package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
  441. package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
  442. package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
  443. package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
  444. package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
  445. package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
  446. package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
  447. package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
  448. package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
  449. package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
  450. package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
  451. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
  452. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
  453. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
  454. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
  455. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
  456. package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
  457. package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
  458. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
  459. package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
  460. package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
  461. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
  462. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
  463. package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
  464. package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
  465. package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
  466. package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
  467. package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
  468. package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
  469. package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
  470. package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
  471. package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
  472. package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
  473. package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
  474. package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
  475. package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
  476. package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
  477. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
  478. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
  479. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
  480. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
  481. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
  482. package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
  483. package/package.json +1 -1
  484. /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
  485. /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
  486. /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 Conventions
10
+ # Orleans conventions
11
11
 
12
- > **⚠️ APPLIES ONLY TO PROJECTS USING MICROSOFT ORLEANS**
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
- In the Cratis organization, Orleans is the Chronicle kernel's actor runtime. The kernel conventions below describe `Cratis/Chronicle` 19.50.0 and later. Shared hosting and jobs come from `Cratis/Choreography`; use `Cratis.Choreography` 2.0.0 or newer (renamed from `Cratis.Orleans`); use its setup for other services that co-host a silo.
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
- ## General
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
- - Do **not** split grain interfaces into a separate project. Grain interfaces and their implementations live together in `Kernel/Core`; the `Contracts` project holds the gRPC contracts, not grain interfaces.
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
- A profile selects which skills, rules and MCP server declarations `cratis ai install` copies into a repository. The catalog is `profile-catalog.json` in the Cratis AI repository: each profile lists the skills it installs (`availableTargets`) and the profiles it includes (`composes`). Selecting a profile installs its own skills and those of the profiles it composes, transitively. A composed profile is skipped if it matches none of the configured languages, unless it is language-agnostic. Naming a profile directly bypasses that filter; omitting `languages` leaves composition unfiltered.
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
- ## Choose a profile
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
- | no `profile` | The rule's `applyTo` globs name a language in the repository's `languages`, or name no language at all. A rule whose globs match only `.md` or `.mdx` files installs when `cratis/documentation` is selected or composed. |
69
- | `profile: framework` | A selected or composed profile is `cratis/engineering` or one of its children, and the language condition above holds. |
70
- | `profile: application` | A selected or composed profile is `cratis/application` or one of its children, and the language condition above holds. |
71
- | `profile: cratis/<id>` | `profiles` in `.cratis/ai.json` names that ID or one of its children directly. A parent that only composes it does not install the rule. The language condition above also applies. |
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
- `applyTo` and `paths` then limit an installed rule to matching files. Only `general.md` has neither a profile nor a file scope. A profile-only rule is always on wherever its profile is selected under the rules above.
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
- ## Change the catalog
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
- Edit the canonical skill and its catalog entry in the Cratis AI repository, never a consuming repository's managed copy or a generated harness adapter. A skill that links to another skill needs that skill in every profile that installs the first, or the link leaves the selection. Plugin installs expose the whole skill tree and apply no profile, so check reachability through the catalog as well.
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` are POSIX sh compatible with bash 3.2, or Node. Read stdin with `IFS= read -r -d '' x || true`, never `$(</dev/stdin)`.
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
- # How to Write C# Specs
9
+ # C# specs
10
10
 
11
- C# conventions for specs written with `Cratis.Specifications` (`Establish → Because → should_`) and NSubstitute. This rule covers naming, layout and style only. Whether a behavior needs a spec, and at which boundary, is decided by **cratis-specifications-isolate-behavior** and **cratis-specifications-exercise-backend** where they are installed; do not add a spec because a class or method exists.
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
- ## Folder and file names
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
- The path reads as a sentence: `for_Changeset / when_adding_changes / and_there_are_differences`.
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
- # Specify Elixir behavior
11
+ # Elixir specs
12
12
 
13
- Use ExUnit tests with native fixtures. For an Arc command exercise the pipeline through `Cratis.Arc.Test`; for Chronicle use `Cratis.Chronicle.Testing.Case`. Seed only the relevant state, execute once and assert the accepted fact or specific refusal. Do not infer a real external delivery from an in-memory test.
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
- ## Discover colocated specs
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
- Use `.exs` scripts with no `_test` suffix under `lib/<slice>/for_<unit>/`. Mix compiles `.ex` modules, so these colocated scripts are not compiled into releases. Put reusable compiled case helpers in `test/support/*.ex` and include that directory only in `:test`. For a project adopting this layout on Mix 1.19 or newer, configure:
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 Story Conventions
9
+ # Storybook stories
10
10
 
11
- Stories are visual coverage and documentation for reusable React components built on Cratis Components — **not** the behavior test suite. Behavior is specified with **cratis-specifications-observe-ui**, not with stories; a story is never a quota to fill. Every story file is colocated with the component it covers.
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
- ## When to write a story
14
-
15
- Write stories for **reusable components**: shared component-library primitives and slice-internal components reused across slices. Do **not** story live slice pages wired directly to Arc query/command hooks or a backend — exercise those in the running app. For a presentational view that needs visual coverage, extract it or render its presentational subcomponents with deterministic fixture props.
16
-
17
- Good candidates: a presentational card/list-item/form-field with multiple visual states; a component with hover/selected/disabled/error variants; anything reusable across slices.
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.