@eventmodelers/cli 0.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 (220) hide show
  1. package/README.md +175 -0
  2. package/cli.js +676 -0
  3. package/package.json +35 -0
  4. package/shared/build-kit/code-export.mjs +560 -0
  5. package/shared/build-kit/lib/ollama-agent.js +147 -0
  6. package/shared/build-kit/package.json +11 -0
  7. package/shared/build-kit/ralph-ollama.js +39 -0
  8. package/shared/build-kit/realtime-agent.js +18 -0
  9. package/stacks/axon/templates/.claude/skills/build-automation/SKILL.md +407 -0
  10. package/stacks/axon/templates/.claude/skills/build-automation/references/feature-flag-patterns.md +114 -0
  11. package/stacks/axon/templates/.claude/skills/build-automation-workflow/SKILL.md +496 -0
  12. package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/axon-workflow-api.md +279 -0
  13. package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/feature-flag-patterns.md +114 -0
  14. package/stacks/axon/templates/.claude/skills/build-state-change/SKILL.md +396 -0
  15. package/stacks/axon/templates/.claude/skills/build-state-change/references/axon-test-fixture-patterns.md +162 -0
  16. package/stacks/axon/templates/.claude/skills/build-state-change/references/feature-flag-patterns.md +56 -0
  17. package/stacks/axon/templates/.claude/skills/build-state-change/references/rest-api-patterns.md +115 -0
  18. package/stacks/axon/templates/.claude/skills/build-state-view/SKILL.md +282 -0
  19. package/stacks/axon/templates/.claude/skills/connect/SKILL.md +178 -0
  20. package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +611 -0
  21. package/stacks/axon/templates/.claude/skills/load-slice/SKILL.md +141 -0
  22. package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
  23. package/stacks/axon/templates/build-kit/lib/AGENT.md +47 -0
  24. package/stacks/axon/templates/build-kit/lib/agent.sh +20 -0
  25. package/stacks/axon/templates/build-kit/lib/backend-prompt.md +158 -0
  26. package/stacks/axon/templates/build-kit/lib/prompt.md +126 -0
  27. package/stacks/axon/templates/build-kit/lib/ralph.js +369 -0
  28. package/stacks/axon/templates/build-kit/ralph-claude.js +44 -0
  29. package/stacks/axon/templates/build-kit/ralph.sh +98 -0
  30. package/stacks/axon/templates/root/.env.example +5 -0
  31. package/stacks/axon/templates/root/CLAUDE.md +60 -0
  32. package/stacks/axon/templates/root/README.md +44 -0
  33. package/stacks/axon/templates/root/docker-compose.yml +64 -0
  34. package/stacks/axon/templates/root/mvnw +259 -0
  35. package/stacks/axon/templates/root/mvnw.cmd +149 -0
  36. package/stacks/axon/templates/root/pom.xml +125 -0
  37. package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/QuickstartApplication.java +128 -0
  38. package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/config/WebConfig.java +155 -0
  39. package/stacks/axon/templates/root/src/main/resources/application.properties +2 -0
  40. package/stacks/axon/templates/root/src/main/resources/static/bg-body.png +0 -0
  41. package/stacks/axon/templates/root/src/main/resources/static/bg-header.png +0 -0
  42. package/stacks/axon/templates/root/src/main/resources/static/index.html +596 -0
  43. package/stacks/cratis-csharp/templates/.claude/skills/_shared/cratis-conventions.md +251 -0
  44. package/stacks/cratis-csharp/templates/.claude/skills/build-automation/SKILL.md +99 -0
  45. package/stacks/cratis-csharp/templates/.claude/skills/build-automation/references/patterns.md +115 -0
  46. package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/SKILL.md +163 -0
  47. package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/references/patterns.md +234 -0
  48. package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/SKILL.md +120 -0
  49. package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/references/patterns.md +166 -0
  50. package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +169 -0
  51. package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +609 -0
  52. package/stacks/cratis-csharp/templates/.claude/skills/load-slice/SKILL.md +141 -0
  53. package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
  54. package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +58 -0
  55. package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +20 -0
  56. package/stacks/cratis-csharp/templates/build-kit/lib/backend-prompt.md +129 -0
  57. package/stacks/cratis-csharp/templates/build-kit/lib/prompt.md +124 -0
  58. package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +302 -0
  59. package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +37 -0
  60. package/stacks/cratis-csharp/templates/build-kit/ralph.sh +98 -0
  61. package/stacks/cratis-csharp/templates/root/.frontend/index.css +29 -0
  62. package/stacks/cratis-csharp/templates/root/.frontend/index.html +17 -0
  63. package/stacks/cratis-csharp/templates/root/.frontend/main.tsx +18 -0
  64. package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.json +42 -0
  65. package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.node.json +11 -0
  66. package/stacks/cratis-csharp/templates/root/.frontend/vite.config.ts +56 -0
  67. package/stacks/cratis-csharp/templates/root/App.tsx +23 -0
  68. package/stacks/cratis-csharp/templates/root/CLAUDE.md +62 -0
  69. package/stacks/cratis-csharp/templates/root/CratisApp.csproj +25 -0
  70. package/stacks/cratis-csharp/templates/root/CratisApp.sln +18 -0
  71. package/stacks/cratis-csharp/templates/root/GlobalUsings.cs +3 -0
  72. package/stacks/cratis-csharp/templates/root/Home.tsx +102 -0
  73. package/stacks/cratis-csharp/templates/root/Program.cs +26 -0
  74. package/stacks/cratis-csharp/templates/root/README.md +192 -0
  75. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/AllListings.ts +47 -0
  76. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.cs +11 -0
  77. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.ts +12 -0
  78. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/ListingDataTable.tsx +17 -0
  79. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/index.ts +1 -0
  80. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Register.ts +51 -0
  81. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/RegisterDialog.tsx +18 -0
  82. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Registration.cs +27 -0
  83. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/index.ts +1 -0
  84. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeFeature.tsx +22 -0
  85. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeName.cs +3 -0
  86. package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/index.ts +1 -0
  87. package/stacks/cratis-csharp/templates/root/appsettings.Development.json +9 -0
  88. package/stacks/cratis-csharp/templates/root/appsettings.json +26 -0
  89. package/stacks/cratis-csharp/templates/root/docker-compose.yml +23 -0
  90. package/stacks/cratis-csharp/templates/root/package.json +33 -0
  91. package/stacks/cratis-csharp/templates/root/tsconfig.json +3 -0
  92. package/stacks/modeling-kit/templates/.claude/settings.local.json +13 -0
  93. package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +215 -0
  94. package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +176 -0
  95. package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +182 -0
  96. package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/SKILL.md +383 -0
  97. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/SKILL.md +465 -0
  98. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/SKILL.md +587 -0
  99. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/facilitating-event-modeling-workshops.md +626 -0
  100. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/SKILL.md +542 -0
  101. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/SKILL.md +497 -0
  102. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +783 -0
  103. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md +604 -0
  104. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/SKILL.md +699 -0
  105. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-integrating-legacy-systems/SKILL.md +674 -0
  106. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/SKILL.md +231 -0
  107. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/domain-patterns.md +150 -0
  108. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/patterns.md +329 -0
  109. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/snapshotting.md +204 -0
  110. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md +352 -0
  111. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/references/project-planning-with-event-modeling.md +341 -0
  112. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/SKILL.md +153 -0
  113. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/SKILL.md +136 -0
  114. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/examples.md +78 -0
  115. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/patterns.md +85 -0
  116. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/SKILL.md +655 -0
  117. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/SKILL.md +479 -0
  118. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/SKILL.md +234 -0
  119. package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/SKILL.md +353 -0
  120. package/stacks/modeling-kit/templates/.claude/skills/examples/SKILL.md +200 -0
  121. package/stacks/modeling-kit/templates/.claude/skills/handle-comment/SKILL.md +94 -0
  122. package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +441 -0
  123. package/stacks/modeling-kit/templates/.claude/skills/place-element/SKILL.md +290 -0
  124. package/stacks/modeling-kit/templates/.claude/skills/storyboard/SKILL.md +212 -0
  125. package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/SKILL.md +123 -0
  126. package/stacks/modeling-kit/templates/.claude/skills/timeline/SKILL.md +353 -0
  127. package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
  128. package/stacks/modeling-kit/templates/.claude/skills/wdyt/SKILL.md +134 -0
  129. package/stacks/modeling-kit/templates/kit/lib/agent.sh +20 -0
  130. package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +147 -0
  131. package/stacks/modeling-kit/templates/kit/lib/ralph.js +286 -0
  132. package/stacks/modeling-kit/templates/kit/package.json +12 -0
  133. package/stacks/modeling-kit/templates/kit/ralph-claude.js +50 -0
  134. package/stacks/modeling-kit/templates/kit/ralph-ollama.js +38 -0
  135. package/stacks/modeling-kit/templates/kit/ralph.sh +61 -0
  136. package/stacks/modeling-kit/templates/kit/realtime-agent.js +18 -0
  137. package/stacks/modeling-kit/templates/root/CLAUDE.md +56 -0
  138. package/stacks/node/templates/.claude/skills/build-automation/SKILL.md +266 -0
  139. package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +344 -0
  140. package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +412 -0
  141. package/stacks/node/templates/.claude/skills/connect/SKILL.md +178 -0
  142. package/stacks/node/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
  143. package/stacks/node/templates/.claude/skills/load-slice/SKILL.md +143 -0
  144. package/stacks/node/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
  145. package/stacks/node/templates/build-kit/README.md +86 -0
  146. package/stacks/node/templates/build-kit/lib/AGENT.md +47 -0
  147. package/stacks/node/templates/build-kit/lib/agent.sh +20 -0
  148. package/stacks/node/templates/build-kit/lib/backend-prompt.md +152 -0
  149. package/stacks/node/templates/build-kit/lib/prompt.md +122 -0
  150. package/stacks/node/templates/build-kit/lib/ralph.js +369 -0
  151. package/stacks/node/templates/build-kit/ralph-claude.js +44 -0
  152. package/stacks/node/templates/build-kit/ralph.sh +98 -0
  153. package/stacks/node/templates/root/.env.example +15 -0
  154. package/stacks/node/templates/root/CLAUDE.md +60 -0
  155. package/stacks/node/templates/root/docker-compose.yml +15 -0
  156. package/stacks/node/templates/root/flyway.conf +17 -0
  157. package/stacks/node/templates/root/migrations/V1__schema.sql.example +12 -0
  158. package/stacks/node/templates/root/package.json +50 -0
  159. package/stacks/node/templates/root/server.ts +130 -0
  160. package/stacks/node/templates/root/setup-env.sh +53 -0
  161. package/stacks/node/templates/root/src/common/assertions.ts +6 -0
  162. package/stacks/node/templates/root/src/common/db.ts +32 -0
  163. package/stacks/node/templates/root/src/common/loadPostgresEventstore.ts +23 -0
  164. package/stacks/node/templates/root/src/common/parseEndpoint.ts +51 -0
  165. package/stacks/node/templates/root/src/common/processorDlq.ts +28 -0
  166. package/stacks/node/templates/root/src/common/realtimeBroadcast.ts +12 -0
  167. package/stacks/node/templates/root/src/common/replay.ts +16 -0
  168. package/stacks/node/templates/root/src/common/routes.ts +19 -0
  169. package/stacks/node/templates/root/src/common/testHelpers.ts +44 -0
  170. package/stacks/node/templates/root/src/swagger.ts +34 -0
  171. package/stacks/node/templates/root/src/util/assertions.ts +6 -0
  172. package/stacks/node/templates/root/src/util/hash.ts +9 -0
  173. package/stacks/node/templates/root/src/util/sanitize.ts +23 -0
  174. package/stacks/node/templates/root/tsconfig.json +32 -0
  175. package/stacks/node/templates/root/vercel.json +8 -0
  176. package/stacks/supabase/templates/.claude/skills/build-automation/SKILL.md +266 -0
  177. package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +344 -0
  178. package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +390 -0
  179. package/stacks/supabase/templates/.claude/skills/build-webhook/SKILL.md +303 -0
  180. package/stacks/supabase/templates/.claude/skills/connect/SKILL.md +178 -0
  181. package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
  182. package/stacks/supabase/templates/.claude/skills/load-slice/SKILL.md +143 -0
  183. package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
  184. package/stacks/supabase/templates/build-kit/README.md +86 -0
  185. package/stacks/supabase/templates/build-kit/lib/AGENT.md +47 -0
  186. package/stacks/supabase/templates/build-kit/lib/agent.sh +20 -0
  187. package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +152 -0
  188. package/stacks/supabase/templates/build-kit/lib/prompt.md +123 -0
  189. package/stacks/supabase/templates/build-kit/lib/ralph.js +369 -0
  190. package/stacks/supabase/templates/build-kit/ralph-claude.js +44 -0
  191. package/stacks/supabase/templates/build-kit/ralph.sh +98 -0
  192. package/stacks/supabase/templates/root/.env.example +22 -0
  193. package/stacks/supabase/templates/root/CLAUDE.md +61 -0
  194. package/stacks/supabase/templates/root/flyway.conf +17 -0
  195. package/stacks/supabase/templates/root/package.json +52 -0
  196. package/stacks/supabase/templates/root/server.ts +177 -0
  197. package/stacks/supabase/templates/root/setup-env.sh +53 -0
  198. package/stacks/supabase/templates/root/src/common/assertions.ts +6 -0
  199. package/stacks/supabase/templates/root/src/common/db.ts +32 -0
  200. package/stacks/supabase/templates/root/src/common/loadPostgresEventstore.ts +23 -0
  201. package/stacks/supabase/templates/root/src/common/parseEndpoint.ts +51 -0
  202. package/stacks/supabase/templates/root/src/common/processorDlq.ts +28 -0
  203. package/stacks/supabase/templates/root/src/common/realtimeBroadcast.ts +19 -0
  204. package/stacks/supabase/templates/root/src/common/replay.ts +16 -0
  205. package/stacks/supabase/templates/root/src/common/routes.ts +23 -0
  206. package/stacks/supabase/templates/root/src/common/testHelpers.ts +54 -0
  207. package/stacks/supabase/templates/root/src/supabase/README.md +141 -0
  208. package/stacks/supabase/templates/root/src/supabase/api.ts +56 -0
  209. package/stacks/supabase/templates/root/src/supabase/requireOrgaAdmin.ts +32 -0
  210. package/stacks/supabase/templates/root/src/supabase/requireSysUser.ts +40 -0
  211. package/stacks/supabase/templates/root/src/supabase/requireUser.ts +72 -0
  212. package/stacks/supabase/templates/root/src/swagger.ts +34 -0
  213. package/stacks/supabase/templates/root/src/util/assertions.ts +6 -0
  214. package/stacks/supabase/templates/root/src/util/hash.ts +9 -0
  215. package/stacks/supabase/templates/root/src/util/sanitize.ts +23 -0
  216. package/stacks/supabase/templates/root/supabase/config.toml +295 -0
  217. package/stacks/supabase/templates/root/supabase/migrations/V1__schema.sql.example +12 -0
  218. package/stacks/supabase/templates/root/supabase/seed.sql +1 -0
  219. package/stacks/supabase/templates/root/tsconfig.json +32 -0
  220. package/stacks/supabase/templates/root/vercel.json +8 -0
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: load-slice
3
+ description: Load all slices from the board via the slicedata API and persist them to the .build-kit/.slices/ directory hierarchy (index.json with full definitions, per-slice folders). Returns data for a specific slice by ID or title.
4
+ ---
5
+
6
+ # Load Slice
7
+
8
+ > **Before doing anything else**, invoke the `connect` skill to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL`. Do not proceed until the connect skill has completed.
9
+
10
+ ---
11
+
12
+ ## Step 1 — Parse arguments
13
+
14
+ From `$ARGUMENTS`, extract:
15
+
16
+ | Field | How to find it | Default |
17
+ |-------|---------------|---------|
18
+ | `sliceId` | UUID of the slice (SLICE_BORDER node ID) | optional — prefer over title |
19
+ | `sliceTitle` | slice title (case-insensitive match) | optional — used if sliceId missing |
20
+
21
+ If neither is provided, load and persist all slices without filtering.
22
+
23
+ ---
24
+
25
+ ## Step 2 — Fetch all slices from the slicedata API
26
+
27
+ ```bash
28
+ curl -s \
29
+ -H "x-token: <TOKEN>" \
30
+ -H "x-board-id: <BOARD_ID>" \
31
+ -H "x-user-id: load-slice-skill" \
32
+ "<BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/slicedata/slices"
33
+ ```
34
+
35
+ Response shape: `{ "slices": [ { "id": "...", "title": "...", "status": "...", "context": "...", "comments": ["..."], ... } ] }`
36
+
37
+ Save the full array as `ALL_SLICES`.
38
+
39
+ ---
40
+
41
+ ## Step 3 — Persist slices to .build-kit/.slices/ directory
42
+
43
+ Apply the following logic for every slice in `ALL_SLICES`.
44
+
45
+ ### Derive paths
46
+
47
+ - `contextName` = `slice.context` if present, otherwise `"default"` — **preserve original casing** (e.g. `"Beta"`, not `"beta"`)
48
+ - `sliceFolder` = `slice.title` lowercased, with all spaces removed and the prefix `"slice:"` stripped
49
+ e.g. `"Beta Enable User for Beta Test"` → `"betaenableuserforbetatest"`
50
+ - `baseFolder` = `.build-kit/.slices/<contextName>/`
51
+ - `sliceDir` = `.build-kit/.slices/<contextName>/<sliceFolder>/`
52
+
53
+ ### Write files
54
+
55
+ ```bash
56
+ mkdir -p ".build-kit/.slices/<contextName>/<sliceFolder>"
57
+ ```
58
+
59
+ **`.build-kit/.slices/current_context.json`** — always overwrite:
60
+
61
+ ```json
62
+ { "name": "Beta" }
63
+ ```
64
+
65
+ **`.build-kit/.slices/<contextName>/context.json`** — write once per context:
66
+
67
+ ```json
68
+ { "name": "Beta" }
69
+ ```
70
+
71
+ **`.build-kit/.slices/<contextName>/<sliceFolder>/slice.json`** — the full slice object with the `index` field removed.
72
+
73
+ ### Maintain `.build-kit/.slices/<contextName>/index.json`
74
+
75
+ Read the file if it exists, otherwise start with `{ "slices": [] }`.
76
+
77
+ Each entry in `index.json` contains the index metadata **plus** the complete slice definition fetched from the API:
78
+
79
+ ```json
80
+ {
81
+ "slices": [
82
+ {
83
+ "id": "d0dbc70c-f244-4048-886b-1d11e461f466",
84
+ "slice": "Beta Enable User for Beta Test",
85
+ "index": 0,
86
+ "context": "Beta",
87
+ "folder": "betaenableuserforbetatest",
88
+ "status": "Created",
89
+ "definition": {
90
+ "id": "d0dbc70c-f244-4048-886b-1d11e461f466",
91
+ "title": "Beta Enable User for Beta Test",
92
+ "status": "Created",
93
+ "context": "Beta"
94
+ }
95
+ }
96
+ ]
97
+ }
98
+ ```
99
+
100
+ The `definition` field holds the full object returned by the API for that slice (all fields as-is).
101
+
102
+ **Merge rules:**
103
+ - If an entry with the same `id` already exists: update all fields and refresh `definition`; preserve any existing `assigned` field.
104
+ - If not found: append the new entry.
105
+
106
+ Write the updated object back to `.build-kit/.slices/<contextName>/index.json`.
107
+
108
+ ---
109
+
110
+ ## Step 4 — Return the requested slice
111
+
112
+ If `sliceId` was given: find the entry in `ALL_SLICES` where `id === sliceId`.
113
+ If `sliceTitle` was given: find the entry where `title` matches case-insensitively.
114
+ If neither: return all slices.
115
+
116
+ If a specific slice was requested but not found, stop and list the available titles.
117
+
118
+ ---
119
+
120
+ ## Step 5 — Output
121
+
122
+ ```
123
+ Slices loaded: <count> total
124
+ Persisted to: .build-kit/.slices/<contextName>/
125
+
126
+ Requested slice:
127
+ Title: <title>
128
+ ID: <id>
129
+ Status: <status>
130
+ Folder: .build-kit/.slices/<contextName>/<sliceFolder>/slice.json
131
+ ```
132
+
133
+ Or if no filter was given:
134
+
135
+ ```
136
+ All slices (<count>) — context: <contextName>:
137
+ - <title> [<status>] → .build-kit/.slices/<contextName>/<sliceFolder>/
138
+ - ...
139
+ ```
140
+
141
+ Make the matched slice's `id`, `title`, `status`, and local folder path available to subsequent steps in the same session.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: update-slice-status
3
+ description: Update the status of a single slice on an eventmodelers board by changing the SLICE_BORDER node's sliceStatus field
4
+ ---
5
+
6
+ # Update Slice Status
7
+
8
+ > **Before doing anything else**, invoke the `connect` skill to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL`. Do not proceed until the connect skill has completed.
9
+
10
+ ---
11
+
12
+ ## Step 1 — Parse arguments
13
+
14
+ From `$ARGUMENTS`, extract:
15
+
16
+ | Field | How to find it | Default |
17
+ |-------|---------------|---------|
18
+ | `sliceName` | the slice title to update (case-insensitive match) | **required** |
19
+ | `newStatus` | the target status value | **required** |
20
+
21
+ Valid status values (case-sensitive):
22
+
23
+ | Value | Meaning |
24
+ |-------|---------|
25
+ | `Created` | Default — slice has been created but not started |
26
+ | `Planned` | Work is planned |
27
+ | `InProgress` | Work is actively in progress |
28
+ | `Review` | Ready for review |
29
+ | `Done` | Completed |
30
+ | `Blocked` | Blocked by something |
31
+ | `Assigned` | Assigned to someone |
32
+ | `Informational` | Informational / reference slice |
33
+
34
+ If `newStatus` is not one of these exact values, stop and tell the user the valid options.
35
+
36
+ ---
37
+
38
+ ## Step 2 — List all slices
39
+
40
+ Fetch all slices on the board:
41
+
42
+ ```bash
43
+ curl -s \
44
+ -H "x-token: <TOKEN>" \
45
+ -H "x-board-id: <BOARD_ID>" \
46
+ -H "x-user-id: update-slice-status-skill" \
47
+ "<BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/slicedata/slices"
48
+ ```
49
+
50
+ Response: `{ "slices": [{ "id": "<nodeId>", "title": "<title>", "status": "<status>" }] }`
51
+
52
+ The `id` here is the `SLICE_BORDER` node ID — use it directly in Step 3.
53
+
54
+ Find the slice whose `title` matches `sliceName` (case-insensitive). If no match is found, stop and list the available slice titles so the user can pick one.
55
+
56
+ Save the matched slice as:
57
+ - `SLICE_NODE_ID` — the node ID of the SLICE_BORDER
58
+ - `CURRENT_STATUS` — the current status value
59
+
60
+ ---
61
+
62
+ ## Step 3 — Update the slice status
63
+
64
+ Send a `node:changed` event to update the `sliceStatus` field in the SLICE_BORDER node's meta:
65
+
66
+ ```bash
67
+ curl -s -X POST "<BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/nodes/events" \
68
+ -H "Content-Type: application/json" \
69
+ -H "x-token: <TOKEN>" \
70
+ -H "x-board-id: <BOARD_ID>" \
71
+ -H "x-user-id: update-slice-status-skill" \
72
+ -d '[{
73
+ "id": "<new-random-uuid>",
74
+ "eventType": "node:changed",
75
+ "nodeId": "<SLICE_NODE_ID>",
76
+ "boardId": "<BOARD_ID>",
77
+ "timestamp": <Date.now()>,
78
+ "changedAttributes": ["sliceStatus"],
79
+ "meta": {
80
+ "sliceStatus": "<newStatus>"
81
+ }
82
+ }]'
83
+ ```
84
+
85
+ Response: `{ "hashes": { "<eventId>": "<hash>" } }`
86
+
87
+ ---
88
+
89
+ ## Step 4 — Report back
90
+
91
+ Tell the user:
92
+
93
+ - **Slice**: the title that was updated
94
+ - **Previous status**: `CURRENT_STATUS`
95
+ - **New status**: `newStatus`
96
+ - **Node ID**: `SLICE_NODE_ID`
97
+ - **Any errors**: raw API message if something failed
98
+
99
+ Example success output:
100
+ ```
101
+ Updated: "Order Placed" slice
102
+ Before: InProgress
103
+ After: Done
104
+ Node ID: a1b2c3d4-…
105
+ ```
@@ -0,0 +1,58 @@
1
+ # Agent Learnings
2
+
3
+ Patterns and gotchas discovered during task processing. Update this file whenever you encounter something reusable.
4
+
5
+ ## Cratis non-negotiables (seed — full detail in `.claude/skills/_shared/cratis-conventions.md`)
6
+
7
+ - ALL backend artifacts for a slice go in ONE `.cs` file under the project's slice folder (the shipped starter uses `<Module>/<Feature>/<Slice>/<Slice>.cs` — discover the real top-level folder from an existing slice). Never split into `Commands/`, `Handlers/`, `Events/`.
8
+ - `[Command]` records define `Handle()` directly on the record — never a separate handler class.
9
+ - `[EventType]` takes NO attribute arguments (the type name is the id); events are past-tense and never nullable.
10
+ - Use `ConceptAs<T>` for every identity/value — no raw `Guid`/`string` in the domain.
11
+ - Read models: `[ReadModel]` record with `public static` query methods on it; observable queries return `ISubject<T>` directly (never `Task<ISubject<T>>`). Projections join events, never read models.
12
+ - Reactors implement the marker `IReactor`; dispatch is by the first parameter type. Write new events only via `ICommandPipeline.Execute(...)`, never `IEventLog`. Reactors must be idempotent and stateless.
13
+ - Namespace mirrors the folders and drops any `.Features.` segment: `<Root>.<Module>.<Feature>.<Slice>` (the starter's `<Root>` is `CratisApp`). Find `<Root>` from the `.csproj` `<RootNamespace>` / existing slices; never hard-code.
14
+ - `dotnet build` generates the TypeScript proxies — backend must compile before a slice's frontend can reference them. Order: Backend → build → Specs → Frontend → Composition.
15
+ - Quality gate: `dotnet build` with zero warnings/errors (warnings = errors); `dotnet test --filter "FullyQualifiedName~<SliceName>"`. File header only if the project's existing `.cs` files already carry one (the shipped example uses none).
16
+
17
+ ## tasks.json
18
+
19
+ - Tasks are objects with `id`, `createdAt`, and `payload` (a `SliceChangedPayload`).
20
+ - After completing a task, remove it from the array entirely — do not add a status field.
21
+ - Write `[]` to `tasks.json` if the last task is completed.
22
+
23
+ ## SliceChangedPayload fields
24
+
25
+ ```
26
+ event always "slice:changed"
27
+ organizationId org UUID or null
28
+ boardId board UUID
29
+ sliceId SLICE_BORDER node UUID — use this with /load-slice
30
+ sliceTitle human-readable slice name (may be null)
31
+ sliceStatus e.g. "Created", "InProgress", "Done", "Blocked" (may be null)
32
+ timestamp unix ms when the change was emitted
33
+ ```
34
+
35
+ ## Slice files
36
+
37
+ The realtime agent writes one file per slice on startup and after each `slice:changed` event:
38
+
39
+ ```
40
+ .slices/<context>/<sliceName>/slice.json
41
+ ```
42
+
43
+ - `<context>` is the slice's context value, or `default` if none.
44
+ - `<sliceName>` is the slice title lowercased with spaces removed (e.g. `"Enable User"` → `enableuser`).
45
+
46
+ These files are always up to date — read them directly before invoking any skill.
47
+
48
+ ## Skill Usage
49
+
50
+ - Always run `/connect` first to load credentials from `.eventmodelers/config.json` before calling any other skill.
51
+ - `/load-slice sliceId=<uuid>` re-fetches all slices from the API, refreshes the slice files, and returns the requested slice. Use it when you need a guaranteed-fresh view of a specific slice.
52
+ - Read `.slices/<context>/<sliceName>/slice.json` directly when you already know the context and name and the file is recent enough.
53
+
54
+ ## Board API
55
+
56
+ - The `boardId` and `organizationId` from each payload provide full context — pass them to skills.
57
+ - Node events use `node:created`, `node:changed`, `node:deleted` — always POST to `/api/org/:orgId/boards/:boardId/nodes/events`.
58
+ - Slice metadata (title, status) lives on the SLICE_BORDER node under `meta.sliceStatus` and `meta.title`.
@@ -0,0 +1,20 @@
1
+ #!/bin/bash
2
+ # Runs the AI agent with the given prompt in the project directory.
3
+ # Called by ralph.sh with cwd already set to the project root.
4
+ # Usage: ./agent.sh "<prompt>"
5
+
6
+ set -euo pipefail
7
+
8
+ PROMPT="${1:-}"
9
+ if [[ -z "$PROMPT" ]]; then
10
+ echo "ERROR: No prompt provided"
11
+ exit 1
12
+ fi
13
+
14
+ claude --dangerously-skip-permissions -p "$PROMPT"
15
+
16
+ # --- To use a local Ollama model instead, comment out the line above
17
+ # and uncomment the block below. Run `ollama serve` first.
18
+ #
19
+ # MODEL="${OLLAMA_MODEL:-qwen3.5:9b}"
20
+ # node "$(dirname "$0")/ollama-agent.js" "$MODEL"
@@ -0,0 +1,129 @@
1
+ # Ralph Agent Instructions — Cratis (Arc + Chronicle)
2
+
3
+ You are an autonomous coding agent building software slices in a **Cratis** .NET / C# project. You
4
+ apply your skills to implement one slice at a time, the Cratis way.
5
+
6
+ The conventions in `.claude/skills/_shared/cratis-conventions.md` are authoritative — read them before
7
+ implementing.
8
+
9
+ ## Your Task
10
+
11
+ 0. Do not read the entire codebase. Focus on the task in this description.
12
+ 1. Read `.build-kit/.slices/current_context.json` to find the active context name, then
13
+ read `.build-kit/.slices/<contextName>/index.json`. Every item with status "Planned"
14
+ is a task.
15
+ 2. Read the progress log at `progress.txt` (check the **Codebase Patterns** section first) and the
16
+ accumulated learnings in `AGENT.md`.
17
+ 3. Make sure you are on the right branch `feature/<slicename>`; if unsure, start from `main`.
18
+ 4. Pick the **highest priority** slice where status is **exactly** "Planned" (case insensitive). This
19
+ becomes your PRD. Set its status to "InProgress" in `index.json` **and** on the board via the
20
+ `update-slice-status` skill (or MCP if available).
21
+ **Only work on slices with status "Planned". Never pick up "InProgress", "Done", "Blocked",
22
+ "Created", or any other status — even if it looks incomplete. If no slice is "Planned", reply with**
23
+ `<promise>NO_TASKS</promise>` **and stop immediately.**
24
+ 5. Read the slice definition from
25
+ `.build-kit/.slices/<contextName>/<folder>/slice.json` — it is the source of truth.
26
+ Never work on more than one slice per iteration.
27
+ 6. A slice may define additional `codegen` / `backendPrompt` hints — take them into account and note in
28
+ `progress.txt` when used.
29
+ 7. Determine the slice type and load the matching skill:
30
+ - **State Change** (has `commands` / `events`, no `processors`) → `/build-state-change`
31
+ - **State View** (has `readModel` / `projections` / `queries`) → `/build-state-view`
32
+ - **Automation** (`processors` array non-empty) → `/build-automation`
33
+ - **Translation** (`sliceType === "TRANSLATION"`) → read `description` / `notes` for hints; default
34
+ to `/build-automation` (a reactor that triggers a command in its own slice)
35
+ 8. Write a short one-line progress note to `progress.txt` after each step.
36
+ 9. Implement that single slice using the matching skill as guidance. Make a TODO list of what's needed.
37
+ The JSON is the desired state — carefully compare events, fields, commands, and specifications
38
+ against the code. A "Planned" task may be **added specifications** on an existing slice: always look
39
+ at the slice AND its specifications, and add any missing specs in code.
40
+ 10. The JSON is always true — the code follows what the JSON defines.
41
+ 11. A slice is only "Done" when the business logic is implemented as defined, the read/write/automation
42
+ artifacts exist, every specification in the JSON has an executable equivalent in code, and it
43
+ fulfills `slice.json`. There must be no specification in the JSON without a code equivalent.
44
+ 12. **Follow the Cratis non-negotiables** (full detail in `cratis-conventions.md`):
45
+ - ALL backend artifacts for the slice in ONE `.cs` file under the project's slice folder
46
+ (the shipped starter uses `<Module>/<Feature>/<Slice>/<Slice>.cs` — discover the real
47
+ top-level folder from an existing slice and match it).
48
+ - `[Command]` records with `Handle()` on the record — never separate handler classes.
49
+ - `[EventType]` with NO attribute arguments; past-tense names; no nullable properties.
50
+ - `ConceptAs<T>` for every identity / value — no raw `Guid` / `string` in the domain.
51
+ - Namespace mirrors the folders and drops any `.Features.` segment
52
+ (`<Root>.<Module>.<Feature>.<Slice>`; the starter's `<Root>` is `CratisApp`). Read the
53
+ `<RootNamespace>` in the `.csproj` and existing slices to find the root; never hard-code it.
54
+ - File header: only if the project's existing `.cs` files already carry one — the shipped
55
+ example slices use none, so default to no header.
56
+ 13. Run quality checks — it is enough to run the tests for the slice only, not all tests. Run from the
57
+ **project root** (where the `.csproj`/solution lives), not the kit folder:
58
+ - Build: `dotnet build` (zero warnings, zero errors — warnings are treated as errors; this also
59
+ regenerates the TypeScript proxies)
60
+ - Test (slice only): `dotnet test --filter "FullyQualifiedName~<SliceName>"`
61
+ If the slice is UI-triggered, also implement the React component(s) AFTER the build generated the
62
+ proxies, then register them in the feature's composition page.
63
+ 14. If checks pass, commit ALL changes with message `feat: <Slice Name>` and merge back to `main` as a
64
+ fast-forward merge (update first).
65
+ 15. Set `status: Done` for the slice in `index.json` **and** on the board via `update-slice-status`.
66
+ 16. Append progress to `progress.txt` after each step.
67
+ 17. Append new reusable learnings to `AGENT.md` in compressed form (only if not already there).
68
+ 18. Finish the iteration.
69
+
70
+ ## Sequencing (Cratis-specific)
71
+
72
+ `dotnet build` generates the TypeScript proxies — **the frontend of a slice cannot reference its proxy
73
+ until the backend compiles**. Always: Backend → `dotnet build` → Specs → Frontend → Composition.
74
+ Never implement a slice's frontend before its backend builds.
75
+
76
+ ## Progress Report Format
77
+
78
+ APPEND to `progress.txt` (never replace):
79
+
80
+ ```
81
+ ## [Date/Time] - [Slice]
82
+
83
+ - What was implemented
84
+ - Files changed
85
+ - **Learnings for future iterations:**
86
+ - Patterns discovered (e.g., "this project's namespace root is `Library`")
87
+ - Gotchas (e.g., "observable queries must return ISubject<T>, never Task<ISubject<T>>")
88
+ - Useful context
89
+ ---
90
+ ```
91
+
92
+ ## Consolidate Patterns
93
+
94
+ If you discover a **reusable** pattern, add it to a `## Codebase Patterns` section at the TOP of
95
+ `progress.txt` (create it if missing). Only general, reusable patterns — not slice-specific details.
96
+
97
+ ```
98
+ ## Codebase Patterns
99
+ - Namespace root is `<Root>`; slices live under <Module>/<Feature>/<Slice>/
100
+ - Read models expose queries as public static methods on the [ReadModel] record
101
+ - DCB rules: inject the read model as a Handle() parameter
102
+ ```
103
+
104
+ ## Quality Requirements
105
+
106
+ - ALL commits must pass `dotnet build` (zero warnings/errors) and the slice's `dotnet test`.
107
+ - Do NOT commit broken code. Keep changes focused and minimal. Follow existing patterns.
108
+
109
+ ## Specifications
110
+
111
+ For every specification on the slice, implement one executable spec in code (Cratis.Specifications BDD:
112
+ `Establish` / `Because` / `[Fact] should_*`). A slice is not complete if specifications are missing or
113
+ cannot execute.
114
+
115
+ ## Stop Condition
116
+
117
+ **After completing ONE slice, always stop** — the ralph loop will invoke you again for the next slice.
118
+ Never chain multiple slices in one iteration.
119
+
120
+ - Slice completed and committed → reply `<promise>DONE</promise>`
121
+ - No slice has status "Planned" → reply `<promise>NO_TASKS</promise>`
122
+ - ALL slices across the index are Done → reply `<promise>COMPLETE</promise>`
123
+
124
+ ## Important
125
+
126
+ - If `.build-kit/.eventmodelers/config.json` is absent, skip all platform communication
127
+ (MCP calls, `update-slice-status`, board sync) and continue working locally.
128
+ - Work on ONE slice per iteration. Commit frequently. Update `progress.txt` frequently.
129
+ - Read the Codebase Patterns section in `progress.txt` and `AGENT.md` before starting.
@@ -0,0 +1,124 @@
1
+ # Agent Task Instructions
2
+
3
+ You are an autonomous agent reacting to slice status change events on an Eventmodelers board.
4
+
5
+ ## Your Loop
6
+
7
+ 1. Read `AGENT.md` to load accumulated learnings before doing anything else.
8
+ 2. Read `.build-kit/tasks.json`.
9
+ 3. If `tasks.json` is empty or missing, reply with:
10
+ <promise>IDLE</promise>
11
+ and stop.
12
+ 4. Pick the **oldest task** (earliest `createdAt`).
13
+ 5. Execute the task — see the Execution section below.
14
+ 6. After execution, remove that task from the array and write `.build-kit/tasks.json` back.
15
+ 7. Append a progress entry to `progress.txt` (create if missing).
16
+ 8. Update `AGENT.md` with any new reusable learnings discovered this iteration.
17
+ 9. Reply normally so the next iteration can pick up the next task.
18
+
19
+ ## Execution
20
+
21
+ Each task has a single `payload` of type `SliceChangedPayload`:
22
+
23
+ ```
24
+ {
25
+ event: "slice:changed"
26
+ organizationId: string | null
27
+ boardId: string
28
+ sliceId: string ← SLICE_BORDER node UUID
29
+ sliceTitle: string | null
30
+ sliceStatus: string | null ← e.g. "InProgress", "Done", "Blocked"
31
+ timestamp: number
32
+ }
33
+ ```
34
+
35
+ ### Step 1 — Load credentials
36
+
37
+ Run `/connect` to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL` from `.eventmodelers/config.json`.
38
+
39
+ ### Step 2 — Load the slice
40
+
41
+ Run `/load-slice sliceId=<payload.sliceId>` to fetch full slice details (title, status, raw node record).
42
+
43
+ ### Step 3 — Act on the change
44
+
45
+ Inspect the `sliceStatus` in the payload:
46
+
47
+ #### `Planned` — build the slice
48
+
49
+ This is the build trigger. Setting `InProgress` and building are one atomic step:
50
+
51
+ 1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
52
+
53
+ 2. Read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json` (written by `/load-slice`).
54
+
55
+ 3. Determine the **slice type** from the slice.json:
56
+ - **Translation** — `sliceType === "TRANSLATION"` → read `description` and `notes` from slice.json for hints; default to `/build-automation` if nothing else is specified
57
+ - **Automation** — `processors` array is non-empty → invoke `/build-automation`
58
+ - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
59
+ - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
60
+
61
+ 4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
62
+
63
+ 5. **Verify against slice.json**: Cross-check the implementation — every command field, event field, and specification in slice.json must appear in the code. No invented fields — if it is not in slice.json, it must not be in the code.
64
+
65
+ 6. Run quality checks (from the project root — `dotnet build` also regenerates the TypeScript proxies the frontend depends on):
66
+ - Build: `dotnet build` (zero warnings, zero errors)
67
+ - Test (slice only): `dotnet test --filter "FullyQualifiedName~<SliceName>"`
68
+
69
+ 7. If checks pass, commit all changes with message: `feat: [Slice Name]`.
70
+
71
+ 8. Call `/update-slice-status` to set the slice to `Done` on the board.
72
+
73
+ #### `InProgress`
74
+ Another agent is already building this slice. Log it and skip — do not build.
75
+
76
+ #### `Done`
77
+ Summarize what was completed and update `progress.txt`.
78
+
79
+ #### `Blocked`
80
+ Log the blocker in `progress.txt`.
81
+
82
+ #### `Review`
83
+ Fetch slice details and prepare a review summary in `progress.txt`.
84
+
85
+ #### Any other status (`Created`, etc.)
86
+ Load the slice and log the state transition in `progress.txt`. No build action.
87
+
88
+ Use the skills available in `.claude/skills/` to interact with the board.
89
+
90
+ ## Updating tasks.json
91
+
92
+ After completing a task, remove it from the array and write the updated array back to `.build-kit/tasks.json`. If the array is now empty, write `[]`.
93
+
94
+ ## Progress Report Format
95
+
96
+ APPEND to `progress.txt` (never replace):
97
+ ```
98
+ ## [ISO timestamp] — Task [task.id]
99
+
100
+ Slice: [sliceTitle] ([sliceId])
101
+ Status change: [sliceStatus]
102
+
103
+ Action taken:
104
+ - [what was done in response to the slice change]
105
+
106
+ Learnings:
107
+ - [any patterns, gotchas, or reusable knowledge discovered]
108
+ ---
109
+ ```
110
+
111
+ ## Stop Condition
112
+
113
+ If `.build-kit/tasks.json` is empty (`[]`) or does not exist, reply with:
114
+ <promise>IDLE</promise>
115
+
116
+ ## Updating AGENT.md
117
+
118
+ After completing a task, add any **reusable** learnings to `AGENT.md` — patterns, gotchas, API quirks, or skill behaviour that future iterations should know. Only add things that are general and applicable beyond this single task. Do not duplicate what is already there.
119
+
120
+ ## Important
121
+
122
+ - Process **one task per iteration**.
123
+ - Read `AGENT.md` first — it contains patterns from previous iterations.
124
+ - Always start with `/connect` if credentials are not yet loaded.