opencode-swarm-plugin 0.62.2 → 0.63.1
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/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/commands/ralph.md +157 -0
- package/claude-plugin/dist/schemas/ralph.d.ts +622 -0
- package/claude-plugin/dist/schemas/ralph.d.ts.map +1 -0
- package/claude-plugin/skills/always-on-guidance/SKILL.md +4 -10
- package/claude-plugin/skills/ralph-supervisor/SKILL.md +198 -0
- package/claude-plugin/skills/swarm-cli/SKILL.md +4 -2
- package/claude-plugin/skills/swarm-coordination/SKILL.md +96 -11
- package/dist/ralph-supervisor.d.ts +248 -0
- package/dist/ralph-supervisor.d.ts.map +1 -0
- package/dist/schemas/ralph.d.ts +622 -0
- package/dist/schemas/ralph.d.ts.map +1 -0
- package/package.json +3 -3
- package/claude-plugin/skills/release/SKILL.md +0 -101
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run ralph supervisor loop with Codex as executor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are a ralph supervisor. Claude supervises while Codex executes implementation work.
|
|
6
|
+
|
|
7
|
+
## Task
|
|
8
|
+
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
|
|
11
|
+
## Ralph Pattern Overview
|
|
12
|
+
|
|
13
|
+
Ralph is a supervisor/executor pattern:
|
|
14
|
+
- **Supervisor (Claude)**: Plans stories, reviews work, coordinates
|
|
15
|
+
- **Executor (Codex)**: Implements each story in isolated context
|
|
16
|
+
|
|
17
|
+
Key benefits:
|
|
18
|
+
- **Fresh context per iteration** - Codex starts clean, no drift
|
|
19
|
+
- **Validation gates** - Tests must pass before story is marked complete
|
|
20
|
+
- **Git-backed persistence** - Commits preserve completed work
|
|
21
|
+
- **Progress carryover** - Learnings flow forward via progress.txt
|
|
22
|
+
|
|
23
|
+
## Flags
|
|
24
|
+
|
|
25
|
+
- `--init` - Initialize a new ralph project
|
|
26
|
+
- `--dry-run` - Show what would happen without executing
|
|
27
|
+
- `--sync` - Run loop synchronously (blocks until complete)
|
|
28
|
+
- `--model <model>` - Codex model to use (default: gpt-5.3-codex)
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
### 1. Initialize Project (first time only)
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
ralph_init({ project_name: "My Project", description: "..." })
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Creates:
|
|
39
|
+
- `prd.json` - Product Requirements Document with stories
|
|
40
|
+
- `progress.txt` - Accumulated learnings
|
|
41
|
+
|
|
42
|
+
### 2. Add Stories
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
ralph_story({
|
|
46
|
+
title: "Add user authentication",
|
|
47
|
+
description: "Implement login/logout with JWT tokens...",
|
|
48
|
+
priority: 1,
|
|
49
|
+
validation_command: "npm test && npm run typecheck",
|
|
50
|
+
acceptance_criteria: '["JWT token generation works", "Refresh token flow implemented"]'
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Run Iterations
|
|
55
|
+
|
|
56
|
+
**Single iteration:**
|
|
57
|
+
```
|
|
58
|
+
ralph_iterate({ model: "gpt-5.3-codex", sandbox: "workspace-write" })
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Full loop (async by default):**
|
|
62
|
+
```
|
|
63
|
+
ralph_loop({ max_iterations: 20, stop_on_failure: false })
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 4. Monitor Progress
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
ralph_status() # Project overview
|
|
70
|
+
ralph_status({ job_id: "ralph-123..." }) # Specific job
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 5. Review Completed Work
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
ralph_review({ story_id: "story-123", approve: true })
|
|
77
|
+
ralph_review({ story_id: "story-456", approve: false, feedback: "Missing error handling" })
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Supervisor Responsibilities
|
|
81
|
+
|
|
82
|
+
As the supervisor, you should:
|
|
83
|
+
|
|
84
|
+
1. **Define clear stories** - Each should fit in one Codex context window
|
|
85
|
+
2. **Set validation commands** - Tests that verify the work is correct
|
|
86
|
+
3. **Review completed work** - Approve or reject with feedback
|
|
87
|
+
4. **Track progress** - Monitor status, handle failures
|
|
88
|
+
5. **Store learnings** - Use hivemind_store for persistent knowledge
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
92
|
+
│ SUPERVISOR GUIDELINES │
|
|
93
|
+
├─────────────────────────────────────────────────────────────┤
|
|
94
|
+
│ │
|
|
95
|
+
│ ✅ Break work into discrete stories │
|
|
96
|
+
│ ✅ Set clear acceptance criteria │
|
|
97
|
+
│ ✅ Review work quality, not just test pass │
|
|
98
|
+
│ ✅ Provide specific feedback when rejecting │
|
|
99
|
+
│ ✅ Store learnings in hivemind after completion │
|
|
100
|
+
│ │
|
|
101
|
+
│ ❌ Don't write implementation code yourself │
|
|
102
|
+
│ ❌ Don't skip validation steps │
|
|
103
|
+
│ ❌ Don't approve without reviewing │
|
|
104
|
+
│ ❌ Don't forget to check on long-running loops │
|
|
105
|
+
│ │
|
|
106
|
+
└─────────────────────────────────────────────────────────────┘
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Example Session
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Initialize
|
|
113
|
+
/swarm:ralph --init "Add OAuth integration"
|
|
114
|
+
|
|
115
|
+
# Add stories
|
|
116
|
+
/swarm:ralph "Add story: Implement OAuth provider config"
|
|
117
|
+
/swarm:ralph "Add story: Add session management"
|
|
118
|
+
/swarm:ralph "Add story: Create OAuth callback handler"
|
|
119
|
+
|
|
120
|
+
# Run the loop
|
|
121
|
+
/swarm:ralph "Start the loop with max 15 iterations"
|
|
122
|
+
|
|
123
|
+
# Check progress
|
|
124
|
+
/swarm:ralph "Show status"
|
|
125
|
+
|
|
126
|
+
# Review and approve
|
|
127
|
+
/swarm:ralph "Review story-123, approve it"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Tools Available
|
|
131
|
+
|
|
132
|
+
| Tool | Purpose |
|
|
133
|
+
|------|---------|
|
|
134
|
+
| `ralph_init` | Initialize project (prd.json + progress.txt) |
|
|
135
|
+
| `ralph_story` | Add a story to the PRD |
|
|
136
|
+
| `ralph_iterate` | Run single iteration |
|
|
137
|
+
| `ralph_loop` | Run full loop until done |
|
|
138
|
+
| `ralph_status` | Get project or job status |
|
|
139
|
+
| `ralph_cancel` | Cancel a running loop |
|
|
140
|
+
| `ralph_review` | Approve or reject completed work |
|
|
141
|
+
|
|
142
|
+
## Integration with Swarm Tools
|
|
143
|
+
|
|
144
|
+
Ralph integrates with:
|
|
145
|
+
- **Hive** - Stories can be tracked as hive cells (set `use_hive: true` in init)
|
|
146
|
+
- **Hivemind** - Store learnings with `hivemind_store`
|
|
147
|
+
- **Swarmmail** - File reservations for coordination
|
|
148
|
+
|
|
149
|
+
## When to Use Ralph vs Swarm
|
|
150
|
+
|
|
151
|
+
| Use Ralph | Use Swarm |
|
|
152
|
+
|-----------|-----------|
|
|
153
|
+
| Sequential tasks | Parallel independent tasks |
|
|
154
|
+
| Needs human review | Fully autonomous |
|
|
155
|
+
| Complex validation | Simple test suites |
|
|
156
|
+
| Learning accumulation | One-shot execution |
|
|
157
|
+
| Codex as executor | Claude workers |
|