@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.
Files changed (44) hide show
  1. package/.agents/ralph/PROMPT_build.md +126 -126
  2. package/.agents/ralph/config.sh +25 -25
  3. package/.agents/ralph/log-activity.sh +15 -15
  4. package/.agents/ralph/loop.sh +1265 -1027
  5. package/.agents/ralph/references/CONTEXT_ENGINEERING.md +126 -126
  6. package/.agents/ralph/references/GUARDRAILS.md +174 -174
  7. package/.agents/tasks/prd.json +531 -0
  8. package/.agents/tasks/prd.overview.md +34 -0
  9. package/README.md +431 -270
  10. package/bin/ralph +932 -767
  11. package/dashboard/server/public/assets/index-BsXe-adb.css +1 -0
  12. package/dashboard/server/public/assets/index-baxd-uax.js +453 -0
  13. package/dashboard/server/public/index.html +14 -0
  14. package/package.json +67 -39
  15. package/skills/commit/SKILL.md +219 -219
  16. package/skills/commit/references/commit_examples.md +292 -292
  17. package/skills/dev-browser/SKILL.md +211 -211
  18. package/skills/dev-browser/bun.lock +443 -443
  19. package/skills/dev-browser/package-lock.json +2988 -2988
  20. package/skills/dev-browser/package.json +31 -31
  21. package/skills/dev-browser/references/scraping.md +155 -155
  22. package/skills/dev-browser/scripts/start-relay.ts +32 -32
  23. package/skills/dev-browser/scripts/start-server.ts +117 -117
  24. package/skills/dev-browser/server.sh +24 -24
  25. package/skills/dev-browser/src/client.ts +474 -474
  26. package/skills/dev-browser/src/index.ts +287 -287
  27. package/skills/dev-browser/src/relay.ts +731 -731
  28. package/skills/dev-browser/src/snapshot/__tests__/snapshot.test.ts +223 -223
  29. package/skills/dev-browser/src/snapshot/browser-script.ts +877 -877
  30. package/skills/dev-browser/src/snapshot/index.ts +14 -14
  31. package/skills/dev-browser/src/snapshot/inject.ts +13 -13
  32. package/skills/dev-browser/src/types.ts +34 -34
  33. package/skills/dev-browser/tsconfig.json +36 -36
  34. package/skills/dev-browser/vitest.config.ts +12 -12
  35. package/skills/prd/SKILL.md +235 -235
  36. package/AGENTS.md +0 -20
  37. package/diagram.svg +0 -55
  38. package/examples/commands.md +0 -46
  39. package/ralph.webp +0 -0
  40. package/tests/agent-loops.mjs +0 -79
  41. package/tests/agent-ping.mjs +0 -39
  42. package/tests/audit.md +0 -56
  43. package/tests/cli-smoke.mjs +0 -47
  44. package/tests/real-agents.mjs +0 -127
package/README.md CHANGED
@@ -1,270 +1,431 @@
1
- # Ralph
2
-
3
- ![Ralph](ralph.webp)
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
- - **First-run agent selection** - Prompted to choose your default agent on first use
12
- - **`ralph config` command** - Reconfigure your default agent anytime
13
- - **Improved Claude support** - Uses stdin mode (`-p -`) for reliable prompt passing
14
- - **Better Windows compatibility** - Fixed shell quoting and Python detection
15
- - **Global config storage** - Settings persist in `~/.ralph/config.json`
16
-
17
- ## How It Works
18
-
19
- Ralph treats **files and git** as memory, not the model context:
20
-
21
- - **PRD (JSON)** - Defines stories, quality gates, and status
22
- - **Loop** - Executes one story per iteration
23
- - **State** - Persists in `.ralph/` directory
24
-
25
- ![Ralph architecture](diagram.svg)
26
-
27
- ## Installation
28
-
29
- ### From npm (recommended)
30
-
31
- ```bash
32
- npm i -g @canivel/ralph
33
- ```
34
-
35
- ### From source
36
-
37
- ```bash
38
- git clone https://github.com/canivel/ralph.git
39
- cd ralph
40
- npm install
41
- npm link
42
- ```
43
-
44
- ### Prerequisites
45
-
46
- You need at least one AI agent CLI installed:
47
-
48
- | Agent | Install Command |
49
- |-------|-----------------|
50
- | Claude | `curl -fsSL https://claude.ai/install.sh \| bash` |
51
- | Codex | `npm i -g @openai/codex` |
52
- | Droid | `curl -fsSL https://app.factory.ai/cli \| sh` |
53
- | OpenCode | `curl -fsSL https://opencode.ai/install.sh \| bash` |
54
-
55
- ## Quick Start
56
-
57
- ```bash
58
- # 1. Navigate to your project
59
- cd my-project
60
-
61
- # 2. Generate a PRD (first run prompts for agent selection)
62
- ralph prd "A task management app with projects and due dates"
63
-
64
- # 3. Build one story at a time
65
- ralph build 1
66
- ```
67
-
68
- On first run, you'll see the agent selection prompt:
69
-
70
- ```
71
- Ralph Configuration
72
- ? Select your default agent
73
- > claude (Anthropic Claude CLI)
74
- codex (OpenAI Codex CLI)
75
- droid (Factory Droid CLI)
76
- opencode (OpenCode CLI)
77
- ```
78
-
79
- ## Commands
80
-
81
- | Command | Description |
82
- |---------|-------------|
83
- | `ralph prd ["<request>"]` | Generate a PRD JSON file via agent |
84
- | `ralph build [n]` | Run n build iterations (default: continuous) |
85
- | `ralph config` | Configure or change default agent |
86
- | `ralph install` | Copy templates to current repo for customization |
87
- | `ralph install --skills` | Install required skills (commit, dev-browser, prd) |
88
- | `ralph overview` | Generate human-readable overview from PRD |
89
- | `ralph ping` | Health check for agent connectivity |
90
- | `ralph log "<message>"` | Append to activity log |
91
- | `ralph help` | Show help message |
92
-
93
- ### Options
94
-
95
- | Option | Description |
96
- |--------|-------------|
97
- | `--agent <name>` | Override agent (codex, claude, droid, opencode) |
98
- | `--prd <path>` | Override PRD file path |
99
- | `--out <path>` | Override PRD output path (for `prd` command) |
100
- | `--progress <path>` | Override progress log path |
101
- | `--no-commit` | Dry run without committing (for `build` command) |
102
- | `--force` | Force overwrite (for `install` command) |
103
-
104
- ## Usage Examples
105
-
106
- ### Generate a PRD
107
-
108
- ```bash
109
- # Interactive mode - prompts for description
110
- ralph prd
111
-
112
- # Direct mode - pass description as argument
113
- ralph prd "A REST API for user authentication with JWT tokens"
114
-
115
- # Specify output path
116
- ralph prd --out .agents/tasks/prd-auth.json "Auth API"
117
- ```
118
-
119
- ### Build Stories
120
-
121
- ```bash
122
- # Build one story
123
- ralph build 1
124
-
125
- # Build 5 stories
126
- ralph build 5
127
-
128
- # Dry run (no commits)
129
- ralph build 1 --no-commit
130
-
131
- # Use specific PRD file
132
- ralph build 1 --prd .agents/tasks/prd-auth.json
133
-
134
- # Override agent for this run
135
- ralph build 1 --agent codex
136
- ```
137
-
138
- ### Configuration
139
-
140
- ```bash
141
- # Change default agent
142
- ralph config
143
-
144
- # Install templates for customization
145
- ralph install
146
-
147
- # Install skills (commit, dev-browser, prd)
148
- ralph install --skills
149
- ```
150
-
151
- ## Configuration
152
-
153
- ### Global Config
154
-
155
- Ralph stores global settings in `~/.ralph/config.json`:
156
-
157
- ```json
158
- {
159
- "defaultAgent": "claude",
160
- "configuredAt": "2026-01-19T12:00:00.000Z"
161
- }
162
- ```
163
-
164
- To change your default agent:
165
-
166
- ```bash
167
- ralph config
168
- ```
169
-
170
- ### Project Config
171
-
172
- After running `ralph install`, you can customize behavior in `.agents/ralph/config.sh`:
173
-
174
- ```bash
175
- # Override agent command (Claude uses stdin mode by default)
176
- # AGENT_CMD="claude --dangerously-skip-permissions -p -"
177
-
178
- # Build settings
179
- NO_COMMIT=false
180
- MAX_ITERATIONS=25
181
- STALE_SECONDS=0
182
- ```
183
-
184
- ## Template Hierarchy
185
-
186
- Ralph looks for templates in this order:
187
-
188
- 1. `.agents/ralph/` in current project (if present)
189
- 2. Bundled defaults from the package
190
-
191
- State and logs always go to `.ralph/` in the project.
192
-
193
- ## PRD Story Status
194
-
195
- The build loop automatically updates story status:
196
-
197
- | Status | Meaning |
198
- |--------|---------|
199
- | `open` | Available for selection |
200
- | `in_progress` | Currently being worked on (with `startedAt`) |
201
- | `done` | Completed (with `completedAt`) |
202
-
203
- If a loop crashes while a story is `in_progress`, set `STALE_SECONDS` in config to auto-reopen stalled stories.
204
-
205
- ## State Files
206
-
207
- All state is stored in `.ralph/` in your project:
208
-
209
- | File | Purpose |
210
- |------|---------|
211
- | `progress.md` | Append-only progress log |
212
- | `guardrails.md` | Lessons learned ("Signs") |
213
- | `activity.log` | Activity and timing log |
214
- | `errors.log` | Repeated failures and notes |
215
- | `runs/` | Raw run logs and summaries |
216
-
217
- ## Advanced
218
-
219
- ### Multiple PRD Files
220
-
221
- If you have multiple PRD JSON files in `.agents/tasks/` and don't specify `--prd`, Ralph will prompt you to choose.
222
-
223
- ### OpenCode Server Mode
224
-
225
- For faster performance with OpenCode, run `opencode serve` in a separate terminal and uncomment the server mode lines in `.agents/ralph/agents.sh`:
226
-
227
- ```bash
228
- AGENT_OPENCODE_CMD="opencode run --attach http://localhost:4096 \"\$(cat {prompt})\""
229
- ```
230
-
231
- ### Custom Agent Commands
232
-
233
- Agents are passed prompts via stdin by default. Use `{prompt}` placeholder when the agent needs a file path instead:
234
-
235
- ```bash
236
- # Stdin mode (default for claude, codex)
237
- AGENT_CMD="my-agent -"
238
-
239
- # File path mode (for agents that require a file)
240
- AGENT_CMD="my-agent --file {prompt}"
241
- ```
242
-
243
- ## Development
244
-
245
- ### Running Tests
246
-
247
- ```bash
248
- # Dry-run smoke tests (no agent required)
249
- npm test
250
-
251
- # Fast agent health check
252
- npm run test:ping
253
-
254
- # Integration tests (requires agents)
255
- RALPH_INTEGRATION=1 npm test
256
-
257
- # Full real-agent loop test
258
- npm run test:real
259
- ```
260
-
261
- ### Publishing
262
-
263
- ```bash
264
- npm login
265
- npm publish --access public
266
- ```
267
-
268
- ## License
269
-
270
- MIT
1
+ # Ralph
2
+
3
+ ![Ralph](ralph.webp)
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
+ ![Ralph architecture](diagram.svg)
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
+ ![Ralph Dashboard — Projects](images/dash-projects.png)
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
+ ![Ralph Dashboard — Story Board](images/Screenshot%202026-01-31%20094653.png)
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