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-brainstorm
description: Unified team skill for brainstorming team. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team brainstorm".
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 Brainstorm
@@ -306,7 +306,7 @@ Beat 1 2 3-4 5 6
When coordinator spawns workers, use `team-worker` agent with role-spec path:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker",
team_name: "brainstorm",
@@ -338,7 +338,7 @@ Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Pha
| Quick/Deep pipeline (single ideator) | Standard spawn: single `ideator` team-worker agent |
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn ideator-<N> worker",
team_name: "brainstorm",
@@ -384,7 +384,7 @@ AskUserQuestion({
| Choice | Action |
|--------|--------|
| Archive & Clean | Update session status="completed" -> TeamDelete(brainstorm) -> 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-brainstorm", args="resume")` |
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |

View File

@@ -23,7 +23,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>
@@ -37,10 +36,9 @@ CONTEXT:
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits>
---
InnerLoop: false",
blockedBy: [<dependency-list>],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
```
### Pipeline Router
@@ -59,7 +57,6 @@ InnerLoop: false",
```
TaskCreate({
subject: "IDEA-001",
owner: "ideator",
description: "PURPOSE: Generate multi-angle ideas for brainstorm topic | Success: >= 6 unique ideas across all angles
TASK:
- Read topic and angles from session context
@@ -72,17 +69,15 @@ CONTEXT:
EXPECTED: <session>/ideas/idea-001.md with >= 6 ideas
CONSTRAINTS: Divergent thinking only, no evaluation
---
InnerLoop: false",
blockedBy: [],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "IDEA-001", owner: "ideator" })
```
**CHALLENGE-001** (challenger):
```
TaskCreate({
subject: "CHALLENGE-001",
owner: "challenger",
description: "PURPOSE: Challenge assumptions and assess feasibility of generated ideas | Success: Each idea rated by severity
TASK:
- Read all idea files from ideas/ directory
@@ -95,17 +90,15 @@ CONTEXT:
EXPECTED: <session>/critiques/critique-001.md with severity table and GC signal
CONSTRAINTS: Critical analysis only, do not generate alternative ideas
---
InnerLoop: false",
blockedBy: ["IDEA-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "CHALLENGE-001", addBlockedBy: ["IDEA-001"], owner: "challenger" })
```
**SYNTH-001** (synthesizer):
```
TaskCreate({
subject: "SYNTH-001",
owner: "synthesizer",
description: "PURPOSE: Synthesize ideas and critiques into integrated proposals | Success: >= 1 consolidated proposal
TASK:
- Read all ideas and critiques
@@ -117,10 +110,9 @@ CONTEXT:
EXPECTED: <session>/synthesis/synthesis-001.md with proposals
CONSTRAINTS: Integration and synthesis only, no new ideas
---
InnerLoop: false",
blockedBy: ["CHALLENGE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SYNTH-001", addBlockedBy: ["CHALLENGE-001"], owner: "synthesizer" })
```
### Deep Pipeline
@@ -131,7 +123,6 @@ Creates all 6 tasks. First 2 same as Quick, then:
```
TaskCreate({
subject: "IDEA-002",
owner: "ideator",
description: "PURPOSE: Revise ideas based on critique feedback (GC Round 1) | Success: HIGH/CRITICAL challenges addressed
TASK:
- Read critique feedback from critiques/
@@ -143,17 +134,15 @@ CONTEXT:
EXPECTED: <session>/ideas/idea-002.md with revised ideas
CONSTRAINTS: Address critique only, focused revision
---
InnerLoop: false",
blockedBy: ["CHALLENGE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "IDEA-002", addBlockedBy: ["CHALLENGE-001"], owner: "ideator" })
```
**CHALLENGE-002** (challenger, round 2):
```
TaskCreate({
subject: "CHALLENGE-002",
owner: "challenger",
description: "PURPOSE: Validate revised ideas (GC Round 2) | Success: Severity assessment of revised ideas
TASK:
- Read revised idea files
@@ -165,10 +154,9 @@ CONTEXT:
EXPECTED: <session>/critiques/critique-002.md
CONSTRAINTS: Focus on revised/new ideas
---
InnerLoop: false",
blockedBy: ["IDEA-002"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "CHALLENGE-002", addBlockedBy: ["IDEA-002"], owner: "challenger" })
```
**SYNTH-001** blocked by CHALLENGE-002. **EVAL-001** blocked by SYNTH-001:
@@ -176,7 +164,6 @@ InnerLoop: false",
```
TaskCreate({
subject: "EVAL-001",
owner: "evaluator",
description: "PURPOSE: Score and rank synthesized proposals | Success: Ranked list with weighted scores
TASK:
- Read synthesis results
@@ -188,10 +175,9 @@ CONTEXT:
EXPECTED: <session>/evaluation/evaluation-001.md with scoring matrix
CONSTRAINTS: Evaluation only, no new proposals
---
InnerLoop: false",
blockedBy: ["SYNTH-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "EVAL-001", addBlockedBy: ["SYNTH-001"], owner: "evaluator" })
```
### Full Pipeline

View File

@@ -74,7 +74,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: "brainstorm",

View File

@@ -231,7 +231,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
Find first unblocked task(s) and spawn worker(s):
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn ideator worker",
team_name: "brainstorm",
@@ -255,7 +255,7 @@ For **Full pipeline** with parallel ideators, spawn N team-worker agents:
```
// For each parallel IDEA task (IDEA-001, IDEA-002, IDEA-003)
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn ideator worker for IDEA-<N>",
team_name: "brainstorm",
@@ -316,6 +316,6 @@ AskUserQuestion({
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("brainstorm") -> output final summary with artifact paths |
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete() -> output final summary with artifact paths |
| Keep Active | Update session status="paused" -> output: "Session paused. Resume with: Skill(skill='team-brainstorm', args='resume')" |
| Export Results | AskUserQuestion for target directory -> copy all artifacts -> Archive & Clean flow |