Skip to content

Commit 75469c4

Browse files
author
catlog22
committed
Refactor agent management commands to replace assign_task with followup_task across multiple skills and roles. Update wait_agent calls to remove target specifications for improved clarity and consistency. Adjust documentation to reflect these changes in message semantics and tool usage.
1 parent 6b19a40 commit 75469c4

110 files changed

Lines changed: 553 additions & 574 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codex/skills/brainstorm/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: |
55
(spawn_agents_on_csv) → cross-role synthesis. Single role mode: individual role analysis.
66
CSV-driven parallel coordination with NDJSON discovery board.
77
argument-hint: "[-y|--yes] [--count N] [--session ID] [--skip-questions] [--style-skill PKG] \"topic\" | <role-name> [--session ID]"
8-
allowed-tools: spawn_agents_on_csv, spawn_agent, wait_agent, send_message, assign_task, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep
8+
allowed-tools: spawn_agents_on_csv, spawn_agent, wait_agent, send_message, followup_task, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep
99
---
1010

1111
## Auto Mode
@@ -556,7 +556,7 @@ Follow the same analysis protocol as wave role analysis but with interactive ref
556556
`
557557
})
558558
559-
wait_agent({ targets: [agentId] })
559+
wait_agent()
560560
close_agent({ target: agentId })
561561
562562
console.log(`\n✓ ${roleName} analysis complete: ${roleDir}/analysis.md`)
@@ -631,7 +631,7 @@ Evaluate complexity score (0-8):
631631
`
632632
})
633633
634-
wait_agent({ targets: [synthesisAgent] })
634+
wait_agent()
635635
close_agent({ target: synthesisAgent })
636636
```
637637

.codex/skills/ccw-coordinate/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: ccw-coordinate
33
description: Team-agent pipeline coordinator — classifies intent via structured extraction (action × object × style), maps to skill chain, spawns one agent per step whose prompt contains the skill invocation ($skill-name "intent"). Step results propagate as context to each successor. Session state at .workflow/.ccw-coordinate/{session-id}/state.json.
44
argument-hint: "\"intent text\" [-y] [-c|--continue] [--dry-run] [--chain <name>]"
5-
allowed-tools: spawn_agent, wait, send_input, close_agent, Read, Write, Bash, Glob, Grep
5+
allowed-tools: spawn_agent, wait_agent, send_message, followup_task, close_agent, Read, Write, Bash, Glob, Grep
66
---
77

88
## Auto Mode
@@ -318,10 +318,10 @@ for (const step of state.steps.filter(s => s.status === 'pending')) {
318318
const agent = spawn_agent({ message: stepPrompt })
319319

320320
// Wait — with timeout urge
321-
let result = wait({ ids: [agent], timeout_ms: 600000 })
321+
let result = wait_agent({ timeout_ms: 600000 })
322322
if (result.timed_out) {
323-
send_input({ id: agent, message: "Please wrap up and output your findings JSON now." })
324-
result = wait({ ids: [agent], timeout_ms: 120000 })
323+
followup_task({ target: agent, message: "Please wrap up and output your findings JSON now." })
324+
result = wait_agent({ timeout_ms: 120000 })
325325
}
326326

327327
// Parse structured output from agent
@@ -331,7 +331,7 @@ for (const step of state.steps.filter(s => s.status === 'pending')) {
331331
hints_for_next: ""
332332
}
333333

334-
close_agent({ id: agent })
334+
close_agent({ target: agent })
335335

336336
// Persist step result
337337
step.status = result.timed_out ? "failed" : "completed"
@@ -460,6 +460,6 @@ Resume: $ccw-coordinate --continue
460460
5. **Skip on Failure**: Step failure immediately marks all remaining steps `skipped` and aborts the loop
461461
6. **Close before spawn**: Always `close_agent` the current step agent before spawning the next
462462
7. **Dry-run is read-only**: Stop after displaying the chain plan — never spawn agents
463-
8. **Timeout handling**: One urge via `send_input`; if still timed out → mark `failed`
463+
8. **Timeout handling**: One urge via `followup_task`; if still timed out → mark `failed`
464464
9. **No CLI fallback**: All execution is agent-native — no `exec_command("maestro cli ...")`
465465
10. **Semantic Routing**: Use LLM structured extraction (`action × object × style`) not regex for intent classification

.codex/skills/clean/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ Format:
204204
})
205205

206206
// Wait with timeout handling
207-
let result = wait_agent({ targets: [exploreAgent], timeout_ms: 600000 })
207+
let result = wait_agent({ timeout_ms: 600000 })
208208

209209
if (result.timed_out) {
210-
assign_task({ target: exploreAgent, items: [{ type: "text", text: "Complete now and write cleanup-manifest.json." }] })
211-
result = wait_agent({ targets: [exploreAgent], timeout_ms: 300000 })
210+
followup_task({ target: exploreAgent, message: "Complete now and write cleanup-manifest.json." })
211+
result = wait_agent({ timeout_ms: 300000 })
212212
if (result.timed_out) throw new Error('Agent timeout')
213213
}
214214

.codex/skills/investigate/agents/investigator.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Investigator Agent
22

3-
Executes all 5 phases of the systematic debugging investigation under the Iron Law methodology. Single long-running agent driven through phases by orchestrator assign_task calls.
3+
Executes all 5 phases of the systematic debugging investigation under the Iron Law methodology. Single long-running agent driven through phases by orchestrator followup_task calls.
44

55
## Identity
66

77
- **Type**: `investigation`
88
- **Role File**: `~/.codex/skills/investigate/agents/investigator.md`
99
- **task_name**: `investigator`
1010
- **Responsibility**: Full 5-phase investigation execution — evidence collection, pattern search, hypothesis testing, minimal fix, verification
11-
- **fork_context**: false
11+
- **fork_turns**: "none"
1212
- **Reasoning Effort**: high
1313

1414
## Boundaries
@@ -23,7 +23,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
2323
- Implement only minimal fix — change only what addresses the confirmed root cause
2424
- Add a regression test that fails without the fix and passes with it
2525
- Write the final debug report to `.workflow/.debug/` using the schema in `~/.codex/skills/investigate/specs/debug-report-format.md`
26-
- Produce structured output after each phase, then await next assign_task
26+
- Produce structured output after each phase, then await next followup_task
2727

2828
### MUST NOT
2929

@@ -75,7 +75,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
7575

7676
| Source | Required | Description |
7777
|--------|----------|-------------|
78-
| assign_task message | Yes | Bug description, symptoms, error messages, context |
78+
| followup_task message | Yes | Bug description, symptoms, error messages, context |
7979
| Phase file | Yes | `~/.codex/skills/investigate/phases/01-root-cause-investigation.md` |
8080

8181
**Steps**:
@@ -89,7 +89,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
8989
4. Collect evidence — search for error messages in source, find related log output, identify affected files and modules.
9090
5. Run inline-cli-analysis subagent for initial diagnostic perspective (see Inline Subagent Calls).
9191
6. Assemble `investigation-report` in memory: bug_description, reproduction result, evidence, initial_diagnosis.
92-
7. Output Phase 1 summary and await assign_task for Phase 2.
92+
7. Output Phase 1 summary and await followup_task for Phase 2.
9393

9494
**Output**: In-memory investigation-report (phase 1 fields populated)
9595

@@ -103,7 +103,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
103103

104104
| Source | Required | Description |
105105
|--------|----------|-------------|
106-
| assign_task message | Yes | Phase 2 instruction |
106+
| followup_task message | Yes | Phase 2 instruction |
107107
| Phase file | Yes | `~/.codex/skills/investigate/phases/02-pattern-analysis.md` |
108108
| investigation-report | Yes | Phase 1 output in context |
109109

@@ -118,7 +118,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
118118
7. Classify scope: `isolated` | `module-wide` | `systemic` with justification.
119119
8. Document all similar occurrences with file:line references and risk classification (`same_bug` | `potential_bug` | `safe`).
120120
9. Add `pattern_analysis` section to investigation-report in memory.
121-
10. Output Phase 2 summary and await assign_task for Phase 3.
121+
10. Output Phase 2 summary and await followup_task for Phase 3.
122122

123123
**Output**: investigation-report with pattern_analysis section added
124124

@@ -132,7 +132,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
132132

133133
| Source | Required | Description |
134134
|--------|----------|-------------|
135-
| assign_task message | Yes | Phase 3 instruction |
135+
| followup_task message | Yes | Phase 3 instruction |
136136
| Phase file | Yes | `~/.codex/skills/investigate/phases/03-hypothesis-testing.md` |
137137
| investigation-report | Yes | Phase 1-2 output in context |
138138

@@ -154,7 +154,7 @@ Executes all 5 phases of the systematic debugging investigation under the Iron L
154154

155155
6. If strike counter reaches 3 — STOP immediately. Output escalation block (see 3-Strike Escalation Output below). Set status BLOCKED.
156156
7. If a hypothesis is confirmed — document `confirmed_root_cause` with full evidence chain.
157-
8. Output Phase 3 results and await assign_task for Phase 4 (or halt on BLOCKED).
157+
8. Output Phase 3 results and await followup_task for Phase 4 (or halt on BLOCKED).
158158

159159
**3-Strike Escalation Output**:
160160

@@ -203,7 +203,7 @@ STATUS: BLOCKED
203203

204204
| Source | Required | Description |
205205
|--------|----------|-------------|
206-
| assign_task message | Yes | Phase 4 instruction |
206+
| followup_task message | Yes | Phase 4 instruction |
207207
| Phase file | Yes | `~/.codex/skills/investigate/phases/04-implementation.md` |
208208
| investigation-report | Yes | Must contain confirmed_root_cause |
209209

@@ -233,7 +233,7 @@ STATUS: BLOCKED
233233
- Test must be deterministic
234234
6. Re-run the original reproduction case from Phase 1. Verify it now passes.
235235
7. Add `fix_applied` section to investigation-report in memory.
236-
8. Output Phase 4 summary and await assign_task for Phase 5.
236+
8. Output Phase 4 summary and await followup_task for Phase 5.
237237

238238
**Output**: Modified source files, regression test file; investigation-report with fix_applied section
239239

@@ -247,7 +247,7 @@ STATUS: BLOCKED
247247

248248
| Source | Required | Description |
249249
|--------|----------|-------------|
250-
| assign_task message | Yes | Phase 5 instruction |
250+
| followup_task message | Yes | Phase 5 instruction |
251251
| Phase file | Yes | `~/.codex/skills/investigate/phases/05-verification-report.md` |
252252
| investigation-report | Yes | All phases populated |
253253

@@ -301,7 +301,7 @@ This agent spawns a utility subagent for cross-file diagnostic analysis during P
301301
```
302302
spawn_agent({
303303
task_name: "inline-cli-analysis",
304-
fork_context: false,
304+
fork_turns: "none",
305305
model: "haiku",
306306
reasoning_effort: "medium",
307307
message: `### MANDATORY FIRST STEPS
@@ -317,7 +317,7 @@ CONSTRAINTS: Read-only analysis | Focus on <affected_module>>
317317
318318
Expected: Structured findings with file:line references`
319319
})
320-
const result = wait_agent({ targets: ["inline-cli-analysis"], timeout_ms: 180000 })
320+
const result = wait_agent({ timeout_ms: 180000 })
321321
close_agent({ target: "inline-cli-analysis" })
322322
```
323323

@@ -337,7 +337,7 @@ Substitute the analysis task description with phase-appropriate content:
337337

338338
## Structured Output Template
339339

340-
After each phase, output the following structure before awaiting the next assign_task:
340+
After each phase, output the following structure before awaiting the next followup_task:
341341

342342
```
343343
## Phase <N> Complete

.codex/skills/investigate/orchestrator.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Systematic debugging skill that enforces the Iron Law: never fix without a confi
2626
| 5-phase loop) |
2727
+------------------+
2828
| ^ |
29-
assign_task | | | assign_task
29+
followup_task | | | followup_task
3030
(Phase 2-5) v | v (Phase 3 gate check)
3131
+------------------+
3232
| Phase 1: Root |
@@ -44,26 +44,26 @@ Systematic debugging skill that enforces the Iron Law: never fix without a confi
4444

4545
## Agent Registry
4646

47-
| Agent | task_name | Role File | Responsibility | Pattern | fork_context |
47+
| Agent | task_name | Role File | Responsibility | Pattern | fork_turns |
4848
|-------|-----------|-----------|----------------|---------|-------------|
49-
| investigator | `investigator` | `~/.codex/skills/investigate/agents/investigator.md` | Full 5-phase investigation execution | Deep Interaction (2.3) | false |
49+
| investigator | `investigator` | `~/.codex/skills/investigate/agents/investigator.md` | Full 5-phase investigation execution | Deep Interaction (2.3) | "none" |
5050

5151
> **COMPACT PROTECTION**: Agent files are execution documents. When context compression occurs and agent instructions are reduced to summaries, **you MUST immediately `Read` the corresponding agent.md to reload before continuing execution**.
5252
5353
---
5454

5555
## Fork Context Strategy
5656

57-
| Agent | task_name | fork_context | fork_from | Rationale |
57+
| Agent | task_name | fork_turns | fork_from | Rationale |
5858
|-------|-----------|-------------|-----------|-----------|
59-
| investigator | `investigator` | false || Starts fresh; receives all phase context via assign_task messages. No prior conversation history needed. |
59+
| investigator | `investigator` | "none" || Starts fresh; receives all phase context via followup_task messages. No prior conversation history needed. |
6060

6161
**Fork Decision Rules**:
6262

63-
| Condition | fork_context | Reason |
63+
| Condition | fork_turns | Reason |
6464
|-----------|-------------|--------|
65-
| investigator spawned (Phase 1) | false | Clean context; full task description in message |
66-
| Phase 2-5 transitions | N/A | assign_task used, agent already running |
65+
| investigator spawned (Phase 1) | "none" | Clean context; full task description in message |
66+
| Phase 2-5 transitions | N/A | followup_task used, agent already running |
6767

6868
---
6969

@@ -112,7 +112,7 @@ Build the initial spawn message embedding the bug report and Phase 1 instruction
112112
```
113113
spawn_agent({
114114
task_name: "investigator",
115-
fork_context: false,
115+
fork_turns: "none",
116116
message: `## TASK ASSIGNMENT
117117
118118
### MANDATORY FIRST STEPS (Agent Execute)
@@ -132,7 +132,7 @@ Execute Phase 1 per the phase file. Produce investigation-report (in-memory) and
132132
- Await next phase assignment.`
133133
})
134134
135-
const p1Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
135+
const p1Result = wait_agent({ timeout_ms: 300000 })
136136
```
137137

138138
**Output**:
@@ -158,7 +158,7 @@ const p1Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
158158
**Execution**:
159159

160160
```
161-
assign_task({
161+
followup_task({
162162
target: "investigator",
163163
items: [{
164164
type: "text",
@@ -176,7 +176,7 @@ Report back with pattern_analysis section and scope classification. Await next p
176176
}]
177177
})
178178
179-
const p2Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
179+
const p2Result = wait_agent({ timeout_ms: 300000 })
180180
```
181181

182182
**Output**:
@@ -202,7 +202,7 @@ const p2Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
202202
**Execution**:
203203

204204
```
205-
assign_task({
205+
followup_task({
206206
target: "investigator",
207207
items: [{
208208
type: "text",
@@ -222,7 +222,7 @@ Report back with hypothesis test results and either:
222222
}]
223223
})
224224
225-
const p3Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
225+
const p3Result = wait_agent({ timeout_ms: 480000 })
226226
```
227227

228228
**Phase 3 Gate Decision**:
@@ -232,7 +232,7 @@ const p3Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
232232
| p3Result contains `confirmed_root_cause` | Proceed to Phase 4 |
233233
| p3Result contains `BLOCKED` | Halt workflow, output escalation dump to user, close investigator |
234234
| p3Result contains `ESCALATION: 3-Strike Limit Reached` | Halt workflow, output diagnostic dump, close investigator |
235-
| Timeout | assign_task "Finalize Phase 3 results now", re-wait 120s; if still timeout → halt |
235+
| Timeout | followup_task "Finalize Phase 3 results now", re-wait 120s; if still timeout → halt |
236236

237237
If BLOCKED: close investigator and surface the diagnostic dump to the user. Do not proceed to Phase 4.
238238

@@ -253,7 +253,7 @@ If BLOCKED: close investigator and surface the diagnostic dump to the user. Do n
253253
**Execution**:
254254

255255
```
256-
assign_task({
256+
followup_task({
257257
target: "investigator",
258258
items: [{
259259
type: "text",
@@ -272,7 +272,7 @@ Report back with fix_applied section. Await Phase 5 assignment.`
272272
}]
273273
})
274274
275-
const p4Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
275+
const p4Result = wait_agent({ timeout_ms: 480000 })
276276
```
277277

278278
**Output**:
@@ -298,7 +298,7 @@ const p4Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
298298
**Execution**:
299299

300300
```
301-
assign_task({
301+
followup_task({
302302
target: "investigator",
303303
items: [{
304304
type: "text",
@@ -316,7 +316,7 @@ Final phase:
316316
}]
317317
})
318318
319-
const p5Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
319+
const p5Result = wait_agent({ timeout_ms: 300000 })
320320
```
321321

322322
**Output**:
@@ -335,11 +335,11 @@ const p5Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
335335

336336
| Phase | Default Timeout | On Timeout |
337337
|-------|-----------------|------------|
338-
| Phase 1 (spawn + wait) | 300000 ms | assign_task "Finalize Phase 1 now" + wait 120s; if still timeout → halt |
339-
| Phase 2 (assign + wait) | 300000 ms | assign_task "Finalize Phase 2 now" + wait 120s; if still timeout → halt |
340-
| Phase 3 (assign + wait) | 480000 ms | assign_task "Finalize Phase 3 now" + wait 120s; if still timeout → halt BLOCKED |
341-
| Phase 4 (assign + wait) | 480000 ms | assign_task "Finalize Phase 4 now" + wait 120s; if still timeout → halt |
342-
| Phase 5 (assign + wait) | 300000 ms | assign_task "Finalize Phase 5 now" + wait 120s; if still timeout → partial report |
338+
| Phase 1 (spawn + wait) | 300000 ms | followup_task "Finalize Phase 1 now" + wait 120s; if still timeout → halt |
339+
| Phase 2 (assign + wait) | 300000 ms | followup_task "Finalize Phase 2 now" + wait 120s; if still timeout → halt |
340+
| Phase 3 (assign + wait) | 480000 ms | followup_task "Finalize Phase 3 now" + wait 120s; if still timeout → halt BLOCKED |
341+
| Phase 4 (assign + wait) | 480000 ms | followup_task "Finalize Phase 4 now" + wait 120s; if still timeout → halt |
342+
| Phase 5 (assign + wait) | 300000 ms | followup_task "Finalize Phase 5 now" + wait 120s; if still timeout → partial report |
343343

344344
### Cleanup Protocol
345345

@@ -355,13 +355,13 @@ close_agent({ target: "investigator" })
355355

356356
| Scenario | Resolution |
357357
|----------|------------|
358-
| Agent timeout (first) | assign_task "Finalize current work and output results" + re-wait 120000 ms |
358+
| Agent timeout (first) | followup_task "Finalize current work and output results" + re-wait 120000 ms |
359359
| Agent timeout (second) | close_agent, report partial results to user |
360360
| Phase 3 BLOCKED | close_agent, surface full escalation dump to user, halt |
361361
| Phase 4 Iron Law violation | close_agent, report "Cannot proceed: no confirmed root cause" |
362362
| Phase 4 introduces regression | Investigator returns to fix adjustment; orchestrator re-waits same phase |
363363
| User cancellation | close_agent({ target: "investigator" }), report current state |
364-
| send_message ignored | Escalate to assign_task |
364+
| send_message ignored | Escalate to followup_task |
365365

366366
---
367367

0 commit comments

Comments
 (0)