@canivel/ralph 0.2.3 → 0.3.0
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/.agents/ralph/PROMPT_build.md +126 -126
- package/.agents/ralph/config.sh +25 -25
- package/.agents/ralph/log-activity.sh +15 -15
- package/.agents/ralph/loop.sh +1265 -1027
- package/.agents/ralph/references/CONTEXT_ENGINEERING.md +126 -126
- package/.agents/ralph/references/GUARDRAILS.md +174 -174
- package/.agents/tasks/prd.json +531 -0
- package/.agents/tasks/prd.overview.md +34 -0
- package/README.md +431 -270
- package/bin/ralph +932 -767
- package/dashboard/server/public/assets/index-BsXe-adb.css +1 -0
- package/dashboard/server/public/assets/index-baxd-uax.js +453 -0
- package/dashboard/server/public/index.html +14 -0
- package/package.json +67 -39
- package/skills/commit/SKILL.md +219 -219
- package/skills/commit/references/commit_examples.md +292 -292
- package/skills/dev-browser/SKILL.md +211 -211
- package/skills/dev-browser/bun.lock +443 -443
- package/skills/dev-browser/package-lock.json +2988 -2988
- package/skills/dev-browser/package.json +31 -31
- package/skills/dev-browser/references/scraping.md +155 -155
- package/skills/dev-browser/scripts/start-relay.ts +32 -32
- package/skills/dev-browser/scripts/start-server.ts +117 -117
- package/skills/dev-browser/server.sh +24 -24
- package/skills/dev-browser/src/client.ts +474 -474
- package/skills/dev-browser/src/index.ts +287 -287
- package/skills/dev-browser/src/relay.ts +731 -731
- package/skills/dev-browser/src/snapshot/__tests__/snapshot.test.ts +223 -223
- package/skills/dev-browser/src/snapshot/browser-script.ts +877 -877
- package/skills/dev-browser/src/snapshot/index.ts +14 -14
- package/skills/dev-browser/src/snapshot/inject.ts +13 -13
- package/skills/dev-browser/src/types.ts +34 -34
- package/skills/dev-browser/tsconfig.json +36 -36
- package/skills/dev-browser/vitest.config.ts +12 -12
- package/skills/prd/SKILL.md +235 -235
- package/AGENTS.md +0 -20
- package/diagram.svg +0 -55
- package/examples/commands.md +0 -46
- package/ralph.webp +0 -0
- package/tests/agent-loops.mjs +0 -79
- package/tests/agent-ping.mjs +0 -39
- package/tests/audit.md +0 -56
- package/tests/cli-smoke.mjs +0 -47
- package/tests/real-agents.mjs +0 -127
package/README.md
CHANGED
|
@@ -1,270 +1,431 @@
|
|
|
1
|
-
# Ralph
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
Ralph is a minimal, file-based agent loop for autonomous coding. Each iteration starts fresh, reads the same on-disk state, and commits work for one story at a time.
|
|
6
|
-
|
|
7
|
-
> **Fork Note:** This is a fork of [@iannuttall/ralph](https://github.com/iannuttall/ralph) with improved agent support and first-run configuration.
|
|
8
|
-
|
|
9
|
-
## What's New in This Fork
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
|
96
|
-
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
##
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
#
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
1
|
+
# Ralph
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Ralph is a minimal, file-based agent loop for autonomous coding. Each iteration starts fresh, reads the same on-disk state, and commits work for one story at a time.
|
|
6
|
+
|
|
7
|
+
> **Fork Note:** This is a fork of [@iannuttall/ralph](https://github.com/iannuttall/ralph) with improved agent support and first-run configuration.
|
|
8
|
+
|
|
9
|
+
## What's New in This Fork
|
|
10
|
+
|
|
11
|
+
### Latest Updates
|
|
12
|
+
|
|
13
|
+
- **Web Dashboard** - Real-time monitoring UI for managing multiple projects from a single interface (`ralph dashboard`) -- see [Dashboard](#dashboard)
|
|
14
|
+
- **Automatic Retry** - Transient errors (API timeouts, rate limits) trigger automatic retries with exponential backoff
|
|
15
|
+
- **Story Blocking** - Stories that fail repeatedly are automatically blocked to prevent infinite loops
|
|
16
|
+
- **Git Cleanup** - Failed iterations automatically clean up uncommitted changes
|
|
17
|
+
- **Lean Progress Log** - Detailed run info moved to `.ralph/runs/`, keeping progress.md concise
|
|
18
|
+
|
|
19
|
+
### Original Fork Features
|
|
20
|
+
|
|
21
|
+
- **First-run agent selection** - Prompted to choose your default agent on first use
|
|
22
|
+
- **`ralph config` command** - Reconfigure your default agent anytime
|
|
23
|
+
- **Improved Claude support** - Uses stdin mode (`-p -`) for reliable prompt passing
|
|
24
|
+
- **Better Windows compatibility** - Fixed shell quoting and Python detection
|
|
25
|
+
- **Global config storage** - Settings persist in `~/.ralph/config.json`
|
|
26
|
+
|
|
27
|
+
## How It Works
|
|
28
|
+
|
|
29
|
+
Ralph treats **files and git** as memory, not the model context:
|
|
30
|
+
|
|
31
|
+
- **PRD (JSON)** - Defines stories, quality gates, and status
|
|
32
|
+
- **Loop** - Executes one story per iteration
|
|
33
|
+
- **State** - Persists in `.ralph/` directory
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
### From npm (recommended)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm i -g @canivel/ralph
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### From source
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/canivel/ralph.git
|
|
49
|
+
cd ralph
|
|
50
|
+
npm install
|
|
51
|
+
npm link
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Prerequisites
|
|
55
|
+
|
|
56
|
+
You need at least one AI agent CLI installed:
|
|
57
|
+
|
|
58
|
+
| Agent | Install Command |
|
|
59
|
+
|-------|-----------------|
|
|
60
|
+
| Claude | `curl -fsSL https://claude.ai/install.sh \| bash` |
|
|
61
|
+
| Codex | `npm i -g @openai/codex` |
|
|
62
|
+
| Droid | `curl -fsSL https://app.factory.ai/cli \| sh` |
|
|
63
|
+
| OpenCode | `curl -fsSL https://opencode.ai/install.sh \| bash` |
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 1. Navigate to your project
|
|
69
|
+
cd my-project
|
|
70
|
+
|
|
71
|
+
# 2. Generate a PRD (first run prompts for agent selection)
|
|
72
|
+
ralph prd "A task management app with projects and due dates"
|
|
73
|
+
|
|
74
|
+
# 3. Build one story at a time
|
|
75
|
+
ralph build 1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
On first run, you'll see the agent selection prompt:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Ralph Configuration
|
|
82
|
+
? Select your default agent
|
|
83
|
+
> claude (Anthropic Claude CLI)
|
|
84
|
+
codex (OpenAI Codex CLI)
|
|
85
|
+
droid (Factory Droid CLI)
|
|
86
|
+
opencode (OpenCode CLI)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
| Command | Description |
|
|
92
|
+
|---------|-------------|
|
|
93
|
+
| `ralph prd ["<request>"]` | Generate a PRD JSON file via agent |
|
|
94
|
+
| `ralph build [n]` | Run n build iterations (default: continuous) |
|
|
95
|
+
| `ralph config` | Configure or change default agent |
|
|
96
|
+
| `ralph install` | Copy templates to current repo for customization |
|
|
97
|
+
| `ralph install --skills` | Install required skills (commit, dev-browser, prd) |
|
|
98
|
+
| `ralph overview` | Generate human-readable overview from PRD |
|
|
99
|
+
| `ralph ping` | Health check for agent connectivity |
|
|
100
|
+
| `ralph log "<message>"` | Append to activity log |
|
|
101
|
+
| `ralph dashboard` | Start the Ralph dashboard web server |
|
|
102
|
+
| `ralph help` | Show help message |
|
|
103
|
+
|
|
104
|
+
### Options
|
|
105
|
+
|
|
106
|
+
| Option | Description |
|
|
107
|
+
|--------|-------------|
|
|
108
|
+
| `--agent <name>` | Override agent (codex, claude, droid, opencode) |
|
|
109
|
+
| `--prd <path>` | Override PRD file path |
|
|
110
|
+
| `--out <path>` | Override PRD output path (for `prd` command) |
|
|
111
|
+
| `--progress <path>` | Override progress log path |
|
|
112
|
+
| `--no-commit` | Dry run without committing (for `build` command) |
|
|
113
|
+
| `--force` | Force overwrite (for `install` command) |
|
|
114
|
+
|
|
115
|
+
## Usage Examples
|
|
116
|
+
|
|
117
|
+
### Generate a PRD
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Interactive mode - prompts for description
|
|
121
|
+
ralph prd
|
|
122
|
+
|
|
123
|
+
# Direct mode - pass description as argument
|
|
124
|
+
ralph prd "A REST API for user authentication with JWT tokens"
|
|
125
|
+
|
|
126
|
+
# Specify output path
|
|
127
|
+
ralph prd --out .agents/tasks/prd-auth.json "Auth API"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Build Stories
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Build one story
|
|
134
|
+
ralph build 1
|
|
135
|
+
|
|
136
|
+
# Build 5 stories
|
|
137
|
+
ralph build 5
|
|
138
|
+
|
|
139
|
+
# Dry run (no commits)
|
|
140
|
+
ralph build 1 --no-commit
|
|
141
|
+
|
|
142
|
+
# Use specific PRD file
|
|
143
|
+
ralph build 1 --prd .agents/tasks/prd-auth.json
|
|
144
|
+
|
|
145
|
+
# Override agent for this run
|
|
146
|
+
ralph build 1 --agent codex
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Configuration
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Change default agent
|
|
153
|
+
ralph config
|
|
154
|
+
|
|
155
|
+
# Install templates for customization
|
|
156
|
+
ralph install
|
|
157
|
+
|
|
158
|
+
# Install skills (commit, dev-browser, prd)
|
|
159
|
+
ralph install --skills
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Configuration
|
|
163
|
+
|
|
164
|
+
### Global Config
|
|
165
|
+
|
|
166
|
+
Ralph stores global settings in `~/.ralph/config.json`:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"defaultAgent": "claude",
|
|
171
|
+
"configuredAt": "2026-01-19T12:00:00.000Z"
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
To change your default agent:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
ralph config
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Project Config
|
|
182
|
+
|
|
183
|
+
After running `ralph install`, you can customize behavior in `.agents/ralph/config.sh`:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Override agent command (Claude uses stdin mode by default)
|
|
187
|
+
# AGENT_CMD="claude --dangerously-skip-permissions -p -"
|
|
188
|
+
|
|
189
|
+
# Build settings
|
|
190
|
+
NO_COMMIT=false
|
|
191
|
+
MAX_ITERATIONS=25
|
|
192
|
+
STALE_SECONDS=0
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Template Hierarchy
|
|
196
|
+
|
|
197
|
+
Ralph looks for templates in this order:
|
|
198
|
+
|
|
199
|
+
1. `.agents/ralph/` in current project (if present)
|
|
200
|
+
2. Bundled defaults from the package
|
|
201
|
+
|
|
202
|
+
State and logs always go to `.ralph/` in the project.
|
|
203
|
+
|
|
204
|
+
## PRD Story Status
|
|
205
|
+
|
|
206
|
+
The build loop automatically updates story status:
|
|
207
|
+
|
|
208
|
+
| Status | Meaning |
|
|
209
|
+
|--------|---------|
|
|
210
|
+
| `open` | Available for selection |
|
|
211
|
+
| `in_progress` | Currently being worked on (with `startedAt`) |
|
|
212
|
+
| `done` | Completed (with `completedAt`) |
|
|
213
|
+
| `blocked` | Too many failures (with `blockedReason`) |
|
|
214
|
+
|
|
215
|
+
If a loop crashes while a story is `in_progress`, set `STALE_SECONDS` in config to auto-reopen stalled stories.
|
|
216
|
+
|
|
217
|
+
## Error Handling & Retry
|
|
218
|
+
|
|
219
|
+
Ralph includes robust error handling for transient failures:
|
|
220
|
+
|
|
221
|
+
### Automatic Retry
|
|
222
|
+
|
|
223
|
+
When the agent fails with a transient error (API timeouts, rate limits, connection resets), Ralph automatically retries:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
╔═══════════════════════════════════════════════════════════╗
|
|
227
|
+
║ Transient error detected, retrying (1/3)...
|
|
228
|
+
╚═══════════════════════════════════════════════════════════╝
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Detected transient errors:
|
|
232
|
+
- "No messages returned" (Claude CLI)
|
|
233
|
+
- Rate limit errors
|
|
234
|
+
- API overload errors
|
|
235
|
+
- Connection resets (ECONNRESET, ETIMEDOUT)
|
|
236
|
+
- Socket hang up
|
|
237
|
+
|
|
238
|
+
### Story Blocking
|
|
239
|
+
|
|
240
|
+
If a story fails repeatedly (default: 3 times), it's automatically marked as `blocked`:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"id": "US-001",
|
|
245
|
+
"status": "blocked",
|
|
246
|
+
"blockedReason": "Failed 3 times"
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Blocked stories are skipped in subsequent iterations. To retry a blocked story, manually change its status back to `open` in the PRD JSON.
|
|
251
|
+
|
|
252
|
+
### Git Cleanup
|
|
253
|
+
|
|
254
|
+
When an iteration fails, Ralph automatically cleans up uncommitted changes to prevent polluting the next iteration:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Automatic cleanup on failure
|
|
258
|
+
git checkout -- .
|
|
259
|
+
git clean -fd
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Configuration
|
|
263
|
+
|
|
264
|
+
Control retry behavior in `.agents/ralph/config.sh`:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Number of retries per iteration for transient errors (default: 3)
|
|
268
|
+
MAX_RETRIES=3
|
|
269
|
+
|
|
270
|
+
# Delay between retries in seconds (default: 5)
|
|
271
|
+
RETRY_DELAY=5
|
|
272
|
+
|
|
273
|
+
# Max failures before blocking a story (default: 3)
|
|
274
|
+
MAX_STORY_FAILURES=3
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## State Files
|
|
278
|
+
|
|
279
|
+
All state is stored in `.ralph/` in your project:
|
|
280
|
+
|
|
281
|
+
| File | Purpose |
|
|
282
|
+
|------|---------|
|
|
283
|
+
| `progress.md` | Append-only progress log |
|
|
284
|
+
| `guardrails.md` | Lessons learned ("Signs") |
|
|
285
|
+
| `activity.log` | Activity and timing log |
|
|
286
|
+
| `errors.log` | Repeated failures and notes |
|
|
287
|
+
| `runs/` | Raw run logs and summaries |
|
|
288
|
+
|
|
289
|
+
## Dashboard
|
|
290
|
+
|
|
291
|
+
Ralph includes a real-time web dashboard for monitoring and managing multiple projects from a single interface. Run several autonomous builds in parallel and track all of them from one place.
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
ralph dashboard --open
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Managing Multiple Projects
|
|
298
|
+
|
|
299
|
+
The dashboard landing page shows every registered project as a card. Each card displays the project name, path, story completion progress, and last activity time. Click any card to drill into that project's full detail view.
|
|
300
|
+
|
|
301
|
+

|
|
302
|
+
|
|
303
|
+
**Adding projects:**
|
|
304
|
+
|
|
305
|
+
There are three ways to register projects with the dashboard:
|
|
306
|
+
|
|
307
|
+
1. **Auto-detect** -- If the current directory contains a `.ralph/` folder, it is registered automatically when you start the dashboard.
|
|
308
|
+
2. **CLI flag** -- Pass multiple project paths at launch:
|
|
309
|
+
```bash
|
|
310
|
+
ralph dashboard --projects ~/project-a,~/project-b,~/project-c
|
|
311
|
+
```
|
|
312
|
+
3. **From the UI** -- Click the **Add Project** button in the top-right corner, browse to a directory that contains a `.ralph/` folder, and add it. Projects can be added at any time without restarting the server.
|
|
313
|
+
|
|
314
|
+
Any directory with a `.ralph/` folder is a valid Ralph project. You can mix and match projects that use different agents or PRDs.
|
|
315
|
+
|
|
316
|
+
### Project Detail View
|
|
317
|
+
|
|
318
|
+
Click a project card to open its detail view. The header shows the project name, status (Idle / Running), path, story progress bar, and run count. Below that, seven tabs give you full visibility into the build.
|
|
319
|
+
|
|
320
|
+

|
|
321
|
+
|
|
322
|
+
| Tab | What It Shows |
|
|
323
|
+
|-----|---------------|
|
|
324
|
+
| **Overview** | Story progress bar, quality gates, recent activity feed, current iteration status |
|
|
325
|
+
| **Stories** | Kanban board with **Open**, **In Progress**, and **Done** columns. Cards show story ID, title, blocked/dependency status, and elapsed time |
|
|
326
|
+
| **Runs** | Timeline of every iteration with duration, success/failure status, and expandable raw output |
|
|
327
|
+
| **Logs** | Browsable activity log, error log, and per-run logs with search and filtering |
|
|
328
|
+
| **Progress** | Rendered `progress.md` with syntax highlighting |
|
|
329
|
+
| **Guardrails** | Rendered `guardrails.md` with color-coded Sign entries |
|
|
330
|
+
| **Metrics** | Charts for completion rate, iteration durations, and success/failure rates over time |
|
|
331
|
+
|
|
332
|
+
### Key Capabilities
|
|
333
|
+
|
|
334
|
+
- **Real-time Updates** -- WebSocket-based live updates as files change on disk; no manual refresh needed
|
|
335
|
+
- **Multi-project Support** -- Switch between projects from the landing page or the sidebar to monitor parallel builds
|
|
336
|
+
- **Story Dependency Tracking** -- Blocked stories show which dependency they are waiting on (e.g. "Waiting on: US-005")
|
|
337
|
+
- **Elapsed Time Tracking** -- In-progress and completed stories display elapsed time
|
|
338
|
+
- **Connection Status** -- A live indicator in the header shows the WebSocket connection state
|
|
339
|
+
- **Dark / Light Mode** -- Toggle between themes
|
|
340
|
+
- **Responsive Design** -- Works on desktop and mobile
|
|
341
|
+
|
|
342
|
+
### Dashboard Options
|
|
343
|
+
|
|
344
|
+
| Option | Description |
|
|
345
|
+
|--------|-------------|
|
|
346
|
+
| `--port <number>` | Port to run the server on (default: 4242) |
|
|
347
|
+
| `--host <hostname>` | Host to bind to (default: localhost) |
|
|
348
|
+
| `--open` | Open browser automatically after starting |
|
|
349
|
+
| `--projects <paths>` | Comma-separated project paths to register |
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
# Examples
|
|
353
|
+
ralph dashboard # default port 4242
|
|
354
|
+
ralph dashboard --port 8080 # custom port
|
|
355
|
+
ralph dashboard --open # auto-open browser
|
|
356
|
+
ralph dashboard --host 0.0.0.0 # expose on all interfaces
|
|
357
|
+
ralph dashboard --projects ~/app-a,~/app-b,~/app-c # register three projects
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Tech Stack
|
|
361
|
+
|
|
362
|
+
- **Frontend**: React 19, TypeScript, Vite, Tailwind CSS, shadcn/ui, Recharts
|
|
363
|
+
- **Backend**: Express, WebSocket (ws), chokidar (file watching)
|
|
364
|
+
- **State**: Zustand for client state management
|
|
365
|
+
|
|
366
|
+
### Running Dashboard Tests
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# Run all dashboard tests (113 tests)
|
|
370
|
+
npm run test:dashboard
|
|
371
|
+
|
|
372
|
+
# Tests cover:
|
|
373
|
+
# - Data parsers (PRD, activity log, errors log, progress.md, guardrails.md)
|
|
374
|
+
# - Project manager service
|
|
375
|
+
# - API endpoints
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Advanced
|
|
379
|
+
|
|
380
|
+
### Multiple PRD Files
|
|
381
|
+
|
|
382
|
+
If you have multiple PRD JSON files in `.agents/tasks/` and don't specify `--prd`, Ralph will prompt you to choose.
|
|
383
|
+
|
|
384
|
+
### OpenCode Server Mode
|
|
385
|
+
|
|
386
|
+
For faster performance with OpenCode, run `opencode serve` in a separate terminal and uncomment the server mode lines in `.agents/ralph/agents.sh`:
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
AGENT_OPENCODE_CMD="opencode run --attach http://localhost:4096 \"\$(cat {prompt})\""
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Custom Agent Commands
|
|
393
|
+
|
|
394
|
+
Agents are passed prompts via stdin by default. Use `{prompt}` placeholder when the agent needs a file path instead:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# Stdin mode (default for claude, codex)
|
|
398
|
+
AGENT_CMD="my-agent -"
|
|
399
|
+
|
|
400
|
+
# File path mode (for agents that require a file)
|
|
401
|
+
AGENT_CMD="my-agent --file {prompt}"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Development
|
|
405
|
+
|
|
406
|
+
### Running Tests
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
# Dry-run smoke tests (no agent required)
|
|
410
|
+
npm test
|
|
411
|
+
|
|
412
|
+
# Fast agent health check
|
|
413
|
+
npm run test:ping
|
|
414
|
+
|
|
415
|
+
# Integration tests (requires agents)
|
|
416
|
+
RALPH_INTEGRATION=1 npm test
|
|
417
|
+
|
|
418
|
+
# Full real-agent loop test
|
|
419
|
+
npm run test:real
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Publishing
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
npm login
|
|
426
|
+
npm publish --access public
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## License
|
|
430
|
+
|
|
431
|
+
MIT
|