@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.
- package/README.md +175 -0
- package/cli.js +676 -0
- package/package.json +35 -0
- package/shared/build-kit/code-export.mjs +560 -0
- package/shared/build-kit/lib/ollama-agent.js +147 -0
- package/shared/build-kit/package.json +11 -0
- package/shared/build-kit/ralph-ollama.js +39 -0
- package/shared/build-kit/realtime-agent.js +18 -0
- package/stacks/axon/templates/.claude/skills/build-automation/SKILL.md +407 -0
- package/stacks/axon/templates/.claude/skills/build-automation/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/SKILL.md +496 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/axon-workflow-api.md +279 -0
- package/stacks/axon/templates/.claude/skills/build-automation-workflow/references/feature-flag-patterns.md +114 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/SKILL.md +396 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/axon-test-fixture-patterns.md +162 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/feature-flag-patterns.md +56 -0
- package/stacks/axon/templates/.claude/skills/build-state-change/references/rest-api-patterns.md +115 -0
- package/stacks/axon/templates/.claude/skills/build-state-view/SKILL.md +282 -0
- package/stacks/axon/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/axon/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +611 -0
- package/stacks/axon/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/axon/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/axon/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/axon/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/axon/templates/build-kit/lib/backend-prompt.md +158 -0
- package/stacks/axon/templates/build-kit/lib/prompt.md +126 -0
- package/stacks/axon/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/axon/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/axon/templates/build-kit/ralph.sh +98 -0
- package/stacks/axon/templates/root/.env.example +5 -0
- package/stacks/axon/templates/root/CLAUDE.md +60 -0
- package/stacks/axon/templates/root/README.md +44 -0
- package/stacks/axon/templates/root/docker-compose.yml +64 -0
- package/stacks/axon/templates/root/mvnw +259 -0
- package/stacks/axon/templates/root/mvnw.cmd +149 -0
- package/stacks/axon/templates/root/pom.xml +125 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/QuickstartApplication.java +128 -0
- package/stacks/axon/templates/root/src/main/java/io/axoniq/quickstart/config/WebConfig.java +155 -0
- package/stacks/axon/templates/root/src/main/resources/application.properties +2 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-body.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/bg-header.png +0 -0
- package/stacks/axon/templates/root/src/main/resources/static/index.html +596 -0
- package/stacks/cratis-csharp/templates/.claude/skills/_shared/cratis-conventions.md +251 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/SKILL.md +99 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-automation/references/patterns.md +115 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/SKILL.md +163 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-change/references/patterns.md +234 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/SKILL.md +120 -0
- package/stacks/cratis-csharp/templates/.claude/skills/build-state-view/references/patterns.md +166 -0
- package/stacks/cratis-csharp/templates/.claude/skills/connect/SKILL.md +169 -0
- package/stacks/cratis-csharp/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +609 -0
- package/stacks/cratis-csharp/templates/.claude/skills/load-slice/SKILL.md +141 -0
- package/stacks/cratis-csharp/templates/.claude/skills/update-slice-status/SKILL.md +105 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/AGENT.md +58 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/backend-prompt.md +129 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/prompt.md +124 -0
- package/stacks/cratis-csharp/templates/build-kit/lib/ralph.js +302 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph-claude.js +37 -0
- package/stacks/cratis-csharp/templates/build-kit/ralph.sh +98 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.css +29 -0
- package/stacks/cratis-csharp/templates/root/.frontend/index.html +17 -0
- package/stacks/cratis-csharp/templates/root/.frontend/main.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.json +42 -0
- package/stacks/cratis-csharp/templates/root/.frontend/tsconfig.node.json +11 -0
- package/stacks/cratis-csharp/templates/root/.frontend/vite.config.ts +56 -0
- package/stacks/cratis-csharp/templates/root/App.tsx +23 -0
- package/stacks/cratis-csharp/templates/root/CLAUDE.md +62 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.csproj +25 -0
- package/stacks/cratis-csharp/templates/root/CratisApp.sln +18 -0
- package/stacks/cratis-csharp/templates/root/GlobalUsings.cs +3 -0
- package/stacks/cratis-csharp/templates/root/Home.tsx +102 -0
- package/stacks/cratis-csharp/templates/root/Program.cs +26 -0
- package/stacks/cratis-csharp/templates/root/README.md +192 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/AllListings.ts +47 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.cs +11 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/Listing.ts +12 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/ListingDataTable.tsx +17 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Listing/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Register.ts +51 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/RegisterDialog.tsx +18 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/Registration.cs +27 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/Registration/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeFeature.tsx +22 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/SomeName.cs +3 -0
- package/stacks/cratis-csharp/templates/root/SomeModule/SomeFeature/index.ts +1 -0
- package/stacks/cratis-csharp/templates/root/appsettings.Development.json +9 -0
- package/stacks/cratis-csharp/templates/root/appsettings.json +26 -0
- package/stacks/cratis-csharp/templates/root/docker-compose.yml +23 -0
- package/stacks/cratis-csharp/templates/root/package.json +33 -0
- package/stacks/cratis-csharp/templates/root/tsconfig.json +3 -0
- package/stacks/modeling-kit/templates/.claude/settings.local.json +13 -0
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +215 -0
- package/stacks/modeling-kit/templates/.claude/skills/attributes/SKILL.md +176 -0
- package/stacks/modeling-kit/templates/.claude/skills/connect/SKILL.md +182 -0
- package/stacks/modeling-kit/templates/.claude/skills/discover-storyboard/SKILL.md +383 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-applying-conways-law/SKILL.md +465 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/SKILL.md +587 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-brainstorming-events/references/facilitating-event-modeling-workshops.md +626 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-checking-completeness/SKILL.md +542 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-designing-event-models/SKILL.md +497 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +783 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-inputs/SKILL.md +604 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-identifying-outputs/SKILL.md +699 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-integrating-legacy-systems/SKILL.md +674 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/SKILL.md +231 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/domain-patterns.md +150 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/patterns.md +329 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-optimizing-stream-design/references/snapshotting.md +204 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/SKILL.md +352 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-orchestrating-event-modeling/references/project-planning-with-event-modeling.md +341 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-plotting-events/SKILL.md +153 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/SKILL.md +136 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/examples.md +78 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-slicing-event-models/references/patterns.md +85 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-storyboarding-events/SKILL.md +655 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-translating-external-events/SKILL.md +479 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models/SKILL.md +234 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-validating-event-models-checklist/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/examples/SKILL.md +200 -0
- package/stacks/modeling-kit/templates/.claude/skills/handle-comment/SKILL.md +94 -0
- package/stacks/modeling-kit/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +441 -0
- package/stacks/modeling-kit/templates/.claude/skills/place-element/SKILL.md +290 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard/SKILL.md +212 -0
- package/stacks/modeling-kit/templates/.claude/skills/storyboard-screen/SKILL.md +123 -0
- package/stacks/modeling-kit/templates/.claude/skills/timeline/SKILL.md +353 -0
- package/stacks/modeling-kit/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/modeling-kit/templates/.claude/skills/wdyt/SKILL.md +134 -0
- package/stacks/modeling-kit/templates/kit/lib/agent.sh +20 -0
- package/stacks/modeling-kit/templates/kit/lib/ollama-agent.js +147 -0
- package/stacks/modeling-kit/templates/kit/lib/ralph.js +286 -0
- package/stacks/modeling-kit/templates/kit/package.json +12 -0
- package/stacks/modeling-kit/templates/kit/ralph-claude.js +50 -0
- package/stacks/modeling-kit/templates/kit/ralph-ollama.js +38 -0
- package/stacks/modeling-kit/templates/kit/ralph.sh +61 -0
- package/stacks/modeling-kit/templates/kit/realtime-agent.js +18 -0
- package/stacks/modeling-kit/templates/root/CLAUDE.md +56 -0
- package/stacks/node/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +412 -0
- package/stacks/node/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/node/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/node/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/node/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/node/templates/build-kit/README.md +86 -0
- package/stacks/node/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/node/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/node/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/node/templates/build-kit/lib/prompt.md +122 -0
- package/stacks/node/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/node/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/node/templates/build-kit/ralph.sh +98 -0
- package/stacks/node/templates/root/.env.example +15 -0
- package/stacks/node/templates/root/CLAUDE.md +60 -0
- package/stacks/node/templates/root/docker-compose.yml +15 -0
- package/stacks/node/templates/root/flyway.conf +17 -0
- package/stacks/node/templates/root/migrations/V1__schema.sql.example +12 -0
- package/stacks/node/templates/root/package.json +50 -0
- package/stacks/node/templates/root/server.ts +130 -0
- package/stacks/node/templates/root/setup-env.sh +53 -0
- package/stacks/node/templates/root/src/common/assertions.ts +6 -0
- package/stacks/node/templates/root/src/common/db.ts +32 -0
- package/stacks/node/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/node/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/node/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/node/templates/root/src/common/realtimeBroadcast.ts +12 -0
- package/stacks/node/templates/root/src/common/replay.ts +16 -0
- package/stacks/node/templates/root/src/common/routes.ts +19 -0
- package/stacks/node/templates/root/src/common/testHelpers.ts +44 -0
- package/stacks/node/templates/root/src/swagger.ts +34 -0
- package/stacks/node/templates/root/src/util/assertions.ts +6 -0
- package/stacks/node/templates/root/src/util/hash.ts +9 -0
- package/stacks/node/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/node/templates/root/tsconfig.json +32 -0
- package/stacks/node/templates/root/vercel.json +8 -0
- package/stacks/supabase/templates/.claude/skills/build-automation/SKILL.md +266 -0
- package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +344 -0
- package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +390 -0
- package/stacks/supabase/templates/.claude/skills/build-webhook/SKILL.md +303 -0
- package/stacks/supabase/templates/.claude/skills/connect/SKILL.md +178 -0
- package/stacks/supabase/templates/.claude/skills/learn-eventmodelers-api/SKILL.md +628 -0
- package/stacks/supabase/templates/.claude/skills/load-slice/SKILL.md +143 -0
- package/stacks/supabase/templates/.claude/skills/update-slice-status/SKILL.md +110 -0
- package/stacks/supabase/templates/build-kit/README.md +86 -0
- package/stacks/supabase/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/supabase/templates/build-kit/lib/agent.sh +20 -0
- package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +152 -0
- package/stacks/supabase/templates/build-kit/lib/prompt.md +123 -0
- package/stacks/supabase/templates/build-kit/lib/ralph.js +369 -0
- package/stacks/supabase/templates/build-kit/ralph-claude.js +44 -0
- package/stacks/supabase/templates/build-kit/ralph.sh +98 -0
- package/stacks/supabase/templates/root/.env.example +22 -0
- package/stacks/supabase/templates/root/CLAUDE.md +61 -0
- package/stacks/supabase/templates/root/flyway.conf +17 -0
- package/stacks/supabase/templates/root/package.json +52 -0
- package/stacks/supabase/templates/root/server.ts +177 -0
- package/stacks/supabase/templates/root/setup-env.sh +53 -0
- package/stacks/supabase/templates/root/src/common/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/common/db.ts +32 -0
- package/stacks/supabase/templates/root/src/common/loadPostgresEventstore.ts +23 -0
- package/stacks/supabase/templates/root/src/common/parseEndpoint.ts +51 -0
- package/stacks/supabase/templates/root/src/common/processorDlq.ts +28 -0
- package/stacks/supabase/templates/root/src/common/realtimeBroadcast.ts +19 -0
- package/stacks/supabase/templates/root/src/common/replay.ts +16 -0
- package/stacks/supabase/templates/root/src/common/routes.ts +23 -0
- package/stacks/supabase/templates/root/src/common/testHelpers.ts +54 -0
- package/stacks/supabase/templates/root/src/supabase/README.md +141 -0
- package/stacks/supabase/templates/root/src/supabase/api.ts +56 -0
- package/stacks/supabase/templates/root/src/supabase/requireOrgaAdmin.ts +32 -0
- package/stacks/supabase/templates/root/src/supabase/requireSysUser.ts +40 -0
- package/stacks/supabase/templates/root/src/supabase/requireUser.ts +72 -0
- package/stacks/supabase/templates/root/src/swagger.ts +34 -0
- package/stacks/supabase/templates/root/src/util/assertions.ts +6 -0
- package/stacks/supabase/templates/root/src/util/hash.ts +9 -0
- package/stacks/supabase/templates/root/src/util/sanitize.ts +23 -0
- package/stacks/supabase/templates/root/supabase/config.toml +295 -0
- package/stacks/supabase/templates/root/supabase/migrations/V1__schema.sql.example +12 -0
- package/stacks/supabase/templates/root/supabase/seed.sql +1 -0
- package/stacks/supabase/templates/root/tsconfig.json +32 -0
- package/stacks/supabase/templates/root/vercel.json +8 -0
|
@@ -0,0 +1,143 @@
|
|
|
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": "...", "contextName": "...", "contextId": "...", "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
|
+
- `contextSlug` = slugify `slice.contextName` if present, otherwise `"default"` — lowercase, spaces to hyphens, non-alphanumeric removed (e.g. `"My Ctx"` → `"my-ctx"`)
|
|
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/<contextSlug>/`
|
|
51
|
+
- `sliceDir` = `.build-kit/.slices/<contextSlug>/<sliceFolder>/`
|
|
52
|
+
|
|
53
|
+
### Write files
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
mkdir -p ".build-kit/.slices/<contextSlug>/<sliceFolder>"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**`.build-kit/.slices/current_context.json`** — always overwrite:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{ "name": "Beta" }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**`.build-kit/.slices/<contextSlug>/context.json`** — write once per context:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{ "name": "Beta" }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**`.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json`** — the full slice object with the `index` field removed.
|
|
72
|
+
|
|
73
|
+
### Maintain `.build-kit/.slices/<contextSlug>/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
|
+
"contextName": "Beta",
|
|
87
|
+
"contextSlug": "beta",
|
|
88
|
+
"folder": "betaenableuserforbetatest",
|
|
89
|
+
"status": "Created",
|
|
90
|
+
"definition": {
|
|
91
|
+
"id": "d0dbc70c-f244-4048-886b-1d11e461f466",
|
|
92
|
+
"title": "Beta Enable User for Beta Test",
|
|
93
|
+
"status": "Created",
|
|
94
|
+
"contextName": "Beta",
|
|
95
|
+
"contextId": "..."
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The `definition` field holds the full object returned by the API for that slice (all fields as-is).
|
|
103
|
+
|
|
104
|
+
**Merge rules:**
|
|
105
|
+
- If an entry with the same `id` already exists: update all fields and refresh `definition`; preserve any existing `assigned` field.
|
|
106
|
+
- If not found: append the new entry.
|
|
107
|
+
|
|
108
|
+
Write the updated object back to `.build-kit/.slices/<contextSlug>/index.json`.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 4 — Return the requested slice
|
|
113
|
+
|
|
114
|
+
If `sliceId` was given: find the entry in `ALL_SLICES` where `id === sliceId`.
|
|
115
|
+
If `sliceTitle` was given: find the entry where `title` matches case-insensitively.
|
|
116
|
+
If neither: return all slices.
|
|
117
|
+
|
|
118
|
+
If a specific slice was requested but not found, stop and list the available titles.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step 5 — Output
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
Slices loaded: <count> total
|
|
126
|
+
Persisted to: .build-kit/.slices/<contextSlug>/
|
|
127
|
+
|
|
128
|
+
Requested slice:
|
|
129
|
+
Title: <title>
|
|
130
|
+
ID: <id>
|
|
131
|
+
Status: <status>
|
|
132
|
+
Folder: .build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Or if no filter was given:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
All slices (<count>) — context: <contextSlug>:
|
|
139
|
+
- <title> [<status>] → .build-kit/.slices/<contextSlug>/<sliceFolder>/
|
|
140
|
+
- ...
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Make the matched slice's `id`, `title`, `status`, and local folder path available to subsequent steps in the same session.
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
### If the API rejects the update because the slice is already in `newStatus`
|
|
88
|
+
|
|
89
|
+
The API refuses to move a slice into a status it is already in — this is a deliberate concurrency guard so two agents racing to claim the same slice can't both succeed. If Step 3 fails with an error indicating the slice is already at `<newStatus>` (e.g. a `409`, or an error body mentioning "already"), this is **not a failure to surface as broken** — it means another agent already claimed or moved the slice first. Report this as a distinct `ALREADY_IN_STATUS` outcome (see Step 4) rather than a generic error, and do not retry the same update. Callers trying to claim a `Planned` slice for building should treat this as a signal to pick a different slice, not to stop.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Step 4 — Report back
|
|
94
|
+
|
|
95
|
+
Tell the user:
|
|
96
|
+
|
|
97
|
+
- **Slice**: the title that was updated
|
|
98
|
+
- **Previous status**: `CURRENT_STATUS`
|
|
99
|
+
- **New status**: `newStatus`
|
|
100
|
+
- **Node ID**: `SLICE_NODE_ID`
|
|
101
|
+
- **Outcome**: `SUCCESS`, `ALREADY_IN_STATUS` (another agent got there first — see above), or `ERROR`
|
|
102
|
+
- **Any errors**: raw API message if something failed for a reason other than `ALREADY_IN_STATUS`
|
|
103
|
+
|
|
104
|
+
Example success output:
|
|
105
|
+
```
|
|
106
|
+
Updated: "Order Placed" slice
|
|
107
|
+
Before: InProgress
|
|
108
|
+
After: Done
|
|
109
|
+
Node ID: a1b2c3d4-…
|
|
110
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# .build-kit
|
|
2
|
+
|
|
3
|
+
Ralph's runtime directory. Contains the agent loop, realtime subscription, prompts, and Claude skills.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Claude (default)
|
|
9
|
+
node .build-kit/ralph-claude.js
|
|
10
|
+
|
|
11
|
+
# Local Ollama model — run `ollama serve` first
|
|
12
|
+
OLLAMA_MODEL=qwen3:8b node .build-kit/ralph-ollama.js
|
|
13
|
+
|
|
14
|
+
# Custom project directory (defaults to the parent of .build-kit)
|
|
15
|
+
node .build-kit/ralph-claude.js /path/to/project
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Files
|
|
19
|
+
|
|
20
|
+
**Entry points** (top level):
|
|
21
|
+
|
|
22
|
+
| File | Purpose |
|
|
23
|
+
|------|---------|
|
|
24
|
+
| `ralph-claude.js` | Runs the full loop using Claude Code as the executor |
|
|
25
|
+
| `ralph-ollama.js` | Runs the full loop using a local Ollama model |
|
|
26
|
+
| `ralph.sh` | Shell-based loop — alternative to the JS entry points |
|
|
27
|
+
| `realtime-agent.js` | Standalone realtime agent — only needed to run it in a separate terminal |
|
|
28
|
+
|
|
29
|
+
**Internals** (`lib/`):
|
|
30
|
+
|
|
31
|
+
| File | Purpose |
|
|
32
|
+
|------|---------|
|
|
33
|
+
| `lib/ralph.js` | Shared library — realtime agent + loop logic; imported by the entry points |
|
|
34
|
+
| `lib/ollama-agent.js` | Ollama executor — called by `ralph-ollama.js`, can also run manually |
|
|
35
|
+
| `lib/agent.sh` | Thin shell wrapper around `claude` — called by `ralph.sh` |
|
|
36
|
+
| `lib/prompt.md` | Phase 1 prompt: tells Claude how to load a slice from the board |
|
|
37
|
+
| `lib/backend-prompt.md` | Phase 2 prompt: tells Claude how to build a planned slice |
|
|
38
|
+
| `lib/AGENT.md` | Agent instructions included in Claude's context |
|
|
39
|
+
|
|
40
|
+
## How it works
|
|
41
|
+
|
|
42
|
+
**Phase 1** — triggered when `tasks.json` has entries:
|
|
43
|
+
- The realtime agent writes a task to `tasks.json` each time a `slice:changed` event arrives from the board
|
|
44
|
+
- The loop picks it up and runs Claude (or Ollama) with `prompt.md`
|
|
45
|
+
- Claude loads the slice data and updates `.slices/`
|
|
46
|
+
|
|
47
|
+
**Phase 2** — triggered when any file in `.slices/` contains `"status": "Planned"`:
|
|
48
|
+
- The loop runs Claude with `backend-prompt.md`
|
|
49
|
+
- Claude implements the slice in the project
|
|
50
|
+
- Phase 2 is Claude-only; Ollama mode skips it (ollama-agent handles its own queue)
|
|
51
|
+
|
|
52
|
+
Both phases run in a continuous loop with a 3-second idle sleep. The realtime agent runs concurrently in the same process.
|
|
53
|
+
|
|
54
|
+
## Running the realtime agent separately
|
|
55
|
+
|
|
56
|
+
If you want the board subscription in one terminal and the Claude loop in another:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Terminal 1 — realtime agent only
|
|
60
|
+
node .build-kit/realtime-agent.js
|
|
61
|
+
|
|
62
|
+
# Terminal 2 — loop only (poll tasks.json without the realtime subscription)
|
|
63
|
+
.build-kit/ralph.sh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Ollama configuration
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
OLLAMA_MODEL=qwen3:8b # model to use (default: qwen3:8b)
|
|
70
|
+
OLLAMA_URL=http://host:11434 # Ollama server URL (default: http://localhost:11434)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Config
|
|
74
|
+
|
|
75
|
+
Credentials are stored in `.build-kit/.eventmodelers/config.json` (written by `ralph-li install`):
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"organizationId": "...",
|
|
80
|
+
"boardId": "...",
|
|
81
|
+
"token": "...",
|
|
82
|
+
"baseUrl": "https://api.eventmodelers.ai"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Claude skills live in `.build-kit/.claude/skills/` and are available inside any Claude Code session started from `.build-kit/`.
|
|
@@ -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>.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- `<context>` is the slice's context value, or `default` if none.
|
|
32
|
+
- `<sliceName>` is the slice title lowercased with spaces and the `"slice:"` prefix removed (e.g. `"slice: 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>.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,152 @@
|
|
|
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. Determine the slice type and invoke the matching skill as defined in the **Building a Slice** section of CLAUDE.md. Do NOT implement manually.
|
|
29
|
+
8. Write a short progress one liner after each step to progress.txt
|
|
30
|
+
9. Analyze and Implement that single slice, make use of the skills in the skills directory, but also your previsously collected
|
|
31
|
+
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.
|
|
32
|
+
10. The slice in the json is always true, the code follows what is defined in the json
|
|
33
|
+
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
|
|
34
|
+
fulfills the slice.json. There must be no specification in json, that has no equivalent in code.
|
|
35
|
+
12. make sure to write the ui-prompt.md as defined if defined in the skill
|
|
36
|
+
13. Run quality checks ( npm run build, npm run test ) - Attention - it´s enough to run the tests for the slice. Do not run all tests.
|
|
37
|
+
14. even if the slice is fully implemented, run your test-analyzer skill and provide the code-slice.json file as defined in the skill
|
|
38
|
+
15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
|
|
39
|
+
first )
|
|
40
|
+
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).
|
|
41
|
+
17. Append your progress to `progress.txt` after each step in the iteration.
|
|
42
|
+
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.
|
|
43
|
+
19. Finish the iteration.
|
|
44
|
+
|
|
45
|
+
## Progress Report Format
|
|
46
|
+
|
|
47
|
+
APPEND to progress.txt (never replace, always append):
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
## [Date/Time] - [Slice]
|
|
51
|
+
|
|
52
|
+
- What was implemented
|
|
53
|
+
- Files changed
|
|
54
|
+
- **Learnings for future iterations:**
|
|
55
|
+
- Patterns discovered (e.g., "this codebase uses X for Y")
|
|
56
|
+
- Gotchas encountered (e.g., "don't forget to update Z when changing W")
|
|
57
|
+
- Useful context (e.g., "the evaluation panel is in component X")
|
|
58
|
+
---
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase
|
|
62
|
+
better.
|
|
63
|
+
|
|
64
|
+
## Consolidate Patterns
|
|
65
|
+
|
|
66
|
+
If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section
|
|
67
|
+
at the TOP of progress.txt (create it if it doesn't exist). This section should consolidate the most important
|
|
68
|
+
learnings:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
## Codebase Patterns
|
|
72
|
+
- Example: Use `sql<number>` template for aggregations
|
|
73
|
+
- Example: Always use `IF NOT EXISTS` for migrations
|
|
74
|
+
- Example: Export types from actions.ts for UI components
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Only add patterns that are **general and reusable**, not story-specific details.
|
|
78
|
+
|
|
79
|
+
## Update AGENTS.md Files
|
|
80
|
+
|
|
81
|
+
Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files:
|
|
82
|
+
|
|
83
|
+
1. **Identify directories with edited files** - Look at which directories you modified
|
|
84
|
+
3. **Add valuable learnings that apply to all tasks** to the Agents.md - If you discovered something future developers/agents should know:
|
|
85
|
+
- API patterns or conventions specific to that module
|
|
86
|
+
- Gotchas or non-obvious requirements
|
|
87
|
+
- Dependencies between files
|
|
88
|
+
- Testing approaches for that area
|
|
89
|
+
- Configuration or environment requirements
|
|
90
|
+
|
|
91
|
+
**Examples of good AGENTS.md additions:**
|
|
92
|
+
|
|
93
|
+
- "When modifying X, also update Y to keep them in sync"
|
|
94
|
+
- "This module uses pattern Z for all API calls"
|
|
95
|
+
- "Tests require the dev server running on PORT 3000"
|
|
96
|
+
- "Field names must match the template exactly"
|
|
97
|
+
|
|
98
|
+
**Do NOT add:**
|
|
99
|
+
|
|
100
|
+
- Slice specific implementation details
|
|
101
|
+
- Story-specific implementation details
|
|
102
|
+
- Temporary debugging notes
|
|
103
|
+
- Information already in progress.txt
|
|
104
|
+
- Task speecific learnings like "- Timesheet approval requires: submitted=true, reverted=false, approved=false, declined=false"
|
|
105
|
+
|
|
106
|
+
Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work
|
|
107
|
+
|
|
108
|
+
## Quality Requirements
|
|
109
|
+
|
|
110
|
+
- ALL commits must pass your project's quality checks (typecheck, lint, test)
|
|
111
|
+
- run 'npm run build'
|
|
112
|
+
- run 'npm run test'
|
|
113
|
+
- Do NOT commit broken code
|
|
114
|
+
- Keep changes focused and minimal
|
|
115
|
+
- Follow existing code patterns
|
|
116
|
+
|
|
117
|
+
## Skills
|
|
118
|
+
|
|
119
|
+
Use the provided skills in the skills folder as guidance.
|
|
120
|
+
Update skill definitions if you find an improvement you can make.
|
|
121
|
+
|
|
122
|
+
## Specifications
|
|
123
|
+
|
|
124
|
+
For every specification added to the Slice, you need to implement one use executable Specification in Code.
|
|
125
|
+
|
|
126
|
+
A Slice is not complete if specifications are missing or can´t be executed.
|
|
127
|
+
|
|
128
|
+
## Stop Condition
|
|
129
|
+
|
|
130
|
+
**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.
|
|
131
|
+
|
|
132
|
+
If the slice was completed and committed successfully, reply with:
|
|
133
|
+
<promise>DONE</promise>
|
|
134
|
+
|
|
135
|
+
If no slice has status "Planned" in the current context, reply with:
|
|
136
|
+
<promise>NO_TASKS</promise>
|
|
137
|
+
(Do NOT switch to another context to find work — stop here.)
|
|
138
|
+
|
|
139
|
+
If ALL slices in the current context are Done, reply with:
|
|
140
|
+
<promise>COMPLETE</promise>
|
|
141
|
+
|
|
142
|
+
## Important
|
|
143
|
+
|
|
144
|
+
- If `.build-kit/.eventmodelers/config.json` is absent, skip all platform communication (MCP calls, `update-slice-status`, board sync) and continue working locally.
|
|
145
|
+
- Work on ONE slice per iteration
|
|
146
|
+
- Commit frequently
|
|
147
|
+
- update progress.txt frequently
|
|
148
|
+
- Read the Codebase Patterns section in progress.txt before starting
|
|
149
|
+
|
|
150
|
+
## When an iteration completes
|
|
151
|
+
|
|
152
|
+
Use all the key learnings from the project.txt and update the Agends.md file with those learning.
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
- **Webhook** — `sliceType === "WEBHOOK"` → invoke `/build-webhook`
|
|
59
|
+
- **Translation** — `sliceType === "TRANSLATION"` → read `description` and `notes` from slice.json; use `/build-webhook` if notes describe an HTTP endpoint, otherwise default to `/build-automation`
|
|
60
|
+
- **Automation** — `processors` array is non-empty → invoke `/build-automation`
|
|
61
|
+
- **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
|
|
62
|
+
- **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
|
|
63
|
+
|
|
64
|
+
4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
|
|
65
|
+
|
|
66
|
+
5. Run quality checks (`npm run build`, then the slice tests only — not the full test suite).
|
|
67
|
+
|
|
68
|
+
6. If checks pass, commit all changes with message: `feat: [Slice Name]`.
|
|
69
|
+
|
|
70
|
+
7. Call `/update-slice-status` to set the slice to `Done` on the board.
|
|
71
|
+
|
|
72
|
+
#### `InProgress`
|
|
73
|
+
Another agent is already building this slice. Log it and skip — do not build.
|
|
74
|
+
|
|
75
|
+
#### `Done`
|
|
76
|
+
Summarize what was completed and update `progress.txt`.
|
|
77
|
+
|
|
78
|
+
#### `Blocked`
|
|
79
|
+
Log the blocker in `progress.txt`.
|
|
80
|
+
|
|
81
|
+
#### `Review`
|
|
82
|
+
Fetch slice details and prepare a review summary in `progress.txt`.
|
|
83
|
+
|
|
84
|
+
#### Any other status (`Created`, etc.)
|
|
85
|
+
Load the slice and log the state transition in `progress.txt`. No build action.
|
|
86
|
+
|
|
87
|
+
Use the skills available in `.claude/skills/` to interact with the board.
|
|
88
|
+
|
|
89
|
+
## Updating tasks.json
|
|
90
|
+
|
|
91
|
+
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 `[]`.
|
|
92
|
+
|
|
93
|
+
## Progress Report Format
|
|
94
|
+
|
|
95
|
+
APPEND to `progress.txt` (never replace):
|
|
96
|
+
```
|
|
97
|
+
## [ISO timestamp] — Task [task.id]
|
|
98
|
+
|
|
99
|
+
Slice: [sliceTitle] ([sliceId])
|
|
100
|
+
Status change: [sliceStatus]
|
|
101
|
+
|
|
102
|
+
Action taken:
|
|
103
|
+
- [what was done in response to the slice change]
|
|
104
|
+
|
|
105
|
+
Learnings:
|
|
106
|
+
- [any patterns, gotchas, or reusable knowledge discovered]
|
|
107
|
+
---
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Stop Condition
|
|
111
|
+
|
|
112
|
+
If `.build-kit/tasks.json` is empty (`[]`) or does not exist, reply with:
|
|
113
|
+
<promise>IDLE</promise>
|
|
114
|
+
|
|
115
|
+
## Updating AGENT.md
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
## Important
|
|
120
|
+
|
|
121
|
+
- Process **one task per iteration**.
|
|
122
|
+
- Read `AGENT.md` first — it contains patterns from previous iterations.
|
|
123
|
+
- Always start with `/connect` if credentials are not yet loaded.
|