Use when a spec is approved and needs decomposition into scoped implementation tasks — requires completed challenge phase.
From dp-ctonpx claudepluginhub raisedadead/dotplugins --plugin dp-ctoThis skill uses the workspace's default tool permissions.
references/agent-prompt-template.mdreferences/anti-rationalization.mdreferences/dependency-rules.mdreferences/dispatch-heuristic.mdreferences/red-flags.mdreferences/task-breakdown-template.mdreferences/task-spec-fields.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Running: handoff — Decomposing the approved spec into scoped tasks in one pass. Expect: A TASKS file presented for approve/revise/reject gate, plus beads molecule for
/dp-cto:rundispatch.
<EXTREMELY_IMPORTANT> You are a principal engineer converting an approved spec into implementation tasks. You decompose, scope, and structure. You NEVER implement.
If you catch yourself writing application code, STOP. You are decomposing, not coding. </EXTREMELY_IMPORTANT>
Read references/anti-rationalization.md before proceeding. It contains the rationalization prevention table for this skill.
Stage must be challenged. The adversarial review from /dp-cto:challenge has been completed and the spec is approved.
If the stage is not challenged, the stage machine hook will deny this skill. Do not attempt to bypass.
Do this automatically. No user interaction needed.
CLAUDE.md for project conventions, tech stack, test commands${CLAUDE_SKILL_DIR}/references/task-breakdown-template.md (relative to the plugin installation directory)git log --oneline -10 for current work contextSummarize the spec in 3-5 bullet points covering: goal, architecture, key components, testing strategy, protection boundaries.
Before decomposing into tasks, extract from the spec's Protection Section:
Present these as a consolidated protection list. Every task created in later steps will reference this list in its constraints.
If the spec has no Protection Section, probe the codebase: identify public API surfaces, exported interfaces, and config files that should be protected. Present the inferred list and proceed.
Break the approved spec into implementation tasks. Each task must be:
Read references/task-spec-fields.md for the complete task specification field definitions. Every field is required.
Read references/dispatch-heuristic.md for the dispatch type selection heuristic.
Read references/dependency-rules.md for the dependency ordering rules.
Present tasks in two groups following the task-breakdown template:
This is the default output path. Always generate the markdown task breakdown.
Read the task-breakdown template from ${CLAUDE_SKILL_DIR}/references/task-breakdown-template.md (relative to the plugin installation directory) and use its format.
Derive the title from the spec document title:
TASKS-TASKS-user-auth-service.mdRead references/agent-prompt-template.md for the self-contained agent prompt template. Every task needs a prompt executable by an agent with no conversation history.
Save as TASKS-<title>.md in the current working directory. Use the task-breakdown template structure with all fields from Step 2 populated.
Include at the top:
# Implementation Task Breakdown
**Source Spec:** [Path to the approved spec document]
**Spec Type:** [RFC / PRD / ADR]
**Generated:** [Date]
**Total Tasks:** [Count]
**Dispatch Summary:** [N subagent, N iterative, N collaborative]
## Protection Boundaries
[Full protection list from Step 1 — agents must respect these]
Then list all tasks following the template format, grouped into Critical Path and Parallelizable Work sections.
Each task entry must include the full agent prompt (from Step 3b) in a fenced code block.
Present the task breakdown summary (task count, critical path, parallelizable groups, dispatch type distribution) and use AskUserQuestion with exactly three options:
If the user selects Reject, stop and print: "Handoff rejected. Run /dp-cto:challenge to revisit the spec."
If the user selects Approve, proceed to Step 5.
Check beads availability:
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_available && echo ok'
If beads is NOT available, STOP. Report: "Beads not available. Run /dp-cto:spec or dp_beads_init to initialize."
If beads IS available, create the beads molecule from the task decomposition. This enables scheduling for /dp-cto:run.
All beads operations MUST use wrapper functions from lib/dp-beads.sh. Never call bd directly.
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_create "[Spec Title] — Implementation" epic -d "[One-sentence goal from spec]"'
Record the returned epic ID.
Set the spec summary as the epic description. Use dp_beads_update to write the full description with architecture context, protection boundaries, and testing strategy from the spec. This is the agent's primary context source — write it rich, not thin.
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_update "{epic-id}" -d "[Full spec summary with architecture, protection boundaries, testing strategy]"'
For each task from Step 2, create a beads child task with the full agent prompt as the description (from Step 3b). This is critical — dp_beads_show is what the implementer agent reads. Thin descriptions produce thin implementations.
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_create "Task N: [Component Name] [dispatch-tag]" task --parent {epic-id} -d "[FULL agent prompt from Step 3b — not a summary]"'
Record each returned task ID.
For each task with dependencies:
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_dep_add {dependent-task-id} {blocking-task-id}'
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_list --pretty'
bash -c 'source ${CLAUDE_PLUGIN_ROOT}/lib/dp-beads.sh && dp_beads_ready --json'
Verify:
If verification fails, fix the issues before proceeding.
Print exactly:
"Spec complete. Task breakdown saved to TASKS-<title>.md. Beads epic {epic-id} with N tasks created — ready for /dp-cto:run."
Do NOT invoke dp-cto:run. Do NOT offer to start execution. The user decides when.
<CHAIN> Spec pipeline complete. The approved spec has been decomposed into implementation tasks. TASKS-*.md is a human-readable companion to the beads molecule. Beads epic created: /dp-cto:run can dispatch tasks via `dp_beads_ready`. The user decides the next step. Do NOT auto-invoke /dp-cto:run. </CHAIN>Read references/red-flags.md before proceeding. It contains the stop conditions for this skill.