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-testing
description: Unified team skill for testing team. All roles invoke this skill with --role arg for role-specific execution. Triggers on "team testing".
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 Testing
@@ -305,7 +305,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: "testing",
@@ -352,7 +352,7 @@ AskUserQuestion({
| Choice | Action |
|--------|--------|
| Archive & Clean | Update session status="completed" -> TeamDelete(testing) -> 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-testing", args="resume")` |
| Export Results | AskUserQuestion for target path -> copy deliverables -> Archive & Clean |

View File

@@ -59,7 +59,7 @@ Bash("<test-command> 2>&1 || true")
**Auto-fix delegation** (on failure):
```
Task({
Agent({
subagent_type: "code-developer",
run_in_background: false,
description: "Fix test failures (iteration <N>)",

View File

@@ -61,7 +61,7 @@ For revision mode:
**Agent delegation** (medium/high complexity):
```
Task({
Agent({
subagent_type: "code-developer",
run_in_background: false,
description: "Generate <layer> tests",

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 criteria>
TASK:
- <step 1: specific action>
@@ -38,10 +37,9 @@ CONTEXT:
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: <true|false>",
blockedBy: [<dependency-list>],
status: "pending"
InnerLoop: <true|false>"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })
```
### Mode Router
@@ -71,10 +69,9 @@ CONTEXT:
EXPECTED: <session>/strategy/test-strategy.md
CONSTRAINTS: Read-only analysis
---
InnerLoop: false",
blockedBy: [],
status: "pending"
InnerLoop: false"
})
TaskUpdate({ taskId: "STRATEGY-001", owner: "strategist" })
```
**TESTGEN-001** (generator, L1):
@@ -93,10 +90,9 @@ CONTEXT:
EXPECTED: <session>/tests/L1-unit/
CONSTRAINTS: Only generate test code, do not modify source
---
InnerLoop: true",
blockedBy: ["STRATEGY-001"],
status: "pending"
InnerLoop: true"
})
TaskUpdate({ taskId: "TESTGEN-001", addBlockedBy: ["STRATEGY-001"], owner: "generator" })
```
**TESTRUN-001** (executor, L1):
@@ -115,10 +111,9 @@ CONTEXT:
EXPECTED: <session>/results/run-001.json
CONSTRAINTS: Only fix test files, not source code
---
InnerLoop: true",
blockedBy: ["TESTGEN-001"],
status: "pending"
InnerLoop: true"
})
TaskUpdate({ taskId: "TESTRUN-001", addBlockedBy: ["TESTGEN-001"], owner: "executor" })
```
### Standard Pipeline

View File

@@ -68,7 +68,6 @@ When executor reports test results:
```
TaskCreate({
subject: "TESTGEN-<layer>-fix-<round>",
owner: "generator",
description: "PURPOSE: Revise tests to fix failures and improve coverage
TASK:
- Read previous test results and failure details
@@ -80,10 +79,9 @@ CONTEXT:
- Previous results: <session>/results/run-<N>.json
EXPECTED: Revised test files in <session>/tests/<layer>/
---
InnerLoop: true",
blockedBy: [],
status: "pending"
InnerLoop: true"
})
TaskUpdate({ taskId: "TESTGEN-<layer>-fix-<round>", owner: "generator" })
```
Create TESTRUN-fix blocked on TESTGEN-fix.
@@ -108,7 +106,7 @@ Find and spawn the next ready tasks.
3. Spawn team-worker:
```
Task({
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "testing",

View File

@@ -202,7 +202,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 strategist worker",
team_name: "testing",
@@ -269,7 +269,7 @@ AskUserQuestion({
| Choice | Steps |
|--------|-------|
| Archive & Clean | TaskList -> verify all completed -> update session status="completed" -> TeamDelete("testing") -> 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-testing', args='resume')" |
| Deepen Coverage | Create additional TESTGEN+TESTRUN tasks for next layer -> Phase 4 |