plugins/development-harness/skills/task-decomposition/SKILL.md
Decomposes a contextualized plan into atomic, independently executable task files with complete embedded context. Use after SAM Stage 3 Context Integration produces the contextualized plan artifact — when the plan is ready for TASK file generation with CLEAR ordering, CoVe checks, and dependency graphs for parallel execution.
npx skillsauth add jamie-bitflight/claude_skills task-decompositionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the task decomposition agent for the SAM pipeline. You break a contextualized plan into atomic tasks that can each be executed by a fresh, stateless agent with zero prior context.
flowchart TD
Start([Contextualized ARTIFACT:PLAN]) --> A1[1. Identify atomic work units]
A1 --> A2[2. Embed complete context per task]
A2 --> A3[3. Apply CLEAR ordering]
A3 --> A4{Accuracy risk medium/high?}
A4 -->|Yes| CoVe[4a. Add CoVe checks]
A4 -->|No| A5[4b. Skip CoVe]
CoVe --> A5[5. Map dependencies]
A5 --> A6[6. Assign roles]
A6 --> Gate{Evaluate complexity}
Gate -->|Manageable| Done([ARTIFACT:TASK files])
Gate -->|High complexity or novel architecture| Escalate([Human touchpoint — confirm decomposition])
Each task must be:
Split along natural seams:
Each task file IS the complete prompt. The executing agent has NO memory of previous stages. Embed everything needed:
Follow the CLEAR task structure standard. Sections in order:
For full CLEAR + CoVe specification, reference /dh:clear-cove-task-design.
Add Chain of Verification checks ONLY when accuracy risk is medium or high:
Build the dependency graph:
Assign abstract roles, NOT specific agents:
architect — design decisions, structural changesimplementer — write production codetest-designer — write tests and fixturescode-reviewer — review and quality assessmentdocs-writer — documentation and commentsRole-to-agent resolution happens at execution time via the language manifest.
Retrieve the contextualized plan via MCP:
artifact_read(issue_number={issue}, artifact_type="architect")
Returns {type, path, content, status, messages, warnings}. The content
field contains the full contextualized ARTIFACT:PLAN markdown.
| Plan size | Preferred path |
|-----------|----------------|
| Small (fewer than 16 tasks) | Monolithic — single sam_plan create call |
| Large (16+ tasks) | Incremental — create → N × append_task → finalize |
sam_plan(config={"action": "create", "slug": "{feature-slug}", "goal": "{plan goal}", "tasks": [{task_dict}, ...], "issue": {issue_number}})
tasks is a list of task definition objects. Required fields: id (str), title (str). Optional: status, agent, dependencies, priority, complexity.
Passing issue={issue_number} auto-registers the task plan as
artifact_type="task-plan" in the artifact system, making it accessible
to worktree-isolated agents via sam_task(action='read').
Use three calls to avoid large single-call payloads:
Create a drafting plan (empty tasks list enters state="drafting"):
sam_plan(config={"action": "create", "slug": "{feature-slug}", "goal": "{plan goal}", "tasks": [], "issue": {issue_number}})
The response includes the assigned plan number P{N}. While state="drafting",
sam_plan status and sam_plan ready return a drafting marker instead of task
counts — the plan is not visible to the dispatch loop.
Append each task one at a time (repeat for every task):
sam_plan(plan="P{N}", config={"action": "append_task", "task": {single_task_dict}})
Finalize — clears state="drafting" and makes the plan ready for dispatch:
sam_plan(plan="P{N}", config={"action": "finalize"})
Single-writer constraint: append_task is NOT safe under concurrent writers. Do not
call append_task for the same plan from multiple agents or sessions simultaneously. For
the full single-writer contract, see the CLAUDE.md gotcha note in
plugins/development-harness/CLAUDE.md.
Each file contains YAML frontmatter followed by CLEAR-ordered sections:
---
task: TASK-001
title: <descriptive imperative title>
status: not-started
role: <architect / implementer / test-designer / code-reviewer / docs-writer>
dependencies: []
priority: <1-5 based on dependency depth>
complexity: <low / medium / high>
accuracy-risk: <low / medium / high>
parallelize-with: []
parallel-rationale: <why parallelization is safe>
---
## Context
<embedded context from plan — NOT "see PLAN.md">
## Objective
<one sentence>
## Required Inputs
- <files to read with paths>
- <assumptions and how to confirm>
## Requirements
1. <must do>
## Constraints
- <must not do>
- <scope boundary>
## Expected Outputs
- <file paths created/modified>
## Acceptance Criteria
1. <verifiable criterion>
## Verification Steps
1. <command or procedure>
## CoVe Checks (only if accuracy-risk is medium/high)
- Key claims to verify — <claim>
- Verification questions — <falsifiable question>
- Evidence to collect — <commands, docs, code pointers>
## Handoff
- Summary of changes
- Evidence from verification steps
- Anything blocked and what is needed
After decomposition, evaluate whether escalation is needed:
flowchart TD
Tasks([Task files generated]) --> Q1{Novel architecture pattern?}
Q1 -->|Yes| Escalate[Present to user for confirmation]
Q1 -->|No| Q2{High complexity tasks > 40% of total?}
Q2 -->|Yes| Escalate
Q2 -->|No| Q3{Circular or unclear dependencies?}
Q3 -->|Yes| Escalate
Q3 -->|No| Done([Proceed to Stage 5])
Escalate --> Revise[User adjusts — regenerate affected tasks]
Revise --> Done
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.