The /speckit.tasks command generates a dependency-ordered, parallelizable task breakdown from implementation plans and design artifacts. This command transforms high-level specifications and technical plans into executable work items that AI agents can implement systematically. It produces a tasks.md file that serves as the execution roadmap for the /speckit.implement command.
This page documents task generation logic, format requirements, and phase organization. For creating implementation plans that feed this command, see /speckit.plan Command. For executing generated tasks, see /speckit.implement Command. For quality validation of task completeness, see /speckit.analyze Command.
Sources: templates/commands/tasks.md1-141 README.md119-134 README.md576-594
The /speckit.tasks command occupies a critical position in the Spec-Driven Development workflow, bridging planning and implementation:
Workflow Position: Tasks Generation
Sources: templates/commands/tasks.md17-68 README.md576-594
The command reads multiple design documents from the feature directory (FEATURE_DIR), determined by running the prerequisite check script:
| Artifact | Required | Purpose | Format |
|---|---|---|---|
plan.md | ✅ Yes | Tech stack, libraries, project structure | Structured markdown with sections |
spec.md | ✅ Yes | User stories with priorities (P1, P2, P3) | Markdown with user story enumeration |
data-model.md | ⚠️ Optional | Entity definitions and relationships | Markdown with entity descriptions |
contracts/*.json | ⚠️ Optional | API endpoint specifications | OpenAPI/custom JSON schemas |
contracts/*.md | ⚠️ Optional | Contract definitions (e.g., SignalR) | Markdown specification |
research.md | ⚠️ Optional | Technical decisions and rationale | Markdown with decision records |
quickstart.md | ⚠️ Optional | Test scenarios and validation criteria | Markdown with test cases |
Sources: templates/commands/tasks.md29-32
Before reading artifacts, the command executes a prerequisite check to determine the feature directory and available documents:
Bash variant:
scripts/bash/check-prerequisites.sh --json
PowerShell variant:
scripts/powershell/check-prerequisites.ps1 -Json
The script returns JSON with FEATURE_DIR (absolute path) and AVAILABLE_DOCS (list of present artifacts).
Sources: templates/commands/tasks.md13-14 templates/commands/tasks.md27
Task Generation Workflow: From Design Artifacts to Executable Tasks
Sources: templates/commands/tasks.md34-43
The command maps design artifacts to user stories to ensure each story phase contains all necessary implementation tasks:
Component-to-Story Mapping: How Artifacts Map to Task Phases
Sources: templates/commands/tasks.md110-132
The generated tasks.md file follows a strict structure defined by templates/tasks-template.md:
tasks.md Document Structure
Sources: templates/commands/tasks.md45-56 README.md585-592
Every task in tasks.md MUST follow the strict checklist format specified in the task generation rules:
- [ ] [TaskID] [P?] [Story?] Description with file path
| Component | Required | Format | Purpose | Example |
|---|---|---|---|---|
| Checkbox | Always | - [ ] | Markdown checkbox for tracking | - [ ] |
| Task ID | Always | T### | Sequential number in execution order | T001, T042 |
| Parallel Marker | Conditional | [P] | Indicates task can run in parallel | [P] |
| Story Label | Phase-specific | [US#] | Maps to user story from spec.md | [US1], [US3] |
| Description | Always | Text + file path | Action with exact file location | Create User model in src/models/user.py |
Story labels ([US#]) are REQUIRED only for user story phase tasks:
Sources: templates/commands/tasks.md76-107
Sources: templates/commands/tasks.md97-107
Tasks are organized into phases that enable incremental delivery:
Phase Progression: From Setup to Polish
Sources: templates/commands/tasks.md133-141
| Phase | Name | Purpose | Story Label | When to Use |
|---|---|---|---|---|
| Phase 1 | Setup | Project initialization, tooling setup | No | Always first |
| Phase 2 | Foundational | Blocking prerequisites for ALL user stories | No | Shared infrastructure |
| Phase 3+ | User Story N | Complete implementation of one user story | Yes ([USN]) | Per-story work |
| Final | Polish | Cross-cutting concerns, documentation | No | Always last |
Each user story phase follows this internal order:
Sources: templates/commands/tasks.md133-141
The command generates a dependency graph showing user story completion order:
Dependency Graph: Story Completion Order
Key Principle: Most user stories should be independent to enable parallel development and incremental delivery. Hard dependencies between stories are rare and should be explicitly documented.
Sources: templates/commands/tasks.md41-42 templates/commands/tasks.md110-119
Within a phase, tasks must respect component dependencies:
Task Dependencies: Models → Services → Endpoints
Sources: templates/commands/tasks.md136-139
Tasks that can execute in parallel are marked with [P]:
A task can be marked [P] if:
Tasks that cannot be marked [P]:
Sources: templates/commands/tasks.md86-88
The tasks.md includes per-story parallel execution examples:
**Sources:** <FileRef file-url="https://github.com/github/spec-kit/blob/9a1e3037/templates/commands/tasks.md#L42-L43" min=42 max=43 file-path="templates/commands/tasks.md">Hii</FileRef> <FileRef file-url="https://github.com/github/spec-kit/blob/9a1e3037/templates/commands/tasks.md#L62-L62" min=62 file-path="templates/commands/tasks.md">Hii</FileRef>
---
## Test-Driven Development Support
### Optional Test Generation
The command generates test tasks **only if explicitly requested**:
- ✅ Generate tests if: Specification includes testing requirements OR user requests TDD approach
- ❌ Do not generate tests if: No testing mentioned in specification
**Sources:** <FileRef file-url="https://github.com/github/spec-kit/blob/9a1e3037/templates/commands/tasks.md#L74-L74" min=74 file-path="templates/commands/tasks.md">Hii</FileRef>
---
### Test Task Ordering
When tests are requested, they follow Test-Driven Development principles:
```mermaid
graph LR
subgraph "User Story Phase with Tests"
direction TB
CT["Contract Tests<br/>[P] [US1]<br/>tests/contracts/"]
UT["Unit Tests<br/>[P] [US1]<br/>tests/unit/"]
Models["Models<br/>[US1]<br/>src/models/"]
Services["Services<br/>[US1]<br/>src/services/"]
Endpoints["Endpoints<br/>[US1]<br/>src/api/"]
IT["Integration Tests<br/>[US1]<br/>tests/integration/"]
end
CT -->|"Define contracts first"| Models
UT -->|"Write tests before impl"| Models
Models --> Services
Services --> Endpoints
Endpoints --> IT
Test-Driven Development Task Order
Sources: templates/commands/tasks.md136-139 README.md590
Each user story phase includes independent test criteria to enable validation without completing all stories:
Sources: templates/commands/tasks.md43 templates/commands/tasks.md50 README.md591
The command reports a suggested MVP scope in its summary output:
Default MVP: Typically just User Story 1 (the highest priority P1 story)
Sources: templates/commands/tasks.md56 templates/commands/tasks.md62
Complete Task Generation Flow: From Design Artifacts to Executable Task List
Sources: templates/commands/tasks.md17-68
The command validates and reports format compliance:
Sources: templates/commands/tasks.md58-65
The command interacts with specific scripts and files in the repository:
| Entity | Type | Purpose | Location |
|---|---|---|---|
check-prerequisites.sh | Bash Script | Determine FEATURE_DIR and AVAILABLE_DOCS | .specify/scripts/bash/check-prerequisites.sh |
check-prerequisites.ps1 | PowerShell Script | Windows equivalent of above | .specify/scripts/powershell/check-prerequisites.ps1 |
tasks-template.md | Template File | Structure template for generated tasks.md | .specify/templates/tasks-template.md |
tasks.md | Generated Output | Executable task breakdown | .specify/specs/{feature-id}/tasks.md |
plan.md | Input Artifact | Tech stack and implementation plan | .specify/specs/{feature-id}/plan.md |
spec.md | Input Artifact | User stories with priorities | .specify/specs/{feature-id}/spec.md |
data-model.md | Optional Input | Entity definitions | .specify/specs/{feature-id}/data-model.md |
contracts/ | Optional Input Directory | API specifications | .specify/specs/{feature-id}/contracts/ |
Sources: templates/commands/tasks.md13-14 templates/commands/tasks.md29-32 templates/commands/tasks.md45-56
Task identifiers follow strict naming patterns that can be searched in generated tasks.md files:
| Pattern | Format | Search Regex | Example |
|---|---|---|---|
| Task ID | T### | T\d{3} | T001, T042, T137 |
| Parallel Marker | [P] | \[P\] | [P] |
| Story Label | [US#] | \[US\d+\] | [US1], [US12] |
| Complete Task | - [ ] T### [P] [US#] Description | ^- \[ \] T\d{3} | - [ ] T011 [P] [US1] Create model |
Usage in Code:
/speckit.implement parses these patterns to execute tasks in order[P] markers enable parallel processing[US#] labels enable story-level filteringSources: templates/commands/tasks.md76-107
The /speckit.tasks command includes built-in handoff suggestions:
Command Handoff Chain
Handoff Definitions (from YAML frontmatter):
Sources: templates/commands/tasks.md3-11
When design artifacts are incomplete:
| Missing Artifact | Impact | Mitigation |
|---|---|---|
data-model.md | No entity-to-story mapping | Generate generic model tasks in foundational phase |
contracts/ | No endpoint-to-story mapping | Infer endpoints from plan.md structure |
research.md | No decision context for setup | Use generic setup tasks from plan.md |
quickstart.md | No test scenarios | Use independent test criteria based on user story acceptance |
Sources: templates/commands/tasks.md31
The command performs format validation before completing:
Format Validation State Machine
Sources: templates/commands/tasks.md64
Refresh this wiki