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.
@@ -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 `claude -p`.
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 `claude -p`
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 claude-flow@v3alpha swarm init --topology hierarchical --max-agents 6
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
- claude -p "Implement core auth logic" --session-id auth-core &
55
- claude -p "Implement auth middleware" --session-id auth-middleware &
56
- claude -p "Write auth tests" --session-id auth-tests &
57
- claude -p "Document auth API" --session-id auth-docs &
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 claude-flow@v3alpha memory list --namespace results
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(`claude -p "${w.task}" --session-id ${w.id} &`);
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
- claude -p "
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-{{session_id}}', namespace='results', upsert=true)
124
- " --session-id {{session_id}} &
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
- mcp__ruv-swarm__swarm_init {
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
- mcp__claude-flow__memory_store {
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
- mcp__claude-flow__memory_list {
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 claude-flow@v3alpha swarm init --topology hierarchical --max-agents 4
173
+ npx ruflo@latest swarm init --topology hierarchical --max-agents 4
169
174
 
170
175
  # Spawn workers in parallel
171
- claude -p "Architect: Design $FEATURE" --session-id ${FEATURE}-arch &
172
- claude -p "Coder: Implement $FEATURE" --session-id ${FEATURE}-code &
173
- claude -p "Tester: Test $FEATURE" --session-id ${FEATURE}-test &
174
- claude -p "Docs: Document $FEATURE" --session-id ${FEATURE}-docs &
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 claude-flow@v3alpha memory list --namespace results
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**: Session IDs should identify the worker's purpose
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. **Budget Limits**: Use `--max-budget-usd` to control costs
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 | `claude -p "Implement [feature]"` |
196
- | `tester` | Write tests | `claude -p "Write tests for [module]"` |
197
- | `reviewer` | Review code | `claude -p "Review [files]"` |
198
- | `docs` | Documentation | `claude -p "Document [component]"` |
199
- | `architect` | Design | `claude -p "Design [system]"` |
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 `claude -p` and coordinate with other workers through shared memory.
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: claude -p "task" --session-id X &
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
- mcp__claude-flow__memory_search {
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
- mcp__claude-flow__memory_store {
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
- mcp__claude-flow__memory_store {
67
- key: "result-[session-id]",
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
- claude -p "
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
- " --session-id worker-1 &
94
+ 3. Store results in the 'results' namespace
95
+ " &
89
96
  ```
90
97
 
91
- ### With Budget Limit
98
+ ### Pin a Model
92
99
  ```bash
93
- claude -p "Implement user auth" --max-budget-usd 0.50 --session-id auth-worker &
100
+ codex exec --sandbox workspace-write --skip-git-repo-check -m gpt-5.3-codex "Implement user auth" &
94
101
  ```
95
102
 
96
- ### With Specific Tools
103
+ ### Read-only Worker (no file writes)
97
104
  ```bash
98
- claude -p "Write tests for api.ts" --allowedTools "Read,Write,Bash" --session-id test-worker &
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
- claude -p "
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
- " --session-id coder-1 &
117
+ " &
111
118
  ```
112
119
 
113
120
  ### Tester Worker
114
121
  ```bash
115
- claude -p "
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
- " --session-id tester-1 &
127
+ " &
121
128
  ```
122
129
 
123
130
  ### Documenter Worker
124
131
  ```bash
125
- claude -p "
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
- " --session-id docs-1 &
137
+ " &
131
138
  ```
132
139
 
133
140
  ### Reviewer Worker
134
141
  ```bash
135
- claude -p "
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
- " --session-id reviewer-1 &
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
- mcp__claude-flow__memory_search {
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
- mcp__claude-flow__memory_store {
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
- mcp__ruv-swarm__swarm_status {
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**: Run with `&` for parallel execution
170
- 2. **Use Session IDs**: Track workers with `--session-id`
171
- 3. **Store Results**: Coordinator needs to collect your output
172
- 4. **Budget Limits**: Use `--max-budget-usd` for cost control
173
- 5. **Upsert Pattern**: Always use `upsert: true` to avoid duplicate key errors
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 meaningful session IDs for tracking
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 will collect your results via shared memory.
190
+ Remember: You run headlessly in background. The coordinator collects your results via shared memory.