@eventmodelers/cli 1.0.54 → 1.0.55
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 +6 -0
- package/cli.js +24 -0
- package/package.json +1 -1
- package/shared/build-kit/lib/ralph.js +103 -5
- package/shared/skills/learn-eventmodelers-api/SKILL.md +3 -0
- package/stacks/react/templates/.claude/skills/build-automation/SKILL.md +42 -0
- package/stacks/react/templates/.claude/skills/build-state-change/SKILL.md +43 -0
- package/stacks/react/templates/.claude/skills/build-state-view/SKILL.md +42 -0
- package/stacks/react/templates/build-kit/CLAUDE.md +62 -0
- package/stacks/react/templates/build-kit/README.md +79 -0
- package/stacks/react/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/react/templates/build-kit/lib/backend-prompt.md +135 -0
- package/stacks/react/templates/build-kit/lib/prompt.md +139 -0
- package/stacks/react/templates/build-kit/lib/ralph.js +508 -0
- package/stacks/react/templates/build-kit/package.json +9 -0
- package/stacks/react/templates/build-kit/ralph-claude.js +107 -0
- package/stacks/react/templates/build-kit/ralph-ollama.js +40 -0
- package/stacks/supabase-react/templates/.claude/skills/build-state-change/SKILL.md +305 -0
- package/stacks/supabase-react/templates/.claude/skills/build-state-view/SKILL.md +238 -0
- package/stacks/supabase-react/templates/.claude/skills/init-style-guide/SKILL.md +60 -0
- package/stacks/supabase-react/templates/.claude/skills/learn-styleguide/SKILL.md +28 -0
- package/stacks/supabase-react/templates/.claude/skills/learn-styleguide/references/README.md +5 -0
- package/stacks/supabase-react/templates/build-kit/CLAUDE.md +149 -0
- package/stacks/supabase-react/templates/build-kit/lib/AGENT.md +47 -0
- package/stacks/supabase-react/templates/build-kit/lib/backend-prompt.md +139 -0
- package/stacks/supabase-react/templates/build-kit/lib/prompt.md +145 -0
- package/stacks/supabase-react/templates/root/.env.example +12 -0
- package/stacks/supabase-react/templates/root/.oxlintrc.json +9 -0
- package/stacks/supabase-react/templates/root/README.md +49 -0
- package/stacks/supabase-react/templates/root/index.html +13 -0
- package/stacks/supabase-react/templates/root/package.json +26 -0
- package/stacks/supabase-react/templates/root/public/favicon.svg +1 -0
- package/stacks/supabase-react/templates/root/public/icons.svg +24 -0
- package/stacks/supabase-react/templates/root/src/App.css +184 -0
- package/stacks/supabase-react/templates/root/src/App.tsx +122 -0
- package/stacks/supabase-react/templates/root/src/assets/hero.png +0 -0
- package/stacks/supabase-react/templates/root/src/assets/react.svg +1 -0
- package/stacks/supabase-react/templates/root/src/assets/vite.svg +1 -0
- package/stacks/supabase-react/templates/root/src/index.css +111 -0
- package/stacks/supabase-react/templates/root/src/lib/api.ts +127 -0
- package/stacks/supabase-react/templates/root/src/lib/supabase.ts +10 -0
- package/stacks/supabase-react/templates/root/src/main.tsx +10 -0
- package/stacks/supabase-react/templates/root/src/slices/.gitkeep +0 -0
- package/stacks/supabase-react/templates/root/src/vite-env.d.ts +13 -0
- package/stacks/supabase-react/templates/root/tsconfig.app.json +26 -0
- package/stacks/supabase-react/templates/root/tsconfig.json +7 -0
- package/stacks/supabase-react/templates/root/tsconfig.node.json +23 -0
- package/stacks/supabase-react/templates/root/vite.config.ts +7 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Agent Task Instructions
|
|
2
|
+
|
|
3
|
+
You are an autonomous agent reacting to slice status change events on an Eventmodelers board.
|
|
4
|
+
|
|
5
|
+
## Your Loop
|
|
6
|
+
|
|
7
|
+
1. Read `AGENT.md` to load accumulated learnings before doing anything else.
|
|
8
|
+
2. Read `.build-kit/tasks.json`.
|
|
9
|
+
3. If `tasks.json` is empty or missing, reply with:
|
|
10
|
+
<promise>IDLE</promise>
|
|
11
|
+
and stop.
|
|
12
|
+
4. Pick the **oldest task** (earliest `createdAt`).
|
|
13
|
+
5. Execute the task — see the Execution section below.
|
|
14
|
+
6. After execution, remove that task from the array and write `.build-kit/tasks.json` back.
|
|
15
|
+
7. Append a progress entry to `progress.txt` (create if missing).
|
|
16
|
+
8. Update `AGENT.md` with any new reusable learnings discovered this iteration.
|
|
17
|
+
9. Reply normally so the next iteration can pick up the next task.
|
|
18
|
+
|
|
19
|
+
## Execution
|
|
20
|
+
|
|
21
|
+
Each task has a single `payload` of type `SliceChangedPayload`:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
{
|
|
25
|
+
event: "slice:changed"
|
|
26
|
+
organizationId: string | null
|
|
27
|
+
boardId: string
|
|
28
|
+
sliceId: string ← SLICE_BORDER node UUID
|
|
29
|
+
sliceTitle: string | null
|
|
30
|
+
sliceStatus: string | null ← e.g. "InProgress", "Done", "Blocked"
|
|
31
|
+
timestamp: number
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 1 — Load credentials
|
|
36
|
+
|
|
37
|
+
Run `/connect` to resolve `TOKEN`, `BOARD_ID`, `ORG_ID`, and `BASE_URL` from `.eventmodelers/config.json`.
|
|
38
|
+
|
|
39
|
+
### Step 2 — Load the slice
|
|
40
|
+
|
|
41
|
+
Run `/load-slice sliceId=<payload.sliceId>` to fetch full slice details (title, status, raw node record).
|
|
42
|
+
|
|
43
|
+
### Step 3 — Act on the change
|
|
44
|
+
|
|
45
|
+
Inspect the `sliceStatus` in the payload:
|
|
46
|
+
|
|
47
|
+
#### `Planned` — build the slice
|
|
48
|
+
|
|
49
|
+
This is the build trigger. Setting `InProgress` and building are one atomic step:
|
|
50
|
+
|
|
51
|
+
1. Immediately call `/update-slice-status` to set the slice to `InProgress` on the board.
|
|
52
|
+
|
|
53
|
+
**Claim conflict**: if this call reports the slice is already in `InProgress` (or any status other than `Planned`), another agent already claimed it first — this is expected, not an error. Log it in `progress.txt`, drop this task without building, and continue the loop (the next task will naturally cover the next slice). Do not retry.
|
|
54
|
+
|
|
55
|
+
2. Read the slice definition from `.build-kit/.slices/<contextSlug>/<sliceFolder>/slice.json` (written by `/load-slice`).
|
|
56
|
+
|
|
57
|
+
3. Determine the **slice type** from the slice.json:
|
|
58
|
+
- **Translation** — `sliceType === "TRANSLATION"` → read `description` and `notes` from slice.json for hints; default to `/build-automation` if nothing else is specified
|
|
59
|
+
- **Automation** — `processors` array is non-empty → invoke `/build-automation`
|
|
60
|
+
- **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
|
|
61
|
+
- **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
|
|
62
|
+
|
|
63
|
+
4. Invoke the matching skill and follow its instructions **completely**. Do NOT implement the slice manually.
|
|
64
|
+
|
|
65
|
+
5. **Verify against slice.json**: cross-check the implementation — every command field, event field, and specification in slice.json must appear in the code. No invented fields — if it is not in slice.json, it must not be in the code.
|
|
66
|
+
|
|
67
|
+
6. Run quality checks (TODO: your stack's build + test commands — slice-scoped tests only, not the full suite).
|
|
68
|
+
|
|
69
|
+
7. If checks pass, commit all changes with message: `feat: [Slice Name]`.
|
|
70
|
+
|
|
71
|
+
8. Call `/update-slice-status` to set the slice to `Done` on the board.
|
|
72
|
+
|
|
73
|
+
#### `InProgress`
|
|
74
|
+
Another agent is already building this slice. Log it and skip — do not build.
|
|
75
|
+
|
|
76
|
+
#### `Done`
|
|
77
|
+
Summarize what was completed and update `progress.txt`.
|
|
78
|
+
|
|
79
|
+
#### `Blocked`
|
|
80
|
+
Log the blocker in `progress.txt`.
|
|
81
|
+
|
|
82
|
+
#### `Review`
|
|
83
|
+
Fetch slice details and prepare a review summary in `progress.txt`.
|
|
84
|
+
|
|
85
|
+
#### Any other status (`Created`, etc.)
|
|
86
|
+
Load the slice and log the state transition in `progress.txt`. No build action.
|
|
87
|
+
|
|
88
|
+
Use the skills available in `.claude/skills/` to interact with the board.
|
|
89
|
+
|
|
90
|
+
## Updating tasks.json
|
|
91
|
+
|
|
92
|
+
After completing a task, remove it from the array and write the updated array back to `.build-kit/tasks.json`. If the array is now empty, write `[]`.
|
|
93
|
+
|
|
94
|
+
## Escalating Ambiguity
|
|
95
|
+
|
|
96
|
+
**If the slice's requirements are genuinely ambiguous, contradictory, or missing a decision you need
|
|
97
|
+
in order to proceed — do not guess, and do not build anyway.** Invoke `/request-feedback` with the
|
|
98
|
+
specific question; it posts the question as a comment on the slice and marks it `Blocked` on the
|
|
99
|
+
board (overriding the `InProgress` set earlier), then stop this iteration without finishing the
|
|
100
|
+
build — reply `<promise>DONE</promise>` as if the iteration's work was to raise the question, not to
|
|
101
|
+
implement the slice. This is an escalation path, not a routine step — read the slice.json and the
|
|
102
|
+
matching build skill's own instructions fully first; most slices are fully specified and need none of
|
|
103
|
+
this.
|
|
104
|
+
|
|
105
|
+
## Progress Report Format
|
|
106
|
+
|
|
107
|
+
APPEND to `progress.txt` (never replace):
|
|
108
|
+
```
|
|
109
|
+
## [ISO timestamp] — Task [task.id]
|
|
110
|
+
|
|
111
|
+
Slice: [sliceTitle] ([sliceId])
|
|
112
|
+
Status change: [sliceStatus]
|
|
113
|
+
|
|
114
|
+
Action taken:
|
|
115
|
+
- [what was done in response to the slice change]
|
|
116
|
+
|
|
117
|
+
Learnings:
|
|
118
|
+
- [any patterns, gotchas, or reusable knowledge discovered]
|
|
119
|
+
---
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Stop Condition
|
|
123
|
+
|
|
124
|
+
If `.build-kit/tasks.json` is empty (`[]`) or does not exist, reply with:
|
|
125
|
+
<promise>IDLE</promise>
|
|
126
|
+
|
|
127
|
+
## Updating AGENT.md
|
|
128
|
+
|
|
129
|
+
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.
|
|
130
|
+
|
|
131
|
+
## Important
|
|
132
|
+
|
|
133
|
+
- Process **one task per iteration**.
|
|
134
|
+
- Read `AGENT.md` first — it contains patterns from previous iterations.
|
|
135
|
+
- Always start with `/connect` if credentials are not yet loaded.
|
|
@@ -0,0 +1,139 @@
|
|
|
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 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 `.build-kit/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, 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.
|
|
31
|
+
10. The slice in the json is always true, the code follows what is defined in the json
|
|
32
|
+
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.
|
|
33
|
+
12. Make sure to write the ui-prompt.md as defined if defined in the skill
|
|
34
|
+
13. Run quality checks — TODO: your stack's build command, TODO: your stack's test command (slice-scoped only; do not run all tests).
|
|
35
|
+
14. If checks pass, commit ALL changes with message: `feat: [Slice Name]` and merge back to main as FF merge (update first)
|
|
36
|
+
15. 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).
|
|
37
|
+
16. Append your progress to `progress.txt` after each step in the iteration.
|
|
38
|
+
17. Append your new learnings to `.build-kit/AGENTS.md` in a compressed form, reusable for future iterations. Only add learnings if they are not already there.
|
|
39
|
+
18. Finish the iteration.
|
|
40
|
+
|
|
41
|
+
## Escalating Ambiguity
|
|
42
|
+
|
|
43
|
+
**If the slice's requirements are genuinely ambiguous, contradictory, or missing a decision you need
|
|
44
|
+
in order to proceed — do not guess, and do not build anyway.** Invoke `/request-feedback` with the
|
|
45
|
+
specific question; it posts the question as a comment on the slice and marks it `Blocked` on the
|
|
46
|
+
board (overriding the `InProgress` set in step 5), then stop this iteration without finishing the
|
|
47
|
+
build — reply `<promise>DONE</promise>` as if the iteration's work was to raise the question, not to
|
|
48
|
+
implement the slice. This is an escalation path, not a routine step — read the slice.json and the
|
|
49
|
+
matching build skill's own instructions fully first; most slices are fully specified and need none of
|
|
50
|
+
this.
|
|
51
|
+
|
|
52
|
+
## Progress Report Format
|
|
53
|
+
|
|
54
|
+
APPEND to progress.txt (never replace, always append):
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
## [Date/Time] - [Slice]
|
|
58
|
+
|
|
59
|
+
- What was implemented
|
|
60
|
+
- Files changed
|
|
61
|
+
- **Learnings for future iterations:**
|
|
62
|
+
- Patterns discovered (e.g., "this codebase uses X for Y")
|
|
63
|
+
- Gotchas encountered (e.g., "don't forget to update Z when changing W")
|
|
64
|
+
- Useful context (e.g., "the evaluation panel is in component X")
|
|
65
|
+
---
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase better.
|
|
69
|
+
|
|
70
|
+
## Consolidate Patterns
|
|
71
|
+
|
|
72
|
+
If you discover a **reusable pattern** that future iterations should know, add it to the `## Codebase Patterns` section at the TOP of progress.txt (create it if it doesn't exist).
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
## Codebase Patterns
|
|
76
|
+
- TODO: an example of a your stack-specific reusable pattern once you have one
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Only add patterns that are **general and reusable**, not story-specific details.
|
|
80
|
+
|
|
81
|
+
## Update AGENTS.md Files
|
|
82
|
+
|
|
83
|
+
Before committing, check if any edited files have learnings worth preserving in nearby AGENTS.md files — API patterns/conventions, gotchas, dependencies between files, testing approaches, configuration/environment requirements.
|
|
84
|
+
|
|
85
|
+
**Do NOT add:**
|
|
86
|
+
|
|
87
|
+
- Slice specific implementation details
|
|
88
|
+
- Story-specific implementation details
|
|
89
|
+
- Temporary debugging notes
|
|
90
|
+
- Information already in progress.txt
|
|
91
|
+
- Task-specific learnings
|
|
92
|
+
|
|
93
|
+
Only update AGENTS.md if you have **genuinely reusable knowledge** that would help future work
|
|
94
|
+
|
|
95
|
+
## Quality Requirements
|
|
96
|
+
|
|
97
|
+
- ALL commits must pass this project's quality checks (typecheck/compile, lint, test)
|
|
98
|
+
- TODO: your stack's build command
|
|
99
|
+
- TODO: your stack's test command
|
|
100
|
+
- Do NOT commit broken code
|
|
101
|
+
- Keep changes focused and minimal
|
|
102
|
+
- Follow existing code patterns
|
|
103
|
+
|
|
104
|
+
## Skills
|
|
105
|
+
|
|
106
|
+
Use the provided skills in the skills folder as guidance.
|
|
107
|
+
Update skill definitions if you find an improvement you can make.
|
|
108
|
+
|
|
109
|
+
## Specifications
|
|
110
|
+
|
|
111
|
+
For every specification added to the Slice, you need to implement one executable Specification in Code.
|
|
112
|
+
|
|
113
|
+
A Slice is not complete if specifications are missing or can't be executed.
|
|
114
|
+
|
|
115
|
+
## Stop Condition
|
|
116
|
+
|
|
117
|
+
**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.
|
|
118
|
+
|
|
119
|
+
If the slice was completed and committed successfully, reply with:
|
|
120
|
+
<promise>DONE</promise>
|
|
121
|
+
|
|
122
|
+
If no slice has status "Planned" in the current context, reply with:
|
|
123
|
+
<promise>NO_TASKS</promise>
|
|
124
|
+
(Do NOT switch to another context to find work — stop here.)
|
|
125
|
+
|
|
126
|
+
If ALL slices in the current context are Done, reply with:
|
|
127
|
+
<promise>COMPLETE</promise>
|
|
128
|
+
|
|
129
|
+
## Important
|
|
130
|
+
|
|
131
|
+
- If `.build-kit/.eventmodelers/config.json` is absent, skip all platform communication (MCP calls, `update-slice-status`, board sync) and continue working locally.
|
|
132
|
+
- Work on ONE slice per iteration
|
|
133
|
+
- Commit frequently
|
|
134
|
+
- update progress.txt frequently
|
|
135
|
+
- Read the Codebase Patterns section in progress.txt before starting
|
|
136
|
+
|
|
137
|
+
## When an iteration completes
|
|
138
|
+
|
|
139
|
+
Use all the key learnings from the progress.txt and update the `.build-kit/AGENTS.md` file with those learnings.
|