| name | task-decomposition |
| description | Systematic decomposition of complex user requests into manageable, executable sub-tasks. Teaches how to break down multi-faceted requests, create execution plans, track progress, and handle dependencies between sub-tasks. Use when the user's request involves multiple steps, spans different domains, requires coordinating multiple tools, or when the scope is too large to complete in a single response.
|
Task Decomposition
Overview
Complex user requests often require 3-20 distinct steps across multiple tools. Attempting everything at once leads to incomplete answers, missed requirements, and lost context. This skill teaches systematic decomposition.
When to Decompose
Decompose when the request meets ANY of these criteria:
- Requires 3+ distinct actions (search, analyze, create)
- Spans multiple domains (research + coding + writing)
- Has dependencies (step B needs output from step A)
- User explicitly requests a plan ("help me plan...", "what are the steps to...")
Decomposition Framework
Step 1: Requirements Extraction
Read the user's request and extract ALL explicit and implicit requirements:
User: "帮我分析最近的AI行业趋势,写一份报告,并用邮件发给团队"
Extracted requirements:
1. Search for recent AI industry trends (time-sensitive → need dateTime + search)
2. Analyze and synthesize findings
3. Write a structured report
4. Convert to appropriate format
5. Send via email to team (need email addresses)
Step 2: Dependency Mapping
Identify which steps depend on others:
[1] dateTime ──→ [2] webSearch ──→ [3] analyze ──→ [4] write report ──→ [5] email
↑ ↑
(depends on 1) (depends on 2)
Step 3: Create Execution Plan
Use the planning tool for 3+ step tasks (this is mandatory — always use the planning tool, never skip it for complex tasks). For simpler tasks (1-2 steps), create a mental plan:
Plan:
1. Get current time (dateTime)
2. Search AI trends 2026 (tavilySearch, topic: "news")
3. Search specific AI topics based on results
4. Synthesize findings into structured report
5. Generate PDF report (pdfGeneration or markdownToPdf)
6. Confirm with user before sending email
7. Send email (email, with PDF attachment if possible)
Step 4: Execute with Progress Tracking
Starting task: "AI Industry Analysis Report"
✓ Step 1: Got current time → 2026-06-08
✓ Step 2: Searched AI trends → found 8 relevant articles
→ Step 3: Analyzing findings... (in progress)
○ Step 4: Write report
○ Step 5: Generate PDF
○ Step 6: Send email
Step 5: Verify Completion
Before declaring the task done:
- Are ALL extracted requirements satisfied?
- Did any step produce unexpected results that need follow-up?
- Is the output quality sufficient?
Multi-Domain Task Patterns
Research + Report Pattern
1. dateTime (context)
2. tavilySearch × N (gather data on each sub-topic)
3. smartWebFetch × M (deep-dive on key sources)
4. Analyze and synthesize
5. Generate document (pdfGeneration / markdownToPdf)
Code + Deploy Pattern
1. Understand requirements
2. fileOperation (read existing code)
3. Write/modify code
4. bash (test the changes)
5. git (check version history)
6. Deploy or package
Data Analysis Pattern
1. fileOperation (read data file)
2. bash (run analysis scripts)
3. Interpret results
4. Generate visualization or report
When NOT to Decompose
- User asks a question answerable in a single reply (no tools, no multi-step)
- Request is a simple conversation or clarification
- User explicitly says "quick answer" or "简短回答"
- The entire task can be done with one tool call plus a brief summary
Anti-Patterns
- Jumping directly to execution without understanding the full scope
- Executing dependent steps before prerequisites are complete
- Forgetting to verify intermediate results before proceeding
- Not tracking which steps are complete (losing context in long chains)
- Over-decomposing simple tasks (applying decomposition to 1-2 step requests)