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-ultra-analyze
description: Unified team skill for deep collaborative analysis. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team ultra-analyze", "team analyze".
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 Ultra Analyze
@@ -359,7 +359,7 @@ When coordinator spawns workers, use `team-worker` agent with role-spec path. Th
**Single spawn template** (worker template used for all roles):
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker",
team_name: "ultra-analyze",
@@ -434,7 +434,7 @@ AskUserQuestion({
| Choice | Action |
|--------|--------|
| Archive & Clean | Update session status="completed" -> TeamDelete(ultra-analyze) -> 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-ultra-analyze", args="resume")` |
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |

View File

@@ -48,7 +48,7 @@ Select strategy by discussion type:
**deepen**: Spawn cli-explore-agent focused on open questions and uncertain insights:
```
Task({
Agent({
subagent_type: "cli-explore-agent",
run_in_background: false,
prompt: "Focus on open questions: <questions>. Find evidence for uncertain insights. Write to: <session>/discussions/deepen-<num>.json"
@@ -62,7 +62,12 @@ ccw cli -p "Re-analyze '<topic>' with adjusted focus on '<userFeedback>'" --tool
**specific-questions**: Spawn cli-explore-agent targeting user's questions:
```
Task({ subagent_type: "cli-explore-agent", prompt: "Answer: <userFeedback>. Write to: <session>/discussions/questions-<num>.json" })
Agent({
subagent_type: "cli-explore-agent",
description: "Answer specific user questions",
run_in_background: false,
prompt: "Answer: <userFeedback>. Write to: <session>/discussions/questions-<num>.json"
})
```
## Phase 4: Update Discussion Timeline

View File

@@ -43,7 +43,7 @@ Explore codebase structure through cli-explore-agent, collecting structured cont
Spawn `cli-explore-agent` subagent for actual exploration:
```
Task({
Agent({
subagent_type: "cli-explore-agent",
run_in_background: false,
description: "Explore codebase: <topic> (<perspective>)",

View File

@@ -24,7 +24,6 @@ Every task description uses structured format:
```
TaskCreate({
subject: "<TASK-ID>",
owner: "<role>",
description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
TASK:
- <step 1: specific action>
@@ -39,10 +38,9 @@ CONTEXT:
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: false",
blockedBy: [<dependency-list>],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
```
### Mode Router
@@ -75,9 +73,9 @@ CONTEXT:
EXPECTED: <session>/explorations/exploration-001.json | Structured exploration with files and findings
CONSTRAINTS: Focus on <topic> scope
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "EXPLORE-001", owner: "explorer" })
```
**ANALYZE-001** (analyst):
@@ -99,10 +97,9 @@ CONTEXT:
EXPECTED: <session>/analyses/analysis-001.json | Structured analysis with evidence
CONSTRAINTS: Focus on technical perspective | <dimensions>
---
InnerLoop: false",
blockedBy: ["EXPLORE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "ANALYZE-001", addBlockedBy: ["EXPLORE-001"], owner: "analyst" })
```
**SYNTH-001** (synthesizer):
@@ -122,10 +119,9 @@ CONTEXT:
EXPECTED: <session>/conclusions.json + discussion.md update | Final conclusions with confidence levels
CONSTRAINTS: Pure integration, no new exploration
---
InnerLoop: false",
blockedBy: ["ANALYZE-001"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SYNTH-001", addBlockedBy: ["ANALYZE-001"], owner: "synthesizer" })
```
---
@@ -140,7 +136,6 @@ Create tasks in dependency order with parallel exploration and analysis windows:
// For each perspective[i]:
TaskCreate({
subject: "EXPLORE-<NNN>",
owner: "explorer-<i+1>",
description: "PURPOSE: Explore codebase from <perspective> angle | Success: Perspective-specific files and patterns collected
TASK:
- Search codebase from <perspective> perspective
@@ -155,9 +150,9 @@ CONTEXT:
EXPECTED: <session>/explorations/exploration-<NNN>.json
CONSTRAINTS: Focus on <perspective> angle
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "EXPLORE-<NNN>", owner: "explorer-<i+1>" })
```
**ANALYZE-001..N** (analyst, parallel): One per perspective. Each blocked by its corresponding EXPLORE-N.
@@ -165,7 +160,6 @@ InnerLoop: false",
```
TaskCreate({
subject: "ANALYZE-<NNN>",
owner: "analyst-<i+1>",
description: "PURPOSE: Deep analysis from <perspective> perspective | Success: Insights with confidence and evidence
TASK:
- Load exploration-<NNN> results
@@ -181,10 +175,9 @@ CONTEXT:
EXPECTED: <session>/analyses/analysis-<NNN>.json
CONSTRAINTS: <perspective> perspective | <dimensions>
---
InnerLoop: false",
blockedBy: ["EXPLORE-<NNN>"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "ANALYZE-<NNN>", addBlockedBy: ["EXPLORE-<NNN>"], owner: "analyst-<i+1>" })
```
**DISCUSS-001** (discussant): Blocked by all ANALYZE tasks.
@@ -207,10 +200,9 @@ CONTEXT:
EXPECTED: <session>/discussions/discussion-round-001.json + discussion.md update
CONSTRAINTS: Aggregate only, no new exploration
---
InnerLoop: false",
blockedBy: ["ANALYZE-001", ..., "ANALYZE-<N>"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "DISCUSS-001", addBlockedBy: ["ANALYZE-001", ..., "ANALYZE-<N>"], owner: "discussant" })
```
**SYNTH-001** (synthesizer): Blocked by DISCUSS-001.
@@ -220,9 +212,8 @@ TaskCreate({
subject: "SYNTH-001",
description: "PURPOSE: Cross-perspective integration into final conclusions | Success: Executive summary with prioritized recommendations
...same as Quick mode SYNTH-001 but blocked by DISCUSS-001..."
blockedBy: ["DISCUSS-001"],
status: "pending"
})
TaskUpdate({ taskId: "SYNTH-001", addBlockedBy: ["DISCUSS-001"], owner: "synthesizer" })
```
---
@@ -255,9 +246,9 @@ CONTEXT:
- Shared memory: <session>/wisdom/.msg/meta.json
EXPECTED: <session>/discussions/discussion-round-<NNN>.json
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "DISCUSS-<NNN>", owner: "discussant" })
```
**ANALYZE-fix-N** (direction adjustment):
@@ -277,9 +268,9 @@ CONTEXT:
- Shared memory: <session>/wisdom/.msg/meta.json
EXPECTED: <session>/analyses/analysis-fix-<N>.json
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "ANALYZE-fix-<N>", owner: "analyst" })
```
## Phase 4: Validation

View File

@@ -133,9 +133,9 @@ CONTEXT:
- Shared memory: <session>/wisdom/.msg/meta.json
EXPECTED: <session>/discussions/discussion-round-<NNN>.json
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "DISCUSS-<NNN>", owner: "discussant" })
```
ANALYZE-fix-N (direction adjustment):
@@ -155,9 +155,9 @@ CONTEXT:
- Shared memory: <session>/wisdom/.msg/meta.json
EXPECTED: <session>/analyses/analysis-fix-<N>.json
---
InnerLoop: false",
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "ANALYZE-fix-<N>", owner: "analyst" })
```
SYNTH-001 (created dynamically in deep mode):
@@ -177,10 +177,9 @@ CONTEXT:
EXPECTED: <session>/conclusions.json + discussion.md update
CONSTRAINTS: Pure integration, no new exploration
---
InnerLoop: false",
blockedBy: ["<last-DISCUSS-task-id>"],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "SYNTH-001", addBlockedBy: ["<last-DISCUSS-task-id>"], owner: "synthesizer" })
```
7. Record user feedback to decision_trail via team_msg:
@@ -220,7 +219,7 @@ Find and spawn the next ready tasks.
3. Spawn team-worker for each ready task:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-subject>",
team_name: "ultra-analyze",

View File

@@ -195,7 +195,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
Find first unblocked tasks and spawn their workers:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn explorer worker",
team_name: "ultra-analyze",
@@ -263,7 +263,7 @@ AskUserQuestion({
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("ultra-analyze") -> output final summary |
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete() -> output final summary |
| Keep Active | Update session status="paused" -> output resume instructions |
| Export Results | AskUserQuestion for target directory -> copy artifacts -> Archive & Clean |