Files
Claude-Code-Workflow/.claude/CLAUDE.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

2.5 KiB

Claude Instructions

  • Coding Philosophy: @~/.ccw/workflows/coding-philosophy.md

CLI Endpoints

  • CLI Tools Usage: @~/.ccw/workflows/cli-tools-usage.md
  • CLI Endpoints Config: @~/.claude/cli-tools.json

Strictly follow the cli-tools.json configuration

Available CLI endpoints are dynamically defined by the config file

Tool Execution

  • Context Requirements: @~/.ccw/workflows/context-tools.md
  • File Modification: @~/.ccw/workflows/file-modification.md

Agent Calls

  • Always use run_in_background: false for Agent tool calls: Agent({ subagent_type: "xxx", prompt: "...", run_in_background: false }) to ensure synchronous execution and immediate result visibility
  • TaskOutput usage: Only use TaskOutput({ task_id: "xxx", block: false }) + sleep loop to poll completion status. NEVER read intermediate output during agent/CLI execution - wait for final result only

CLI Tool Calls (ccw cli)

  • Default: CLI calls (ccw cli) default to background execution (run_in_background: true):
    Bash({
      command: "ccw cli -p '...' --tool gemini",
      run_in_background: true  // Bash tool parameter, not ccw cli parameter
    })
    
  • CRITICAL — Agent-specific instructions ALWAYS override this default. If an agent's definition file (.claude/agents/*.md) specifies run_in_background: false, that instruction takes highest priority. Subagents (Agent tool agents) CANNOT receive hook callbacks, so they MUST use run_in_background: false for CLI calls that produce required results.
  • After CLI call (main conversation only): Stop output immediately - let CLI execute in background. DO NOT use TaskOutput polling - wait for hook callback to receive results

CLI Analysis Calls

  • Wait for results: MUST wait for CLI analysis to complete before taking any write action. Do NOT proceed with fixes while analysis is running
  • Value every call: Each CLI invocation is valuable and costly. NEVER waste analysis results:
    • Aggregate multiple analysis results before proposing solutions

CLI Auto-Invoke Triggers

  • Reference: See cli-tools-usage.mdAuto-Invoke Triggers for full specification
  • Key scenarios: Self-repair fails, ambiguous requirements, architecture decisions, pattern uncertainty, critical code paths
  • Principles: Default --mode analysis, no confirmation needed, wait for completion, flexible rule selection

Code Diagnostics

  • Prefer mcp__ide__getDiagnostics for code error checking over shell-based TypeScript compilation