refactor: replace Task tool with Agent tool and fix schema compliance

## Task -> Agent Replacement
- Replace all Task({}) calls with Agent({}) across .claude/ directory
- Update allowed-tools declarations from Task to Agent
- Update documentation references from "Task tool" to "Agent tool"

## Schema Compliance Fixes

### Agent Schema
- Add missing required `description` parameter in 6 files
- Add missing `run_in_background: false` for subagent calls
- Add missing `subagent_type` parameter

### AskUserQuestion Schema
- Fix issue-manage/SKILL.md: reduce options from 5 to 4 (max allowed)

### SendMessage Schema
- Fix team-worker.md: use correct params (type, content, summary)
- Remove invalid `team_name` parameter

### TaskCreate/TaskUpdate Schema
- Remove invalid `blockedBy`, `owner`, `status` from TaskCreate calls
- Use separate TaskUpdate calls for dependencies and ownership
- Fix TaskUpdate syntax to use object parameter

### TeamDelete Schema
- Remove parameters from TeamDelete() calls (should be no params)

### TaskOutput Schema
- Fix Python-style syntax to JavaScript object syntax

## Files Changed
- 146 files updated across commands/, skills/, skills_lib/, agents/
This commit is contained in:
catlog22
2026-03-04 22:40:39 +08:00
parent 64e772f9b8
commit 16bbfcd12a
146 changed files with 505 additions and 516 deletions

View File

@@ -1,7 +1,7 @@
---
name: team-issue
description: Unified team skill for issue resolution. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team issue".
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Task(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
allowed-tools: TeamCreate(*), TeamDelete(*), SendMessage(*), TaskCreate(*), TaskUpdate(*), TaskList(*), TaskGet(*), Agent(*), AskUserQuestion(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
---
# Team Issue Resolution
@@ -301,7 +301,7 @@ Beat 1 2 3 4 5
When coordinator spawns workers, use `team-worker` agent with role-spec path:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker",
team_name: "issue",
@@ -344,7 +344,7 @@ Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Pha
**Parallel spawn template**:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role>-<N> worker",
team_name: "issue",
@@ -390,7 +390,7 @@ AskUserQuestion({
| Choice | Action |
|--------|--------|
| Archive & Clean | Update session status="completed" -> TeamDelete(issue) -> output final summary |
| Archive & Clean | Update session status="completed" -> TeamDelete() -> output final summary |
| Keep Active | Update session status="paused" -> output resume instructions: `Skill(skill="team-issue", args="resume")` |
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |

View File

@@ -53,7 +53,7 @@ Bash("ccw issue status <issueId> --json")
| Complexity | Execution |
|------------|-----------|
| Low | Direct ACE search: `mcp__ace-tool__search_context(project_root_path, query)` |
| Medium/High | Spawn cli-explore-agent: `Task({ subagent_type: "cli-explore-agent", run_in_background: false })` |
| Medium/High | Spawn cli-explore-agent: `Agent({ subagent_type: "cli-explore-agent", run_in_background: false })` |
**cli-explore-agent prompt template**:

View File

@@ -15,7 +15,7 @@ Load solution plan, route to execution backend (Agent/Codex/Gemini), run tests,
| Backend | Condition | Method |
|---------|-----------|--------|
| agent | task_count <= 3 or explicit | `Task({ subagent_type: "code-developer", run_in_background: false })` |
| agent | task_count <= 3 or explicit | `Agent({ subagent_type: "code-developer", run_in_background: false })` |
| codex | task_count > 3 or explicit | `ccw cli --tool codex --mode write --id issue-<issueId>` |
| gemini | explicit | `ccw cli --tool gemini --mode write --id issue-<issueId>` |
@@ -69,7 +69,7 @@ Dependencies: <explorerContext.dependencies>
```
Route by executor:
- **agent**: `Task({ subagent_type: "code-developer", run_in_background: false, prompt: <prompt> })`
- **agent**: `Agent({ subagent_type: "code-developer", run_in_background: false, prompt: <prompt> })`
- **codex**: `Bash("ccw cli -p \"<prompt>\" --tool codex --mode write --id issue-<issueId>")`
- **gemini**: `Bash("ccw cli -p \"<prompt>\" --tool gemini --mode write --id issue-<issueId>")`

View File

@@ -39,7 +39,7 @@ Bash("ccw issue solutions <issueId> --json")
**Agent invocation**:
```
Task({
Agent({
subagent_type: "issue-queue-agent",
run_in_background: false,
description: "Form queue for <count> issues",

View File

@@ -40,7 +40,7 @@ Read("<session>/explorations/context-<issueId>.json")
**Agent invocation**:
```
Task({
Agent({
subagent_type: "issue-plan-agent",
run_in_background: false,
description: "Plan solution for <issueId>",

View File

@@ -25,7 +25,6 @@ Every task description uses structured format:
```
TaskCreate({
subject: "<TASK-ID>",
owner: "<role>",
description: "PURPOSE: <what this task achieves> | Success: <completion criteria>
TASK:
- <step 1>
@@ -40,10 +39,9 @@ CONSTRAINTS: <scope limits>
---
InnerLoop: false
execution_method: <method>
code_review: <setting>",
blockedBy: [<dependency-list>],
status: "pending"
code_review: <setting>"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
```
### Pipeline Router
@@ -62,7 +60,6 @@ code_review: <setting>",
```
TaskCreate({
subject: "EXPLORE-001",
owner: "explorer",
description: "PURPOSE: Analyze issue context and map codebase impact | Success: Context report with relevant files and dependencies
TASK:
- Load issue details via ccw issue status
@@ -74,17 +71,15 @@ CONTEXT:
EXPECTED: <session>/explorations/context-<issueId>.json with relevant files, dependencies, and impact assessment
CONSTRAINTS: Exploration and analysis only, no solution design
---
InnerLoop: false",
blockedBy: [],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "EXPLORE-001", owner: "explorer" })
```
**SOLVE-001** (planner):
```
TaskCreate({
subject: "SOLVE-001",
owner: "planner",
description: "PURPOSE: Design solution and decompose into implementation tasks | Success: Bound solution with task decomposition
TASK:
- Load explorer context report
@@ -97,17 +92,15 @@ CONTEXT:
EXPECTED: <session>/solutions/solution-<issueId>.json with solution plan and task list
CONSTRAINTS: Solution design only, no code implementation
---
InnerLoop: false",
blockedBy: ["EXPLORE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SOLVE-001", addBlockedBy: ["EXPLORE-001"], owner: "planner" })
```
**MARSHAL-001** (integrator):
```
TaskCreate({
subject: "MARSHAL-001",
owner: "integrator",
description: "PURPOSE: Form execution queue with conflict detection and ordering | Success: Execution queue file with resolved conflicts
TASK:
- Verify all issues have bound solutions
@@ -120,17 +113,15 @@ CONTEXT:
EXPECTED: .workflow/issues/queue/execution-queue.json with queue, conflicts, parallel groups
CONSTRAINTS: Queue formation only, no implementation
---
InnerLoop: false",
blockedBy: ["SOLVE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "MARSHAL-001", addBlockedBy: ["SOLVE-001"], owner: "integrator" })
```
**BUILD-001** (implementer):
```
TaskCreate({
subject: "BUILD-001",
owner: "implementer",
description: "PURPOSE: Implement solution plan and verify with tests | Success: Code changes committed, tests pass
TASK:
- Load bound solution and explorer context
@@ -146,10 +137,9 @@ CONSTRAINTS: Follow solution plan, no scope creep
---
InnerLoop: false
execution_method: <execution_method>
code_review: <code_review>",
blockedBy: ["MARSHAL-001"],
status: "pending"
code_review: <code_review>"
})
TaskUpdate({ taskId: "BUILD-001", addBlockedBy: ["MARSHAL-001"], owner: "implementer" })
```
### Full Pipeline
@@ -162,7 +152,6 @@ Creates 5 tasks. First 2 same as Quick, then AUDIT gate before MARSHAL and BUILD
```
TaskCreate({
subject: "AUDIT-001",
owner: "reviewer",
description: "PURPOSE: Review solution for technical feasibility, risk, and completeness | Success: Clear verdict (approved/rejected/concerns) with scores
TASK:
- Load explorer context and bound solution
@@ -175,10 +164,9 @@ CONTEXT:
EXPECTED: <session>/audits/audit-report.json with per-issue scores and overall verdict
CONSTRAINTS: Review only, do not modify solutions
---
InnerLoop: false",
blockedBy: ["SOLVE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "AUDIT-001", addBlockedBy: ["SOLVE-001"], owner: "reviewer" })
```
**MARSHAL-001** (integrator): Same as Quick, but `blockedBy: ["AUDIT-001"]`.
@@ -201,7 +189,6 @@ For each issue in issue_ids, create an EXPLORE task. When N > 1, assign distinct
```
TaskCreate({
subject: "EXPLORE-<NNN>",
owner: "explorer-<N>",
description: "PURPOSE: Analyze issue <issueId> context and map codebase impact | Success: Context report for <issueId>
TASK:
- Load issue details for <issueId>
@@ -213,20 +200,18 @@ CONTEXT:
EXPECTED: <session>/explorations/context-<issueId>.json
CONSTRAINTS: Single issue scope, exploration only
---
InnerLoop: false",
blockedBy: [],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "EXPLORE-<NNN>", owner: "explorer-<N>" })
```
**SOLVE-001..N** (planner, sequential after all EXPLORE):
For each issue, create a SOLVE task blocked by all EXPLORE tasks:
For each issue, create a SOLVE task blocked by all EXPLORE tasks
```
TaskCreate({
subject: "SOLVE-<NNN>",
owner: "planner",
description: "PURPOSE: Design solution for <issueId> | Success: Bound solution with tasks
TASK:
- Load explorer context for <issueId>
@@ -239,17 +224,15 @@ CONTEXT:
EXPECTED: <session>/solutions/solution-<issueId>.json
CONSTRAINTS: Solution design only
---
InnerLoop: false",
blockedBy: ["EXPLORE-001", ..., "EXPLORE-<N>"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SOLVE-<NNN>", addBlockedBy: ["EXPLORE-001", ..., "EXPLORE-<N>"], owner: "planner" })
```
**AUDIT-001** (reviewer, batch review):
```
TaskCreate({
subject: "AUDIT-001",
owner: "reviewer",
description: "PURPOSE: Batch review all solutions | Success: Verdict for each solution
TASK:
- Load all explorer contexts and bound solutions
@@ -262,10 +245,9 @@ CONTEXT:
EXPECTED: <session>/audits/audit-report.json with batch results
CONSTRAINTS: Review only
---
InnerLoop: false",
blockedBy: ["SOLVE-001", ..., "SOLVE-<N>"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "AUDIT-001", addBlockedBy: ["SOLVE-001", ..., "SOLVE-<N>"], owner: "reviewer" })
```
**MARSHAL-001** (integrator): `blockedBy: ["AUDIT-001"]`.
@@ -282,7 +264,6 @@ After MARSHAL produces execution queue, create M BUILD tasks based on parallel g
```
TaskCreate({
subject: "BUILD-<NNN>",
owner: "implementer-<M>",
description: "PURPOSE: Implement solution for <issueId> | Success: Code committed, tests pass
TASK:
- Load bound solution and explorer context
@@ -297,10 +278,9 @@ CONSTRAINTS: Follow solution plan
---
InnerLoop: false
execution_method: <execution_method>
code_review: <code_review>",
blockedBy: ["MARSHAL-001"],
status: "pending"
code_review: <code_review>"
})
TaskUpdate({ taskId: "BUILD-<NNN>", addBlockedBy: ["MARSHAL-001"], owner: "implementer-<M>" })
```
> **Note**: In Batch mode, BUILD task count M may not be known at dispatch time (depends on MARSHAL queue output). Create BUILD tasks with placeholder count, or defer BUILD task creation to handleCallback when MARSHAL completes. Coordinator should check for deferred BUILD task creation in monitor.md handleCallback for integrator.
@@ -313,7 +293,6 @@ When AUDIT rejects a solution, coordinator creates fix tasks dynamically (NOT at
```
TaskCreate({
subject: "SOLVE-fix-001",
owner: "planner",
description: "PURPOSE: Revise solution addressing reviewer feedback (fix cycle <round>) | Success: Revised solution addressing rejection reasons
TASK:
- Read reviewer feedback from audit report
@@ -327,17 +306,15 @@ CONTEXT:
EXPECTED: <session>/solutions/solution-<issueId>.json (revised)
CONSTRAINTS: Address reviewer concerns specifically
---
InnerLoop: false",
blockedBy: ["AUDIT-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SOLVE-fix-001", addBlockedBy: ["AUDIT-001"], owner: "planner" })
```
**AUDIT-002** (reviewer, re-review):
```
TaskCreate({
subject: "AUDIT-002",
owner: "reviewer",
description: "PURPOSE: Re-review revised solution (fix cycle <round>) | Success: Verdict on revised solution
TASK:
- Load revised solution
@@ -350,10 +327,9 @@ CONTEXT:
EXPECTED: <session>/audits/audit-report.json (updated)
CONSTRAINTS: Focus on previously rejected dimensions
---
InnerLoop: false",
blockedBy: ["SOLVE-fix-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "AUDIT-002", addBlockedBy: ["SOLVE-fix-001"], owner: "reviewer" })
```
These fix tasks are created dynamically by handleCallback in monitor.md when reviewer reports rejection, NOT during initial dispatch.

View File

@@ -83,7 +83,7 @@ Find and spawn the next ready tasks.
2. For each ready task, spawn team-worker:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "issue",
@@ -116,7 +116,7 @@ Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
4. **Parallel spawn** (Batch mode with multiple ready tasks for same role):
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role>-<N> worker for <task-id>",
team_name: "issue",

View File

@@ -205,7 +205,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
Find first unblocked task and spawn its worker:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn explorer worker",
team_name: "issue",
@@ -273,6 +273,6 @@ AskUserQuestion({
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("issue") -> output final summary |
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete() -> output final summary |
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-issue', args='resume')" |
| New Batch | Return to Phase 1 |