mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-29 20:11:04 +08:00
refactor: deep Codex v4 API conversion for all 20 team skills
Upgrade all team-* skills from mechanical v3→v4 API renames to deep v4 tool integration with skill-adaptive patterns: - list_agents: health checks in handleResume, cleanup verification in handleComplete, added to allowed-tools and coordinator toolbox - Named targeting: task_name uses task-id (e.g. EXPLORE-001) instead of generic <role>-worker, enabling send_message/assign_task by name - Message semantics: send_message for supplementary cross-agent context vs assign_task for triggering work, with skill-specific examples - Model selection: per-role reasoning_effort guidance matching each skill's actual roles (not generic boilerplate) - timeout_ms: added to all wait_agent calls, timed_out handling in all 18 monitor.md files - Skill-adaptive v4 sections: ultra-analyze N-parallel coordination, lifecycle-v4 supervisor assign_task/send_message distinction, brainstorm ideator parallel patterns, iterdev generator-critic loops, frontend-debug iterative debug assign_task, perf-opt benchmark context sharing, executor lightweight trimmed v4, etc. 60 files changed across 20 team skills (SKILL.md, monitor.md, role.md) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: team-executor
|
||||
description: Lightweight session execution skill. Resumes existing team-coordinate sessions for pure execution via team-worker agents. No analysis, no role generation -- only loads and executes. Session path required. Triggers on "Team Executor".
|
||||
allowed-tools: spawn_agent(*), wait_agent(*), send_input(*), close_agent(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
allowed-tools: spawn_agent(*), wait_agent(*), send_message(*), assign_task(*), close_agent(*), list_agents(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
|
||||
---
|
||||
|
||||
# Team Executor
|
||||
@@ -109,6 +109,8 @@ When executor spawns workers, use `team-worker` agent with role-spec path:
|
||||
```
|
||||
spawn_agent({
|
||||
agent_type: "team_worker",
|
||||
task_name: "<task-id>",
|
||||
fork_context: false,
|
||||
items: [
|
||||
{ type: "text", text: `## Role Assignment
|
||||
role: <role>
|
||||
@@ -132,10 +134,35 @@ pipeline_phase: <pipeline-phase>` },
|
||||
})
|
||||
```
|
||||
|
||||
After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ id })` each worker.
|
||||
After spawning, use `wait_agent({ targets: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ target: <name> })` each worker.
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Model Selection Guide
|
||||
|
||||
team-executor loads roles dynamically from session role-specs. Use reasoning_effort based on the role type defined in the session:
|
||||
- Implementation/fix roles: `reasoning_effort: "high"`
|
||||
- Verification/test roles: `reasoning_effort: "medium"`
|
||||
- Default when role type is unclear: `reasoning_effort: "high"`
|
||||
|
||||
## v4 Agent Coordination
|
||||
|
||||
### State Reconciliation
|
||||
|
||||
On resume, executor reconciles session state with actual running agents:
|
||||
```
|
||||
const running = list_agents({})
|
||||
// Compare with session's task-analysis.json active tasks
|
||||
// Reset orphaned tasks (in_progress but agent gone) to pending
|
||||
```
|
||||
|
||||
### Worker Communication
|
||||
|
||||
- `send_message({ target: "<task-id>", items: [...] })` -- queue supplementary context
|
||||
- `assign_task({ target: "<task-id>", items: [...] })` -- assign new work to inner_loop worker
|
||||
- `close_agent({ target: "<task-id>" })` -- cleanup completed worker
|
||||
|
||||
## Completion Action
|
||||
|
||||
When pipeline completes (all tasks done), executor presents an interactive choice:
|
||||
|
||||
@@ -167,22 +167,30 @@ After spawning all ready tasks:
|
||||
const agentIds = Object.values(state.active_agents)
|
||||
.filter(a => !a.resident)
|
||||
.map(a => a.agentId)
|
||||
wait_agent({ ids: agentIds, timeout_ms: 900000 })
|
||||
|
||||
// Collect results from discoveries/{task_id}.json
|
||||
for (const [taskId, agent] of Object.entries(state.active_agents)) {
|
||||
if (agent.resident) continue
|
||||
try {
|
||||
const disc = JSON.parse(Read(`${sessionFolder}/discoveries/${taskId}.json`))
|
||||
state.tasks[taskId].status = disc.status || 'completed'
|
||||
state.tasks[taskId].findings = disc.findings || ''
|
||||
state.tasks[taskId].error = disc.error || null
|
||||
} catch {
|
||||
state.tasks[taskId].status = 'failed'
|
||||
state.tasks[taskId].error = 'No discovery file produced'
|
||||
const waitResult = wait_agent({ targets: agentIds, timeout_ms: 900000 })
|
||||
if (waitResult.timed_out) {
|
||||
for (const [taskId, agent] of Object.entries(state.active_agents)) {
|
||||
if (agent.resident) continue
|
||||
state.tasks[taskId].status = 'timed_out'
|
||||
close_agent({ target: agent.agentId })
|
||||
delete state.active_agents[taskId]
|
||||
}
|
||||
} else {
|
||||
// Collect results from discoveries/{task_id}.json
|
||||
for (const [taskId, agent] of Object.entries(state.active_agents)) {
|
||||
if (agent.resident) continue
|
||||
try {
|
||||
const disc = JSON.parse(Read(`${sessionFolder}/discoveries/${taskId}.json`))
|
||||
state.tasks[taskId].status = disc.status || 'completed'
|
||||
state.tasks[taskId].findings = disc.findings || ''
|
||||
state.tasks[taskId].error = disc.error || null
|
||||
} catch {
|
||||
state.tasks[taskId].status = 'failed'
|
||||
state.tasks[taskId].error = 'No discovery file produced'
|
||||
}
|
||||
close_agent({ target: agent.agentId })
|
||||
delete state.active_agents[taskId]
|
||||
}
|
||||
close_agent({ id: agent.agentId })
|
||||
delete state.active_agents[taskId]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user