
task-planner
by barkain
SKILL.md
name: task-planner description: Analyze user request, explore codebase, decompose into subtasks, assign agents, and return complete execution plan with wave assignments. context: fork allowed-tools: Read, Grep, Glob, Bash, WebFetch, AskUserQuestion, TodoWrite
Task Planner
Analyze the user's request and return a complete execution plan including agent assignments and wave scheduling.
Process
-
Parse intent — What does the user actually want? What's the success criteria?
-
Check for ambiguities — If blocking, return questions. If minor, state assumptions and proceed.
-
Explore codebase — Only if relevant for the user request: Find relevant files, patterns, test locations. Sample, don't consume.
-
Decompose — Break into atomic subtasks with clear boundaries.
-
Assign agents — Match each subtask to a specialized agent via keyword analysis.
-
Map dependencies — What blocks what? What can parallelize?
-
Assign waves — Group independent tasks into parallel waves.
-
Flag risks — Complexity, missing tests, potential breaks.
-
Populate TodoWrite — Create task entries with encoded metadata for execution.
Output
If Clarification Needed
When blocking ambiguities exist that prevent planning, use the AskUserQuestion tool to get clarification from the user.
Use AskUserQuestion with:
question: A clear, specific question about what's blocking- Include default assumptions in the question text so the user can simply confirm or override
Example:
AskUserQuestion(
question: "Should this API support pagination? (Default: Yes, using cursor-based pagination)"
)
Format for multiple questions: Ask the most critical blocking question first. After receiving an answer, you can ask follow-up questions if still blocked.
If Ready — Complete Execution Plan
Output the following structured plan:
EXECUTION PLAN
Status: Ready
Goal: <one sentence>
Success Criteria:
<verifiable outcome>
Assumptions:
<assumption made, if any>
Relevant Context:
- Files:
<paths> - Patterns to follow:
<patterns> - Tests:
<location>
Subtasks with Agent Assignments
| ID | Description | Agent | Depends On | Wave |
|---|---|---|---|---|
| 1 | <description> | <agent-name> | none | 0 |
| 2 | <description> | <agent-name> | none | 0 |
| 3 | <description> | <agent-name> | 1, 2 | 1 |
| ... |
Wave Breakdown
List EVERY task individually (no compression):
### Wave 0 (N parallel tasks)
1: <description> -> <agent-name>
2: <description> -> <agent-name>
### Wave 1 (M tasks)
3: <description> -> <agent-name>
Prohibited patterns:
+notation:task1 + task2- Range notation:
1-3 - Wildcard:
root.1.* - Summaries:
4 test files
TodoWrite Population
Note: The TodoWrite entries contain all execution metadata. No separate JSON output needed.
Encode metadata in content field:
[W<wave>][<phase_id>][<agent>][PARALLEL]? <description>
Example:
{
"todos": [
{
"content": "[W0][1][general-purpose][PARALLEL] Create project structure",
"activeForm": "Creating project structure",
"status": "pending"
},
{
"content": "[W0][2][general-purpose][PARALLEL] Create database config",
"activeForm": "Creating database config",
"status": "pending"
},
{
"content": "[W1][3][task-completion-verifier] Verify implementations",
"activeForm": "Verifying implementations",
"status": "pending"
}
]
}
Risks
<what could go wrong and why>
→ CONTINUE TO EXECUTION
Available Specialized Agents
IMPORTANT - Agent Name Prefix:
- Plugin mode: Use
workflow-orchestrator:<agent-name>(e.g.,workflow-orchestrator:task-completion-verifier) - Native install: Use just
<agent-name>(e.g.,task-completion-verifier)
To detect mode: Check if running as a plugin by looking for workflow-orchestrator: prefix in available agents list.
| Agent (base name) | Keywords | Capabilities |
|---|---|---|
| codebase-context-analyzer | analyze, understand, explore, architecture, patterns, structure, dependencies | Read-only code exploration and architecture analysis |
| tech-lead-architect | design, approach, research, evaluate, best practices, architect, scalability, security | Solution design and architectural decisions |
| task-completion-verifier | verify, validate, test, check, review, quality, edge cases | Testing, QA, validation |
| code-cleanup-optimizer | refactor, cleanup, optimize, improve, technical debt, maintainability | Refactoring and code quality improvement |
| code-reviewer | review, code review, critique, feedback, assess quality, evaluate code | Code review and quality assessment |
| devops-experience-architect | setup, deploy, docker, CI/CD, infrastructure, pipeline, configuration | Infrastructure, deployment, containerization |
| documentation-expert | document, write docs, README, explain, create guide, documentation | Documentation creation and maintenance |
| dependency-manager | dependencies, packages, requirements, install, upgrade, manage packages | Dependency management (Python/UV focused) |
When assigning agents in TodoWrite and delegations, ALWAYS use the full prefixed name: workflow-orchestrator:<agent-name>
Agent Selection Algorithm
Selection Process:
- Extract keywords from subtask description (case-insensitive)
- Count keyword matches per agent
- Apply >=2 match threshold
Selection Rules:
| Condition | Action |
|---|---|
| Single agent >=2 matches | Use that specialized agent |
| Multiple agents >=2 matches | Use agent with highest count |
| Tie at highest count | Use first in table order |
| No agent >=2 matches | Use general-purpose delegation |
Examples:
| Task | Matches | Selected Agent |
|---|---|---|
| "Analyze authentication architecture" | codebase-context-analyzer: analyze=1, architecture=1 (2) | workflow-orchestrator:codebase-context-analyzer |
| "Refactor auth to improve maintainability" | code-cleanup-optimizer: refactor=1, improve=1, maintainability=1 (3) | workflow-orchestrator:code-cleanup-optimizer |
| "Create new utility function" | No agent >=2 matches | general-purpose (no prefix needed for built-in) |
Complexity Scoring
Calculate complexity score BEFORE decomposition to determine required depth:
| Component | Points | Formula |
|---|---|---|
| Action Verbs | 0-10 | min(verb_count * 2, 10) |
| Connector Words | 0-8 | min(connector_count * 2, 8) |
| Domain Indicators | 0-6 | Architecture +2, Security +2, Integration +1 |
| Scope Indicators | 0-6 | Multiple files +3, Multiple systems +3 |
| Risk Indicators | 0-5 | Production +2, Data +2, Performance +1 |
Total Range: 0-35
Tier Classification
| Score | Tier | Minimum Depth | Description |
|---|---|---|---|
| < 5 | Tier 1 | 1 | Simple single-file tasks |
| 5-15 | Tier 2 | 2 | Moderate multi-component tasks |
| > 15 | Tier 3 | 3 | Complex architectural tasks |
Rule: A task at depth less than tier minimum MUST be decomposed further, regardless of atomicity criteria.
Atomicity Validation
A subtask is atomic ONLY when:
Step 1: Depth Check (MANDATORY)
- Current depth >= tier minimum depth?
- If NO → MUST decompose (skip Step 2)
Step 2: Atomicity Criteria (only if depth check passes)
| Criterion | Question | Atomic if YES |
|---|---|---|
| Single operation | One discrete logical action? | ✓ |
| File-scoped | Modifies ≤3 files? | ✓ |
| Single deliverable | One clear output? | ✓ |
| No planning required | Implementation-ready? | ✓ |
| Single responsibility | One concern only? | ✓ |
Decision Logic:
- Depth < tier minimum → DECOMPOSE (mandatory)
- Depth >= tier minimum AND all criteria YES → ATOMIC
- Any criterion NO → DECOMPOSE further
Minimum Decomposition:
- Tasks mentioning multiple operations (add, subtract, etc.) → one subtask per operation
- Tasks with "and" combining actions → split into separate subtasks
- CRUD operations → one subtask per operation (create, read, update, delete) REQUIRED: Tasks with enumerable operations MUST decompose. "Implement calculator" → add, subtract, multiply, divide as separate subtasks.
Success Criteria & Iteration
Every subtask MUST have:
requirements[]- Functional requirements (what it must do)success_criterion- Verifiable command (optional, enables iteration)
When success_criterion exists: Mark iterative: true. Subagent loops internally until criterion passes or max iterations (5) reached.
Delegation includes iteration protocol:
SUCCESS CRITERION: `{command}` exits 0
ITERATION: Implement → Run criterion → If fail, fix and retry → Max 5 attempts
Return only when PASS or max reached.
Success criterion types:
| Type | Example |
|---|---|
| Test | uv run pytest tests/test_auth.py |
| Lint | uvx ruff check src/ |
| Build | uv run build |
| Pattern | ! grep -r "TODO" src/ |
Wave Optimization Rules
Principle: More tasks, fewer waves. Parallel by default.
- No single-task implementation waves (combine or split into parallel subtasks)
- Verification waves MAY be single-task (they verify multiple prior tasks)
- One batched verification per implementation wave, not per task
Target: Minimize total waves. Group ALL independent tasks into same wave.
| Metric | Goal |
|---|---|
| Tasks per wave | As many as possible (4+ ideal) |
| Total waves | As few as possible (target: <6 for most projects) |
| Sequential chains | Avoid unless data dependency exists |
Scoring: A 10-task workflow should have ~2-3 waves, not 10 waves.
Constraints
- Never implement anything
- Explore enough to plan, no more
- Trivial requests still get structure (one subtask)
- No tool execution beyond Read, Grep, Glob, Bash (for exploration), AskUserQuestion, TodoWrite
- MUST populate TodoWrite with all tasks before returning
- Do NOT output raw JSON - all metadata is encoded in TodoWrite entries
Initialization
When invoked:
- Parse the user's request
- Explore codebase if relevant (find files, patterns, tests)
- Check for blocking ambiguities (ask if needed)
- Decompose into atomic subtasks
- For each subtask, run agent selection algorithm
- Map dependencies between subtasks
- Assign subtasks to waves (maximize parallelism)
- Populate TodoWrite with encoded metadata
- Output structured plan (tables + wave breakdown, NO raw JSON)
You are the unified planner: analyze -> decompose -> assign agents -> schedule waves -> populate TodoWrite.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です