@cratis/pi 0.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -37
  3. package/package/corpus/agents/backend-developer.md +125 -0
  4. package/package/corpus/agents/code-reviewer.md +165 -0
  5. package/package/corpus/agents/coordinator.md +163 -0
  6. package/package/corpus/agents/frontend-developer.md +246 -0
  7. package/package/corpus/agents/orchestrator.md +196 -0
  8. package/package/corpus/agents/performance-reviewer.md +109 -0
  9. package/package/corpus/agents/planner.md +145 -0
  10. package/package/corpus/agents/repository-investigation-reviewer.md +45 -0
  11. package/package/corpus/agents/repository-investigator.md +50 -0
  12. package/package/corpus/agents/security-reviewer.md +118 -0
  13. package/package/corpus/agents/slice-implementer.md +59 -0
  14. package/package/corpus/agents/spec-writer.md +149 -0
  15. package/package/corpus/harnesses/pi/extensions/cratis-hooks/index.ts +213 -0
  16. package/package/corpus/harnesses/pi/extensions/cratis-rules/index.ts +27 -0
  17. package/package/corpus/harnesses/pi/extensions/package.json +4 -0
  18. package/package/corpus/harnesses/pi/extensions/subagent/agents.ts +167 -0
  19. package/package/corpus/harnesses/pi/extensions/subagent/index.ts +352 -0
  20. package/package/corpus/hooks/README.md +434 -0
  21. package/package/corpus/hooks/agent-stop.md +49 -0
  22. package/package/corpus/hooks/pre-commit.md +47 -0
  23. package/package/corpus/hooks/scripts/cratis-guard-writes.sh +87 -0
  24. package/package/corpus/hooks/scripts/cratis-nuget-pins.txt +11 -0
  25. package/package/corpus/hooks/scripts/cratis-pattern-scan.sh +197 -0
  26. package/package/corpus/hooks/scripts/cratis-patterns.json +84 -0
  27. package/package/corpus/hooks/scripts/cratis-quality-gate.sh +219 -0
  28. package/package/corpus/hooks/scripts/hook-lib.sh +152 -0
  29. package/package/corpus/hooks/scripts/quality-gates.json +261 -0
  30. package/package/corpus/hooks/scripts/type-references-allowlist.txt +71 -0
  31. package/package/corpus/hooks/scripts/validate-package-imports.sh +166 -0
  32. package/package/corpus/hooks/scripts/validate-package-subpaths.sh +120 -0
  33. package/package/corpus/hooks/scripts/validate-type-references.sh +308 -0
  34. package/package/corpus/hooks/settings.template.json +40 -0
  35. package/package/corpus/prompts/add-business-rule.prompt.md +22 -0
  36. package/package/corpus/prompts/add-concept.prompt.md +17 -0
  37. package/package/corpus/prompts/add-ef-migration.prompt.md +24 -0
  38. package/package/corpus/prompts/add-projection.prompt.md +20 -0
  39. package/package/corpus/prompts/add-reactor.prompt.md +22 -0
  40. package/package/corpus/prompts/add-reducer.prompt.md +20 -0
  41. package/package/corpus/prompts/audit-hooks.prompt.md +15 -0
  42. package/package/corpus/prompts/check-doc-drift.prompt.md +21 -0
  43. package/package/corpus/prompts/code-review.prompt.md +9 -0
  44. package/package/corpus/prompts/new-feature.prompt.md +9 -0
  45. package/package/corpus/prompts/new-vertical-slice.prompt.md +18 -0
  46. package/package/corpus/prompts/review-pr.prompt.md +35 -0
  47. package/package/corpus/prompts/review-skill.prompt.md +16 -0
  48. package/package/corpus/prompts/scaffold-feature.prompt.md +16 -0
  49. package/package/corpus/prompts/ship-changes.prompt.md +20 -0
  50. package/package/corpus/prompts/verify-ai-setup.prompt.md +19 -0
  51. package/package/corpus/prompts/write-documentation.prompt.md +21 -0
  52. package/package/corpus/prompts/write-specs.prompt.md +22 -0
  53. package/package/corpus/rules/capability-is-not-authority.md +31 -0
  54. package/package/corpus/rules/code-quality.csharp.md +91 -0
  55. package/package/corpus/rules/code-quality.md +82 -0
  56. package/package/corpus/rules/code-quality.typescript.md +89 -0
  57. package/package/corpus/rules/components.md +207 -0
  58. package/package/corpus/rules/concepts.md +115 -0
  59. package/package/corpus/rules/csharp.md +269 -0
  60. package/package/corpus/rules/dialogs.md +264 -0
  61. package/package/corpus/rules/documentation-structure-and-formatting.md +148 -0
  62. package/package/corpus/rules/documentation.md +90 -0
  63. package/package/corpus/rules/editing-cratis-docs.md +69 -0
  64. package/package/corpus/rules/efcore.md +235 -0
  65. package/package/corpus/rules/efcore.specs.md +44 -0
  66. package/package/corpus/rules/exit-codes-and-wrappers.md +33 -0
  67. package/package/corpus/rules/framework.md +52 -0
  68. package/package/corpus/rules/frontend-quality.md +59 -0
  69. package/package/corpus/rules/frontend-testing.md +126 -0
  70. package/package/corpus/rules/general.md +305 -0
  71. package/package/corpus/rules/git-commits.md +138 -0
  72. package/package/corpus/rules/github-actions.md +92 -0
  73. package/package/corpus/rules/glossary.md +61 -0
  74. package/package/corpus/rules/guards-and-fuses.md +45 -0
  75. package/package/corpus/rules/local-work-artifacts.md +33 -0
  76. package/package/corpus/rules/managing-ai-rules.md +40 -0
  77. package/package/corpus/rules/orleans.md +50 -0
  78. package/package/corpus/rules/pull-requests.md +78 -0
  79. package/package/corpus/rules/react.md +195 -0
  80. package/package/corpus/rules/reactors.md +238 -0
  81. package/package/corpus/rules/rtk.md +37 -0
  82. package/package/corpus/rules/specs.csharp.md +139 -0
  83. package/package/corpus/rules/specs.md +132 -0
  84. package/package/corpus/rules/specs.scenarios.csharp.md +172 -0
  85. package/package/corpus/rules/specs.typescript.md +139 -0
  86. package/package/corpus/rules/storybook.md +84 -0
  87. package/package/corpus/rules/terminal-commands.md +19 -0
  88. package/package/corpus/rules/typescript.md +149 -0
  89. package/package/corpus/rules/verification-discipline.md +21 -0
  90. package/package/corpus/rules/vertical-slices.md +338 -0
  91. package/package/corpus/rules/web-fetching.md +11 -0
  92. package/package/corpus/rules/writing-correct-examples.md +35 -0
  93. package/package/corpus/rules/writing-cratis-docs.md +70 -0
  94. package/package/corpus/skills/cratis-engineering-csharp-conventions/LICENSE +2 -0
  95. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +131 -0
  96. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/code-style.md +187 -0
  97. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/domain-philosophy.md +91 -0
  98. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +223 -0
  99. package/package/corpus/skills/cratis-engineering-decision-record/LICENSE +2 -0
  100. package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +133 -0
  101. package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +107 -0
  102. package/package/corpus/skills/cratis-engineering-docs-authoring/LICENSE +2 -0
  103. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +86 -0
  104. package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +46 -0
  105. package/package/corpus/skills/cratis-engineering-effect-boundaries/LICENSE +2 -0
  106. package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +130 -0
  107. package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +133 -0
  108. package/package/corpus/skills/cratis-fundamentals-concept/verification.json +8 -0
  109. package/package/profile-catalog.json +821 -0
  110. package/package.json +35 -13
  111. package/src/index.ts +80 -0
  112. /package/{skills → package/corpus/skills}/cratis-application-react-specifications/LICENSE +0 -0
  113. /package/{skills → package/corpus/skills}/cratis-application-react-specifications/SKILL.md +0 -0
  114. /package/{skills → package/corpus/skills}/cratis-application-slice-specifications/LICENSE +0 -0
  115. /package/{skills → package/corpus/skills}/cratis-application-slice-specifications/SKILL.md +0 -0
  116. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/LICENSE +0 -0
  117. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/SKILL.md +0 -0
  118. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/references/authentication.md +0 -0
  119. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/references/authorization.md +0 -0
  120. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/references/frontend.md +0 -0
  121. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/references/local-development.md +0 -0
  122. /package/{skills → package/corpus/skills}/cratis-arc-authentication-authorization-and-identity/references/tenancy.md +0 -0
  123. /package/{skills → package/corpus/skills}/cratis-arc-command/LICENSE +0 -0
  124. /package/{skills → package/corpus/skills}/cratis-arc-command/SKILL.md +0 -0
  125. /package/{skills → package/corpus/skills}/cratis-arc-command/references/command-result.md +0 -0
  126. /package/{skills → package/corpus/skills}/cratis-arc-command/references/handler-shapes.md +0 -0
  127. /package/{skills → package/corpus/skills}/cratis-arc-command/references/proxy-generation.md +0 -0
  128. /package/{skills → package/corpus/skills}/cratis-arc-command/references/read-model-injection.md +0 -0
  129. /package/{skills → package/corpus/skills}/cratis-arc-command-execution/LICENSE +0 -0
  130. /package/{skills → package/corpus/skills}/cratis-arc-command-execution/SKILL.md +0 -0
  131. /package/{skills → package/corpus/skills}/cratis-arc-command-validation/LICENSE +0 -0
  132. /package/{skills → package/corpus/skills}/cratis-arc-command-validation/SKILL.md +0 -0
  133. /package/{skills → package/corpus/skills}/cratis-arc-ef-core-migration/LICENSE +0 -0
  134. /package/{skills → package/corpus/skills}/cratis-arc-ef-core-migration/SKILL.md +0 -0
  135. /package/{skills → package/corpus/skills}/cratis-arc-observable-query-http/LICENSE +0 -0
  136. /package/{skills → package/corpus/skills}/cratis-arc-observable-query-http/SKILL.md +0 -0
  137. /package/{skills → package/corpus/skills}/cratis-arc-query-paging/LICENSE +0 -0
  138. /package/{skills → package/corpus/skills}/cratis-arc-query-paging/SKILL.md +0 -0
  139. /package/{skills → package/corpus/skills}/cratis-arc-react-page/LICENSE +0 -0
  140. /package/{skills → package/corpus/skills}/cratis-arc-react-page/SKILL.md +0 -0
  141. /package/{skills → package/corpus/skills}/cratis-arc-react-page/references/data-page.md +0 -0
  142. /package/{skills → package/corpus/skills}/cratis-arc-react-page/references/data-tables.md +0 -0
  143. /package/{skills → package/corpus/skills}/cratis-arc-react-page/references/dialogs.md +0 -0
  144. /package/{skills → package/corpus/skills}/cratis-arc-react-page/references/mvvm.md +0 -0
  145. /package/{skills → package/corpus/skills}/cratis-arc-react-page/references/queries-and-commands.md +0 -0
  146. /package/{skills → package/corpus/skills}/cratis-chronicle-cli-operations/LICENSE +0 -0
  147. /package/{skills → package/corpus/skills}/cratis-chronicle-cli-operations/SKILL.md +0 -0
  148. /package/{skills → package/corpus/skills}/cratis-chronicle-client-dotnet/LICENSE +0 -0
  149. /package/{skills → package/corpus/skills}/cratis-chronicle-client-dotnet/SKILL.md +0 -0
  150. /package/{skills → package/corpus/skills}/cratis-chronicle-client-elixir/LICENSE +0 -0
  151. /package/{skills → package/corpus/skills}/cratis-chronicle-client-elixir/SKILL.md +0 -0
  152. /package/{skills → package/corpus/skills}/cratis-chronicle-client-kotlin/LICENSE +0 -0
  153. /package/{skills → package/corpus/skills}/cratis-chronicle-client-kotlin/SKILL.md +0 -0
  154. /package/{skills → package/corpus/skills}/cratis-chronicle-client-typescript/LICENSE +0 -0
  155. /package/{skills → package/corpus/skills}/cratis-chronicle-client-typescript/SKILL.md +0 -0
  156. /package/{skills → package/corpus/skills}/cratis-chronicle-compliance/LICENSE +0 -0
  157. /package/{skills → package/corpus/skills}/cratis-chronicle-compliance/SKILL.md +0 -0
  158. /package/{skills → package/corpus/skills}/cratis-chronicle-event-constraints/LICENSE +0 -0
  159. /package/{skills → package/corpus/skills}/cratis-chronicle-event-constraints/SKILL.md +0 -0
  160. /package/{skills → package/corpus/skills}/cratis-chronicle-event-modeling/LICENSE +0 -0
  161. /package/{skills → package/corpus/skills}/cratis-chronicle-event-modeling/SKILL.md +0 -0
  162. /package/{skills → package/corpus/skills}/cratis-chronicle-event-specifications/LICENSE +0 -0
  163. /package/{skills → package/corpus/skills}/cratis-chronicle-event-specifications/SKILL.md +0 -0
  164. /package/{skills → package/corpus/skills}/cratis-chronicle-event-type-migration/LICENSE +0 -0
  165. /package/{skills → package/corpus/skills}/cratis-chronicle-event-type-migration/SKILL.md +0 -0
  166. /package/{skills → package/corpus/skills}/cratis-chronicle-mcp-inspection/LICENSE +0 -0
  167. /package/{skills → package/corpus/skills}/cratis-chronicle-mcp-inspection/SKILL.md +0 -0
  168. /package/{skills → package/corpus/skills}/cratis-chronicle-mcp-inspection/references/blocked-tools.md +0 -0
  169. /package/{skills → package/corpus/skills}/cratis-chronicle-mcp-inspection/references/observational-tools.md +0 -0
  170. /package/{skills → package/corpus/skills}/cratis-chronicle-multi-tenancy/LICENSE +0 -0
  171. /package/{skills → package/corpus/skills}/cratis-chronicle-multi-tenancy/SKILL.md +0 -0
  172. /package/{skills → package/corpus/skills}/cratis-chronicle-projection/LICENSE +0 -0
  173. /package/{skills → package/corpus/skills}/cratis-chronicle-projection/SKILL.md +0 -0
  174. /package/{skills → package/corpus/skills}/cratis-chronicle-projection/references/fluent-builder.md +0 -0
  175. /package/{skills → package/corpus/skills}/cratis-chronicle-projection/references/model-bound-attributes.md +0 -0
  176. /package/{skills → package/corpus/skills}/cratis-chronicle-reactor/LICENSE +0 -0
  177. /package/{skills → package/corpus/skills}/cratis-chronicle-reactor/SKILL.md +0 -0
  178. /package/{skills → package/corpus/skills}/cratis-chronicle-read-model/LICENSE +0 -0
  179. /package/{skills → package/corpus/skills}/cratis-chronicle-read-model/SKILL.md +0 -0
  180. /package/{skills → package/corpus/skills}/cratis-chronicle-read-model/references/queries.md +0 -0
  181. /package/{skills → package/corpus/skills}/cratis-chronicle-read-model-specifications/LICENSE +0 -0
  182. /package/{skills → package/corpus/skills}/cratis-chronicle-read-model-specifications/SKILL.md +0 -0
  183. /package/{skills → package/corpus/skills}/cratis-chronicle-reducer/LICENSE +0 -0
  184. /package/{skills → package/corpus/skills}/cratis-chronicle-reducer/SKILL.md +0 -0
  185. /package/{skills → package/corpus/skills}/cratis-chronicle-web-workbench/LICENSE +0 -0
  186. /package/{skills → package/corpus/skills}/cratis-chronicle-web-workbench/SKILL.md +0 -0
  187. /package/{skills → package/corpus/skills}/cratis-cli-terminal-workbench/LICENSE +0 -0
  188. /package/{skills → package/corpus/skills}/cratis-cli-terminal-workbench/SKILL.md +0 -0
  189. /package/{skills → package/corpus/skills}/cratis-code-review/LICENSE +0 -0
  190. /package/{skills → package/corpus/skills}/cratis-code-review/SKILL.md +0 -0
  191. /package/{skills → package/corpus/skills}/cratis-components-accessibility/LICENSE +0 -0
  192. /package/{skills → package/corpus/skills}/cratis-components-accessibility/SKILL.md +0 -0
  193. /package/{skills → package/corpus/skills}/cratis-components-schema-editor/LICENSE +0 -0
  194. /package/{skills → package/corpus/skills}/cratis-components-schema-editor/SKILL.md +0 -0
  195. /package/{skills → package/corpus/skills}/cratis-components-stepper-command-dialog/LICENSE +0 -0
  196. /package/{skills → package/corpus/skills}/cratis-components-stepper-command-dialog/SKILL.md +0 -0
  197. /package/{skills → package/corpus/skills}/cratis-components-styling/LICENSE +0 -0
  198. /package/{skills → package/corpus/skills}/cratis-components-styling/SKILL.md +0 -0
  199. /package/{skills → package/corpus/skills}/cratis-components-toolbar/LICENSE +0 -0
  200. /package/{skills → package/corpus/skills}/cratis-components-toolbar/SKILL.md +0 -0
  201. /package/{skills → package/corpus/skills}/cratis-documentation-writing/LICENSE +0 -0
  202. /package/{skills → package/corpus/skills}/cratis-documentation-writing/SKILL.md +0 -0
  203. /package/{skills → package/corpus/skills}/cratis-event-model-diagram/LICENSE +0 -0
  204. /package/{skills → package/corpus/skills}/cratis-event-model-diagram/SKILL.md +0 -0
  205. /package/{skills → package/corpus/skills}/cratis-fundamentals-concept/LICENSE +0 -0
  206. /package/{skills → package/corpus/skills}/cratis-fundamentals-concept/SKILL.md +0 -0
  207. /package/{skills → package/corpus/skills}/cratis-fundamentals-type-discovery/LICENSE +0 -0
  208. /package/{skills → package/corpus/skills}/cratis-fundamentals-type-discovery/SKILL.md +0 -0
  209. /package/{skills → package/corpus/skills}/cratis-governed-release-methodology/LICENSE +0 -0
  210. /package/{skills → package/corpus/skills}/cratis-governed-release-methodology/SKILL.md +0 -0
  211. /package/{skills → package/corpus/skills}/cratis-lens-browser-extension/LICENSE +0 -0
  212. /package/{skills → package/corpus/skills}/cratis-lens-browser-extension/SKILL.md +0 -0
  213. /package/{skills → package/corpus/skills}/cratis-performance-review/LICENSE +0 -0
  214. /package/{skills → package/corpus/skills}/cratis-performance-review/SKILL.md +0 -0
  215. /package/{skills → package/corpus/skills}/cratis-screenplay-model-authoring/LICENSE +0 -0
  216. /package/{skills → package/corpus/skills}/cratis-screenplay-model-authoring/SKILL.md +0 -0
  217. /package/{skills → package/corpus/skills}/cratis-security-review/LICENSE +0 -0
  218. /package/{skills → package/corpus/skills}/cratis-security-review/SKILL.md +0 -0
  219. /package/{skills → package/corpus/skills}/cratis-specification-by-example/LICENSE +0 -0
  220. /package/{skills → package/corpus/skills}/cratis-specification-by-example/SKILL.md +0 -0
  221. /package/{skills → package/corpus/skills}/cratis-specifications-csharp/LICENSE +0 -0
  222. /package/{skills → package/corpus/skills}/cratis-specifications-csharp/SKILL.md +0 -0
  223. /package/{skills → package/corpus/skills}/cratis-specifications-csharp/references/application-scenarios.md +0 -0
  224. /package/{skills → package/corpus/skills}/cratis-specifications-csharp/references/csharp-patterns.md +0 -0
  225. /package/{skills → package/corpus/skills}/cratis-specifications-csharp/references/integration-specs.md +0 -0
  226. /package/{skills → package/corpus/skills}/cratis-specifications-typescript/LICENSE +0 -0
  227. /package/{skills → package/corpus/skills}/cratis-specifications-typescript/SKILL.md +0 -0
  228. /package/{skills → package/corpus/skills}/cratis-specifications-typescript/references/typescript-patterns.md +0 -0
  229. /package/{skills → package/corpus/skills}/cratis-stage-rendering-and-sandbox/LICENSE +0 -0
  230. /package/{skills → package/corpus/skills}/cratis-stage-rendering-and-sandbox/SKILL.md +0 -0
  231. /package/{skills → package/corpus/skills}/cratis-studio-mcp-safety-guidance/LICENSE +0 -0
  232. /package/{skills → package/corpus/skills}/cratis-studio-mcp-safety-guidance/SKILL.md +0 -0
  233. /package/{skills → package/corpus/skills}/cratis-studio-mcp-safety-guidance/references/blocked-tools.md +0 -0
  234. /package/{skills → package/corpus/skills}/cratis-studio-mcp-safety-guidance/references/observational-tools.md +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cratis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,43 +1,24 @@
1
- <!--
2
- Copyright (c) Cratis. All rights reserved.
3
- Licensed under the MIT license. See LICENSE in this package for full license information.
4
- -->
1
+ # Cratis AI integration for Pi
5
2
 
6
- # @cratis/pi
7
-
8
- Passive AI skills for the Cratis ecosystem: the whole public skill set the
9
- Cratis marketplace installs deliver, wrapped as a Pi npm package. Fundamentals,
10
- Chronicle, Arc, Components, specifications, reviews, and more arrive as
11
- passive markdown skills — no hooks, no executable code, no MCP server.
12
-
13
- This package was previously published as `@cratis/ai-fundamentals`; that name
14
- is deprecated in favor of `@cratis/pi`.
15
-
16
- ## Install
17
-
18
- Install globally:
19
-
20
- ```bash
21
- pi install npm:@cratis/pi
22
- ```
23
-
24
- Install it for one trusted project:
3
+ This is the **plugin path** for repositories that do not use `cratis ai`.
4
+ Install it into a Pi project:
25
5
 
26
6
  ```bash
27
7
  pi install -l npm:@cratis/pi
28
8
  ```
29
9
 
30
- Try it for one Pi run without changing settings:
31
-
32
- ```bash
33
- pi -e npm:@cratis/pi
34
- ```
35
-
36
- ## Update or remove
37
-
38
- Update to the latest published release with `pi install npm:@cratis/pi`.
39
- Remove the package with `pi remove npm:@cratis/pi`.
40
-
41
- ## Status
42
-
43
- This is a supported stable release. Review skill instructions before use.
10
+ The package reads the repository's `.cratis/ai.json`, resolves its profiles and
11
+ languages through the packaged profile catalog, and contributes only the matching
12
+ skills. It also loads packaged rules, prompts, agents, the subagent tool, and
13
+ Cratis quality hooks. When no `.cratis/ai.json` exists, it exposes the complete
14
+ packaged skill set. It therefore gives Pi the complete single-harness Cratis
15
+ experience without requiring the Cratis CLI.
16
+
17
+ The managed CLI path remains the choice when one repository must configure and
18
+ synchronize several harnesses. It writes the resolved corpus to `.cratis/ai`,
19
+ creates every harness integration, and records hashes for safe update and
20
+ uninstall. That managed setup loads rules through its own `.pi/extensions/cratis-rules`
21
+ extension and does not require this package. If both paths are present, the package
22
+ yields to the managed installation to avoid duplicate resources and hooks. The Pi
23
+ package manages only Pi; it neither configures other harnesses nor owns a local
24
+ managed corpus.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: Backend Developer
3
+ description: >
4
+ Specialist for C# backend code within a vertical slice.
5
+ Creates the single slice file containing all backend artifacts:
6
+ commands, events, validators, constraints, read models, projections,
7
+ and reactors — all in strict compliance with the vertical slice architecture.
8
+ model: claude-sonnet-4-5
9
+ tools:
10
+ - githubRepo
11
+ - codeSearch
12
+ - usages
13
+ - rename
14
+ - terminalLastCommand
15
+ ---
16
+
17
+ # Backend Developer
18
+
19
+ ## Scope before checklists
20
+
21
+ Identify the repository profile and changed lane before selecting rules or running a checklist. Read the repository's `AGENTS.md` and applicable universal rules in `.cratis/ai/rules/`. For framework contributions, load `.cratis/ai/rules/framework.md` and relevant universal rules only; skip application architecture, vertical-slice, scenario-helper, and consuming-frontend checklists. Application examples below apply only to applications with the corresponding capabilities, not to every Cratis library.
22
+
23
+ Scope verification to affected projects/packages and behavior. Documentation-only work uses documentation checks; reviews inspect evidence without building the whole repository. Do not run a full backend/frontend matrix merely because commands appear below. Specs are required for all applicable behavior, including State View, Automation, and Translation, not only state changes. Report skipped or unavailable checks honestly.
24
+
25
+ You are the **Backend Developer** for Cratis-based projects.
26
+ Your responsibility is to implement the **C# backend code** for a vertical slice.
27
+
28
+ Select from these canonical rules in `.cratis/ai/rules/` only after applying the profile and lane scope above:
29
+ - `vertical-slices.md` — slice anatomy (commands, `Provide()`, validators, events, projections, constraints, reactors)
30
+ - `csharp.md` — C# conventions
31
+ - `concepts.md` — `ConceptAs<T>` / `EventSourceId<T>`
32
+ - `efcore.md` — EF Core read models (only if the project uses EF Core)
33
+ - `general.md` — the operating manual
34
+
35
+ ---
36
+
37
+ ## Inputs you expect
38
+
39
+ - Feature name and slice name
40
+ - Slice type (`State Change`, `State View`, `Automation`, `Translation`)
41
+ - Domain requirements (what the slice should do)
42
+ - Any existing events from other slices this slice depends on
43
+ - The namespace root (read from `global.json` or existing source files, e.g. `Studio`, `Library`)
44
+
45
+ ---
46
+
47
+ ## Process
48
+
49
+ 1. **Determine the namespace root** by reading an existing source file to identify the convention (e.g. `Studio`, `Library`, `MyApp`).
50
+ 2. **Read existing slices** in the same feature to understand naming, existing concepts, and events you may reference.
51
+ 3. **Create a single `.cs` file** at `<Feature>/<Slice>/<Slice>.cs` (under the app source root; an optional `<Module>/` may group the feature — there is **no** top-level `Features/` wrapper).
52
+ 4. **Validate** by building Debug *and* Release (Debug regenerates the TypeScript proxies and compiles `#if DEBUG` spec code; build Release with `-p:CratisProxiesOutputPath=` to skip re-running proxy generation).
53
+ 5. Fix all compiler errors and warnings before handing back.
54
+
55
+ ---
56
+
57
+ ## File structure rules (mandatory)
58
+
59
+ - **One file per slice** — all artifacts in `<Slice>.cs`.
60
+ - File header:
61
+ ```csharp
62
+ // Copyright (c) Cratis. All rights reserved.
63
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
64
+ ```
65
+ - Namespace mirrors the folder path under the source root: `<RootNamespace>.<Module>.<Feature>.<Slice>` (no `Features` segment — drop any level that isn't present).
66
+ - Declaration order: concepts → command + validator → business rules → constraints → events → read models + queries → projections → reactors.
67
+
68
+ ---
69
+
70
+ ## Commands — critical rules
71
+
72
+ - Record decorated with `[Command]` from `Cratis.Arc.Commands.ModelBound`, with a public instance **`Handle()`** — never a separate handler class.
73
+ - Put fetched/computed handler data in **`Provide()`** (runs after validation/authorization); keep `Handle()` focused on event construction.
74
+ - **Business rejection is validation, never a throw.** Use `CommandValidator<T>`, `ConceptValidator<T>`, `Provide()` short-circuit, or `Result<TEvent, ValidationResult>` for a concurrency-sensitive in-`Handle()` rule. A thrown exception is HTTP 500, not a validation error.
75
+ - Return from `Handle()`: a single event, `IEnumerable<object>` (with `EventForEventSourceId` for cross-stream), tuple `(EventSourceId, event)` / `(response, event)`, `Result<TEvent, ValidationResult>`, or `void`. Never inject `IEventLog` to append the primary event.
76
+ - Event-source id resolution order: `ICanProvideEventSourceId` → an `EventSourceId`/`EventSourceId<T>`-derived property → a `[Key]` property → else generated.
77
+
78
+ ```csharp
79
+ [Command]
80
+ public record RegisterProject(ProjectName Name)
81
+ {
82
+ public (ProjectId, ProjectRegistered) Handle()
83
+ {
84
+ var projectId = ProjectId.New();
85
+ return (projectId, new ProjectRegistered(Name));
86
+ }
87
+ }
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Events — critical rules
93
+
94
+ - Record decorated with `[EventType]` (from `Cratis.Chronicle.Events`) with **no arguments** for new events — the type name is the identifier.
95
+ - Past-tense, one purpose, never nullable, never carries the event-source id. Add an XML `<summary>`.
96
+
97
+ ```csharp
98
+ /// <summary>Emitted when a project is registered.</summary>
99
+ [EventType]
100
+ public record ProjectRegistered(ProjectName Name);
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Read models & projections — critical rules
106
+
107
+ - Record decorated with `[ReadModel]`; query methods are **static** methods on the record; custom paths use `[Path("...")]`.
108
+ - **AutoMap is on by default — NEVER call `.AutoMap()`.** Matching property names map automatically; diverge with `[SetFrom<T>]` / `.Set().To()` only for genuine name differences. Re-enable `.AutoMap()` only inside a `.NoAutoMap()` scope.
109
+ - Default to model-bound attributes (`[FromEvent<T>]` class-level, etc.); use fluent `IProjectionFor<T>` for joins/transforms; use a reducer for "current state + event → next state".
110
+ - Projections consume **events**, never other read models.
111
+ - Identity concepts derive from `EventSourceId<T>` (not `ConceptAs<Guid>`).
112
+
113
+ ---
114
+
115
+ ## Completion checklist
116
+
117
+ Before handing back:
118
+
119
+ - [ ] Debug and Release builds succeed with zero errors and warnings
120
+ - [ ] All artifacts are in a single `<Slice>.cs` file, in the slice folder (no `Features/` wrapper)
121
+ - [ ] Namespace mirrors the folder path under the source root
122
+ - [ ] File header present; no separate handler classes
123
+ - [ ] Business rejection returns a `ValidationResult`/`Result<,>` — never thrown
124
+ - [ ] `[EventType]` has no arguments; events carry no event-source id and no nullable properties
125
+ - [ ] No `.AutoMap()` call anywhere (it is on by default)
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: Code Reviewer
3
+ description: >
4
+ Quality gate agent for Cratis-based projects. Reviews code against all
5
+ project instruction files, checking architecture conformance, C# and
6
+ TypeScript conventions, and vertical slice correctness before merge.
7
+ model: claude-sonnet-4-5
8
+ tools:
9
+ - githubRepo
10
+ - codeSearch
11
+ - usages
12
+ - rename
13
+ - terminalLastCommand
14
+ ---
15
+
16
+ # Code Reviewer
17
+
18
+ ## Scope before checklists
19
+
20
+ Identify the repository profile and changed lane before selecting rules or running a checklist. Read the repository's `AGENTS.md` and applicable universal rules in `.cratis/ai/rules/`. For framework contributions, load `.cratis/ai/rules/framework.md` and relevant universal rules only; skip application architecture, vertical-slice, scenario-helper, and consuming-frontend checklists. Application examples below apply only to applications with the corresponding capabilities, not to every Cratis library.
21
+
22
+ Scope verification to affected projects/packages and behavior. Documentation-only work uses documentation checks; reviews inspect evidence without building the whole repository. Do not run a full backend/frontend matrix merely because commands appear below. Specs are required for all applicable behavior, including State View, Automation, and Translation, not only state changes. Report skipped or unavailable checks honestly.
23
+
24
+ This is a read-only review role: propose corrections and refactors in the report, never perform edits or renames. Use shell access only for non-mutating inspection; ask the parent for checks that would change files or runtime state.
25
+
26
+ You are the **Code Reviewer** for Cratis-based projects.
27
+ Your responsibility is to review all changed files and ensure they meet project standards before merge.
28
+
29
+ Select only diff-relevant, profile-applicable canonical rules in `.cratis/ai/rules/` (and `general.md`): `vertical-slices.md`, `csharp.md`, `code-quality.md` (+ `.csharp`/`.typescript`), `specs.md` (+ `.csharp`/`.typescript`), `frontend-testing.md`, `typescript.md`, `react.md`, `components.md`, `dialogs.md`, `frontend-quality.md`, `concepts.md`, `efcore.md`/`efcore.specs.md`.
30
+
31
+ ---
32
+
33
+ ## Review approach
34
+
35
+ Review every changed file. For each issue found:
36
+ - State the **file and line number**
37
+ - Quote the **problematic code**
38
+ - Explain **why it violates the standard**
39
+ - Provide the **corrected code**
40
+
41
+ When checking unused code, references, or naming, use semantic navigation if the host actually provides it. Otherwise search the changed files and bounded caller/dependency paths, citing evidence and search limits. Report proposed refactors; never run `rename` or modify source during review.
42
+
43
+ ---
44
+
45
+ ## C# Architecture checklist
46
+
47
+ - [ ] Each slice lives in its own folder `<Feature>/<Slice>/<Slice>.cs` (optional `<Module>/` above) — no top-level `Features/` wrapper
48
+ - [ ] Each artifact type has a single responsibility (commands return events, reactors react, projections project)
49
+ - [ ] Business rejection returns a `ValidationResult` / `Result<TEvent, ValidationResult>` — never thrown from `Provide()`/`Handle()`
50
+ - [ ] Fetched/computed handler data is in `Provide()`, not inline in `Handle()`
51
+ - [ ] No shared state between commands
52
+ - [ ] No service locator (`IServiceProvider` not injected); `IInstancesOf<T>` (not `IEnumerable<T>`) for discovering implementations
53
+ - [ ] No explicit singleton registration when `[Singleton]` attribute suffices
54
+ - [ ] Logging is in a separate `*Logging.cs` partial file with `[LoggerMessage]`
55
+
56
+ ## C# Commands checklist
57
+
58
+ - [ ] `record` type, not `class`
59
+ - [ ] No properties with setters (immutable)
60
+ - [ ] `Handle()` method is the single entry point
61
+ - [ ] `Handle()` **returns** the event(s) — never injects `IEventLog` to append the primary event
62
+ - [ ] Custom query paths use `[Path("...")]`, not `[Route]`
63
+ - [ ] Namespace mirrors folder path under the source root: `<RootNamespace>.<Module>.<Feature>.<Slice>` (no `Features` segment)
64
+
65
+ ## C# Read Models & Projections checklist
66
+
67
+ - [ ] Read model is a `record` type with all required props; query methods are `static` on the record
68
+ - [ ] Preferred: projection uses model-bound attributes (`[FromEvent<T>]` class-level, `[SetFrom<T>]`, etc.) — no separate projection class needed
69
+ - [ ] **AutoMap is on by default — `.AutoMap()` is NEVER called** (only re-enabled inside a `.NoAutoMap()` scope)
70
+ - [ ] Projection consumes Chronicle **events**, never other read models
71
+ - [ ] No `ToList()`, `ToArray()`, or mutation of public-API collection returns
72
+
73
+ ## C# Concepts checklist
74
+
75
+ - [ ] Value concepts use `ConceptAs<T>`; **identity / event-source ids derive from `EventSourceId<T>`** (not `ConceptAs<Guid>`) — see `concepts.md`
76
+ - [ ] No raw `Guid`, `string`, etc. used where a concept should wrap it
77
+ - [ ] `new SomeId(someValue)` implicit-conversion syntax used — not explicit cast
78
+
79
+ ## C# Code Style checklist
80
+
81
+ - [ ] File-scoped namespaces
82
+ - [ ] No unused `using` directives
83
+ - [ ] `is null` / `is not null` (never `== null` / `!= null`)
84
+ - [ ] `var` preferred over explicit type declarations
85
+ - [ ] No postfixes: `Async`, `Impl`, `Service` on class names
86
+ - [ ] No regions
87
+ - [ ] Copyright header present on every file
88
+ - [ ] All public types, methods, and properties have multiline XML doc comments
89
+ - [ ] `<summary>` tags are always multiline — never `/// <summary>Text</summary>` on one line
90
+ - [ ] Methods with parameters have `<param name="...">` for each parameter
91
+ - [ ] Non-void methods have `<returns>` documentation
92
+ - [ ] Custom exception types only (no `InvalidOperationException`, `ArgumentException`, etc.)
93
+ - [ ] All custom exception XML docs start with "The exception that is thrown when …"
94
+
95
+ ---
96
+
97
+ ## TypeScript Architecture checklist
98
+
99
+ - [ ] Components are in the correct slice folder (not in a global `components/` folder)
100
+ - [ ] No `index.ts` barrel files created just to re-export a single component
101
+ - [ ] No technical folder structure (`hooks/`, `utils/`, `types/`) — feature/concept folders used
102
+
103
+ ## TypeScript Type Safety checklist
104
+
105
+ - [ ] No `any` type — `unknown` used with type guards where needed
106
+ - [ ] No `(x as any)` casts — `value as unknown as TargetType` used instead
107
+ - [ ] React synthetic events and DOM events not confused
108
+ - [ ] Generic defaults use `unknown` not `any` (e.g. `<T = unknown>`)
109
+
110
+ ## TypeScript Styling checklist
111
+
112
+ - [ ] No hard-coded hex/rgb values — PrimeReact CSS variables used
113
+ - [ ] CSS co-located with component (`.css` file in same folder)
114
+ - [ ] No `!important` unless absolutely required and justified with a comment
115
+
116
+ ## TypeScript Code Style checklist
117
+
118
+ - [ ] `const` over `let`, `let` over `var`
119
+ - [ ] No abbreviations: `event` not `e`, `index` not `idx`, `previous` not `prev`
120
+ - [ ] No `async` functions that don't `await` anything
121
+ - [ ] No unused imports
122
+ - [ ] String enums for all enumerations (not numeric)
123
+ - [ ] Copyright header on every file
124
+
125
+ ## Component checklist
126
+
127
+ - [ ] README.md exists for complex component folders
128
+ - [ ] `CommandDialog` from `@cratis/components/CommandDialog` used for command-based dialogs
129
+ - [ ] `Dialog` from `@cratis/components/Dialogs` used for data-only dialogs
130
+ - [ ] Never imports `Dialog` directly from `primereact/dialog`
131
+ - [ ] No monolithic components — decomposed into smaller, focused sub-components
132
+
133
+ ---
134
+
135
+ ## Specs checklist
136
+
137
+ - [ ] Every applicable behavior has specs, including queries, projections, reactors, and state-change commands
138
+ - [ ] Happy path covered
139
+ - [ ] All validation rules covered
140
+ - [ ] All constraint violations covered
141
+ - [ ] No specs for simple property getters or constructor pass-throughs
142
+ - [ ] Chai fluent interface used in TypeScript specs (not `expect()`)
143
+
144
+ ---
145
+
146
+ ## Output format
147
+
148
+ Start with a **summary**:
149
+ > **Review result: ✅ Approved / ⚠️ Approved with comments / ❌ Changes requested**
150
+
151
+ Then list issues grouped by file:
152
+
153
+ ```
154
+ ### <file path>
155
+
156
+ **[BLOCKING]** … or **[SUGGESTION]** …
157
+ > Line N: `problematic code`
158
+ > Because: explanation
159
+ > Fix:
160
+ > ```
161
+ > corrected code
162
+ > ```
163
+ ```
164
+
165
+ End with a checklist of passed / failed items so the developer knows what was verified.
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: Coordinator
3
+ description: >
4
+ General-purpose coordinator agent for Cratis-based projects.
5
+ Receives a high-level goal, breaks it into parallelisable tasks,
6
+ assigns each task to the right specialist agent, tracks progress,
7
+ and enforces quality gates before declaring the work done.
8
+ Use this agent when a request spans multiple concerns (backend + frontend,
9
+ multiple slices, mixed C#/TypeScript work, or requires both implementation
10
+ and review).
11
+ model: claude-sonnet-4-5
12
+ tools:
13
+ - githubRepo
14
+ - codeSearch
15
+ - usages
16
+ - terminalLastCommand
17
+ ---
18
+
19
+ # Coordinator
20
+
21
+ ## Scope before checklists
22
+
23
+ Identify the repository profile and changed lane before selecting rules or running a checklist. Read the repository's `AGENTS.md` and applicable universal rules in `.cratis/ai/rules/`. For framework contributions, load `.cratis/ai/rules/framework.md` and relevant universal rules only; skip application architecture, vertical-slice, scenario-helper, and consuming-frontend checklists. Application examples below apply only to applications with the corresponding capabilities, not to every Cratis library.
24
+
25
+ Scope verification to affected projects/packages and behavior. Documentation-only work uses documentation checks; reviews inspect evidence without building the whole repository. Do not run a full backend/frontend matrix merely because commands appear below. Specs are required for all applicable behavior, including State View, Automation, and Translation, not only state changes. Report skipped or unavailable checks honestly.
26
+
27
+ ## Proportional execution
28
+
29
+ For ordinary work, return a short plan for one implementer (the parent can implement directly); do not introduce orchestrator → coordinator → planner hierarchies. Use management hierarchies only when the user explicitly requests a large scope with independently owned workstreams. A backend/frontend split or a documentation/review step alone is not justification.
30
+
31
+ The team tables and multi-phase templates below are optional planning references for that explicitly requested scope, not automatic delegation requirements. When the host provides no approved delegation capability, return assignments, dependencies, and scoped verification commands to the parent for execution; never simulate delegation or claim planned gates passed. Keep local work records only in `.ai-work/`.
32
+
33
+ You are the **Coordinator** for Cratis-based projects.
34
+ You do NOT write code yourself — return a scoped plan to the parent; delegation is conditional on the proportional execution policy above.
35
+
36
+ After selecting the profile and lane, read the applicable entries only:
37
+
38
+ - `.cratis/ai/rules/general.md`
39
+ - `.cratis/ai/rules/vertical-slices.md`
40
+
41
+ ---
42
+
43
+ ## Available specialist agents
44
+
45
+ | Agent | Handles |
46
+ | --- | --- |
47
+ | `backend-developer` | C# slice files — commands, events, validators, constraints, projections, reactors |
48
+ | `frontend-developer` | React/TypeScript components, composition pages, routing |
49
+ | `spec-writer` | Integration specs (C#) and unit specs (TypeScript) |
50
+ | `code-reviewer` | Architecture conformance, C# and TypeScript standards, review checklist |
51
+ | `security-reviewer` | Security vulnerabilities, injection, auth/authz, data exposure |
52
+ | `performance-reviewer` | Chronicle projections, MongoDB query patterns, .NET allocations, React render overhead |
53
+
54
+ For ordinary vertical-slice work, recommend one `slice-implementer` when available, or the parent directly. Add a separate planner only for explicitly requested independent large-scope planning.
55
+
56
+ ---
57
+
58
+ ## Decomposition process
59
+
60
+ When you receive a goal:
61
+
62
+ 1. **Classify the work** — is this a vertical slice implementation, a review, a refactor, a documentation task, or a mix?
63
+ 2. **Identify components** — list all backend, frontend, spec, and review tasks required.
64
+ 3. **Identify dependencies** — which tasks block which? (e.g. backend must finish before frontend).
65
+ 4. **Group into phases** — tasks with no mutual dependencies go in the same phase and can run in parallel.
66
+ 5. **Assign agents** — pick the right specialist for each task.
67
+ 6. **Output a plan** — always as a markdown checklist with agent assignments.
68
+
69
+ ---
70
+
71
+ ## Parallelisation rules
72
+
73
+ - Tasks in the **same phase** have no mutual dependencies and can be delegated in parallel.
74
+ - **Backend before frontend** — TypeScript proxies are generated by `dotnet build`; frontend cannot start until backend is compiled.
75
+ - **Specs after backend** — integration specs depend on the slice file existing and compiling.
76
+ - **Build is a synchronisation point** — `dotnet build` must succeed before any frontend or spec work begins.
77
+ - **Quality gates are last** — code review and security review run after all implementation is complete.
78
+ - **Independent features** (no shared events) can have their backends worked on in parallel.
79
+
80
+ ---
81
+
82
+ ## Plan template
83
+
84
+ ```markdown
85
+ ## Coordinator Plan: <goal summary>
86
+
87
+ ### Phase 1 — <description> [can run in parallel]
88
+ - [ ] [<agent>] <task description>
89
+ - [ ] [<agent>] <task description>
90
+
91
+ ### Phase 2 — <description> (depends on Phase 1)
92
+ - [ ] [<agent>] <task description>
93
+
94
+ ### Phase 3 — Build
95
+ - [ ] Run `dotnet build` — must succeed before any Phase 4 work
96
+
97
+ ### Phase 4 — <description> [can run in parallel]
98
+ - [ ] [<agent>] <task description>
99
+
100
+ ### Phase 5 — Quality Gates
101
+ - [ ] [code-reviewer] Review all changed files
102
+ - [ ] [security-reviewer] Security review of all changed files
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Delegation instructions
108
+
109
+ When handing off to a specialist agent:
110
+
111
+ 1. State **exactly which files** need to be created or modified.
112
+ 2. Provide **all context** the agent needs — feature name, slice name, slice type, existing events, namespace root.
113
+ 3. State **acceptance criteria** — what "done" looks like for this task.
114
+ 4. Tell the specialist **which agent to hand back to** when finished.
115
+ 5. Quote the **relevant instruction file** section that governs the work.
116
+
117
+ ---
118
+
119
+ ## Quality gate criteria
120
+
121
+ For implementation, the applicable changed-lane gates must pass. Mark unrelated entries not applicable; this list is not a full-repository command mandate:
122
+
123
+ - [ ] `dotnet build` — zero errors, zero warnings
124
+ - [ ] `dotnet test` — all specs pass
125
+ - [ ] `yarn lint` — zero errors (if frontend present)
126
+ - [ ] `npx tsc -b` — zero TypeScript errors (if frontend present)
127
+ - [ ] Public-facing changes (clients, SDKs, public APIs) include associated documentation updates
128
+ - [ ] `Documentation/verify-markdown.sh` passes when documentation is added or changed
129
+ - [ ] `code-reviewer` finds no blocking issues
130
+ - [ ] `security-reviewer` finds no vulnerabilities
131
+ - [ ] PR description follows the pull request template
132
+
133
+ ---
134
+
135
+ ## When to delegate to the planner instead
136
+
137
+ A full backend-to-frontend slice normally needs one implementer, not another manager. Use a separate planner only for explicitly requested large independent scope; otherwise return the short slice sequence to the parent.
138
+
139
+ ---
140
+
141
+ ## Output format
142
+
143
+ Always output a plan before starting any delegation:
144
+
145
+ ```markdown
146
+ ## Coordinator Plan: <goal>
147
+
148
+ ### Phase 1 — Backend [parallel]
149
+ - [ ] [backend-developer] <task>
150
+
151
+ ### Phase 2 — Build
152
+ - [ ] `dotnet build`
153
+
154
+ ### Phase 3 — Frontend + Specs [parallel]
155
+ - [ ] [frontend-developer] <task>
156
+ - [ ] [spec-writer] <task>
157
+
158
+ ### Phase 4 — Quality Gates
159
+ - [ ] [code-reviewer] Review all changed files
160
+ - [ ] [security-reviewer] Security review
161
+ ```
162
+
163
+ If the explicit large-scope delegation contract applies, hand off in dependency order; otherwise return the plan to the parent.