Files
Claude-Code-Workflow/.claude/skills/team-arch-opt/subagents/discuss-subagent.md
catlog22 16bbfcd12a 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/
2026-03-04 22:40:39 +08:00

3.5 KiB

Discuss Subagent

Multi-perspective discussion for evaluating refactoring strategies and reviewing code change quality. Used by designer (DISCUSS-REFACTOR) and reviewer (DISCUSS-REVIEW) when complex trade-offs require multi-angle analysis.

Design Rationale

Complex refactoring decisions (e.g., choosing between dependency inversion vs mediator pattern to break a cycle) and nuanced code review findings (e.g., evaluating whether a temporary coupling increase is acceptable) benefit from structured multi-perspective analysis. This subagent provides that analysis inline without spawning additional team members.

Invocation

Called by designer, reviewer after their primary analysis when complexity warrants multi-perspective evaluation:

Agent({
  subagent_type: "cli-discuss-agent",
  run_in_background: false,
  description: "Discuss <round-id>: <topic> for architecture optimization",
  prompt: `Conduct a multi-perspective discussion on the following topic.

Round: <round-id>
Topic: <discussion-topic>
Session: <session-folder>

Context:
<relevant-context-from-calling-role>

Perspectives to consider:
- Architecture impact: Will this actually improve the target structural metric?
- Risk assessment: What could break? Dangling references? Behavioral changes? Migration risk?
- Maintainability: Is the refactored code more understandable and maintainable?
- Alternative approaches: Are there simpler or safer ways to achieve the same structural improvement?

Evaluate trade-offs and provide a structured recommendation with:
- Consensus verdict: proceed / revise / escalate
- Confidence level: high / medium / low
- Key trade-offs identified
- Recommended approach with rationale
- Dissenting perspectives (if any)`
})

Round Configuration

Round Artifact Parameters Calling Role
DISCUSS-REFACTOR /discussions/DISCUSS-REFACTOR.md Refactoring strategy trade-offs designer
DISCUSS-REVIEW /discussions/DISCUSS-REVIEW.md Code review finding validation reviewer

Integration with Calling Role

The calling role is responsible for:

  1. Before calling: Complete primary analysis, identify the specific trade-off or finding needing discussion
  2. Calling: Invoke subagent with round ID, topic, and relevant context
  3. After calling:
Result Action
consensus_reached (proceed) Incorporate recommendation into output, continue
consensus_reached (revise) Adjust findings/strategy based on discussion insights
consensus_blocked (HIGH) Report to coordinator via message with severity
consensus_blocked (MEDIUM) Include in output with recommendation for revision
consensus_blocked (LOW) Note in output, proceed with original assessment

Output Schema

{
  "round_id": "<DISCUSS-REFACTOR|DISCUSS-REVIEW>",
  "topic": "<discussion-topic>",
  "verdict": "<proceed|revise|escalate>",
  "confidence": "<high|medium|low>",
  "trade_offs": [
    { "dimension": "<architecture|risk|maintainability>", "pro": "<benefit>", "con": "<cost>" }
  ],
  "recommendation": "<recommended-approach>",
  "rationale": "<reasoning>",
  "dissenting_views": ["<alternative-perspective>"]
}

Error Handling

Scenario Resolution
Single perspective analysis fails Continue with partial perspectives
All analyses fail Return basic recommendation from calling role's primary analysis
Artifact not found Return error immediately
Discussion inconclusive Return "revise" verdict with low confidence