ralph-mcp 1.1.1 → 1.1.3

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 (2) hide show
  1. package/README.md +96 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -39,13 +39,42 @@ Claude: ralph_start → Task Agent handles everything automatically
39
39
  - **2-Step Workflow** - Just create PRD and run `ralph_start`, everything else is automatic
40
40
  - **Parallel Execution** - Run 5+ PRDs simultaneously with Claude Code Task tool
41
41
  - **Git Worktree Isolation** - Each PRD runs in its own worktree, zero conflicts
42
+ - **Dependency Management** - PRDs can depend on other PRDs, auto-triggered when dependencies complete
43
+ - **Stagnation Detection** - Auto-detects stuck agents (no progress, repeated errors) and marks as failed
42
44
  - **Agent Memory** - Persistent "Progress Log" learns from mistakes across User Stories
43
45
  - **Context Injection** - Inject project rules (CLAUDE.md) into agent context
44
46
  - **Auto Quality Gates** - Type check, lint, build before every commit
45
47
  - **Auto Merge** - Merges to main when all User Stories pass
46
- - **Doc Sync** - Automatically updates TODO.md with completed items
48
+ - **Merge Queue** - Serial merge queue to avoid conflicts
47
49
  - **Notifications** - Windows Toast when PRD completes
48
50
 
51
+ ## Progress Log (Agent Memory)
52
+
53
+ Ralph maintains a `ralph-progress.md` file in each worktree that persists learnings across User Stories. This gives agents "memory" of what worked and what didn't.
54
+
55
+ ### How it works
56
+
57
+ 1. When an agent completes a User Story, it records learnings in the `notes` field of `ralph_update`
58
+ 2. Ralph appends these notes to `ralph-progress.md` in the worktree
59
+ 3. When the next User Story starts, the agent receives this log in its prompt
60
+ 4. The file is automatically git-ignored (via `.git/info/exclude`)
61
+
62
+ ### Example progress log
63
+
64
+ ```markdown
65
+ ## [2024-01-15 14:30] US-001: Setup Database Schema
66
+ - Used Prisma with PostgreSQL
67
+ - Added index on `userId` for faster queries
68
+ - Note: Must run `pnpm db:migrate:dev` after schema changes
69
+
70
+ ## [2024-01-15 15:45] US-002: User Registration API
71
+ - Reused validation patterns from existing auth module
72
+ - BCrypt rounds set to 12 for password hashing
73
+ - Integration test requires test database to be running
74
+ ```
75
+
76
+ This allows later stories to benefit from earlier discoveries without re-learning.
77
+
49
78
  ## Installation
50
79
 
51
80
  ### From npm
@@ -128,6 +157,7 @@ This enables Claude to automatically use Ralph when you mention PRD execution.
128
157
  | Tool | Description |
129
158
  |------|-------------|
130
159
  | `ralph_start` | Start PRD execution (parse PRD, create worktree, return agent prompt) |
160
+ | `ralph_batch_start` | Start multiple PRDs with dependency resolution |
131
161
  | `ralph_status` | View all PRD execution status |
132
162
  | `ralph_get` | Get single PRD details |
133
163
  | `ralph_update` | Update User Story status (called by agent) |
@@ -135,6 +165,8 @@ This enables Claude to automatically use Ralph when you mention PRD execution.
135
165
  | `ralph_merge` | Merge to main + cleanup worktree |
136
166
  | `ralph_merge_queue` | Manage serial merge queue |
137
167
  | `ralph_set_agent_id` | Record Task agent ID |
168
+ | `ralph_retry` | Retry a failed PRD execution |
169
+ | `ralph_reset_stagnation` | Reset stagnation counters after manual intervention |
138
170
 
139
171
  ## Usage
140
172
 
@@ -193,6 +225,9 @@ ralph_merge({ branch: "ralph/prd-feature" })
193
225
  // Start PRD execution (returns agent prompt)
194
226
  ralph_start({ prdPath: "tasks/prd-feature.md" })
195
227
 
228
+ // Start multiple PRDs in parallel
229
+ ralph_batch_start({ prdPaths: ["tasks/prd-a.md", "tasks/prd-b.md"] })
230
+
196
231
  // View all PRD status
197
232
  ralph_status()
198
233
 
@@ -210,6 +245,12 @@ ralph_merge({ branch: "ralph/prd-feature" })
210
245
 
211
246
  // Record Task agent ID (for tracking)
212
247
  ralph_set_agent_id({ branch: "ralph/prd-feature", agentTaskId: "abc123" })
248
+
249
+ // Retry a failed execution
250
+ ralph_retry({ branch: "ralph/prd-feature" })
251
+
252
+ // Reset stagnation counters (after manual fix)
253
+ ralph_reset_stagnation({ branch: "ralph/prd-feature" })
213
254
  ```
214
255
 
215
256
  ## PRD Format
@@ -291,6 +332,60 @@ ralph_start({
291
332
  })
292
333
  ```
293
334
 
335
+ ### ralph_batch_start options
336
+
337
+ Start multiple PRDs with dependency resolution and serial `pnpm install`.
338
+
339
+ | Option | Default | Description |
340
+ |--------|---------|-------------|
341
+ | `prdPaths` | required | Array of paths to PRD markdown files |
342
+ | `projectRoot` | cwd | Project root directory |
343
+ | `worktree` | `true` | Create worktrees for isolation |
344
+ | `autoMerge` | `true` | Auto add to merge queue when all stories pass |
345
+ | `notifyOnComplete` | `true` | Show Windows notification on completion |
346
+ | `onConflict` | `"agent"` | Conflict resolution strategy |
347
+ | `contextInjectionPath` | `undefined` | Path to file (e.g. CLAUDE.md) to inject into prompt |
348
+ | `preheat` | `true` | Run pnpm install serially before starting agents |
349
+
350
+ ```javascript
351
+ ralph_batch_start({
352
+ prdPaths: [
353
+ "tasks/prd-auth.md",
354
+ "tasks/prd-dashboard.md",
355
+ "tasks/prd-settings.md"
356
+ ],
357
+ contextInjectionPath: "CLAUDE.md",
358
+ autoMerge: true
359
+ })
360
+ ```
361
+
362
+ ### ralph_retry
363
+
364
+ Retry a failed PRD execution. Resets stagnation counters and generates a new agent prompt to continue from where it left off.
365
+
366
+ ```javascript
367
+ // Retry a failed execution
368
+ ralph_retry({ branch: "ralph/prd-feature" })
369
+ // Returns: { success, branch, message, previousStatus, agentPrompt, progress }
370
+ ```
371
+
372
+ ### ralph_reset_stagnation
373
+
374
+ Reset stagnation counters after manual intervention. Use when you've fixed an issue and want the agent to continue.
375
+
376
+ | Option | Default | Description |
377
+ |--------|---------|-------------|
378
+ | `branch` | required | Branch name |
379
+ | `resumeExecution` | `true` | Also set status back to 'running' if currently 'failed' |
380
+
381
+ ```javascript
382
+ // Reset counters and resume
383
+ ralph_reset_stagnation({ branch: "ralph/prd-feature" })
384
+
385
+ // Reset counters only (keep failed status)
386
+ ralph_reset_stagnation({ branch: "ralph/prd-feature", resumeExecution: false })
387
+ ```
388
+
294
389
  ## Credits
295
390
 
296
391
  - [Geoffrey Huntley](https://ghuntley.com/) - Original Ralph pattern
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "MCP server for autonomous PRD execution with Claude Code. Git worktree isolation, progress tracking, auto-merge.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",