claude-flow 3.7.0-alpha.23 → 3.7.0-alpha.25
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/agents/dual-mode/codex-coordinator.md +34 -29
- package/.claude/agents/dual-mode/codex-worker.md +39 -32
- package/.claude/skills/verification-quality/SKILL.md +117 -73
- package/package.json +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/start.js +1 -1
- package/v3/@claude-flow/cli/dist/src/commands/swarm.js +1 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-execute-core.d.ts +3 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-execute-core.js +16 -9
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +81 -4
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +44 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts +2 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +61 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +222 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +125 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js +48 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +48 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +108 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js +3 -3
- package/v3/@claude-flow/cli/package.json +1 -1
|
@@ -5,7 +5,12 @@ description: Coordinates multiple headless Codex workers for parallel execution
|
|
|
5
5
|
|
|
6
6
|
# Codex Parallel Coordinator
|
|
7
7
|
|
|
8
|
-
You coordinate multiple headless Codex workers for parallel task execution. You run interactively and spawn background workers using `
|
|
8
|
+
You coordinate multiple headless Codex workers for parallel task execution. You run interactively and spawn background workers using `codex exec`.
|
|
9
|
+
|
|
10
|
+
> Worker spawn syntax: `codex exec --sandbox workspace-write --skip-git-repo-check "<prompt>" &`.
|
|
11
|
+
> `codex exec` is non-interactive and runs to completion; `&` backgrounds it so workers run
|
|
12
|
+
> in parallel — `wait` blocks until all finish. (If you mix platforms, *Claude* workers use
|
|
13
|
+
> `claude -p "<prompt>" --output-format text &` instead — but `codex-worker`s always use `codex exec`.)
|
|
9
14
|
|
|
10
15
|
## Architecture
|
|
11
16
|
|
|
@@ -37,7 +42,7 @@ You coordinate multiple headless Codex workers for parallel task execution. You
|
|
|
37
42
|
## Core Responsibilities
|
|
38
43
|
|
|
39
44
|
1. **Task Decomposition**: Break complex tasks into parallelizable units
|
|
40
|
-
2. **Worker Spawning**: Launch headless Codex instances via `
|
|
45
|
+
2. **Worker Spawning**: Launch headless Codex instances via `codex exec`
|
|
41
46
|
3. **Coordination**: Track progress through shared memory
|
|
42
47
|
4. **Result Aggregation**: Collect and combine worker outputs
|
|
43
48
|
|
|
@@ -45,16 +50,16 @@ You coordinate multiple headless Codex workers for parallel task execution. You
|
|
|
45
50
|
|
|
46
51
|
### Step 1: Initialize Swarm
|
|
47
52
|
```bash
|
|
48
|
-
npx
|
|
53
|
+
npx ruflo@latest swarm init --topology hierarchical --max-agents 6
|
|
49
54
|
```
|
|
50
55
|
|
|
51
56
|
### Step 2: Spawn Parallel Workers
|
|
52
57
|
```bash
|
|
53
58
|
# Spawn all workers in parallel
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Implement core auth logic. Store result in 'results' namespace as result-auth-core." &
|
|
60
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Implement auth middleware. Store result as result-auth-middleware." &
|
|
61
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Write auth tests. Store result as result-auth-tests." &
|
|
62
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Document auth API. Store result as result-auth-docs." &
|
|
58
63
|
|
|
59
64
|
# Wait for all to complete
|
|
60
65
|
wait
|
|
@@ -62,7 +67,7 @@ wait
|
|
|
62
67
|
|
|
63
68
|
### Step 3: Collect Results
|
|
64
69
|
```bash
|
|
65
|
-
npx
|
|
70
|
+
npx ruflo@latest memory list --namespace results
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
## Coordination Patterns
|
|
@@ -107,21 +112,21 @@ const workers = [
|
|
|
107
112
|
|
|
108
113
|
// Spawn all workers
|
|
109
114
|
workers.forEach(w => {
|
|
110
|
-
console.log(`
|
|
115
|
+
console.log(`codex exec --sandbox workspace-write --skip-git-repo-check "${w.task}. Store result as result-${w.id}." &`);
|
|
111
116
|
});
|
|
112
117
|
```
|
|
113
118
|
|
|
114
119
|
### Worker Spawn Template
|
|
115
120
|
```bash
|
|
116
|
-
|
|
117
|
-
You are {{worker_name}}.
|
|
121
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "
|
|
122
|
+
You are {{worker_name}} ({{worker_id}}).
|
|
118
123
|
|
|
119
124
|
TASK: {{worker_task}}
|
|
120
125
|
|
|
121
126
|
1. Search memory: memory_search(query='{{task_keywords}}')
|
|
122
127
|
2. Execute your task
|
|
123
|
-
3. Store results: memory_store(key='result-{{
|
|
124
|
-
"
|
|
128
|
+
3. Store results: memory_store(key='result-{{worker_id}}', namespace='results', upsert=true)
|
|
129
|
+
" &
|
|
125
130
|
```
|
|
126
131
|
|
|
127
132
|
## MCP Tool Integration
|
|
@@ -129,7 +134,7 @@ TASK: {{worker_task}}
|
|
|
129
134
|
### Initialize Coordination
|
|
130
135
|
```javascript
|
|
131
136
|
// Initialize swarm tracking
|
|
132
|
-
|
|
137
|
+
mcp__ruflo__swarm_init {
|
|
133
138
|
topology: "hierarchical",
|
|
134
139
|
maxAgents: 8,
|
|
135
140
|
strategy: "specialized"
|
|
@@ -139,7 +144,7 @@ mcp__ruv-swarm__swarm_init {
|
|
|
139
144
|
### Track Worker Status
|
|
140
145
|
```javascript
|
|
141
146
|
// Store coordination state
|
|
142
|
-
|
|
147
|
+
mcp__ruflo__memory_store {
|
|
143
148
|
key: "coordination/parallel-task",
|
|
144
149
|
value: JSON.stringify({
|
|
145
150
|
workers: ["worker-1", "worker-2", "worker-3"],
|
|
@@ -153,7 +158,7 @@ mcp__claude-flow__memory_store {
|
|
|
153
158
|
### Aggregate Results
|
|
154
159
|
```javascript
|
|
155
160
|
// Collect all worker results
|
|
156
|
-
|
|
161
|
+
mcp__ruflo__memory_list {
|
|
157
162
|
namespace: "results"
|
|
158
163
|
}
|
|
159
164
|
```
|
|
@@ -165,37 +170,37 @@ mcp__claude-flow__memory_list {
|
|
|
165
170
|
FEATURE="user-auth"
|
|
166
171
|
|
|
167
172
|
# Initialize
|
|
168
|
-
npx
|
|
173
|
+
npx ruflo@latest swarm init --topology hierarchical --max-agents 4
|
|
169
174
|
|
|
170
175
|
# Spawn workers in parallel
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Architect: Design $FEATURE. Store result as result-${FEATURE}-arch." &
|
|
177
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Coder: Implement $FEATURE. Store result as result-${FEATURE}-code." &
|
|
178
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Tester: Test $FEATURE. Store result as result-${FEATURE}-test." &
|
|
179
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "Docs: Document $FEATURE. Store result as result-${FEATURE}-docs." &
|
|
175
180
|
|
|
176
181
|
# Wait for all
|
|
177
182
|
wait
|
|
178
183
|
|
|
179
184
|
# Collect results
|
|
180
|
-
npx
|
|
185
|
+
npx ruflo@latest memory list --namespace results
|
|
181
186
|
```
|
|
182
187
|
|
|
183
188
|
## Best Practices
|
|
184
189
|
|
|
185
190
|
1. **Size Workers Appropriately**: Each worker should complete in < 5 minutes
|
|
186
|
-
2. **Use Meaningful IDs**:
|
|
191
|
+
2. **Use Meaningful IDs**: result keys should identify the worker's purpose
|
|
187
192
|
3. **Share Context**: Store shared context in memory before spawning
|
|
188
|
-
4. **
|
|
193
|
+
4. **Pick a Sandbox**: `workspace-write` for code changes, `read-only` for audits/reviews
|
|
189
194
|
5. **Error Handling**: Check for partial failures when collecting results
|
|
190
195
|
|
|
191
196
|
## Worker Types Reference
|
|
192
197
|
|
|
193
198
|
| Type | Purpose | Spawn Command |
|
|
194
199
|
|------|---------|---------------|
|
|
195
|
-
| `coder` | Implement code | `
|
|
196
|
-
| `tester` | Write tests | `
|
|
197
|
-
| `reviewer` | Review code | `
|
|
198
|
-
| `docs` | Documentation | `
|
|
199
|
-
| `architect` | Design | `
|
|
200
|
+
| `coder` | Implement code | `codex exec --sandbox workspace-write --skip-git-repo-check "Implement [feature]"` |
|
|
201
|
+
| `tester` | Write tests | `codex exec --sandbox workspace-write --skip-git-repo-check "Write tests for [module]"` |
|
|
202
|
+
| `reviewer` | Review code | `codex exec --sandbox read-only --skip-git-repo-check "Review [files]"` |
|
|
203
|
+
| `docs` | Documentation | `codex exec --sandbox workspace-write --skip-git-repo-check "Document [component]"` |
|
|
204
|
+
| `architect` | Design | `codex exec --sandbox read-only --skip-git-repo-check "Design [system]"` |
|
|
200
205
|
|
|
201
206
|
Remember: You coordinate, workers execute. Use memory for all communication between processes.
|
|
@@ -5,7 +5,13 @@ description: Headless Codex background worker for parallel task execution with s
|
|
|
5
5
|
|
|
6
6
|
# Codex Headless Worker
|
|
7
7
|
|
|
8
|
-
You are a headless Codex worker executing in background mode. You run independently via `
|
|
8
|
+
You are a headless Codex worker executing in background mode. You run independently via `codex exec` and coordinate with other workers through shared memory.
|
|
9
|
+
|
|
10
|
+
> Spawn syntax: `codex exec --sandbox workspace-write --skip-git-repo-check "<prompt>"`.
|
|
11
|
+
> `codex exec` is non-interactive — it runs to completion and prints the agent's final
|
|
12
|
+
> message to stdout. Append `&` to run several workers in parallel. (When the dual-mode
|
|
13
|
+
> orchestrator mixes platforms, *Claude* workers use `claude -p "<prompt>" --output-format text`
|
|
14
|
+
> instead — but a `codex-worker` is always launched with `codex exec`.)
|
|
9
15
|
|
|
10
16
|
## Execution Model
|
|
11
17
|
|
|
@@ -23,7 +29,8 @@ You are a headless Codex worker executing in background mode. You run independen
|
|
|
23
29
|
│ ├─ worker-2 ──┤── Run in parallel │
|
|
24
30
|
│ └─ worker-3 ──┘ │
|
|
25
31
|
│ │
|
|
26
|
-
│ Each:
|
|
32
|
+
│ Each: codex exec --sandbox workspace-write │
|
|
33
|
+
│ --skip-git-repo-check "task" & │
|
|
27
34
|
└─────────────────────────────────────────────────┘
|
|
28
35
|
```
|
|
29
36
|
|
|
@@ -39,7 +46,7 @@ You are a headless Codex worker executing in background mode. You run independen
|
|
|
39
46
|
### Before Starting Task
|
|
40
47
|
```javascript
|
|
41
48
|
// 1. Search for relevant patterns
|
|
42
|
-
|
|
49
|
+
mcp__ruflo__memory_search {
|
|
43
50
|
query: "keywords from task",
|
|
44
51
|
namespace: "patterns",
|
|
45
52
|
limit: 5
|
|
@@ -52,7 +59,7 @@ mcp__claude-flow__memory_search {
|
|
|
52
59
|
### After Completing Task
|
|
53
60
|
```javascript
|
|
54
61
|
// 3. Store what worked for future workers
|
|
55
|
-
|
|
62
|
+
mcp__ruflo__memory_store {
|
|
56
63
|
key: "pattern-[task-type]",
|
|
57
64
|
value: JSON.stringify({
|
|
58
65
|
approach: "what worked",
|
|
@@ -63,8 +70,8 @@ mcp__claude-flow__memory_store {
|
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
// 4. Store result for coordinator
|
|
66
|
-
|
|
67
|
-
key: "result-[
|
|
73
|
+
mcp__ruflo__memory_store {
|
|
74
|
+
key: "result-[worker-id]",
|
|
68
75
|
value: JSON.stringify({
|
|
69
76
|
status: "complete",
|
|
70
77
|
summary: "what was done"
|
|
@@ -78,66 +85,66 @@ mcp__claude-flow__memory_store {
|
|
|
78
85
|
|
|
79
86
|
### Basic Worker
|
|
80
87
|
```bash
|
|
81
|
-
|
|
82
|
-
You are codex-worker.
|
|
88
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "
|
|
89
|
+
You are codex-worker (worker-1).
|
|
83
90
|
TASK: [task description]
|
|
84
91
|
|
|
85
92
|
1. Search memory for patterns
|
|
86
93
|
2. Execute the task
|
|
87
|
-
3. Store results
|
|
88
|
-
"
|
|
94
|
+
3. Store results in the 'results' namespace
|
|
95
|
+
" &
|
|
89
96
|
```
|
|
90
97
|
|
|
91
|
-
###
|
|
98
|
+
### Pin a Model
|
|
92
99
|
```bash
|
|
93
|
-
|
|
100
|
+
codex exec --sandbox workspace-write --skip-git-repo-check -m gpt-5.3-codex "Implement user auth" &
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
###
|
|
103
|
+
### Read-only Worker (no file writes)
|
|
97
104
|
```bash
|
|
98
|
-
|
|
105
|
+
codex exec --sandbox read-only --skip-git-repo-check "Audit src/api.ts for security issues" &
|
|
99
106
|
```
|
|
100
107
|
|
|
101
108
|
## Worker Types
|
|
102
109
|
|
|
103
110
|
### Coder Worker
|
|
104
111
|
```bash
|
|
105
|
-
|
|
112
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "
|
|
106
113
|
You are a coder worker.
|
|
107
114
|
Implement: [feature]
|
|
108
115
|
Path: src/[module]/
|
|
109
116
|
Store results when complete.
|
|
110
|
-
"
|
|
117
|
+
" &
|
|
111
118
|
```
|
|
112
119
|
|
|
113
120
|
### Tester Worker
|
|
114
121
|
```bash
|
|
115
|
-
|
|
122
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "
|
|
116
123
|
You are a tester worker.
|
|
117
124
|
Write tests for: [module]
|
|
118
125
|
Path: tests/
|
|
119
126
|
Run tests and store coverage results.
|
|
120
|
-
"
|
|
127
|
+
" &
|
|
121
128
|
```
|
|
122
129
|
|
|
123
130
|
### Documenter Worker
|
|
124
131
|
```bash
|
|
125
|
-
|
|
132
|
+
codex exec --sandbox workspace-write --skip-git-repo-check "
|
|
126
133
|
You are a documentation writer.
|
|
127
134
|
Document: [component]
|
|
128
135
|
Output: docs/
|
|
129
136
|
Store completion status.
|
|
130
|
-
"
|
|
137
|
+
" &
|
|
131
138
|
```
|
|
132
139
|
|
|
133
140
|
### Reviewer Worker
|
|
134
141
|
```bash
|
|
135
|
-
|
|
142
|
+
codex exec --sandbox read-only --skip-git-repo-check "
|
|
136
143
|
You are a code reviewer.
|
|
137
144
|
Review: [files]
|
|
138
145
|
Check for: security, performance, best practices
|
|
139
146
|
Store findings in memory.
|
|
140
|
-
"
|
|
147
|
+
" &
|
|
141
148
|
```
|
|
142
149
|
|
|
143
150
|
## MCP Tool Integration
|
|
@@ -145,13 +152,13 @@ Store findings in memory.
|
|
|
145
152
|
### Available Tools
|
|
146
153
|
```javascript
|
|
147
154
|
// Search for patterns before starting
|
|
148
|
-
|
|
155
|
+
mcp__ruflo__memory_search {
|
|
149
156
|
query: "[task keywords]",
|
|
150
157
|
namespace: "patterns"
|
|
151
158
|
}
|
|
152
159
|
|
|
153
160
|
// Store results and patterns
|
|
154
|
-
|
|
161
|
+
mcp__ruflo__memory_store {
|
|
155
162
|
key: "[result-key]",
|
|
156
163
|
value: "[json-value]",
|
|
157
164
|
namespace: "results",
|
|
@@ -159,25 +166,25 @@ mcp__claude-flow__memory_store {
|
|
|
159
166
|
}
|
|
160
167
|
|
|
161
168
|
// Check swarm status (optional)
|
|
162
|
-
|
|
169
|
+
mcp__ruflo__swarm_status {
|
|
163
170
|
verbose: true
|
|
164
171
|
}
|
|
165
172
|
```
|
|
166
173
|
|
|
167
174
|
## Important Notes
|
|
168
175
|
|
|
169
|
-
1. **Always Background**:
|
|
170
|
-
2. **
|
|
171
|
-
3. **Store Results**:
|
|
172
|
-
4. **
|
|
173
|
-
5. **Upsert Pattern**:
|
|
176
|
+
1. **Always Background**: append `&` so workers run in parallel
|
|
177
|
+
2. **Pick a Sandbox**: `workspace-write` for code changes, `read-only` for audits/reviews
|
|
178
|
+
3. **Store Results**: the coordinator collects your output from the `results` namespace
|
|
179
|
+
4. **Git Check**: `--skip-git-repo-check` lets Codex run outside a git repo
|
|
180
|
+
5. **Upsert Pattern**: always use `upsert: true` to avoid duplicate key errors
|
|
174
181
|
|
|
175
182
|
## Best Practices
|
|
176
183
|
|
|
177
184
|
- Keep tasks focused and small (< 5 minutes each)
|
|
178
185
|
- Search memory before starting to leverage past patterns
|
|
179
186
|
- Store patterns that worked for future workers
|
|
180
|
-
- Use
|
|
187
|
+
- Use a clear worker id in your result keys for tracking
|
|
181
188
|
- Store completion status even on partial success
|
|
182
189
|
|
|
183
|
-
Remember: You run headlessly in background. The coordinator
|
|
190
|
+
Remember: You run headlessly in background. The coordinator collects your results via shared memory.
|