jbaruch

speckit-05-tasks

0
0
# Install this skill:
npx skills add jbaruch/spec-kit-skills --skill "speckit-05-tasks"

Install specific skill from multi-skill repository

# Description

Generate actionable task breakdown from plan and specification

# SKILL.md


name: speckit-05-tasks
description: Generate actionable task breakdown from plan and specification


Spec-Kit Tasks

Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Constitution Loading (REQUIRED)

Before ANY action, load and internalize the project constitution:

  1. Read constitution:
    bash cat .specify/memory/constitution.md 2>/dev/null || echo "NO_CONSTITUTION"

  2. If exists, parse all principles - especially those affecting task ordering (e.g., TDD requirements).

Prerequisites Check

  1. Run prerequisites check:
    bash .specify/scripts/bash/check-prerequisites.sh --json

  2. Parse JSON for FEATURE_DIR and AVAILABLE_DOCS.

  3. If error or missing plan.md:
    ERROR: plan.md not found in feature directory. Run /speckit-03-plan first to create the implementation plan.

Smart Validation (Skills Advantage)

BEFORE generating tasks, perform AI-powered validation that vanilla commands cannot do:

Plan Completeness Gate

  1. Tech Stack Validation:
  2. Verify plan.md has Language/Version defined (not "NEEDS CLARIFICATION")
  3. WARN if missing: "Tech stack undefined - tasks may be too generic"

  4. User Story Mapping:

  5. Extract all user stories from spec.md (P1, P2, P3...)
  6. Verify each has clear acceptance criteria
  7. WARN if story lacks testable criteria: "US-X has no testable acceptance criteria"

  8. Dependency Pre-Analysis:

  9. Identify shared entities from data-model.md
  10. Flag entities used by multiple stories (potential blockers)
  11. Suggest: "Entity X used by US1, US2, US3 - recommend Phase 2 (Foundational)"

Quality Report

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  PLAN READINESS REPORT (Skills Advantage)   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Tech Stack:       [Defined/Missing]   [โœ“/โœ—]โ”‚
โ”‚  User Stories:     X found with criteria    โ”‚
โ”‚  Shared Entities:  X (โ†’ Foundational phase) โ”‚
โ”‚  API Contracts:    X endpoints defined      โ”‚
โ”‚  Research Items:   X decisions documented   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  TASK GENERATION: [READY/NEEDS WORK]        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Execution Flow

1. Load Design Documents

Read from FEATURE_DIR:
- Required: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
- Optional: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)

2. Execute Task Generation

  1. Load plan.md and extract tech stack, libraries, project structure
  2. Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
  3. If data-model.md exists: Extract entities and map to user stories
  4. If contracts/ exists: Map endpoints to user stories
  5. If research.md exists: Extract decisions for setup tasks
  6. Generate tasks organized by user story
  7. Generate dependency graph showing user story completion order
  8. Create parallel execution examples per user story
  9. Validate task completeness

3. Task Format (REQUIRED)

Every task MUST strictly follow this format:

- [ ] [TaskID] [P?] [Story?] Description with file path

Format Components:

  1. Checkbox: ALWAYS start with - [ ] (markdown checkbox)
  2. Task ID: Sequential number (T001, T002, T003...) in execution order
  3. [P] marker: Include ONLY if task is parallelizable (different files, no dependencies)
  4. [Story] label: REQUIRED for user story phase tasks only
  5. Format: [US1], [US2], [US3], etc.
  6. Setup phase: NO story label
  7. Foundational phase: NO story label
  8. User Story phases: MUST have story label
  9. Polish phase: NO story label
  10. Description: Clear action with exact file path

Examples:
- CORRECT: - [ ] T001 Create project structure per implementation plan
- CORRECT: - [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py
- CORRECT: - [ ] T012 [P] [US1] Create User model in src/models/user.py
- CORRECT: - [ ] T014 [US1] Implement UserService in src/services/user_service.py
- WRONG: - [ ] Create User model (missing ID and Story label)
- WRONG: T001 [US1] Create model (missing checkbox)
- WRONG: - [ ] [US1] Create User model (missing Task ID)

4. Phase Structure

  • Phase 1: Setup (project initialization)
  • Phase 2: Foundational (blocking prerequisites - MUST complete before user stories)
  • Phase 3+: User Stories in priority order (P1, P2, P3...)
  • Within each story: Tests (if requested) -> Models -> Services -> Endpoints -> Integration
  • Each phase should be independently testable
  • Final Phase: Polish & Cross-Cutting Concerns

5. Task Organization

From User Stories (spec.md) - PRIMARY ORGANIZATION:
- Each user story (P1, P2, P3...) gets its own phase
- Map all related components to their story:
- Models needed for that story
- Services needed for that story
- Endpoints/UI needed for that story
- Tests specific to that story (if requested)
- Mark story dependencies

From Contracts:
- Map each contract/endpoint to the user story it serves
- Each contract -> contract test task [P] before implementation

From Data Model:
- Map each entity to the user story(ies) that need it
- If entity serves multiple stories: Put in earliest story or Setup phase
- Relationships -> service layer tasks

From Setup/Infrastructure:
- Shared infrastructure -> Setup phase (Phase 1)
- Foundational/blocking tasks -> Foundational phase (Phase 2)
- Story-specific setup -> within that story's phase

6. Generate tasks.md

Use template structure with:
- Correct feature name from plan.md
- Phase 1: Setup tasks
- Phase 2: Foundational tasks
- Phase 3+: One phase per user story (in priority order)
- Final Phase: Polish & cross-cutting concerns
- Dependencies section
- Parallel execution examples
- Implementation strategy section (MVP first, incremental delivery)

7. Dependency Graph Validation (Skills Advantage)

After generating tasks, validate the dependency graph:

  1. Circular Dependency Detection:
  2. Build task dependency graph from blockedBy/blocks relationships
  3. Detect cycles: "CIRCULAR DEPENDENCY: T005 โ†’ T012 โ†’ T008 โ†’ T005"
  4. If found: HALT and require manual resolution

  5. Orphan Task Detection:

  6. Find tasks with no dependencies AND not blocking anything
  7. WARN: "Orphan tasks detected: T015, T023 - verify they belong to a phase"

  8. Critical Path Analysis:

  9. Identify longest dependency chain
  10. Report: "Critical path: T001 โ†’ T003 โ†’ T012 โ†’ T018 (4 tasks)"
  11. Suggest parallelization opportunities

  12. Phase Boundary Validation:

  13. Ensure no cross-phase dependencies go backwards
  14. ERROR if Phase 4 task depends on Phase 5 task

  15. Story Independence Check:

  16. Verify each user story phase CAN be implemented independently
  17. WARN if US2 tasks depend on US3 tasks (wrong priority order)

Dependency Report

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  DEPENDENCY GRAPH ANALYSIS                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Total Tasks:      X                        โ”‚
โ”‚  Circular Deps:    [None/X found]      [โœ“/โœ—]โ”‚
โ”‚  Orphan Tasks:     [None/X found]      [โœ“/!]โ”‚
โ”‚  Critical Path:    X tasks deep             โ”‚
โ”‚  Phase Boundaries: [Valid/X violations][โœ“/โœ—]โ”‚
โ”‚  Story Independence: [Yes/No]          [โœ“/โœ—]โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Parallel Opportunities: X task groups      โ”‚
โ”‚  Estimated Parallelism: X% speedup          โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Report

Output:
- Path to generated tasks.md
- Summary:
- Total task count
- Task count per user story
- Parallel opportunities identified
- Independent test criteria for each story
- Suggested MVP scope (typically just User Story 1)
- Format validation confirmation

Semantic Diff on Re-run (Skills Advantage)

If tasks.md already exists, perform semantic diff before overwriting:

1. Detect Existing Tasks

If tasks.md exists with task items:

  1. Extract semantic elements:
  2. Task IDs and descriptions
  3. Phase structure
  4. Completion status (checked/unchecked)
  5. User story assignments

  6. Preserve completion status:

  7. Tasks marked [x] should remain completed
  8. Map old task IDs to new task IDs by description similarity

  9. Compare with new generation:
    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ SEMANTIC DIFF: tasks.md โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Tasks: โ”‚ โ”‚ + Added: T025-T030 (new user story US4) โ”‚ โ”‚ ~ Renamed: T012 description updated โ”‚ โ”‚ - Removed: T008 (was for deleted FR-008) โ”‚ โ”‚ โœ“ Preserved: 15 completed tasks kept โ”‚ โ”‚ โ”‚ โ”‚ Phases: โ”‚ โ”‚ + Added: Phase 5 (User Story 4) โ”‚ โ”‚ ~ Reordered: None โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ COMPLETION STATUS: โ”‚ โ”‚ Previously completed: 15 tasks โ”‚ โ”‚ Mapped to new tasks: 14 tasks โ”‚ โ”‚ Lost (task removed): 1 task โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

2. Smart Merge Strategy

  • Completed tasks: Preserve completion status where possible
  • New tasks: Add as uncompleted
  • Removed tasks: Warn if they were completed (work may be lost)
  • Reordered tasks: Maintain new order, preserve completion

3. Warn About In-Progress Work

If significant changes affect completed tasks:

โš  WARNING: 3 completed tasks would be affected by regeneration.
Completed work that may need review:
- T008 [x] Create User model (task removed)
- T012 [x] Implement auth (description changed)

Proceed anyway? (yes/no)

Next Steps

After generating tasks:

  1. Recommended: Run /speckit-06-analyze to validate cross-artifact consistency
  2. Checks all user stories have corresponding tasks
  3. Verifies all tasks trace back to requirements
  4. Detects orphaned artifacts and constitution violations
  5. Catches issues before implementation begins

  6. Required: Run /speckit-07-implement to execute the implementation

  7. Note: Requires all checklists to be 100% complete

Suggest to user:

Tasks generated! Next steps:
- /speckit-06-analyze - (Recommended) Validate consistency between spec, plan, and tasks
- /speckit-07-implement - Execute implementation (requires 100% checklist completion)

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.