@eventmodelers/cli 1.0.163 → 2.0.2
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 +48 -36
- package/RELEASE_NOTES.md +20 -2
- package/cli.js +774 -247
- package/lib/adapters/spec-kitty-adapter.js +3 -7
- package/lib/build-kits.js +23 -0
- package/lib/global-agent-id.js +45 -0
- package/lib/modeling-local-ai.js +4 -2
- package/lib/scaffold-model.js +71 -0
- package/lib/scaffold.js +224 -0
- package/lib/supervise.js +60 -0
- package/lib/ui-baseline.js +123 -0
- package/package.json +1 -1
- package/shared/build-kit/README.md +4 -19
- package/shared/build-kit/lib/agent-lock.js +75 -0
- package/shared/build-kit/lib/agent-name.js +27 -0
- package/shared/build-kit/lib/event-prune.js +58 -0
- package/shared/build-kit/lib/events-view.js +134 -0
- package/shared/build-kit/lib/local-ai-agent.js +14 -26
- package/shared/build-kit/lib/mcp-register.js +17 -1
- package/shared/build-kit/lib/prompt-journal.js +191 -0
- package/shared/build-kit/lib/prompt-replay.js +35 -0
- package/shared/build-kit/lib/ralph.js +218 -169
- package/shared/build-kit/lib/slice-curation.js +40 -0
- package/shared/build-kit/lib/slice-events.js +93 -0
- package/shared/build-kit/lib/slice-git.js +86 -0
- package/shared/build-kit/lib/slice-learnings.js +197 -0
- package/shared/build-kit/lib/slice-projection.js +101 -0
- package/shared/build-kit/lib/slice-run.js +181 -0
- package/shared/build-kit/lib/slice-state.js +184 -0
- package/shared/build-kit/lib/slice-tasks.js +35 -0
- package/shared/build-kit/ralph-claude.js +4 -2
- package/shared/build-kit/ralph-exec.js +4 -2
- package/shared/build-kit/ralph-local-ai.js +5 -3
- package/shared/scaffold/LICENSE-em-scaffold +21 -0
- package/shared/scaffold/supabase/generate.mjs +290 -0
- package/shared/scaffold/supabase/template/scripts/create-user.mjs.tmpl +29 -0
- package/shared/scaffold/supabase/template/scripts/dev.mjs.tmpl +145 -0
- package/shared/scaffold/supabase/template/scripts/write-env.mjs.tmpl +44 -0
- package/shared/scaffold/supabase/template/server.ts.tmpl +168 -0
- package/shared/scaffold/supabase/template/src/common/extraEndpoints.ts.tmpl +5 -0
- package/shared/scaffold/supabase/template/src/common/notImplemented.test.ts.tmpl +58 -0
- package/shared/scaffold/supabase/template/src/common/notImplemented.ts.tmpl +29 -0
- package/shared/scaffold/supabase/template/supabase/migrations/_V0__supabase_stubs.sql.tmpl +34 -0
- package/shared/scaffold/supabase/template/web/src/App.tsx.tmpl +38 -0
- package/shared/scaffold/supabase/template/web/src/app/Layout.tsx.tmpl +48 -0
- package/shared/scaffold/supabase/template/web/src/app/NotFound.tsx.tmpl +12 -0
- package/shared/scaffold/supabase/template/web/src/app/SignIn.tsx.tmpl +42 -0
- package/shared/scaffold/supabase/template/web/src/app/TimelinePage.tsx.tmpl +73 -0
- package/shared/scaffold/supabase/template/web/src/app/pages.ts.tmpl +26 -0
- package/shared/scaffold/supabase/template/web/src/app/skeleton.css.tmpl +25 -0
- package/shared/scaffold/supabase/template/web/src/lib/NotBuilt.tsx.tmpl +12 -0
- package/shared/scaffold/supabase/template/web/src/lib/api.ts.tmpl +226 -0
- package/shared/scaffold/supabase/template/web/src/main.tsx.tmpl +13 -0
- package/shared/skills/learn-eventmodelers-api/SKILL.md +17 -4
- package/shared/skills/request-feedback/SKILL.md +1 -2
- package/shared/skills/ui-contract/SKILL.md +7 -5
- package/shared/skills/update-slice-status/SKILL.md +1 -1
- package/stacks/axon/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/axon/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/axon/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/axon/templates/build-kit/lib/prompt.md +32 -41
- package/stacks/blank/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/blank/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/blank/templates/build-kit/lib/backend-prompt.md +20 -37
- package/stacks/blank/templates/build-kit/lib/prompt.md +33 -42
- package/stacks/classic/templates/.claude/skills/build-automation/SKILL.md +1 -1
- package/stacks/classic/templates/.claude/skills/build-state-change/SKILL.md +1 -1
- package/stacks/classic/templates/.claude/skills/build-state-view/SKILL.md +2 -2
- package/stacks/classic/templates/.claude/skills/record-evidence/SKILL.md +2 -2
- package/stacks/classic/templates/build-kit/CLAUDE.md +9 -8
- package/stacks/classic/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/classic/templates/build-kit/lib/backend-prompt.md +20 -38
- package/stacks/classic/templates/build-kit/lib/prompt.md +33 -42
- package/stacks/kurrent/templates/build-kit/CLAUDE.md +7 -7
- package/stacks/kurrent/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/kurrent/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/kurrent/templates/build-kit/lib/prompt.md +32 -41
- package/stacks/modeling-kit/templates/.claude/skills/analyze-existing-model/SKILL.md +1 -1
- package/stacks/modeling-kit/templates/.claude/skills/detect-model-drift/SKILL.md +1 -1
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-core-rules/SKILL.md +2 -0
- package/stacks/modeling-kit/templates/.claude/skills/eventmodeling-elaborating-scenarios/SKILL.md +7 -3
- package/stacks/modeling-kit/templates/.claude/skills/wdyt/SKILL.md +1 -1
- package/stacks/modeling-kit/templates/kit/CLAUDE-STANDALONE.md +3 -4
- package/stacks/modeling-kit/templates/kit/CLAUDE.md +18 -28
- package/stacks/modeling-kit/templates/kit/README.md +1 -1
- package/stacks/modeling-kit/templates/kit/lib/config.js +1 -1
- package/stacks/node/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/node/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/node/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/node/templates/build-kit/lib/prompt.md +18 -41
- package/stacks/opencqrs/templates/build-kit/CLAUDE.md +7 -7
- package/stacks/opencqrs/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/opencqrs/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/opencqrs/templates/build-kit/lib/prompt.md +32 -41
- package/stacks/react/templates/.claude/skills/build-state-change/SKILL.md +1 -1
- package/stacks/react/templates/.claude/skills/build-state-view/SKILL.md +1 -1
- package/stacks/react/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/react/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/react/templates/build-kit/lib/backend-prompt.md +25 -42
- package/stacks/react/templates/build-kit/lib/kit.json +1 -1
- package/stacks/react/templates/build-kit/lib/prompt.md +47 -43
- package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +15 -0
- package/stacks/supabase/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/supabase/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/supabase/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/supabase/templates/build-kit/lib/prompt.md +18 -41
- package/stacks/supabase-react/templates/.claude/skills/build-state-change/SKILL.md +80 -8
- package/stacks/supabase-react/templates/.claude/skills/build-state-view/SKILL.md +66 -13
- package/stacks/supabase-react/templates/build-kit/CLAUDE.md +8 -7
- package/stacks/supabase-react/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/supabase-react/templates/build-kit/lib/backend-prompt.md +25 -42
- package/stacks/supabase-react/templates/build-kit/lib/kit.json +1 -1
- package/stacks/supabase-react/templates/build-kit/lib/prompt.md +48 -44
- package/stacks/umadb/templates/build-kit/CLAUDE.md +7 -6
- package/stacks/umadb/templates/build-kit/lib/AGENT.md +6 -7
- package/stacks/umadb/templates/build-kit/lib/backend-prompt.md +20 -42
- package/stacks/umadb/templates/build-kit/lib/prompt.md +32 -41
- package/shared/bridge/spec-kitty/bridge-spec-kitty-specify/SKILL.md +0 -125
- package/shared/bridge/spec-kitty/bridge-spec-kitty-tasks/SKILL.md +0 -95
- package/shared/build-kit/lib/agent.sh +0 -20
- package/shared/build-kit/ralph.sh +0 -111
- package/shared/build-kit/realtime-agent.js +0 -20
- package/stacks/bridge/templates/bridge/lib/AGENT.md +0 -47
- package/stacks/bridge/templates/bridge/lib/prompt.md +0 -111
- package/stacks/bridge/templates/bridge/ralph-claude.js +0 -50
- package/stacks/bridge/templates/bridge/ralph-hook.js +0 -103
- package/stacks/bridge/templates/bridge/ralph-local-ai.js +0 -43
- package/stacks/bridge/templates/bridge/ralph-static.js +0 -90
|
@@ -20,16 +20,15 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
|
|
|
20
20
|
|
|
21
21
|
0. Do not read the entire code base. `.build-kit/ARCHITECTURE.md` tells you where to look; read the code of the precedent slices its Slice map names and the files the slice actually touches. If a `Done` slice has no row in the Slice map, run `/learn-architecture slices` first.
|
|
22
22
|
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.
|
|
23
|
-
2. Read
|
|
23
|
+
2. Read `.build-kit/AGENTS.md` **if it exists** — the project's accumulated learnings, generated from what earlier builds recorded. If the slice's `slice.json` has a `lastAttempt`, an earlier attempt at it failed: read its `reason`, `lastReply`, `branch` and `changed`, and do not repeat what failed.
|
|
24
24
|
3. Make sure you are on the right branch "feature/<slicename>", if unsure, start from main.
|
|
25
|
-
5.
|
|
26
|
-
**IMPORTANT: Only work on
|
|
25
|
+
5. Your slice is the one the task request names (the run loop picked the highest priority slice with status "Planned"); it becomes your PRD. The run loop has already claimed it — its status is "InProgress" in index.json and on the board. Build that slice and do not call `update-slice-status`: the run loop owns the slice's status on the board.
|
|
26
|
+
**IMPORTANT: Only work on the slice named in the task request. Never switch to another slice, whatever its status. If the task request names no slice and no slice has status "Planned" in the current context, reply with:**
|
|
27
27
|
<promise>NO_TASKS</promise> and stop immediately. Do not work on other slices and do not switch to another context.
|
|
28
|
-
**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>`.
|
|
29
28
|
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.
|
|
30
|
-
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.
|
|
29
|
+
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.
|
|
31
30
|
7. Determine the slice type and invoke the matching skill as defined in the **Building a Slice** section of `.build-kit/CLAUDE.md`. Do NOT implement manually.
|
|
32
|
-
8.
|
|
31
|
+
8. Record each learning the moment you have it (see **Recording Learnings**), not at the end.
|
|
33
32
|
9. Analyze and Implement that single slice, making use of the skills in the skills directory plus your previously collected knowledge. Make a TODO list for what needs to be done, and 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.
|
|
34
33
|
10. The slice in the json is always true, the code follows what is defined in the json
|
|
35
34
|
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 fulfills the slice.json. There must be no specification in json that has no equivalent in code.
|
|
@@ -37,44 +36,27 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
|
|
|
37
36
|
13. Run the quality checks listed in `.build-kit/ARCHITECTURE.md` — build/compile, then only the tests touched by this slice (do not run all tests).
|
|
38
37
|
14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
|
|
39
38
|
15. Invoke `/record-evidence` to write the implementation evidence (element → code mapping, files, specification → test mapping, seams, assumptions, commit) as a note into the slice's column, in the chapter's `Implementation` feedback lane.
|
|
40
|
-
16.
|
|
41
|
-
17.
|
|
42
|
-
18.
|
|
39
|
+
16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
|
|
40
|
+
17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
|
|
41
|
+
18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
|
|
43
42
|
19. Finish the iteration.
|
|
44
43
|
|
|
45
44
|
## Escalating Ambiguity
|
|
46
45
|
|
|
47
|
-
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line
|
|
46
|
+
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line as a code comment. Ambiguity alone is never a reason to stop. **Only if the slice literally cannot be built** — nothing runnable can be produced even with sensible assumptions — invoke `/request-feedback` with the specific question; it posts the question as a comment on the slice and marks it `Blocked`. That must be the absolute exception; a `Blocked` slice should mean "impossible without a human", never "the agent preferred to ask".
|
|
48
47
|
|
|
49
|
-
##
|
|
48
|
+
## Recording Learnings
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
`.build-kit/AGENTS.md` is generated from the learnings recorded so far — read it at the start of every session, never edit it by hand. Record a learning the moment you have it:
|
|
52
51
|
|
|
53
52
|
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- What was implemented
|
|
57
|
-
- Files changed
|
|
58
|
-
- **Learnings for future iterations:**
|
|
59
|
-
- Patterns discovered (e.g., "this codebase uses X for Y")
|
|
60
|
-
- Gotchas encountered (e.g., "don't forget to update Z when changing W")
|
|
61
|
-
- Useful context (e.g., "the evaluation panel is in component X")
|
|
62
|
-
---
|
|
53
|
+
npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
|
|
63
54
|
```
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section at the TOP of progress.txt (create it if it doesn't exist).
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
## Codebase Patterns
|
|
73
|
-
- Example: "Services are transactional at the class level — never open a transaction in the controller"
|
|
74
|
-
- Example: "New tables need a Flyway migration in db/migration, never edit an existing one"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Only add patterns that are **general and reusable**, not story-specific details.
|
|
56
|
+
- Only what is genuinely reusable: codebase patterns, gotchas, commands that work or don't, conventions — and, after a failed approach, what was tried and why it failed. Not slice-specific details, and nothing the code or git log already says.
|
|
57
|
+
- One learning per call, one line each. A learning that is already in `.build-kit/AGENTS.md` is skipped for you.
|
|
58
|
+
- `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
|
|
59
|
+
- One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
|
|
78
60
|
|
|
79
61
|
## Update AGENTS.md Files
|
|
80
62
|
|
|
@@ -85,7 +67,7 @@ Before committing, check if any edited files have learnings worth preserving in
|
|
|
85
67
|
- Slice specific implementation details
|
|
86
68
|
- Story-specific implementation details
|
|
87
69
|
- Temporary debugging notes
|
|
88
|
-
- Information already in
|
|
70
|
+
- Information already recorded as a learning in `.build-kit/AGENTS.md`
|
|
89
71
|
- Task-specific learnings
|
|
90
72
|
|
|
91
73
|
Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work
|
|
@@ -130,9 +112,9 @@ If ALL slices in the current context are Done, reply with:
|
|
|
130
112
|
- If no `.eventmodelers/config.json` exists anywhere (project root or an ancestor directory, or `~/.eventmodelers/config.json` — the one inside `.build-kit/` is only an optional override, so its absence means nothing), skip all platform communication (MCP calls, `update-slice-status`, board sync) and continue working locally.
|
|
131
113
|
- Work on ONE slice per iteration
|
|
132
114
|
- Commit frequently
|
|
133
|
-
-
|
|
134
|
-
- Read
|
|
115
|
+
- Record learnings as you go with `learn`
|
|
116
|
+
- Read `.build-kit/AGENTS.md` before starting
|
|
135
117
|
|
|
136
118
|
## When an iteration completes
|
|
137
119
|
|
|
138
|
-
|
|
120
|
+
Make sure every reusable learning is recorded with `learn`; `.build-kit/AGENTS.md` is generated from them — never edit it by hand.
|
|
@@ -4,17 +4,11 @@ You are an autonomous agent reacting to slice status change events on an Eventmo
|
|
|
4
4
|
|
|
5
5
|
## Your Loop
|
|
6
6
|
|
|
7
|
-
1. Read `AGENT.md` to load accumulated
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
|
|
11
|
-
|
|
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.
|
|
7
|
+
1. Read `AGENT.md` and, if it exists, `.build-kit/AGENTS.md` to load accumulated knowledge before doing anything else.
|
|
8
|
+
2. The task request at the end of this prompt names your task: its id and the slice change that queued it (`sliceId`, `sliceTitle`, `sliceStatus`, …). It is the oldest one waiting — the run loop picked it for you.
|
|
9
|
+
3. Execute the task — see the Execution section below.
|
|
10
|
+
4. Record any reusable learning with `npx @eventmodelers/cli learn "<one terse line>" --topic <topic>` (see **Recording Learnings**).
|
|
11
|
+
5. Reply normally. The run loop completes the task when your turn ends and hands you the next one in a fresh turn — you never read or write a queue file.
|
|
18
12
|
|
|
19
13
|
## Execution
|
|
20
14
|
|
|
@@ -50,7 +44,7 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
|
|
|
50
44
|
|
|
51
45
|
1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
|
|
52
46
|
|
|
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.
|
|
47
|
+
**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. Say so in your reply, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
|
|
54
48
|
|
|
55
49
|
2. Run `/load-slice sliceId=<payload.sliceId>` to fetch the full slice, then read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json`. The runner keeps a `slice.json` fresh from a summary endpoint, so a file holding only `id`, `title`, `status` and `sliceType` is that stub, not an empty slice — never conclude a slice has no elements from it. Only if the full fetch itself returns no commands/events/read models/fields is the slice actually empty.
|
|
56
50
|
|
|
@@ -64,6 +58,20 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
|
|
|
64
58
|
|
|
65
59
|
5. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
|
|
66
60
|
|
|
61
|
+
**Baseline gate** — before touching any code, run `npx @eventmodelers/cli build-baseline check --scope backend`.
|
|
62
|
+
It compares the board's node hashes of every element of the slice (commands, events, read models,
|
|
63
|
+
processors, specifications, ...) with what was recorded after the last successful build:
|
|
64
|
+
- `UNCHANGED` — nothing on the board changed. Do not rebuild or re-diff; run the slice's tests and
|
|
65
|
+
finish. Only now is "no code changes needed" a valid outcome.
|
|
66
|
+
- `NO_BASELINE` / `UNKNOWN` — no recorded build, or the board could not be read: do one full
|
|
67
|
+
field-by-field diff of slice.json against the code (never treat `UNKNOWN` as `UNCHANGED`).
|
|
68
|
+
- `CHANGED` — it lists the elements that changed, were added or were removed. Diff slice.json
|
|
69
|
+
against the code for exactly those and fix every drift; leave what matches alone.
|
|
70
|
+
|
|
71
|
+
When the checks pass, run `npx @eventmodelers/cli build-baseline record --scope backend` **before
|
|
72
|
+
committing**, so `ui-baseline.json` is committed with the slice. Never record without having done the
|
|
73
|
+
work the verdict asked for. Screens and UI prompts are not this kit's business and never trigger a build.
|
|
74
|
+
|
|
67
75
|
6. **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.
|
|
68
76
|
|
|
69
77
|
7. Run the quality checks listed in `.build-kit/ARCHITECTURE.md` (build/compile, then only the tests touched by this slice — not the full suite).
|
|
@@ -78,52 +86,35 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
|
|
|
78
86
|
Another agent is already building this slice. Log it and skip — do not build.
|
|
79
87
|
|
|
80
88
|
#### `Done`
|
|
81
|
-
Summarize what was completed
|
|
89
|
+
Summarize what was completed in your reply.
|
|
82
90
|
|
|
83
91
|
#### `Blocked`
|
|
84
|
-
|
|
92
|
+
State the blocker in your reply.
|
|
85
93
|
|
|
86
94
|
#### `Review`
|
|
87
|
-
Fetch slice details and prepare a review summary in
|
|
95
|
+
Fetch slice details and prepare a review summary in your reply.
|
|
88
96
|
|
|
89
97
|
#### Any other status (`Created`, etc.)
|
|
90
|
-
Load the slice and
|
|
98
|
+
Load the slice and note the state transition in your reply. No build action.
|
|
91
99
|
|
|
92
100
|
Use the skills available in `.claude/skills/` to interact with the board.
|
|
93
101
|
|
|
94
|
-
## Updating tasks.json
|
|
95
|
-
|
|
96
|
-
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 `[]`.
|
|
97
|
-
|
|
98
102
|
## Escalating Ambiguity
|
|
99
103
|
|
|
100
|
-
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line
|
|
101
|
-
|
|
102
|
-
## Progress Report Format
|
|
104
|
+
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line as a code comment. Ambiguity alone is never a reason to stop. **Only if the slice literally cannot be built** — nothing runnable can be produced even with sensible assumptions — invoke `/request-feedback` with the specific question; it posts the question as a comment on the slice and marks it `Blocked`. That must be the absolute exception; a `Blocked` slice should mean "impossible without a human", never "the agent preferred to ask".
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
## [ISO timestamp] — Task [task.id]
|
|
106
|
+
## Recording Learnings
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
Status change: [sliceStatus]
|
|
108
|
+
`.build-kit/AGENTS.md` is generated from the learnings recorded so far — read it at the start of every session, never edit it by hand. Record a learning the moment you have it:
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Learnings:
|
|
115
|
-
- [any patterns, gotchas, or reusable knowledge discovered]
|
|
116
|
-
---
|
|
110
|
+
```
|
|
111
|
+
npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
|
|
117
112
|
```
|
|
118
113
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
## Updating AGENT.md
|
|
125
|
-
|
|
126
|
-
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.
|
|
114
|
+
- Only what is genuinely reusable: codebase patterns, gotchas, commands that work or don't, conventions — and, after a failed approach, what was tried and why it failed. Not slice-specific details, and nothing the code or git log already says.
|
|
115
|
+
- One learning per call, one line each. A learning that is already in `.build-kit/AGENTS.md` is skipped for you.
|
|
116
|
+
- `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
|
|
117
|
+
- One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
|
|
127
118
|
|
|
128
119
|
## Important
|
|
129
120
|
|
|
@@ -65,10 +65,9 @@ Ignore case for files and slices in prompts. "CartItems" slice is the same as "c
|
|
|
65
65
|
Do not change test files unless explicitly instructed, or the change brings the test in line with slice.json (e.g. step 4's field/spec diff): `src/test/java/**/*Test.java`.
|
|
66
66
|
|
|
67
67
|
At the start of every session, read `.build-kit/AGENTS.md` if it exists to load accumulated project
|
|
68
|
-
learnings.
|
|
68
|
+
learnings. It is generated from the learnings recorded so far — record a new one with `npx @eventmodelers/cli learn "<one terse line>" --topic <topic>`, never by editing the file.
|
|
69
69
|
|
|
70
|
-
When
|
|
71
|
-
doing anything else.
|
|
70
|
+
When working from a queued task, invoke the `update-slice-status` skill with `InProgress` status before doing anything else. When the task request names the slice to build (a run-loop build), the run loop has already set it to `InProgress` and pushes the final status itself — do not call `update-slice-status`; record the outcome with `npx @eventmodelers/cli slice-status <status>`.
|
|
72
71
|
|
|
73
72
|
## Building a Slice
|
|
74
73
|
|
|
@@ -76,7 +75,7 @@ doing anything else.
|
|
|
76
75
|
**ALL fields, event names, command names, and business rules MUST come exclusively from slice.json. Do NOT
|
|
77
76
|
invent, assume, or guess any field or logic not present in the slice definition.**
|
|
78
77
|
|
|
79
|
-
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line
|
|
78
|
+
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line as a code comment. Ambiguity alone is never a reason to stop. **Only if the slice literally cannot be built** — nothing runnable can be produced even with sensible assumptions — invoke `/request-feedback` with the specific question; it posts the question as a comment on the slice and marks it `Blocked`. That must be the absolute exception; a `Blocked` slice should mean "impossible without a human", never "the agent preferred to ask".
|
|
80
79
|
|
|
81
80
|
When asked to build a slice, always follow this flow:
|
|
82
81
|
|
|
@@ -88,13 +87,14 @@ When asked to build a slice, always follow this flow:
|
|
|
88
87
|
- **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
|
|
89
88
|
- **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
|
|
90
89
|
3. Invoke the matching skill and follow its instructions completely. Do not deviate.
|
|
91
|
-
4. **
|
|
90
|
+
4. **Baseline gate**: run `npx @eventmodelers/cli build-baseline check --scope backend` first and act only on its verdict — `UNCHANGED` means nothing on the board changed since the last recorded build: do not rebuild, just run the slice's tests and finish; `NO_BASELINE`/`UNKNOWN` mean one full field-by-field diff of slice.json against the code; `CHANGED` lists exactly which elements changed, were added or removed — diff and fix only those. After the checks pass and before committing, run `build-baseline record --scope backend`. A screen or UI prompt change never triggers a backend build.
|
|
91
|
+
5. **Verify against slice.json**: After the skill completes, check that every command field, event field,
|
|
92
92
|
and specification in slice.json appears in the implementation. No invented fields — if it is not in
|
|
93
93
|
slice.json, it must not be in the code. This applies even when the slice was previously `Done` and
|
|
94
94
|
reappears as `Planned` — never dismiss a mismatch as "already implemented" or harmless drift; diff
|
|
95
95
|
slice.json against the code field by field and update the code to match every change.
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
6. Run quality checks (`./mvnw compile -q`, then the slice tests only).
|
|
97
|
+
7. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to set is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4.
|
|
98
98
|
|
|
99
99
|
After you are done, automatically run the tests for the slice that was edited.
|
|
100
100
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
# Agent
|
|
1
|
+
# Agent Reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
What task processing relies on: the shape of a task and the API facts the skills use. A reusable learning is recorded with `npx @eventmodelers/cli learn "<one terse line>"`, not added here.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Tasks
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Write `[]` to `tasks.json` if the last task is completed.
|
|
7
|
+
- A task is a slice change the run loop queued: an `id` and a `payload` (a `SliceChangedPayload`). The task request names it.
|
|
8
|
+
- You never read or write a queue file: the run loop completes the task when your turn ends.
|
|
10
9
|
|
|
11
10
|
## SliceChangedPayload fields
|
|
12
11
|
|
|
@@ -44,7 +43,7 @@ These files are always up to date — read them directly before invoking any ski
|
|
|
44
43
|
- The `boardId` and `organizationId` from each payload provide full context — pass them to skills.
|
|
45
44
|
- Node events use `node:created`, `node:changed`, `node:deleted` — always POST to `/api/org/:orgId/boards/:boardId/nodes/events`.
|
|
46
45
|
- 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.
|
|
46
|
+
- `/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. This applies to queued tasks only: when the task request names the slice to build, the run loop owns its status — never call `/update-slice-status` there.
|
|
48
47
|
|
|
49
48
|
## KurrentDB-specific
|
|
50
49
|
|
|
@@ -17,20 +17,19 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
|
|
|
17
17
|
|
|
18
18
|
0. Do not read the entire code base. Focus on the tasks in this description.
|
|
19
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
|
|
20
|
+
2. Read `.build-kit/AGENTS.md` **if it exists** — the project's accumulated learnings, generated from what earlier builds recorded. If the slice's `slice.json` has a `lastAttempt`, an earlier attempt at it failed: read its `reason`, `lastReply`, `branch` and `changed`, and do not repeat what failed.
|
|
21
21
|
3. Make sure you are on the right branch "feature/<slicename>", if unsure, start from main.
|
|
22
|
-
5.
|
|
23
|
-
**IMPORTANT: Only work on
|
|
22
|
+
5. Your slice is the one the task request names (the run loop picked the highest priority slice with status "Planned"); it becomes your PRD. The run loop has already claimed it — its status is "InProgress" in index.json and on the board. Build that slice and do not call `update-slice-status`: the run loop owns the slice's status on the board.
|
|
23
|
+
**IMPORTANT: Only work on the slice named in the task request. Never switch to another slice, whatever its status. If the task request names no slice and no slice has status "Planned" in the current context, reply with:**
|
|
24
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
25
|
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.
|
|
26
|
+
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.
|
|
28
27
|
7. Define the slice type and load the matching skill:
|
|
29
28
|
- Write slice (has commands, no processors) → `build-state-change`
|
|
30
29
|
- Read slice (has readModel / information flow) → `build-state-view`
|
|
31
30
|
- Translation slice (`sliceType === "TRANSLATION"`) → read `description` and `notes` from slice.json for hints; default to `build-automation` if nothing else is specified
|
|
32
31
|
- Automation slice (processors-array is not empty) → `build-automation`
|
|
33
|
-
8.
|
|
32
|
+
8. Record each learning the moment you have it (see **Recording Learnings**), not at the end.
|
|
34
33
|
9. Analyze and Implement that single slice, make use of the skills in the skills directory, but also your previsously collected
|
|
35
34
|
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
35
|
10. The slice in the json is always true, the code follows what is defined in the json
|
|
@@ -43,48 +42,27 @@ You work within **exactly ONE context at a time** — the one named in `.build-k
|
|
|
43
42
|
If the tests for the slice are not yet named predictably, run `./mvnw test -q` and check for failures.
|
|
44
43
|
15. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge ( update
|
|
45
44
|
first )
|
|
46
|
-
16.
|
|
47
|
-
17.
|
|
48
|
-
18.
|
|
45
|
+
16. Record the outcome with `npx @eventmodelers/cli slice-status Done` — not by editing index.json, and do not call `update-slice-status`: the run loop pushes the status to the board when your turn ends. For STATE_VIEW/STATE_CHANGE slices when `handover` is enabled the status to record is `Waiting`, not `Done` — see the `ui-contract` skill, Step 4. A slice you could not finish needs no status: leave it as it is and the run loop discards the attempt.
|
|
46
|
+
17. Record any reusable learning you have not recorded yet (see **Recording Learnings**).
|
|
47
|
+
18. If an entry in `.build-kit/AGENTS.md` turned out wrong or obsolete, retract it (see **Recording Learnings**).
|
|
49
48
|
19. Finish the iteration.
|
|
50
49
|
|
|
51
50
|
## Escalating Ambiguity
|
|
52
51
|
|
|
53
|
-
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line
|
|
52
|
+
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line as a code comment. Ambiguity alone is never a reason to stop. **Only if the slice literally cannot be built** — nothing runnable can be produced even with sensible assumptions — invoke `/request-feedback` with the specific question; it posts the question as a comment on the slice and marks it `Blocked`. That must be the absolute exception; a `Blocked` slice should mean "impossible without a human", never "the agent preferred to ask".
|
|
54
53
|
|
|
55
|
-
##
|
|
54
|
+
## Recording Learnings
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
`.build-kit/AGENTS.md` is generated from the learnings recorded so far — read it at the start of every session, never edit it by hand. Record a learning the moment you have it:
|
|
58
57
|
|
|
59
58
|
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- What was implemented
|
|
63
|
-
- Files changed
|
|
64
|
-
- **Learnings for future iterations:**
|
|
65
|
-
- Patterns discovered (e.g., "this codebase uses X for Y")
|
|
66
|
-
- Gotchas encountered (e.g., "don't forget to update Z when changing W")
|
|
67
|
-
- Useful context (e.g., "the evaluation panel is in component X")
|
|
68
|
-
---
|
|
59
|
+
npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
|
|
69
60
|
```
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns`
|
|
77
|
-
section at the TOP of progress.txt (create it if it doesn't exist). This section should consolidate the most
|
|
78
|
-
important learnings:
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
## Codebase Patterns
|
|
82
|
-
- Example: Register every new event's type string in CqrsConfiguration.eventTypeResolver() as part of the slice
|
|
83
|
-
- Example: Automations must catch CommandSubjectAlreadyExistsException/CommandSubjectDoesNotExistException locally
|
|
84
|
-
- Example: Export write-model records as package-private unless another slice legitimately needs them
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Only add patterns that are **general and reusable**, not story-specific details.
|
|
62
|
+
- Only what is genuinely reusable: codebase patterns, gotchas, commands that work or don't, conventions — and, after a failed approach, what was tried and why it failed. Not slice-specific details, and nothing the code or git log already says.
|
|
63
|
+
- One learning per call, one line each. A learning that is already in `.build-kit/AGENTS.md` is skipped for you.
|
|
64
|
+
- `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
|
|
65
|
+
- One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
|
|
88
66
|
|
|
89
67
|
## Update AGENTS.md Files
|
|
90
68
|
|
|
@@ -110,7 +88,7 @@ Before committing, check if any edited files have learnings worth preserving in
|
|
|
110
88
|
- Slice specific implementation details
|
|
111
89
|
- Story-specific implementation details
|
|
112
90
|
- Temporary debugging notes
|
|
113
|
-
- Information already in
|
|
91
|
+
- Information already recorded as a learning in `.build-kit/AGENTS.md`
|
|
114
92
|
- Task specific learnings
|
|
115
93
|
|
|
116
94
|
Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work
|
|
@@ -154,9 +132,9 @@ If ALL slices in the current context are Done, reply with:
|
|
|
154
132
|
- If no `.eventmodelers/config.json` exists anywhere (project root or an ancestor directory, or `~/.eventmodelers/config.json` — the one inside `.build-kit/` is only an optional override, so its absence means nothing), skip all platform communication (MCP calls, `update-slice-status`, board sync) and continue working locally.
|
|
155
133
|
- Work on ONE slice per iteration
|
|
156
134
|
- Commit frequently
|
|
157
|
-
-
|
|
158
|
-
- Read
|
|
135
|
+
- Record learnings as you go with `learn`
|
|
136
|
+
- Read `.build-kit/AGENTS.md` before starting
|
|
159
137
|
|
|
160
138
|
## When an iteration completes
|
|
161
139
|
|
|
162
|
-
|
|
140
|
+
Make sure every reusable learning is recorded with `learn`; `.build-kit/AGENTS.md` is generated from them — never edit it by hand.
|
|
@@ -4,17 +4,11 @@ You are an autonomous agent reacting to slice status change events on an Eventmo
|
|
|
4
4
|
|
|
5
5
|
## Your Loop
|
|
6
6
|
|
|
7
|
-
1. Read `AGENT.md` to load accumulated
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
|
|
11
|
-
|
|
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.
|
|
7
|
+
1. Read `AGENT.md` and, if it exists, `.build-kit/AGENTS.md` to load accumulated knowledge before doing anything else.
|
|
8
|
+
2. The task request at the end of this prompt names your task: its id and the slice change that queued it (`sliceId`, `sliceTitle`, `sliceStatus`, …). It is the oldest one waiting — the run loop picked it for you.
|
|
9
|
+
3. Execute the task — see the Execution section below.
|
|
10
|
+
4. Record any reusable learning with `npx @eventmodelers/cli learn "<one terse line>" --topic <topic>` (see **Recording Learnings**).
|
|
11
|
+
5. Reply normally. The run loop completes the task when your turn ends and hands you the next one in a fresh turn — you never read or write a queue file.
|
|
18
12
|
|
|
19
13
|
## Execution
|
|
20
14
|
|
|
@@ -48,11 +42,11 @@ Inspect the `sliceStatus` in the payload:
|
|
|
48
42
|
|
|
49
43
|
This is the build trigger. Setting `InProgress` and building are one atomic step:
|
|
50
44
|
|
|
51
|
-
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line
|
|
45
|
+
**Default: make a reasonable assumption and build the slice.** If a detail is unclear or missing (an example value, a field type, a status mapping, a referenced event that isn't modeled yet, ...), pick the most sensible interpretation from `slice.json`, its specifications and the surrounding model, build it, and record each assumption in one line as a code comment. Ambiguity alone is never a reason to stop. **Only if the slice literally cannot be built** — nothing runnable can be produced even with sensible assumptions — invoke `/request-feedback` with the specific question; it posts the question as a comment on the slice and marks it `Blocked`. That must be the absolute exception; a `Blocked` slice should mean "impossible without a human", never "the agent preferred to ask".
|
|
52
46
|
|
|
53
47
|
1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
|
|
54
48
|
|
|
55
|
-
**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.
|
|
49
|
+
**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. Say so in your reply, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
|
|
56
50
|
|
|
57
51
|
2. Run `/load-slice sliceId=<payload.sliceId>` to fetch the full slice, then read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json`. The runner keeps a `slice.json` fresh from a summary endpoint, so a file holding only `id`, `title`, `status` and `sliceType` is that stub, not an empty slice — never conclude a slice has no elements from it. Only if the full fetch itself returns no commands/events/read models/fields is the slice actually empty.
|
|
58
52
|
|
|
@@ -64,6 +58,20 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
|
|
|
64
58
|
|
|
65
59
|
4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
|
|
66
60
|
|
|
61
|
+
**Baseline gate** — before touching any code, run `npx @eventmodelers/cli build-baseline check --scope backend`.
|
|
62
|
+
It compares the board's node hashes of every element of the slice (commands, events, read models,
|
|
63
|
+
processors, specifications, ...) with what was recorded after the last successful build:
|
|
64
|
+
- `UNCHANGED` — nothing on the board changed. Do not rebuild or re-diff; run the slice's tests and
|
|
65
|
+
finish. Only now is "no code changes needed" a valid outcome.
|
|
66
|
+
- `NO_BASELINE` / `UNKNOWN` — no recorded build, or the board could not be read: do one full
|
|
67
|
+
field-by-field diff of slice.json against the code (never treat `UNKNOWN` as `UNCHANGED`).
|
|
68
|
+
- `CHANGED` — it lists the elements that changed, were added or were removed. Diff slice.json
|
|
69
|
+
against the code for exactly those and fix every drift; leave what matches alone.
|
|
70
|
+
|
|
71
|
+
When the checks pass, run `npx @eventmodelers/cli build-baseline record --scope backend` **before
|
|
72
|
+
committing**, so `ui-baseline.json` is committed with the slice. Never record without having done the
|
|
73
|
+
work the verdict asked for. Screens and UI prompts are not this kit's business and never trigger a build.
|
|
74
|
+
|
|
67
75
|
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.
|
|
68
76
|
|
|
69
77
|
6. Run quality checks:
|
|
@@ -78,48 +86,31 @@ This is the build trigger. Setting `InProgress` and building are one atomic step
|
|
|
78
86
|
Another agent is already building this slice. Log it and skip — do not build.
|
|
79
87
|
|
|
80
88
|
#### `Done`
|
|
81
|
-
Summarize what was completed
|
|
89
|
+
Summarize what was completed in your reply.
|
|
82
90
|
|
|
83
91
|
#### `Blocked`
|
|
84
|
-
|
|
92
|
+
State the blocker in your reply.
|
|
85
93
|
|
|
86
94
|
#### `Review`
|
|
87
|
-
Fetch slice details and prepare a review summary in
|
|
95
|
+
Fetch slice details and prepare a review summary in your reply.
|
|
88
96
|
|
|
89
97
|
#### Any other status (`Created`, etc.)
|
|
90
|
-
Load the slice and
|
|
98
|
+
Load the slice and note the state transition in your reply. No build action.
|
|
91
99
|
|
|
92
100
|
Use the skills available in `.claude/skills/` to interact with the board.
|
|
93
101
|
|
|
94
|
-
##
|
|
95
|
-
|
|
96
|
-
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 `[]`.
|
|
102
|
+
## Recording Learnings
|
|
97
103
|
|
|
98
|
-
|
|
104
|
+
`.build-kit/AGENTS.md` is generated from the learnings recorded so far — read it at the start of every session, never edit it by hand. Record a learning the moment you have it:
|
|
99
105
|
|
|
100
|
-
APPEND to `progress.txt` (never replace):
|
|
101
106
|
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Slice: [sliceTitle] ([sliceId])
|
|
105
|
-
Status change: [sliceStatus]
|
|
106
|
-
|
|
107
|
-
Action taken:
|
|
108
|
-
- [what was done in response to the slice change]
|
|
109
|
-
|
|
110
|
-
Learnings:
|
|
111
|
-
- [any patterns, gotchas, or reusable knowledge discovered]
|
|
112
|
-
---
|
|
107
|
+
npx @eventmodelers/cli learn "<one terse line>" --topic "<topic>"
|
|
113
108
|
```
|
|
114
109
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
## Updating AGENT.md
|
|
121
|
-
|
|
122
|
-
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.
|
|
110
|
+
- Only what is genuinely reusable: codebase patterns, gotchas, commands that work or don't, conventions — and, after a failed approach, what was tried and why it failed. Not slice-specific details, and nothing the code or git log already says.
|
|
111
|
+
- One learning per call, one line each. A learning that is already in `.build-kit/AGENTS.md` is skipped for you.
|
|
112
|
+
- `--scope system` for what is true of the modeled domain (a business rule, a naming convention of the model); `repo` (the default) for the codebase and its tooling. `--tag <tag>` labels it (repeatable).
|
|
113
|
+
- One in `.build-kit/AGENTS.md` that turned out wrong or obsolete: `npx @eventmodelers/cli learnings --ids` lists each with its id, `npx @eventmodelers/cli learn --retract <id>` removes it.
|
|
123
114
|
|
|
124
115
|
## Important
|
|
125
116
|
|
|
@@ -39,7 +39,7 @@ Save the full slice list. Count total slices and group by status:
|
|
|
39
39
|
|
|
40
40
|
| Status values |
|
|
41
41
|
|---------------|
|
|
42
|
-
| `Created`, `Ready`, `Planned`, `InProgress`, `
|
|
42
|
+
| `Created`, `Ready`, `Planned`, `InProgress`, `Waiting`, `Review`, `Done`, `Blocked`, `Assigned`, `Informational` |
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
@@ -84,7 +84,7 @@ Why per commit: when the range contains the commit that **created** a file (e.g.
|
|
|
84
84
|
| Group | Examples | Handling |
|
|
85
85
|
|-------|----------|----------|
|
|
86
86
|
| **Behavior** | controllers/handlers, services, entities/aggregates, events, projections/queries, schema & migrations, validation, templates/UI, tests | compared in Step 5 |
|
|
87
|
-
| **Noise** | dependency bumps, build/CI config, gradle/maven wrappers, formatting-only diffs, docs, `.build-kit/`, `.claude/`, `.agent-modeling-kit/`, `.eventmodelers/`, `.mcp.json`, `CLAUDE.md`,
|
|
87
|
+
| **Noise** | dependency bumps, build/CI config, gradle/maven wrappers, formatting-only diffs, docs, `.build-kit/`, `.claude/`, `.agent-modeling-kit/`, `.eventmodelers/`, `.mcp.json`, `CLAUDE.md`, generated files | listed in the report footer as *not relevant*, never a finding |
|
|
88
88
|
|
|
89
89
|
**Build-kit commits vs. hand-made commits.** A commit is the build kit's only if an `Implementation — <Slice>` evidence note names its sha, or — without evidence notes — its subject is `feat: <Slice Name>` for a slice on the board. It implemented the board, so its files are the **as-built state**: compare it cheaply against that slice only. Every other commit — including any commit after it that touches the same files — is a **hand-made change** and the main subject of this skill: for each file the build kit wrote, the drift candidates are `git diff <buildSha>..<REF> -- <file>`, attributed to the later commits.
|
|
90
90
|
|
|
@@ -127,6 +127,8 @@ To make one: place a normal new node of the same type (COMMAND/EVENT/READMODEL o
|
|
|
127
127
|
|
|
128
128
|
A linked copy is allowed to diverge from its origin afterward in the specific field(s) a newly-connected event actually drives — e.g. the "Updating a Read Model That Already Feeds a Screen" copy above, where `status` is updated post-link to the event's new value. The link establishes "this is the same underlying fact, not a duplicate" at creation time; it doesn't freeze the copy's fields identical to the origin's forever.
|
|
129
129
|
|
|
130
|
+
**Scenarios (and storylines) are always added to the original, never to a copy.** A copy is the same fact reused, so its GWT spec lives once, in the origin's column. Before calling `add_scenario`/`add_storyline`, check `meta.linkedTo` on the target node and follow it to the origin. `eventmodeling-elaborating-scenarios` carries the step-by-step.
|
|
131
|
+
|
|
130
132
|
Never delete the original (the node with no `linkedTo`) once copies of it exist — copies reference it, and removing it breaks every copy. `eventmodeling-checking-completeness` already treats any `linkedTo`-marked node as an intentional copy, never a duplicate or missing-slice gap to flag.
|
|
131
133
|
|
|
132
134
|
See `place-element` Step 6a for the mechanical linking steps.
|