@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,47 @@
1
+ # Agent Learnings
2
+
3
+ Patterns and gotchas discovered during task processing. Update this file whenever you encounter something reusable.
4
+
5
+ ## tasks.json
6
+
7
+ - Tasks are objects with `id`, `createdAt`, and `payload` (a `SliceChangedPayload`).
8
+ - After completing a task, remove it from the array entirely — do not add a status field.
9
+ - Write `[]` to `tasks.json` if the last task is completed.
10
+
11
+ ## SliceChangedPayload fields
12
+
13
+ ```
14
+ event always "slice:changed"
15
+ organizationId org UUID or null
16
+ boardId board UUID
17
+ sliceId SLICE_BORDER node UUID — use this with /load-slice
18
+ sliceTitle human-readable slice name (may be null)
19
+ sliceStatus e.g. "Created", "InProgress", "Done", "Blocked" (may be null)
20
+ timestamp unix ms when the change was emitted
21
+ ```
22
+
23
+ ## Slice files
24
+
25
+ The realtime agent writes one file per slice on startup and after each `slice:changed` event:
26
+
27
+ ```
28
+ .slices/<context>/<sliceName>/slice.json
29
+ ```
30
+
31
+ - `<context>` is the slice's context value, or `default` if none.
32
+ - `<sliceName>` is the slice title lowercased with spaces removed (e.g. `"Enable User"` → `enableuser`).
33
+
34
+ These files are always up to date — read them directly before invoking any skill.
35
+
36
+ ## Skill Usage
37
+
38
+ - Always run `/connect` first to load credentials from `.eventmodelers/config.json` before calling any other skill.
39
+ - `/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.
40
+ - Read `.slices/<context>/<sliceName>/slice.json` directly when you already know the context and name and the file is recent enough.
41
+
42
+ ## Board API
43
+
44
+ - The `boardId` and `organizationId` from each payload provide full context — pass them to skills.
45
+ - Node events use `node:created`, `node:changed`, `node:deleted` — always POST to `/api/org/:orgId/boards/:boardId/nodes/events`.
46
+ - Slice metadata (title, status) lives on the SLICE_BORDER node under `meta.sliceStatus` and `meta.title`.
47
+ - `/update-slice-status` rejects moving a slice into a status it's already in — this is a concurrency guard, not a bug. It means another agent already claimed the slice. Treat it as `ALREADY_IN_STATUS`, skip that slice, and move on to the next `Planned` one instead of erroring out.
@@ -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,158 @@
1
+ # Ralph Agent Instructions
2
+
3
+ You are an autonomous coding agent working on a software project. You apply your skills to build software slices. You only work on one slice at a time.
4
+
5
+ The structure defined in the Project-Skills is relevant.
6
+
7
+ ## Context Boundary (READ FIRST — NON-NEGOTIABLE)
8
+
9
+ You work within **exactly ONE context at a time** — the one named in `.build-kit/.slices/current_context.json`.
10
+
11
+ - **ONLY** look for and build slices inside `.build-kit/.slices/<currentContext>/`.
12
+ - **NEVER** read, scan, or build slices from any other context directory, even if it has "Planned" slices, and even if the current context has no work left.
13
+ - A "Planned" slice in a *different* context (e.g. "Rename organization" while you are in "Board Invitations") is **NOT yours to build**. Ignore it completely.
14
+ - If the current context has no "Planned" slice, you are **done for this iteration** — reply `<promise>NO_TASKS</promise>` and stop. Do not go looking elsewhere. The context is only ever changed on the board, never by you.
15
+
16
+ ## Your Task
17
+
18
+ 0. Do not read the entire code base. Focus on the tasks in this description.
19
+ 1. Read `.build-kit/.slices/current_context.json` to find the active context name, then read `.build-kit/.slices/<contextName>/index.json`. Every item in status "planned" is a task.
20
+ 2. Read the progress log at `progress.txt` (check Codebase Patterns section first)
21
+ 3. Make sure you are on the right branch "feature/<slicename>", if unsure, start from main.
22
+ 5. Pick the **highest priority** slice where status is **exactly** "Planned" (case insensitive). This becomes your PRD. Set the status "InProgress" in the index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
23
+ **IMPORTANT: Only work on slices with status "Planned" in the CURRENT context. Never pick up a slice that is "InProgress", "Done", "Blocked", "Created", or any other status — even if it looks incomplete. If no slice has status "Planned" in the current context, reply with:**
24
+ <promise>NO_TASKS</promise> and stop immediately. Do not work on other slices and do not switch to another context.
25
+ **Claim conflict**: the board rejects the status update if the slice is already in the target status — this is expected: another agent claimed it first, racing you for the same slice. This is NOT an error. Do not stop, do not retry the same slice. Re-read `index.json` (or re-fetch via `load-slice`), pick the next-highest-priority slice still "Planned", and try claiming that one instead. Repeat until a claim succeeds or no "Planned" slice remains, in which case reply `<promise>NO_TASKS</promise>`.
26
+ 6. Pick the slice definition from `.build-kit/.slices/<contextName>/<folder>/slice.json` as defined in the prd. Never work on more than one slice per iteration.
27
+ 7. A slice can define additional prompts as codegen/backendPrompt. any additional prompts defined in backend are hints for the implementation of the slice and have to be taken into account. If you use the additional prompt, add a line in progress.txt
28
+ 7. Define the slice type and load the matching skill:
29
+ - Write slice (has commands, no processors) → `build-state-change`
30
+ - Read slice (has readModel / information flow) → `build-state-view`
31
+ - Translation slice (`sliceType === "TRANSLATION"`) → read `description` and `notes` from slice.json for hints; default to `build-automation` if nothing else is specified
32
+ - Automation slice (processors-array is not empty) → `build-automation`
33
+ 8. Write a short progress one liner after each step to progress.txt
34
+ 9. Analyze and Implement that single slice, make use of the skills in the skills directory, but also your previsously collected
35
+ knowledge. Make a list TODO list for what needs to be done. Also make sure to adjust the implementation according to the json definition. Carefully inspect events, fields and compare against the implemented slice. JSON is the desired state. ATTENTION: A "planned" task can also be just added specifications. So always look at the slice itself, but also the specifications. If specifications were added in json, which are not on code, you need to add them in code.
36
+ 10. The slice in the json is always true, the code follows what is defined in the json
37
+ 11. slice is only 'Done' if business logic is implemented as defined in the JSON, APIs are implemented, all scenarios in JSON are implemented in code and it
38
+ fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
39
+ 12. make sure to write the ui-prompt.md as defined if defined in the skill
40
+ 13. Run quality checks — it is enough to run the tests for the slice only, not all tests:
41
+ - Compile: `./mvnw compile -q`
42
+ - Test: `./mvnw test -Dtest="<SliceName>*" -q`
43
+ If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
44
+ 15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
45
+ first )
46
+ 16. Update the PRD to set `status: Done` for the completed story in index.json **and** update the slice status on the eventmodelers board using the `update-slice-status` skill (or MCP if available).
47
+ 17. Append your progress to `progress.txt` after each step in the iteration.
48
+ 18. append your new learnings to AGENTS.md in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
49
+ 19. Finish the iteration.
50
+
51
+ ## Progress Report Format
52
+
53
+ APPEND to progress.txt (never replace, always append):
54
+
55
+ ```
56
+ ## [Date/Time] - [Slice]
57
+
58
+ - What was implemented
59
+ - Files changed
60
+ - **Learnings for future iterations:**
61
+ - Patterns discovered (e.g., "this codebase uses X for Y")
62
+ - Gotchas encountered (e.g., "don't forget to update Z when changing W")
63
+ - Useful context (e.g., "the evaluation panel is in component X")
64
+ ---
65
+ ```
66
+
67
+ The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase
68
+ better.
69
+
70
+ ## Consolidate Patterns
71
+
72
+ If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section
73
+ at the TOP of progress.txt (create it if it doesn't exist). This section should consolidate the most important
74
+ learnings:
75
+
76
+ ```
77
+ ## Codebase Patterns
78
+ - Example: Use event sourcing aggregate patterns for all state changes
79
+ - Example: Always use @CommandHandler on the aggregate for write slices
80
+ - Example: Export query result types from the slice package
81
+ ```
82
+
83
+ Only add patterns that are **general and reusable**, not story-specific details.
84
+
85
+ ## Update AGENTS.md Files
86
+
87
+ Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
88
+
89
+ 1. **Identify directories with edited files** - Look at which directories you modified
90
+ 3. **Add valuable learnings that apply to all tasks** to the Agents.md - If you discovered something future developers/agents should know:
91
+ - API patterns or conventions specific to that module
92
+ - Gotchas or non-obvious requirements
93
+ - Dependencies between files
94
+ - Testing approaches for that area
95
+ - Configuration or environment requirements
96
+
97
+ **Examples of good AGENTS.md additions:**
98
+
99
+ - "When modifying X, also update Y to keep them in sync"
100
+ - "This module uses pattern Z for all API calls"
101
+ - "Tests require the dev server running on PORT 3000"
102
+ - "Field names must match the template exactly"
103
+
104
+ **Do NOT add:**
105
+
106
+ - Slice specific implementation details
107
+ - Story-specific implementation details
108
+ - Temporary debugging notes
109
+ - Information already in progress.txt
110
+ - Task specific learnings
111
+
112
+ Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work
113
+
114
+ ## Quality Requirements
115
+
116
+ - ALL commits must pass your project's quality checks
117
+ - Compile: `./mvnw compile -q`
118
+ - Test: `./mvnw test -Dtest="<SliceName>*" -q`
119
+ - Do NOT commit broken code
120
+ - Keep changes focused and minimal
121
+ - Follow existing code patterns
122
+
123
+ ## Skills
124
+
125
+ Use the provided skills in the skills folder as guidance.
126
+ Update skill definitions if you find an improvement you can make.
127
+
128
+ ## Specifications
129
+
130
+ For every specification added to the Slice, you need to implement one use executable Specification in Code.
131
+
132
+ A Slice is not complete if specifications are missing or can´t be executed.
133
+
134
+ ## Stop Condition
135
+
136
+ **After completing ONE slice, always stop — regardless of whether more slices are Planned.** The ralph loop will invoke you again for the next slice. Never chain multiple slices in one iteration.
137
+
138
+ If the slice was completed and committed successfully, reply with:
139
+ <promise>DONE</promise>
140
+
141
+ If no slice has status "Planned" in the current context, reply with:
142
+ <promise>NO_TASKS</promise>
143
+ (Do NOT switch to another context to find work — stop here.)
144
+
145
+ If ALL slices in the current context are Done, reply with:
146
+ <promise>COMPLETE</promise>
147
+
148
+ ## Important
149
+
150
+ - If `.build-kit/.eventmodelers/config.json` is absent, skip all platform communication (MCP calls, `update-slice-status`, board sync) and continue working locally.
151
+ - Work on ONE slice per iteration
152
+ - Commit frequently
153
+ - update progress.txt frequently
154
+ - Read the Codebase Patterns section in progress.txt before starting
155
+
156
+ ## When an iteration completes
157
+
158
+ Use all the key learnings from the progress.txt and update the AGENTS.md file with those learnings.
@@ -0,0 +1,126 @@
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
+ **Claim conflict**: if this call reports the slice is already in `InProgress` (or any status other than `Planned`), another agent already claimed it first — this is expected, not an error. Log it in `progress.txt`, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
54
+
55
+ 2. Read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json` (written by `/load-slice`).
56
+
57
+ 3. Determine the **slice type** from the slice.json:
58
+ - **Translation** — `sliceType === "TRANSLATION"` → read `description` and `notes` from slice.json for hints; default to `/build-automation` if nothing else is specified
59
+ - **Automation** — `processors` array is non-empty → invoke `/build-automation`
60
+ - **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
61
+ - **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
62
+
63
+ 4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
64
+
65
+ 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.
66
+
67
+ 6. Run quality checks:
68
+ - Compile: `./mvnw compile -q`
69
+ - Test (slice only): `./mvnw test -Dtest="<SliceName>*" -q`
70
+
71
+ 7. If checks pass, commit all changes with message: `feat: [Slice Name]`.
72
+
73
+ 8. Call `/update-slice-status` to set the slice to `Done` on the board.
74
+
75
+ #### `InProgress`
76
+ Another agent is already building this slice. Log it and skip — do not build.
77
+
78
+ #### `Done`
79
+ Summarize what was completed and update `progress.txt`.
80
+
81
+ #### `Blocked`
82
+ Log the blocker in `progress.txt`.
83
+
84
+ #### `Review`
85
+ Fetch slice details and prepare a review summary in `progress.txt`.
86
+
87
+ #### Any other status (`Created`, etc.)
88
+ Load the slice and log the state transition in `progress.txt`. No build action.
89
+
90
+ Use the skills available in `.claude/skills/` to interact with the board.
91
+
92
+ ## Updating tasks.json
93
+
94
+ 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 `[]`.
95
+
96
+ ## Progress Report Format
97
+
98
+ APPEND to `progress.txt` (never replace):
99
+ ```
100
+ ## [ISO timestamp] — Task [task.id]
101
+
102
+ Slice: [sliceTitle] ([sliceId])
103
+ Status change: [sliceStatus]
104
+
105
+ Action taken:
106
+ - [what was done in response to the slice change]
107
+
108
+ Learnings:
109
+ - [any patterns, gotchas, or reusable knowledge discovered]
110
+ ---
111
+ ```
112
+
113
+ ## Stop Condition
114
+
115
+ If `.build-kit/tasks.json` is empty (`[]`) or does not exist, reply with:
116
+ <promise>IDLE</promise>
117
+
118
+ ## Updating AGENT.md
119
+
120
+ 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.
121
+
122
+ ## Important
123
+
124
+ - Process **one task per iteration**.
125
+ - Read `AGENT.md` first — it contains patterns from previous iterations.
126
+ - Always start with `/connect` if credentials are not yet loaded.