Spec-Driven Task Decomposer Skill
Write a tasks.md document that turns approved requirements and design elements into an ordered, traceable implementation plan.
Your job is to produce a task artifact that:
- is easy for an implementation agent to execute in sequence
- keeps tasks small, concrete, and dependency-aware
- preserves traceability from tasks to
DES-*andREQ-* - includes explicit acceptance-criteria test coverage before final verification
Default path: read approved requirements and design, group work into practical phases, create atomic tasks, add acceptance-criteria testing, validate tasks.md, and return a short review-ready summary.
Read references/task-patterns.md when you need examples of atomic task sizing, grouped acceptance-criteria tests, or phase-shaping patterns.
Process
If long-running-work-planning is available, load it at the start of this phase before decomposing the work. Use it to shape phase ordering, keep progress visible, and avoid holding all task reasoning until the end.
- Read Requirements: Read
specs/changes/<slug>/requirements.md. - Read Design: Read
specs/changes/<slug>/design.md. - Read Project Guidelines (if they exist): Use
GlobandReadto inspectTESTING.mdandSTYLEGUIDE.md. - Retrieve Contextual Memory: Invoke the
contextual-stewardshipskill to retrieveworkflowrules. - Inspect Existing Patterns: Use
Grepto find similar task structures in existing specs when helpful. - Define Phases: Group work into a small number of phases that follow implementation dependencies.
- Create Atomic Tasks: Break each design element into tasks that are concrete and usually completable within one focused session.
- Add Acceptance Criteria Testing: Create a dedicated penultimate testing phase covering every acceptance criterion.
- Add Final Checkpoint: Create a final phase that verifies all requirements and overall spec completeness.
- Validate Tasks: Call
mcp:verify_tasks_fileusingtasks.mdanddesign.mdcontent. - Validate Full Spec: Call
mcp:verify_complete_specfor<slug>. - Write Before Review: Save to
specs/changes/<slug>/tasks.mdbefore asking for approval.
Per-Phase Todo List
When this skill begins execution, create a todo list containing the following items in pending state. This list is scoped to this phase only — do not carry over items from any previous phase.
- Read requirements.md and design.md
- Read project guidelines
- Retrieve contextual memory (workflow)
- Inspect existing patterns
- Define implementation phases
- Create atomic tasks
- Add acceptance criteria testing phase
- Add final checkpoint phase
- Validate tasks
- Quality grade tasks
- Save tasks.md
Progress Rules
- Mark an item
in_progresswhen starting that work step. - Mark an item
completedonly after the work step has been verified. - Do not mark an item
completeduntil verification passes. - Create a fresh list when this phase begins; do not append to a prior phase's list.
Output File
specs/changes/<slug>/tasks.md
Required Document Structure
Your output must use this structure.
# Implementation Tasks
## Overview
This implementation is organized into 4 phases:
1. **Foundation** - Prepare core structures and entry points
2. **Feature Delivery** - Implement the main design elements
3. **Acceptance Criteria Testing** - Verify requirement behavior
4. **Final Checkpoint** - Validate completeness and readiness
**Estimated Effort**: Medium (3-5 sessions)
## Phase 1: Foundation
- [ ] 1.1 Add request entry point
- Create the main request handler for protected operations.
- _Implements: DES-1_
- [ ] 1.2 Add authorization service
- Implement the shared authorization decision logic used by protected operations.
- _Depends: 1.1_
- _Implements: DES-1, REQ-1.1, REQ-1.2_
## Phase 2: Feature Delivery
- [ ] 2.1 Add denial feedback path
- Return a user-visible denial response when authorization fails.
- _Depends: 1.2_
- _Implements: DES-1, REQ-2.1_
- [ ] 2.2 Add audit logging for denied actions
- Record authorization failures when audit logging is enabled.
- _Depends: 1.2_
- _Implements: DES-2, REQ-3.1, REQ-3.2_
## Phase 3: Acceptance Criteria Testing
- [ ] 3.1 Test: reject non-administrator protected actions
- Verify protected actions are rejected for non-administrator users.
- Test type: integration
- _Depends: 1.2_
- _Implements: REQ-1.1_
- [ ] 3.2 Test: allow administrator protected actions
- Verify protected actions succeed for administrator users.
- Test type: integration
- _Depends: 1.2_
- _Implements: REQ-1.2_
- [ ] 3.3 Test: show denial feedback and record denied attempts
- Verify denied protected actions display the denial response and record the denial event.
- Test type: integration
- _Depends: 2.1, 2.2_
- _Implements: REQ-2.1, REQ-3.1_
## Phase 4: Final Checkpoint
- [ ] 4.1 Verify all acceptance criteria
- REQ-1: Confirm protected actions enforce authentication and administrator authorization.
- REQ-2: Confirm denied access returns clear feedback.
- REQ-3: Confirm denied actions are recorded when logging is enabled.
- Run the relevant test suite and resolve any remaining traceability gaps.
- _Implements: All requirements_
Task Rules
- Use checkbox task format:
- [ ] N.M Task title. - Number phases sequentially as
## Phase 1: ...,## Phase 2: ..., and so on. - Number tasks sequentially inside each phase using the phase number (
1.1,1.2,2.1, etc.). - Every non-checkpoint task must include an
_Implements:line. - Use
_Depends:only when the dependency is real and useful. - Resolve all placeholders before returning output.
- Do not include HTML comments, TODO markers, or drafting notes in the final artifact.
Task Types
Implementation Tasks
Use implementation tasks for building or modifying design elements.
- [ ] 2.1 Add authorization middleware
- Implement the request guard used by protected endpoints.
- _Depends: 1.2_
- _Implements: DES-1, REQ-1.1_
Rules:
- Every implementation task must reference at least one
DES-*element. - Add
REQ-*references when the task clearly delivers a specific requirement behavior. - Keep titles action-oriented:
Add,Update,Refactor,Wire,Create,Remove.
Test Tasks
Use test tasks in the dedicated Acceptance Criteria Testing phase.
- [ ] 3.1 Test: reject unauthorized access
- Verify requests without the required role are rejected.
- Test type: integration
- _Depends: 2.1_
- _Implements: REQ-1.1_
Rules:
- Prefix test tasks with
Test:. - Use behavior-focused titles; do not include
REQ-*IDs in the title. - Every test task must include
Test type: unit,Test type: integration, orTest type: e2e. - Every test task must include
_Implements:with one or moreREQ-*acceptance criteria. - Every acceptance criterion from
requirements.mdmust be covered by at least one test task. - You may group closely related acceptance criteria into one test task when a single test flow naturally verifies them together.
- If multiple criteria are grouped, the title and description must make the combined behavior explicit.
Testing Guidance
Choose test type in this order:
- Follow
TESTING.mdif present. - Follow the design document's
Testing Requirementssection if present. - Otherwise default by scope:
unitfor isolated logicintegrationfor cross-component or service-boundary behaviore2efor user-visible end-to-end flows
The Acceptance Criteria Testing phase must be the penultimate phase.
The Final Checkpoint phase must be the last phase.
Phase Design Guidance
Use phases to create a practical execution order.
Good phase patterns include:
- foundation or setup
- core feature delivery
- supporting integrations or error handling
- acceptance criteria testing
- final checkpoint
Prefer 3-6 phases for most changes.
Sizing and Dependency Rules
- Prefer tasks that fit within one focused session.
- Split tasks that cover multiple unrelated concerns.
- Split tasks that touch too many files or systems without a clear reason.
- Avoid dependency chains longer than necessary.
- If a task title naturally contains
and, consider splitting it. - If one task depends on many earlier tasks, reconsider the phase layout.
Traceability Rules
- Every
DES-*element fromdesign.mdshould be implemented by at least one implementation task. - Every
REQ-*acceptance criterion fromrequirements.mdmust be covered by at least one test task. - Use
_Implements: DES-X_or_Implements: DES-X, REQ-Y.Z_for implementation tasks. - Use
_Implements: REQ-Y.Z_or grouped_Implements: REQ-Y.Z, REQ-A.B_for test tasks. - Use
_Implements: All requirements_only for the Final Checkpoint task.
Clarification Policy
Ask a clarifying question only if the ambiguity would materially change:
- task sequencing
- dependency structure
- test strategy
- how requirements map to design elements
When to Ask
- The design is missing key
DES-*details needed for decomposition. - The requirements and design appear inconsistent.
- The scope is too broad for one coherent task plan.
- Test coverage expectations are materially unclear.
When NOT to Ask
- The design provides enough structure for a reasonable task breakdown.
- A low-risk assumption can be made and reflected in the tasks.
- The ambiguity is implementation-level rather than decomposition-level.
How to Ask
- Ask no more than 3 focused questions at a time.
- Ask about execution decisions, not implementation preferences.
- Prefer concrete options when possible.
Validation and Recovery
MCP Validation Failures
When mcp:verify_tasks_file or mcp:verify_complete_spec returns errors:
- Add missing required sections or phases.
- Fix task numbering and checkbox formatting.
- Add missing
_Implements:lines to non-checkpoint tasks. - Add or fix
DES-*references so they matchdesign.md. - Add or fix test tasks so every acceptance criterion is covered.
- Reorder tasks to remove obvious dependency issues.
After 3 failed validation attempts:
- Summarize the remaining errors.
- Ask: "Should I proceed with best-effort corrections?"
- If yes: make corrections and document assumptions in ordinary task prose.
- If no: request focused guidance.
Incomplete Design or Requirement Inputs
If requirements.md or design.md is incomplete but still usable:
- Preserve valid traceability that already exists.
- Infer the smallest reasonable task plan from available structure.
- Avoid inventing major new architecture.
- Surface the blocking gaps if they prevent reliable decomposition.
Quality Bar (Self-Check)
Before returning the tasks, verify:
- Document starts with
# Implementation Tasks -
## Overviewis present - Phase headers use
## Phase N: Title -
Acceptance Criteria Testingis the penultimate phase -
Final Checkpointis the last phase - Every task uses checkbox format
- Every non-checkpoint task includes
_Implements: - Every
DES-*fromdesign.mdis covered by implementation tasks - Every
REQ-*acceptance criterion is covered by at least one test task - Grouped test tasks only combine naturally related criteria
- Numbering is concrete; no symbolic placeholders like
N-1remain - No HTML comments or drafting notes remain
Output Requirements
- Write
specs/changes/<slug>/tasks.mdbefore requesting review - Prefer validator-compatible structure over decorative formatting
- Keep the plan concise but complete enough for direct implementation
- Return ordinary prose summary after the file is written; do not wrap the artifact in XML
Response Behavior
If enough information is available, produce the full tasks.md content directly.
If material ambiguity blocks a sound task plan, ask a short clarification first. Do not produce a low-confidence decomposition.
Contextual Stewardship Integration
At the start of this phase, before decomposing the work, invoke the contextual-stewardship skill to retrieve established workflow conventions:
Invoke: contextual-stewardship skill
Action: retrieve
Query: workflow
This ensures the task breakdown aligns with team processes, testing rules, and naming conventions.
Quality Grading Integration
After completing tasks and before requesting approval, invoke the quality-grading skill to assess and improve task plan quality:
Invoke: quality-grading skill
Artifact: specs/changes/<slug>/tasks.md
Mode: grade-and-fix
This ensures the tasks document meets quality standards across:
- Design Quality: Logical phase organization, task dependencies, clear structure
- Originality: Tailored task breakdown vs generic boilerplate
- Craft: Clear task descriptions, proper traceability, consistent formatting
- Functionality: Complete coverage of requirements, all acceptance criteria mapped
The quality-grading skill will auto-fix issues scoring below 4 and provide actionable suggestions for remaining gaps.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.