@eventmodelers/cli 1.0.54 → 1.0.56
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/node/templates/.claude/skills/build-automation/SKILL.md +5 -1
- package/stacks/node/templates/.claude/skills/build-state-change/SKILL.md +90 -2
- package/stacks/node/templates/.claude/skills/build-state-view/SKILL.md +81 -3
- package/stacks/node/templates/build-kit/CLAUDE.md +6 -1
- package/stacks/node/templates/build-kit/lib/checks/60-openapi-annotation.cjs +72 -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/templates/.claude/skills/build-automation/SKILL.md +5 -1
- package/stacks/supabase/templates/.claude/skills/build-state-change/SKILL.md +90 -2
- package/stacks/supabase/templates/.claude/skills/build-state-view/SKILL.md +80 -2
- package/stacks/supabase/templates/.claude/skills/build-webhook/SKILL.md +73 -0
- package/stacks/supabase/templates/build-kit/CLAUDE.md +6 -1
- package/stacks/supabase/templates/build-kit/lib/checks/60-openapi-annotation.cjs +72 -0
- package/stacks/supabase/templates/root/src/swagger.ts +3 -1
- 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,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-state-view
|
|
3
|
+
description: TODO — one-line description of how a read-side slice (a projection/read model kept up to date from events) is implemented for your stack (see an existing stack's build-state-view/SKILL.md under stacks/<name>/templates/.claude/skills/ for the level of detail expected)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Build State View Slice
|
|
7
|
+
|
|
8
|
+
> **TODO — placeholder installed by `init --build-kit`.** Study an existing stack's
|
|
9
|
+
> build-state-view/SKILL.md (stacks/node, stacks/supabase, stacks/axon, or stacks/cratis-csharp,
|
|
10
|
+
> under `templates/.claude/skills/`) for the level of detail expected, then rewrite
|
|
11
|
+
> every section below for your stack's real conventions — file layout, naming, and
|
|
12
|
+
> the actual framework/language idioms. Delete this callout once done.
|
|
13
|
+
|
|
14
|
+
> Before doing anything else, read the slice definition from `.slices/{Context}/{slicename}/slice.json`.
|
|
15
|
+
> This file is the **source of truth** for all fields, events, and metadata — never invent
|
|
16
|
+
> fields not defined there. Keep this line verbatim; it applies to every stack.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## What a State View Slice is
|
|
21
|
+
|
|
22
|
+
TODO — describe a read-side slice (a projection/read model kept up to date from events) in terms of your stack's own primitives.
|
|
23
|
+
|
|
24
|
+
## Step 1 — Read the slice.json
|
|
25
|
+
|
|
26
|
+
From the slice definition, extract:
|
|
27
|
+
- **sliceName** — the slice title
|
|
28
|
+
- **context** — the bounded context
|
|
29
|
+
- **projections[]** / **queries[]** — the read model(s) this slice serves
|
|
30
|
+
- **specifications[]** — test scenarios (given/when/then)
|
|
31
|
+
|
|
32
|
+
> **Comments & description**: each element carries a `comments: string[]` array (board comments) and a `description` field — use them as implementation hints, and resolve consumed comments via `POST <BASE_URL>/api/org/<ORG_ID>/boards/<BOARD_ID>/nodes/<nodeId>/comments/<commentId>/resolve`.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 2 — TODO (your stack-specific implementation steps)
|
|
37
|
+
|
|
38
|
+
TODO — file layout, naming conventions, framework idioms, how the handler/projection/reactor is wired up.
|
|
39
|
+
|
|
40
|
+
## Quality gate
|
|
41
|
+
|
|
42
|
+
TODO — this stack's build command and how to run only this slice's tests (not the full suite).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Project Configuration
|
|
2
|
+
|
|
3
|
+
TODO — one-line pointer to where domain events live in your stack's scaffold (e.g. "Read Events in src/events to understand the global structure").
|
|
4
|
+
|
|
5
|
+
## File Structure Constraints
|
|
6
|
+
|
|
7
|
+
- **Strict Path Limitation**: TODO — the one directory glob the agent should stay inside by default (e.g. `src/slices/{slicename}/*`)
|
|
8
|
+
- **Slice Organization**: Each feature/domain should be organized as a separate slice
|
|
9
|
+
|
|
10
|
+
## Code Standards
|
|
11
|
+
|
|
12
|
+
- **Language**: TODO
|
|
13
|
+
- **Module System**: TODO
|
|
14
|
+
- **Type Safety**: TODO (delete this line if the language has no static typing)
|
|
15
|
+
|
|
16
|
+
## Development Guidelines
|
|
17
|
+
|
|
18
|
+
1. Each slice should be self-contained and focused on a specific domain
|
|
19
|
+
2. Maintain clear separation of concerns within each slice
|
|
20
|
+
3. TODO — your stack's own idioms/best practices
|
|
21
|
+
|
|
22
|
+
TODO — any other guardrails worth stating up front (e.g. ignore routes files unless
|
|
23
|
+
asked, ignore tests unless asked, slice names are case-insensitive) — copy the ones
|
|
24
|
+
that still apply from an existing stack's build-kit/CLAUDE.md.
|
|
25
|
+
|
|
26
|
+
At the start of every session, read `.build-kit/AGENTS.md` if it exists to load accumulated project learnings.
|
|
27
|
+
|
|
28
|
+
When starting to work on a slice, invoke the `update-slice-status` skill with `InProgress` status before doing anything else.
|
|
29
|
+
|
|
30
|
+
## Building a Slice
|
|
31
|
+
|
|
32
|
+
**CRITICAL: You MUST always use the provided skills to build slices. NEVER implement a slice manually.**
|
|
33
|
+
**ALL fields, event names, command names, and business rules MUST come exclusively from slice.json. Do NOT invent, assume, or guess any field or logic not present in the slice definition.**
|
|
34
|
+
|
|
35
|
+
**If, at any point below, the slice's requirements are genuinely ambiguous, contradictory, or missing
|
|
36
|
+
a decision you need in order to proceed — do not guess, and do not build anyway.** Invoke the
|
|
37
|
+
`request-feedback` skill with the specific question; it posts the question as a comment on the slice
|
|
38
|
+
and marks it `Blocked`, and you then stop work on this slice for this run. This is an escalation path,
|
|
39
|
+
not a routine step — read `slice.json` and the matching build skill's own instructions fully first;
|
|
40
|
+
most slices are fully specified and need none of this.
|
|
41
|
+
|
|
42
|
+
When asked to build a slice, always follow this flow:
|
|
43
|
+
|
|
44
|
+
1. Read the slice definition from `.build-kit/.slices/<context>/<slicename>/slice.json`.
|
|
45
|
+
2. Determine the slice type:
|
|
46
|
+
- **Translation** — `sliceType === "TRANSLATION"` → read `description` and `notes` from slice.json for hints; default to `/build-automation` if nothing else is specified
|
|
47
|
+
- **Automation** — `processors` array is non-empty → invoke `/build-automation`
|
|
48
|
+
- **State-view** — `projections` or `queries` array is non-empty → invoke `/build-state-view`
|
|
49
|
+
- **State-change** — default (has `commands` / `events`) → invoke `/build-state-change`
|
|
50
|
+
3. Invoke the matching skill and follow its instructions completely. Do not deviate.
|
|
51
|
+
4. **Verify against slice.json**: After the skill completes, check that every command field, event field, and specification in slice.json appears in the implementation. No invented fields — if it is not in slice.json, it must not be in the code.
|
|
52
|
+
5. Run quality checks (TODO: this stack's build + test commands), then the slice tests only.
|
|
53
|
+
6. If checks pass, commit with `feat: [Slice Name]` and set slice status to `Done`.
|
|
54
|
+
|
|
55
|
+
After you are done, automatically run the tests for the slice that was edited.
|
|
56
|
+
|
|
57
|
+
## Example Slice Structure
|
|
58
|
+
|
|
59
|
+
TODO — a short tree showing where one slice's files land, e.g.:
|
|
60
|
+
```
|
|
61
|
+
TODO
|
|
62
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# .build-kit
|
|
2
|
+
|
|
3
|
+
Ralph's runtime directory. Contains the agent loop, board poller, prompts, and Claude skills.
|
|
4
|
+
|
|
5
|
+
> This is the **react** (API-access) stack — it talks to the board purely through
|
|
6
|
+
> the plain REST `slicedata` endpoint on `api.eventmodelers.ai`, polled on an interval.
|
|
7
|
+
> There is no Supabase/PocketBase realtime subscription and no direct database table
|
|
8
|
+
> access anywhere in this kit. For instant push notifications instead of polling, use
|
|
9
|
+
> the `supabase-react` stack.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Claude (default)
|
|
15
|
+
node .build-kit/ralph-claude.js
|
|
16
|
+
|
|
17
|
+
# Local Ollama model — run `ollama serve` first
|
|
18
|
+
OLLAMA_MODEL=qwen3.5:9b node .build-kit/ralph-ollama.js
|
|
19
|
+
|
|
20
|
+
# Custom project directory (defaults to the parent of .build-kit)
|
|
21
|
+
node .build-kit/ralph-claude.js /path/to/project
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Files
|
|
25
|
+
|
|
26
|
+
**Entry points** (top level):
|
|
27
|
+
|
|
28
|
+
| File | Purpose |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| `ralph-claude.js` | Runs the full loop using Claude Code as the executor |
|
|
31
|
+
| `ralph-ollama.js` | Runs the full loop using a local Ollama model |
|
|
32
|
+
| `ralph.sh` | Shell-based loop — alternative to the JS entry points |
|
|
33
|
+
|
|
34
|
+
**Internals** (`lib/`):
|
|
35
|
+
|
|
36
|
+
| File | Purpose |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `lib/ralph.js` | Shared library — board poller + loop logic; imported by the entry points |
|
|
39
|
+
| `lib/ollama-agent.js` | Ollama executor — called by `ralph-ollama.js`, can also run manually |
|
|
40
|
+
| `lib/agent.sh` | Thin shell wrapper around `claude` — called by `ralph.sh` |
|
|
41
|
+
| `lib/prompt.md` | Phase 1 prompt: tells Claude how to load a slice from the board |
|
|
42
|
+
| `lib/backend-prompt.md` | Phase 2 prompt: tells Claude how to build a planned slice |
|
|
43
|
+
| `lib/AGENT.md` | Agent instructions included in Claude's context |
|
|
44
|
+
|
|
45
|
+
## How it works
|
|
46
|
+
|
|
47
|
+
**Phase 1** — triggered when `tasks.json` has entries:
|
|
48
|
+
- The poller writes a task to `tasks.json` each time it notices a slice's status changed since the last poll
|
|
49
|
+
- The loop picks it up and runs Claude (or Ollama) with `prompt.md`
|
|
50
|
+
- Claude loads the slice data and updates `.slices/`
|
|
51
|
+
|
|
52
|
+
**Phase 2** — triggered when any file in `.slices/` contains `"status": "Planned"`:
|
|
53
|
+
- The loop runs Claude with `backend-prompt.md`
|
|
54
|
+
- Claude implements the slice in the project
|
|
55
|
+
- Phase 2 is Claude-only; Ollama mode skips it (ollama-agent handles its own queue)
|
|
56
|
+
|
|
57
|
+
Both phases run in a continuous loop with a 3-second idle sleep. The board poller runs concurrently in the same process, re-fetching `slicedata/slices` every `RALPH_POLL_INTERVAL_MS` (default 10s — see `lib/ralph.js`).
|
|
58
|
+
|
|
59
|
+
## Ollama configuration
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
OLLAMA_MODEL=qwen3.5:9b # model to use (default: qwen3.5:9b)
|
|
63
|
+
OLLAMA_URL=http://host:11434 # Ollama server URL (default: http://localhost:11434)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Config
|
|
67
|
+
|
|
68
|
+
Credentials are stored in `.build-kit/.eventmodelers/config.json` (written by `eventmodelers init`):
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"organizationId": "...",
|
|
73
|
+
"boardId": "...",
|
|
74
|
+
"token": "...",
|
|
75
|
+
"baseUrl": "https://api.eventmodelers.ai"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
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 board poller writes one file per slice on startup and after each poll tick that detects a change:
|
|
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,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.
|