skills/src/decompose-plan/SKILL.md
Decomposes an approved design document into a TDD-based implementation plan or reviews an existing plan (mode=create|review). Create mode: task breakdown with traceability. Review mode: independent sub-agent verification absorbing the former analyze-plan audit. Use after design-doc approval when the user needs to break down a design into executable tasks, create an implementation plan, or generate a task list from a design.
npx skillsauth add shuymn/dotfiles decompose-planInstall 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.
<skill-root> means the directory containing this SKILL.md.scripts/... and references/... relative to <skill-root>, not the caller's current working directory.<skill-root>/scripts/....Determine the execution mode from $ARGUMENTS:
$ARGUMENTS is exactly review, or $ARGUMENTS contains --review or mode=review → Review Mode: read references/review-mode.md and follow its instructions.# Task Decomposition from Design Doc)Convert an approved design doc into a concise, execution-ready plan bundle. Output instruction-level guidance only. Do not output implementation code snippets.
docs/plans/<topic>/ (typically created by the design-doc skill).
Split Decision: root-sub, treat the root doc plus all sub docs listed in its Sub-Doc Index as the design input set.docs/plans/<topic>/plan.md (core, frequently read)docs/plans/<topic>/plan.trace.md (traceability evidence, on-demand)docs/plans/<topic>/plan.compose.md (reconstruction check, on-demand)Do NOT begin any implementation until the plan is explicitly approved by the user. Reason: implementing against an unapproved plan locks in scope decisions the user hasn't seen yet; adjusting the plan before code is written is far cheaper than reverting code afterward.
No exceptions. Not even "just to test one thing" or "the first task is trivial."
Before starting decomposition in create mode, verify the design review gate:
skit gate-check <review-file> <source-file>.Overall Verdict: PASS, and the Source Digest must match the current design file.BLOCKED and request the user to run design-doc review first.Before loading design atoms in create mode, verify that the source design's single / root-sub decision still holds:
skit split-check <design-file>.FAIL, stop as BLOCKED and request design updates before decomposition.plan.md compact and avoid compensating for a weak split with duplicated boundary-local narrative.Do not infer migration lifecycle details that are absent from the design doc.
## Compatibility & Sunset and TEMPxx enumeration in either:
Temporary Mechanism Index (preferred)Temporary Mechanism Ledger (legacy-compatible)TEMPxx:
Sunset Closure Checklist row (preferred)Retirement Trigger, Retirement Verification, Removal Scope; exact labels or unambiguous synonyms)TEMPxx, require lifecycle closure fields:
Sunset Clause is supplemental and not a substitute for in-doc closure summary.Sunset Clause for that TEMPxx.BLOCKED and request design completion before decomposition.skit temp-lifecycle-check <design-file>. If it reports FAIL, stop as BLOCKED.Treat decomposition as a reversible transform.
Design Doc -(decompose)-> Tasks must preserve all implementable intent.Tasks -(compose)-> Design Doc must reconstruct the same scope and acceptance intent.Keep the execution file thin and move heavy analysis to sidecars.
plan.md must contain only what is needed repeatedly during implementation.plan.trace.md stores traceability and full check evidence.plan.compose.md stores reconstruction outputs and scope-diff evidence.plan.md) Required Sectionsskit dep-graph-gen)Goal, RED, GREEN, REFACTOR, DoD; no TEMPxx-specific fields)plan.trace.md) Required SectionsDECxx -> ADR-xxxx)TEMPxx lifecycle and closure status)only/remove/no-fallback/fail-closed requirements and their negative checks)ACxx -> Owner Task + Contributors)plan.compose.md) Required Sectionsmissing, extra, ambiguous)plan.md header must include:
**Trace Pack**: docs/plans/<topic>/plan.trace.md**Compose Pack**: docs/plans/<topic>/plan.compose.md- **Key**: valueplan.md concise: no duplicated requirement prose, no full trace matrices, no long rationale blocks.REQxx, ACxx, DECxx) over repeated natural-language restatement.plan.md stops being a thin execution artifact because boundary-local explanations, repeated verification flows, or task narratives are spilling out of sidecars, re-run skit split-check <design-file> and revisit the design split before finalizing.Goal, explicit Dependencies, a Scope Contract, and explicit verification surfaces (RED, Boundary Verification, Closure Verification when needed).Use these non-scoring questions to shape tasks before presenting plan.md.
Objective: Keep each task to one primary objective. If a task contains multiple independently releasable outcomes, split it.Boundary: Separate unrelated ownership surfaces or top-level path families into different tasks.Verification Surface: Add Boundary Verification whenever the task crosses public/runtime/integration boundaries. Add Closure Verification only when an extra close-out surface is genuinely needed.Rollback: Keep rollback and removal boundaries legible through Scope Contract, not through file-count heuristics.For design atoms expressing hard behavioral constraints — restricting behavior to a single path, removing or replacing an existing capability, or mandating failure when a former path is attempted. Common keyword examples (not exhaustive): only, must not, remove, retire, no fallback, fail-closed, 唯一, 廃止, 禁止:
## Decomposition Strategy:
Split Decision: single, continue with the single design doc.Split Decision: root-sub, read all sub docs listed in Sub-Doc Index.root-sub is declared but Sub-Doc Index is missing or any listed sub doc is unreadable, stop as BLOCKED.Goals, Non-Goals, Design, Decision Log, Acceptance Criteria, and Existing Codebase Constraints (when present) from the full design input set (root + sub docs when root-sub).TEMPxx lifecycle records (root + sub docs when root-sub).GOALxx: in-scope outcomesNONGOALxx: explicit exclusionsREQxx: implementable requirementsDECxx: key design decisions; each must map to exactly one ADR-xxxx from Decision LogACxx: acceptance criteriaTEMPxx: temporary mechanisms from Compatibility & Sunset (required for breaking-change designs)TEMPxx, capture lifecycle tuple:
retirement_triggerretirement_verificationremoval_scopeclosure_source (checklist or ledger)record_source (adr or ledger)root-sub, verify design-atom IDs are globally unique across root and all sub docs; if duplicate IDs exist, stop as BLOCKED.DECxx -> ADR-xxxx.AGENTS.md > CLAUDE.md > project config files (package.json, Makefile/Taskfile.yml, pyproject.toml, .pre-commit-config.yaml, CI config).test, lint, format, typecheck, other.BLOCKED and request the user to define quality gates (in AGENTS.md, CLAUDE.md, or a project config file) before proceeding.command -v. If any command is not found, stop as BLOCKED and report the missing command(s).## Risk Classification from the design doc:
## Risk Classification section exists:
BLOCKED and request a risk-classified design doc.TEMPxx lifecycle evidence is missing/incomplete, stop as BLOCKED.TEMPxx, map lifecycle coverage in Temporary Mechanism Trace using existing implementation tasks:
TEMPxx-only tasks or add TEMPxx fields to plan.md task blocks.reason, deadline, owner optional for solo operation).plan.md includes negative verification that the TEMPxx removal is complete (fallback/temporary path must fail or be absent).Scope Contract instead of file allowlists:
Owned Paths: required. These are the paths the task primarily owns.Shared Touchpoints: optional. Each entry must include a rationale.Prohibited Paths: optional. These are fail-closed boundaries for the task.Owned Paths and Shared Touchpoints is a re-slice, not an implicit expansion.
5.5. For each AC with Verification Command: TBD-at-plan in the design doc, resolve the concrete command based on task context (test framework, verification approach). Record the resolved command in the task's RED or DoD. If a concrete command cannot be determined, stop as BLOCKED.RED, GREEN, REFACTOR, DoD, and any required verification surfaces without implementation snippets.
Global Quality Gates apply.Boundary Verification when the task crosses public/runtime/integration boundaries.Closure Verification only when the task needs explicit closure beyond local RED/DoD success.Risk Tier is the source of truth and downstream skills derive the required scrutiny.only, remove, no fallback, fail-closed, 唯一, 廃止, 禁止.BLOCKED.Design Anchors for each task:
REQxx or ACxx.DECxx in anchors.TEMPxx IDs are not valid Design Anchors for plan.md; keep TEMP mapping in plan.trace.md.DECxx.ACxx, assign exactly one Owner Task (the task whose RED validates this AC) and zero or more Contributor Tasks.AC Ownership Map (see Trace Pack required sections).Scope Contract, and explicit verification surfaces.Objective / Boundary / Verification Surface / Rollback self-check to re-slice overloaded tasks before presentation.docs/plans/<topic>/plan.mddocs/plans/<topic>/plan.trace.mddocs/plans/<topic>/plan.compose.mdplan.md as compact execution instructions.plan.trace.md with Design Atom Index, Decision Trace, both matrices, Behavioral Lock Map, and full check details.plan.compose.md with reconstruction summary and scope diff.plan.md links to both sidecars in its header.plan.md references REQxx/ACxx in Satisfied Requirements and has complete Design Anchors.TEMPxx has introducing/retiring task mappings (or explicit waiver metadata) in plan.trace.md.Checkpoint Summary in plan.md using the required fixed format.skit dep-graph-gen <plan-file> to auto-generate ## Task Dependency Graph. Do NOT write this section manually — the command generates it from **Dependencies** fields.Perform structural checks before presenting the plan. Semantic verification is delegated to review mode.
skit structural-check <design-file> <plan-file>.skit trace-compose-check <design-file> <plan-trace-file>.skit risk-dod-check <plan-file> <design-file>. If it reports FAIL, fix missing task-level Risk Tier, Scope Contract, Boundary Verification, or remove legacy boilerplate.plan.trace.md.plan.trace.md, use repository-relative project paths and scripts/<name>.sh helper names, never absolute filesystem paths.Checkpoint Summary in plan.md.Note: The deep semantic checks (forward/reverse fidelity, behavioral lock guard, task-shape blockers, temporal completeness, etc.) are now performed by decompose-plan review mode, which runs as an independent sub-agent.
The review agent writes plan.review.draft.md, and a finalizer script produces the gate artifact plan.review.md.
plan.md first.plan.trace.md and reconstruction evidence is in plan.compose.md.Dependencies, ordering, or prerequisite assumptions reference the changed task IDs or boundaries (for example, if T3 is split, also update each downstream T<N> that depended on T3). Do not limit the fix to the changed task itself. Then re-run skit dep-graph-gen <plan-file> to regenerate the Task Dependency Graph.decompose-plan review (independent sub-agent verification) before execute-plan.RED -> GREEN -> REFACTOR.BLOCKED instead of inferring.development
Simplifies recently changed code by running three parallel reviews (reuse, quality, efficiency) and applying only behavior-preserving fixes. Use when the user asks to simplify, clean up, reduce duplication, improve code reuse, or optimize recently changed code, a staged diff, a branch diff, or explicitly listed files. Also use when the user says things like 'simplify this', 'まとめて整理して', 'コードをスリムにして', or invokes `/simplify`.
tools
Use when the user invokes /workflow. Injects project workflow methodology as context. Accepts argument: plan, exec, review (default: all).
development
Processes AI reviewer feedback and applies only verified fixes. Works in two modes: (1) fetches comments from a PR URL or current branch, (2) processes feedback pasted directly into the conversation. Trigger when the user wants to bulk-process or apply AI review suggestions — from a GitHub PR or pasted text. Do NOT trigger for single questions about what a bot said, or general code review discussion.
testing
Prepares .ralph/ runtime state from an approved and reviewed plan bundle. Syncs plan tasks into prd.json and updates prompt.run.md with project-specific context and quality gates. Use after plan approval, decompose-plan review PASS, and ralph init.