opencodekit 0.14.1 → 0.14.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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/.background-tasks.json +96 -0
- package/dist/template/.opencode/.ralph-state.json +12 -0
- package/dist/template/.opencode/AGENTS.md +76 -5
- package/dist/template/.opencode/agent/build.md +45 -8
- package/dist/template/.opencode/agent/looker.md +124 -0
- package/dist/template/.opencode/agent/planner.md +93 -0
- package/dist/template/.opencode/agent/rush.md +36 -6
- package/dist/template/.opencode/agent/scout.md +0 -1
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/command/implement.md +51 -10
- package/dist/template/.opencode/command/new-feature.md +68 -10
- package/dist/template/.opencode/command/plan.md +59 -10
- package/dist/template/.opencode/command/ralph-loop.md +97 -0
- package/dist/template/.opencode/command/start.md +13 -10
- package/dist/template/.opencode/memory/{project/beads-workflow.md → beads-workflow.md} +53 -0
- package/dist/template/.opencode/memory/project/conventions.md +53 -3
- package/dist/template/.opencode/opencode.json +7 -3
- package/dist/template/.opencode/package.json +2 -1
- package/dist/template/.opencode/plugin/lsp.ts +304 -0
- package/dist/template/.opencode/plugin/ralph-wiggum.ts +182 -0
- package/dist/template/.opencode/tool/background.ts +461 -0
- package/dist/template/.opencode/tool/ralph.ts +203 -0
- package/package.json +1 -1
- /package/dist/template/.opencode/memory/{project/README.md → README.md} +0 -0
- /package/dist/template/.opencode/plugin/{notification.ts → notification.ts.bak} +0 -0
|
@@ -55,6 +55,38 @@ bd ready --json | grep -q "$ARGUMENTS"
|
|
|
55
55
|
|
|
56
56
|
→ Work on ready subtasks instead: `/implement <subtask-id>`
|
|
57
57
|
|
|
58
|
+
**Or execute READY subtasks in parallel:**
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Get all READY subtasks for this epic
|
|
62
|
+
// bd list --parent $ARGUMENTS --status=open --json
|
|
63
|
+
|
|
64
|
+
// Fire all READY subtasks in parallel with beads integration
|
|
65
|
+
background_start({
|
|
66
|
+
agent: "build",
|
|
67
|
+
prompt: `Execute bd-subtask1: [Subtask description]
|
|
68
|
+
|
|
69
|
+
Context: Part of epic $ARGUMENTS
|
|
70
|
+
|
|
71
|
+
Requirements:
|
|
72
|
+
- Complete all work items
|
|
73
|
+
- Run verification commands
|
|
74
|
+
- Commit with bead ID in message`,
|
|
75
|
+
beadId: "bd-subtask1",
|
|
76
|
+
autoCloseBead: true,
|
|
77
|
+
title: "subtask-1"
|
|
78
|
+
}) // Fire more for each READY subtask...
|
|
79
|
+
|
|
80
|
+
// Collect results - beads auto-close on success
|
|
81
|
+
background_output({ taskId: "bg_..." }) // → beadClosed: true
|
|
82
|
+
|
|
83
|
+
// Check newly unblocked subtasks
|
|
84
|
+
bd ready // → Next wave now READY
|
|
85
|
+
|
|
86
|
+
// Cleanup
|
|
87
|
+
background_cancel({ all: true })
|
|
88
|
+
```
|
|
89
|
+
|
|
58
90
|
## Git State Check
|
|
59
91
|
|
|
60
92
|
```bash
|
|
@@ -156,36 +188,45 @@ If memory search fails (Ollama not running), continue without it.
|
|
|
156
188
|
|
|
157
189
|
## Parallel Subagent Research (if --parallel or complex task)
|
|
158
190
|
|
|
159
|
-
**Delegation Pattern: Fire
|
|
191
|
+
**Delegation Pattern: Fire in Background, Collect When Needed**
|
|
160
192
|
|
|
161
|
-
For complex tasks, launch research subagents in
|
|
193
|
+
For complex tasks, launch research subagents in background before diving into code:
|
|
162
194
|
|
|
163
195
|
```typescript
|
|
164
196
|
// Codebase patterns - find similar implementations
|
|
165
|
-
|
|
166
|
-
|
|
197
|
+
background_start({
|
|
198
|
+
agent: "explore",
|
|
167
199
|
prompt: `For implementing $ARGUMENTS, find:
|
|
168
200
|
1. Similar patterns in this codebase (grep/ast-grep)
|
|
169
201
|
2. Related test files and testing patterns
|
|
170
202
|
3. Configuration or setup requirements
|
|
171
203
|
Return: File paths, code patterns, test approach`,
|
|
172
|
-
|
|
173
|
-
});
|
|
204
|
+
title: "explore-patterns",
|
|
205
|
+
}); // → bg_123_abc
|
|
174
206
|
|
|
175
207
|
// External best practices - library docs
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
background_start({
|
|
209
|
+
agent: "scout",
|
|
178
210
|
prompt: `Research best practices for $ARGUMENTS:
|
|
179
211
|
1. Official documentation for libraries involved
|
|
180
212
|
2. Common implementation patterns (Context7, GitHub)
|
|
181
213
|
3. Known pitfalls or gotchas
|
|
182
214
|
Return: Code examples, API usage, warnings`,
|
|
183
|
-
|
|
184
|
-
});
|
|
215
|
+
title: "scout-docs",
|
|
216
|
+
}); // → bg_456_def
|
|
185
217
|
|
|
186
218
|
// Continue working immediately - don't wait for results
|
|
219
|
+
// Collect later with: background_output({ taskId: "bg_123_abc" })
|
|
187
220
|
```
|
|
188
221
|
|
|
222
|
+
**Background Task Tools:**
|
|
223
|
+
| Tool | Purpose |
|
|
224
|
+
| ---- | ------- |
|
|
225
|
+
| `background_start` | Fire subagent in background, returns task_id |
|
|
226
|
+
| `background_output` | Collect results from completed task |
|
|
227
|
+
| `background_list` | See all tasks and their status |
|
|
228
|
+
| `background_cancel` | Cancel running tasks (single or all) |
|
|
229
|
+
|
|
189
230
|
**Subagent Rules:**
|
|
190
231
|
| Agent | Use For | Can Do | Cannot Do |
|
|
191
232
|
| -------- | ------------------------------ | ---------------- | ---------------- |
|
|
@@ -54,27 +54,29 @@ Before creating anything, understand the landscape.
|
|
|
54
54
|
### Parallel Subagent Research
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
// Fire both in
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// Fire both in background - collect results when needed
|
|
58
|
+
background_start({
|
|
59
|
+
agent: "explore",
|
|
60
60
|
prompt: `Research codebase for "${$ARGUMENTS}":
|
|
61
61
|
1. Find similar implementations or patterns
|
|
62
62
|
2. Identify likely affected directories
|
|
63
63
|
3. Find existing tests in related areas
|
|
64
64
|
4. Check for related beads (open or closed)
|
|
65
65
|
Return: File paths, patterns, test locations, related beads`,
|
|
66
|
-
|
|
67
|
-
});
|
|
66
|
+
title: "explore-codebase",
|
|
67
|
+
}); // → bg_123_abc
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
background_start({
|
|
70
|
+
agent: "scout",
|
|
71
71
|
prompt: `Research best practices for "${$ARGUMENTS}":
|
|
72
72
|
1. Industry patterns for this type of feature
|
|
73
73
|
2. Library/framework recommendations
|
|
74
74
|
3. Common pitfalls to avoid
|
|
75
75
|
Return: Recommendations, code examples, warnings`,
|
|
76
|
-
|
|
77
|
-
});
|
|
76
|
+
title: "scout-practices",
|
|
77
|
+
}); // → bg_456_def
|
|
78
|
+
|
|
79
|
+
// Continue working - collect later with background_output()
|
|
78
80
|
```
|
|
79
81
|
|
|
80
82
|
### Check Existing Work
|
|
@@ -451,7 +453,63 @@ npm test
|
|
|
451
453
|
|
|
452
454
|
---
|
|
453
455
|
|
|
454
|
-
## Phase 8:
|
|
456
|
+
## Phase 8: Parallel Task Execution (Optional)
|
|
457
|
+
|
|
458
|
+
If multiple tasks are READY (no blockers), execute them in parallel:
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
# Check what's ready
|
|
462
|
+
bd ready --json
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
```typescript
|
|
466
|
+
// Fire all READY tasks in parallel with auto-close
|
|
467
|
+
background_start({
|
|
468
|
+
agent: "build",
|
|
469
|
+
prompt: `Execute bd-xxx1: [Task 1 description]
|
|
470
|
+
|
|
471
|
+
Context: This is part of epic [epic-id] for $ARGUMENTS
|
|
472
|
+
|
|
473
|
+
Requirements:
|
|
474
|
+
- Complete all work items in the task spec
|
|
475
|
+
- Run verification commands
|
|
476
|
+
- Commit changes with bead ID in message
|
|
477
|
+
|
|
478
|
+
Return: Summary of changes, files modified, verification results`,
|
|
479
|
+
beadId: "bd-xxx1",
|
|
480
|
+
autoCloseBead: true,
|
|
481
|
+
title: "task-1-execution"
|
|
482
|
+
}) // → bg_task1
|
|
483
|
+
|
|
484
|
+
background_start({
|
|
485
|
+
agent: "build",
|
|
486
|
+
prompt: `Execute bd-xxx2: [Task 2 description]...`,
|
|
487
|
+
beadId: "bd-xxx2",
|
|
488
|
+
autoCloseBead: true,
|
|
489
|
+
title: "task-2-execution"
|
|
490
|
+
}) // → bg_task2
|
|
491
|
+
|
|
492
|
+
// Collect results when done
|
|
493
|
+
background_output({ taskId: "bg_task1" }) // → beadClosed: true
|
|
494
|
+
background_output({ taskId: "bg_task2" }) // → beadClosed: true
|
|
495
|
+
|
|
496
|
+
// Check what's now unblocked
|
|
497
|
+
bd ready // → Tasks that were blocked by xxx1, xxx2 now READY
|
|
498
|
+
|
|
499
|
+
// Cleanup
|
|
500
|
+
background_cancel({ all: true })
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
**Parallel Execution Rules:**
|
|
504
|
+
|
|
505
|
+
- Only fire tasks that are READY (no unresolved blockers)
|
|
506
|
+
- Each background task gets its own build agent session
|
|
507
|
+
- Beads auto-close on successful completion
|
|
508
|
+
- Check `bd ready` after each batch to find newly unblocked tasks
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## Phase 9: Sync and Report
|
|
455
513
|
|
|
456
514
|
```bash
|
|
457
515
|
bd sync
|
|
@@ -73,31 +73,35 @@ If memory search fails (Ollama not running), continue to subagent research.
|
|
|
73
73
|
|
|
74
74
|
## Phase 1: Parallel Subagent Research
|
|
75
75
|
|
|
76
|
-
Gather context before designing. Fire both in
|
|
76
|
+
Gather context before designing. Fire both in background:
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
79
|
// Codebase patterns
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
background_start({
|
|
81
|
+
agent: "explore",
|
|
82
82
|
prompt: `For planning $ARGUMENTS, research the codebase:
|
|
83
83
|
1. Find similar implementations or patterns
|
|
84
84
|
2. Identify affected files and their structure
|
|
85
85
|
3. Find related tests and testing patterns
|
|
86
86
|
4. Check for potential conflicts with in-progress work
|
|
87
87
|
Return: File paths, code patterns, test approach, conflicts`,
|
|
88
|
-
|
|
89
|
-
});
|
|
88
|
+
title: "explore-for-plan",
|
|
89
|
+
}); // → bg_123_abc
|
|
90
90
|
|
|
91
91
|
// External best practices
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
background_start({
|
|
93
|
+
agent: "scout",
|
|
94
94
|
prompt: `Research implementation approaches for $ARGUMENTS:
|
|
95
95
|
1. Best practices from official documentation
|
|
96
96
|
2. Common patterns in open source projects
|
|
97
97
|
3. Pitfalls and anti-patterns to avoid
|
|
98
98
|
Return: Recommendations, code examples, warnings`,
|
|
99
|
-
|
|
100
|
-
});
|
|
99
|
+
title: "scout-for-plan",
|
|
100
|
+
}); // → bg_456_def
|
|
101
|
+
|
|
102
|
+
// Collect when ready
|
|
103
|
+
background_output({ taskId: "bg_123_abc" });
|
|
104
|
+
background_output({ taskId: "bg_456_def" });
|
|
101
105
|
```
|
|
102
106
|
|
|
103
107
|
**Continue working while subagents research.**
|
|
@@ -413,7 +417,52 @@ If issues detected after deployment:
|
|
|
413
417
|
|
|
414
418
|
---
|
|
415
419
|
|
|
416
|
-
## Phase 7:
|
|
420
|
+
## Phase 7: Parallel Task Execution (if --parallel)
|
|
421
|
+
|
|
422
|
+
After creating hierarchy, execute READY tasks in parallel:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
# Check what's ready to start
|
|
426
|
+
bd ready --json
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
// Fire all READY tasks in parallel with beads integration
|
|
431
|
+
for (const task of readyTasks) {
|
|
432
|
+
background_start({
|
|
433
|
+
agent: "build",
|
|
434
|
+
prompt: `Execute ${task.id}: ${task.title}
|
|
435
|
+
|
|
436
|
+
Context: Part of plan for $ARGUMENTS
|
|
437
|
+
Spec: See .beads/artifacts/$ARGUMENTS/plan.md
|
|
438
|
+
|
|
439
|
+
Requirements:
|
|
440
|
+
- Complete work items for this task
|
|
441
|
+
- Run verification commands from plan
|
|
442
|
+
- Commit with bead ID in message
|
|
443
|
+
|
|
444
|
+
Return: Changes made, verification results`,
|
|
445
|
+
beadId: task.id,
|
|
446
|
+
autoCloseBead: true,
|
|
447
|
+
title: `exec-${task.id}`
|
|
448
|
+
})
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// Collect results
|
|
452
|
+
for (const taskId of backgroundTaskIds) {
|
|
453
|
+
background_output({ taskId }) // → beadClosed: true
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Check newly unblocked tasks
|
|
457
|
+
bd ready // → Next wave of tasks now READY
|
|
458
|
+
|
|
459
|
+
// Cleanup
|
|
460
|
+
background_cancel({ all: true })
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Phase 8: Sync and Report
|
|
417
466
|
|
|
418
467
|
```bash
|
|
419
468
|
bd sync
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start Ralph Wiggum autonomous loop for task completion
|
|
3
|
+
argument-hint: "<task> [--prd <file>] [--max <iterations>] [--afk]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ralph Wiggum Loop
|
|
8
|
+
|
|
9
|
+
You are starting a Ralph Wiggum autonomous loop. This pattern enables you to work autonomously on a task list until completion.
|
|
10
|
+
|
|
11
|
+
## Task
|
|
12
|
+
|
|
13
|
+
$ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
1. **Start the loop** by calling the `ralph-start` tool:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
ralph -
|
|
21
|
+
start({
|
|
22
|
+
task: "$1",
|
|
23
|
+
prdFile: "$2" || null, // Optional: PRD.md, tasks.md, etc.
|
|
24
|
+
progressFile: "progress.txt",
|
|
25
|
+
maxIterations: 50,
|
|
26
|
+
mode: "hitl", // or "afk" for autonomous
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
2. **Create progress.txt** if it doesn't exist:
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# Progress Log
|
|
34
|
+
|
|
35
|
+
## Session Started: [date]
|
|
36
|
+
|
|
37
|
+
### Completed Tasks
|
|
38
|
+
|
|
39
|
+
(none yet)
|
|
40
|
+
|
|
41
|
+
### Notes for Next Iteration
|
|
42
|
+
|
|
43
|
+
- Starting fresh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Loop Behavior
|
|
47
|
+
|
|
48
|
+
After each iteration, the loop will automatically:
|
|
49
|
+
|
|
50
|
+
1. Check if you output `<promise>COMPLETE</promise>`
|
|
51
|
+
2. If yes → Loop ends, success!
|
|
52
|
+
3. If no → Send continuation prompt for next iteration
|
|
53
|
+
4. Repeat until completion or max iterations
|
|
54
|
+
|
|
55
|
+
## Your Instructions
|
|
56
|
+
|
|
57
|
+
For each iteration:
|
|
58
|
+
|
|
59
|
+
1. **Review** the PRD/task list and progress file
|
|
60
|
+
2. **Choose** the highest-priority incomplete task (YOU decide, not first in list)
|
|
61
|
+
3. **Implement** ONE feature only (small steps prevent context rot)
|
|
62
|
+
4. **Validate** with feedback loops:
|
|
63
|
+
- `npm run typecheck` (must pass)
|
|
64
|
+
- `npm run test` (must pass)
|
|
65
|
+
- `npm run lint` (must pass)
|
|
66
|
+
5. **Commit** if all pass
|
|
67
|
+
6. **Update** progress.txt with:
|
|
68
|
+
- Task completed
|
|
69
|
+
- Key decisions made
|
|
70
|
+
- Files changed
|
|
71
|
+
- Notes for next iteration
|
|
72
|
+
|
|
73
|
+
## Exit Conditions
|
|
74
|
+
|
|
75
|
+
Output `<promise>COMPLETE</promise>` when:
|
|
76
|
+
|
|
77
|
+
- ALL tasks in the PRD are complete
|
|
78
|
+
- ALL feedback loops pass
|
|
79
|
+
- Code is committed
|
|
80
|
+
|
|
81
|
+
The loop will also stop if:
|
|
82
|
+
|
|
83
|
+
- Max iterations reached
|
|
84
|
+
- You call `ralph-stop` tool
|
|
85
|
+
- An error occurs
|
|
86
|
+
|
|
87
|
+
## Best Practices
|
|
88
|
+
|
|
89
|
+
- **Small steps**: One feature per iteration
|
|
90
|
+
- **Quality over speed**: Never skip tests
|
|
91
|
+
- **Explicit scope**: Vague tasks loop forever
|
|
92
|
+
- **Track progress**: Update progress.txt every iteration
|
|
93
|
+
- **Prioritize risk**: Hard tasks first, easy wins last
|
|
94
|
+
|
|
95
|
+
## Start Now
|
|
96
|
+
|
|
97
|
+
Call `ralph-start` with the task description to begin the loop.
|
|
@@ -169,33 +169,36 @@ cd .worktrees/$ARGUMENTS
|
|
|
169
169
|
For complex tasks, gather context before diving in:
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
|
-
// Fire subagents in
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
// Fire subagents in background - don't wait for results
|
|
173
|
+
background_start({
|
|
174
|
+
agent: "explore",
|
|
175
175
|
prompt: `Research codebase patterns for $ARGUMENTS:
|
|
176
176
|
- Find similar implementations
|
|
177
177
|
- Identify affected files
|
|
178
178
|
- Note testing patterns used
|
|
179
179
|
Return: File list, patterns found, testing approach`,
|
|
180
|
-
|
|
181
|
-
});
|
|
180
|
+
title: "explore-codebase",
|
|
181
|
+
}); // → bg_123_abc
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
background_start({
|
|
184
|
+
agent: "scout",
|
|
185
185
|
prompt: `Research external docs for $ARGUMENTS:
|
|
186
186
|
- API documentation for libraries involved
|
|
187
187
|
- Best practices for the approach
|
|
188
188
|
- Common pitfalls to avoid
|
|
189
189
|
Return: Key findings, code examples, warnings`,
|
|
190
|
-
|
|
191
|
-
});
|
|
190
|
+
title: "scout-docs",
|
|
191
|
+
}); // → bg_456_def
|
|
192
|
+
|
|
193
|
+
// Collect later with: background_output({ taskId: "bg_123_abc" })
|
|
192
194
|
```
|
|
193
195
|
|
|
194
196
|
**Subagent delegation rules:**
|
|
195
197
|
|
|
196
198
|
- Subagents are **read-only** - they don't modify beads state
|
|
197
|
-
- Results
|
|
199
|
+
- Results collected via `background_output({ taskId })` when ready
|
|
198
200
|
- Use for research, not for implementation
|
|
201
|
+
- Cleanup at session end: `background_cancel({ all: true })`
|
|
199
202
|
|
|
200
203
|
## Existing Artifacts
|
|
201
204
|
|
|
@@ -426,6 +426,59 @@ git worktree remove .worktrees/bd-epic # Cleanup worktree
|
|
|
426
426
|
/finish bd-epic
|
|
427
427
|
```
|
|
428
428
|
|
|
429
|
+
### Pattern 8: Ralph Wiggum Autonomous Loop
|
|
430
|
+
|
|
431
|
+
For tasks that can run autonomously until completion. The agent loops until it outputs `<promise>COMPLETE</promise>` or hits max iterations.
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
/ralph-loop "Migrate all Jest tests to Vitest"
|
|
435
|
+
# Or with PRD file:
|
|
436
|
+
/ralph-loop "Complete PRD tasks" --prd PRD.md --max 50
|
|
437
|
+
|
|
438
|
+
# Agent automatically:
|
|
439
|
+
# 1. Picks highest-priority incomplete task
|
|
440
|
+
# 2. Implements ONE feature
|
|
441
|
+
# 3. Runs feedback loops (typecheck, test, lint)
|
|
442
|
+
# 4. Commits if all pass
|
|
443
|
+
# 5. Updates progress.txt
|
|
444
|
+
# 6. Loops until <promise>COMPLETE</promise> or max iterations
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**When to use Ralph:**
|
|
448
|
+
|
|
449
|
+
| Scenario | Use Ralph? | Why |
|
|
450
|
+
| ------------------------- | ---------- | ------------------------------------ |
|
|
451
|
+
| Test coverage improvement | ✅ Yes | Clear success criteria, safe to loop |
|
|
452
|
+
| Linting fixes | ✅ Yes | Deterministic, feedback-driven |
|
|
453
|
+
| Migration (Jest→Vitest) | ✅ Yes | Repetitive, well-defined end state |
|
|
454
|
+
| Feature implementation | ⚠️ HITL | Need oversight for design decisions |
|
|
455
|
+
| Architectural changes | ❌ No | Too risky for autonomous work |
|
|
456
|
+
| Vague "improve X" tasks | ❌ No | No clear completion criteria |
|
|
457
|
+
|
|
458
|
+
**Ralph + Beads Integration:**
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
# Create PRD from beads
|
|
462
|
+
bd list --status=open --json > PRD.json
|
|
463
|
+
|
|
464
|
+
# Start Ralph loop
|
|
465
|
+
/ralph-loop "Complete all open tasks" --prd PRD.json
|
|
466
|
+
|
|
467
|
+
# Ralph will work through tasks, you can:
|
|
468
|
+
ralph-status # Check progress
|
|
469
|
+
ralph-stop # Stop gracefully
|
|
470
|
+
|
|
471
|
+
# After completion, sync beads
|
|
472
|
+
bd sync
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
**Key constraints:**
|
|
476
|
+
|
|
477
|
+
- ONE feature per iteration (prevents context rot)
|
|
478
|
+
- MUST pass all feedback loops before commit
|
|
479
|
+
- Small steps > large changes
|
|
480
|
+
- Always cap iterations (never infinite loops)
|
|
481
|
+
|
|
429
482
|
## Agent Boundaries
|
|
430
483
|
|
|
431
484
|
### Leader Agents (Touch Beads)
|
|
@@ -111,10 +111,60 @@ This transforms passive detection into active agent behavior (e.g., Memory plugi
|
|
|
111
111
|
|
|
112
112
|
## Agent Behavior Rules
|
|
113
113
|
|
|
114
|
-
###
|
|
114
|
+
### MANDATORY LSP-First Workflow
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
**HARD RULE**: Before editing ANY code file, you MUST use LSP tools first.
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
grep/read → LSP → understand → THEN edit
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**After EVERY grep/glob/read that returns code files:**
|
|
123
|
+
|
|
124
|
+
1. **IMMEDIATELY** call `lsp` with `documentSymbol` to understand file structure
|
|
125
|
+
2. **IMMEDIATELY** call `lsp` with `findReferences` on symbols you'll modify
|
|
126
|
+
3. **IMMEDIATELY** call `lsp` with `goToDefinition` to trace dependencies
|
|
127
|
+
4. **USE** additional LSP operations as needed:
|
|
128
|
+
- `hover` - Get type info and documentation
|
|
129
|
+
- `goToImplementation` - Find implementations of interface/abstract
|
|
130
|
+
- `workspaceSymbol` - Search symbols across entire workspace
|
|
131
|
+
- `prepareCallHierarchy` - Get call hierarchy item at position
|
|
132
|
+
- `incomingCalls` - Find what calls this function
|
|
133
|
+
- `outgoingCalls` - Find what this function calls
|
|
134
|
+
5. **ONLY THEN** proceed with edits
|
|
135
|
+
|
|
136
|
+
**Example - The Correct Flow:**
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
User: "Fix the auth bug in src/auth.ts"
|
|
140
|
+
|
|
141
|
+
# Step 1: Read the file
|
|
142
|
+
read({ filePath: "src/auth.ts" })
|
|
143
|
+
|
|
144
|
+
# Step 2: MANDATORY LSP (before ANY edit) - use ALL relevant operations
|
|
145
|
+
lsp({ operation: "documentSymbol", filePath: "src/auth.ts", line: 1, character: 1 })
|
|
146
|
+
lsp({ operation: "findReferences", filePath: "src/auth.ts", line: 42, character: 10 })
|
|
147
|
+
lsp({ operation: "goToDefinition", filePath: "src/auth.ts", line: 42, character: 10 })
|
|
148
|
+
lsp({ operation: "hover", filePath: "src/auth.ts", line: 42, character: 10 })
|
|
149
|
+
lsp({ operation: "incomingCalls", filePath: "src/auth.ts", line: 42, character: 10 })
|
|
150
|
+
lsp({ operation: "outgoingCalls", filePath: "src/auth.ts", line: 42, character: 10 })
|
|
151
|
+
|
|
152
|
+
# Step 3: NOW you can edit
|
|
153
|
+
edit({ filePath: "src/auth.ts", ... })
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Why This Matters:**
|
|
157
|
+
|
|
158
|
+
- LSP gives you semantic understanding (types, references, call hierarchy)
|
|
159
|
+
- grep/read only gives you text (no understanding of relationships)
|
|
160
|
+
- Editing without LSP context leads to broken refactors
|
|
161
|
+
|
|
162
|
+
**Violations:**
|
|
163
|
+
|
|
164
|
+
- ❌ `read → edit` (WRONG - no LSP)
|
|
165
|
+
- ❌ `grep → edit` (WRONG - no LSP)
|
|
166
|
+
- ✅ `read → LSP → edit` (CORRECT)
|
|
167
|
+
- ✅ `grep → read → LSP → edit` (CORRECT)
|
|
118
168
|
|
|
119
169
|
## Patterns to Avoid
|
|
120
170
|
|
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
},
|
|
8
8
|
"compaction": {
|
|
9
9
|
"description": "Session summarizer for context continuity across compactions",
|
|
10
|
-
"model": "
|
|
10
|
+
"model": "proxypal/gemini-2.5-flash"
|
|
11
11
|
},
|
|
12
12
|
"explore": {
|
|
13
13
|
"description": "Fast codebase search specialist",
|
|
14
|
-
"model": "
|
|
14
|
+
"model": "proxypal/gemini-3-flash-preview"
|
|
15
|
+
},
|
|
16
|
+
"looker": {
|
|
17
|
+
"description": "Media extraction specialist for images, PDFs, diagrams",
|
|
18
|
+
"model": "proxypal/gemini-3-flash-preview"
|
|
15
19
|
},
|
|
16
20
|
"general": {
|
|
17
21
|
"disable": true
|
|
@@ -506,7 +510,7 @@
|
|
|
506
510
|
}
|
|
507
511
|
},
|
|
508
512
|
"share": "manual",
|
|
509
|
-
"small_model": "
|
|
513
|
+
"small_model": "proxypal/gemini-2.5-flash-lite",
|
|
510
514
|
"tui": {
|
|
511
515
|
"diff_style": "auto",
|
|
512
516
|
"scroll_acceleration": {
|