speckit-tasks
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Pre-Execution Checks
Check for extension hooks (before tasks generation):
- Check if
.specify/extensions.yml exists in the project root.
- If it exists, read it and look for entries under the
hooks.before_tasks key
- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.yml could not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue normally
- Filter out hooks where
enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
- For each remaining hook, do not attempt to interpret or evaluate hook
condition expressions:
- If the hook has no
condition field, or it is null/empty, treat the hook as executable
- If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- For each executable hook, output the following based on its
optional flag:
- Optional hook (
optional: true):## Extension Hooks
**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
- Mandatory hook (
optional: false):## Extension Hooks
**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
Wait for the result of the hook command before proceeding to the Outline.
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal {command} id shown above, e.g. a skills-mode agent runs it as /skill:speckit-... or $speckit-...). Emitting the block alone does not run the hook.
- If no hooks are registered or
.specify/extensions.yml does not exist, skip silently
Outline
Setup: Run .specify/scripts/bash/setup-tasks.sh --json from repo root and parse FEATURE_DIR, TASKS_TEMPLATE_CONTENT, TASKS_TEMPLATE, and AVAILABLE_DOCS list. FEATURE_DIR and TASKS_TEMPLATE must be absolute paths when provided. AVAILABLE_DOCS is a list of document names/relative paths available under FEATURE_DIR (for example research.md or contracts/). For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot").
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/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
- IF EXISTS: Load
/memory/constitution.md for project principles and governance constraints
- Note: Not all projects have all documents. Generate tasks based on what's available.
Execute task generation workflow:
- Load plan.md and extract tech stack, libraries, project structure
- Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
- If data-model.md exists: Extract entities and map to user stories
- If contracts/ exists: Map interface contracts to user stories
- If research.md exists: Extract decisions for setup tasks
- Generate tasks organized by user story (see Task Generation Rules below)
- Generate dependency graph showing user story completion order
- Create parallel execution examples per user story
- Validate task completeness (each user story has all needed tasks, independently testable)
Generate tasks.md: Use TASKS_TEMPLATE_CONTENT (from the JSON output above) as the structure. For compatibility with older setup scripts that omit TASKS_TEMPLATE_CONTENT, read TASKS_TEMPLATE instead. Fill with:
- Correct feature name from plan.md
- Phase 1: Setup tasks (project initialization)
- Phase 2: Foundational tasks (blocking prerequisites for all user stories)
- Phase 3+: One phase per user story (in priority order from spec.md)
- Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
- Final Phase: Polish & cross-cutting concerns
- All tasks must follow the strict checklist format (see Task Generation Rules below)
- Clear file paths for each task
- Dependencies section showing story completion order
- Parallel execution examples per story
- Implementation strategy section (MVP first, incremental delivery)
Mandatory Post-Execution Hooks
You MUST complete this section before reporting completion to the user.
Check if .specify/extensions.yml exists in the project root.
- If it does not exist, or no hooks are registered under
hooks.after_tasks, skip to the Completion Report.
- If it exists, read it and look for entries under the
hooks.after_tasks key.
- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.yml could not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue to the Completion Report.
- Filter out hooks where
enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
- For each remaining hook, do not attempt to interpret or evaluate hook
condition expressions:
- If the hook has no
condition field, or it is null/empty, treat the hook as executable
- If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- For each executable hook, output the following based on its
optional flag:
- Mandatory hook (
optional: false) — You MUST emit EXECUTE_COMMAND: for each mandatory hook:## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal {command} id shown above, e.g. a skills-mode agent runs it as /skill:speckit-... or $speckit-...). Emitting the block alone does not run the hook.
- Optional hook (
optional: true):## Extension Hooks
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
Completion Report
Output path to generated tasks.md and 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: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
Context for task generation: $ARGUMENTS
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
Task Generation Rules
CRITICAL: Tasks MUST be organized by user story to enable independent implementation and testing.
Tests are OPTIONAL: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
Checklist Format (REQUIRED)
Every task MUST strictly follow this format:
- [ ] [TaskID] [P?] [Story?] Description with file path
Format Components:
- Checkbox: ALWAYS start with
- [ ] (markdown checkbox)
- Task ID: Sequential number (T001, T002, T003...) in execution order
- [P] marker: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
- [Story] label: REQUIRED for user story phase tasks only
- Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
- Setup phase: NO story label
- Foundational phase: NO story label
- User Story phases: MUST have story label
- Polish phase: NO story label
- 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)
- ❌ WRONG:
- [ ] T001 [US1] Create model (missing file path)
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
- Interfaces/UI needed for that story
- If tests requested: Tests specific to that story
- Mark story dependencies (most stories should be independent)
From Contracts:
- Map each interface contract → to the user story it serves
- If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
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 in appropriate story phase
- For each field with constraints in data-model.md (max length, nullable/required, enum values, validation rules), quote the constraint verbatim in the task description so it is not left to implementation-time discretion
From Setup/Infrastructure:
- Shared infrastructure → Setup phase (Phase 1)
- Foundational/blocking tasks → Foundational phase (Phase 2)
- Story-specific setup → within that story's phase
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 a complete, independently testable increment
- Final Phase: Polish & Cross-Cutting Concerns
Done When
Task line format
Write each task as - [ ] T001 [P] [US1] <ROW-ID> description. The task number and the requirement row ID are required; [P] and [US1] are optional. Every active row needs a task line and every task names an existing row; pipelines-hook spec-standard fails a touched spec that breaks either rule. Include tasks that reuse the named wiring, add positive and negative tests bound to the rows, verify the runtime path, and update the affected docs. Add a final evidence task that reconciles the rows against merged code, tests and documentation. Cross-repository work gets local tasks in each owning repository with links to the contract.
Workspace conventions
- Feature artifacts live in tracked repository-root
specs/<stable-id>/, never under .specify/specs/ or agent_data/. .specify/ holds only project configuration, templates and .specify/memory/constitution.md.
- Route the feature first with the ecosystem boundaries standard (https://github.com/Knuckles-Team/pipelines/blob/main/reference/ecosystem-boundaries.md). Each behavior has one normative owner. Look up the owning spec and extend it before you add a new one.
- Keep every requirement row ID (
<PREFIX>-<AREA>-R012.4), every Spec: commit trailer and every test binding intact. The delivery state (SPECIFIED, LANDED, VERIFIED, RETIRED) is computed by pipelines-hook spec-status; never write a Status: line or status.json.
- Specs and prompts name no private repository, internal host, homelab inventory or local workspace path. A contributor with only public GitHub access must be able to complete the work.
- When
.specify/scripts/ is absent, derive the feature directory from the repository root and the stable ID instead of running a script.
1---2name: speckit-tasks3domain: development4skill_type: skill5description: "Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts. Use when a plan needs a dependency-ordered tasks.md."6license: MIT7tags: [spec-kit, sdd, upstream]8metadata:9 source: https://skillmd.com/skills/knuckles-team/speckit-tasks10 version: '1.6.0'11 author: GitHub Spec Kit contributors12 upstream: https://github.com/github/spec-kit13---1415# speckit-tasks1617## User Input1819```text20$ARGUMENTS21```2223You **MUST** consider the user input before proceeding (if not empty).2425## Pre-Execution Checks2627**Check for extension hooks (before tasks generation)**:28- Check if `.specify/extensions.yml` exists in the project root.29- If it exists, read it and look for entries under the `hooks.before_tasks` key30- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue normally31- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.32- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:33 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable34 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation35- For each executable hook, output the following based on its `optional` flag:36 - **Optional hook** (`optional: true`):37 ```38 ## Extension Hooks3940 **Optional Pre-Hook**: {extension}41 Command: `/{command}`42 Description: {description}4344 Prompt: {prompt}45 To execute: `/{command}`46 ```47 - **Mandatory hook** (`optional: false`):48 ```49 ## Extension Hooks5051 **Automatic Pre-Hook**: {extension}52 Executing: `/{command}`53 EXECUTE_COMMAND: {command}5455 Wait for the result of the hook command before proceeding to the Outline.56 ```57 After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.58- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently5960## Outline61621. **Setup**: Run `.specify/scripts/bash/setup-tasks.sh --json` from repo root and parse FEATURE_DIR, TASKS_TEMPLATE_CONTENT, TASKS_TEMPLATE, and AVAILABLE_DOCS list. `FEATURE_DIR` and `TASKS_TEMPLATE` must be absolute paths when provided. `AVAILABLE_DOCS` is a list of document names/relative paths available under `FEATURE_DIR` (for example `research.md` or `contracts/`). For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot").63642. **Load design documents**: Read from FEATURE_DIR:65 - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)66 - **Optional**: data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)67 - **IF EXISTS**: Load `/memory/constitution.md` for project principles and governance constraints68 - Note: Not all projects have all documents. Generate tasks based on what's available.69703. **Execute task generation workflow**:71 - Load plan.md and extract tech stack, libraries, project structure72 - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)73 - If data-model.md exists: Extract entities and map to user stories74 - If contracts/ exists: Map interface contracts to user stories75 - If research.md exists: Extract decisions for setup tasks76 - Generate tasks organized by user story (see Task Generation Rules below)77 - Generate dependency graph showing user story completion order78 - Create parallel execution examples per user story79 - Validate task completeness (each user story has all needed tasks, independently testable)80814. **Generate tasks.md**: Use TASKS_TEMPLATE_CONTENT (from the JSON output above) as the structure. For compatibility with older setup scripts that omit TASKS_TEMPLATE_CONTENT, read TASKS_TEMPLATE instead. Fill with:82 - Correct feature name from plan.md83 - Phase 1: Setup tasks (project initialization)84 - Phase 2: Foundational tasks (blocking prerequisites for all user stories)85 - Phase 3+: One phase per user story (in priority order from spec.md)86 - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks87 - Final Phase: Polish & cross-cutting concerns88 - All tasks must follow the strict checklist format (see Task Generation Rules below)89 - Clear file paths for each task90 - Dependencies section showing story completion order91 - Parallel execution examples per story92 - Implementation strategy section (MVP first, incremental delivery)9394## Mandatory Post-Execution Hooks9596**You MUST complete this section before reporting completion to the user.**9798Check if `.specify/extensions.yml` exists in the project root.99- If it does not exist, or no hooks are registered under `hooks.after_tasks`, skip to the Completion Report.100- If it exists, read it and look for entries under the `hooks.after_tasks` key.101- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue to the Completion Report.102- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.103- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:104 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable105 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation106- For each executable hook, output the following based on its `optional` flag:107 - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:108 ```109 ## Extension Hooks110111 **Automatic Hook**: {extension}112 Executing: `/{command}`113 EXECUTE_COMMAND: {command}114 ```115 After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal `{command}` id shown above, e.g. a skills-mode agent runs it as `/skill:speckit-...` or `$speckit-...`). Emitting the block alone does not run the hook.116 - **Optional hook** (`optional: true`):117 ```118 ## Extension Hooks119120 **Optional Hook**: {extension}121 Command: `/{command}`122 Description: {description}123124 Prompt: {prompt}125 To execute: `/{command}`126 ```127128## Completion Report129130Output path to generated tasks.md and summary:131- Total task count132- Task count per user story133- Parallel opportunities identified134- Independent test criteria for each story135- Suggested MVP scope (typically just User Story 1)136- Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)137138Context for task generation: $ARGUMENTS139140The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.141142## Task Generation Rules143144**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.145146**Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.147148### Checklist Format (REQUIRED)149150Every task MUST strictly follow this format:151152```text153- [ ] [TaskID] [P?] [Story?] Description with file path154```155156**Format Components**:1571581. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)1592. **Task ID**: Sequential number (T001, T002, T003...) in execution order1603. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)1614. **[Story] label**: REQUIRED for user story phase tasks only162 - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)163 - Setup phase: NO story label164 - Foundational phase: NO story label165 - User Story phases: MUST have story label166 - Polish phase: NO story label1675. **Description**: Clear action with exact file path168169**Examples**:170171- ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`172- ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`173- ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`174- ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`175- ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)176- ❌ WRONG: `T001 [US1] Create model` (missing checkbox)177- ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)178- ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)179180### Task Organization1811821. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:183 - Each user story (P1, P2, P3...) gets its own phase184 - Map all related components to their story:185 - Models needed for that story186 - Services needed for that story187 - Interfaces/UI needed for that story188 - If tests requested: Tests specific to that story189 - Mark story dependencies (most stories should be independent)1901912. **From Contracts**:192 - Map each interface contract → to the user story it serves193 - If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase1941953. **From Data Model**:196 - Map each entity to the user story(ies) that need it197 - If entity serves multiple stories: Put in earliest story or Setup phase198 - Relationships → service layer tasks in appropriate story phase199 - For each field with constraints in data-model.md (max length, nullable/required, enum values, validation rules), quote the constraint verbatim in the task description so it is not left to implementation-time discretion2002014. **From Setup/Infrastructure**:202 - Shared infrastructure → Setup phase (Phase 1)203 - Foundational/blocking tasks → Foundational phase (Phase 2)204 - Story-specific setup → within that story's phase205206### Phase Structure207208- **Phase 1**: Setup (project initialization)209- **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)210- **Phase 3+**: User Stories in priority order (P1, P2, P3...)211 - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration212 - Each phase should be a complete, independently testable increment213- **Final Phase**: Polish & Cross-Cutting Concerns214215## Done When216217- [ ] tasks.md generated with all phases, task IDs, and file paths218- [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above219- [ ] Completion reported to user with task count, story breakdown, and MVP scope220221## Task line format222223Write each task as `- [ ] T001 [P] [US1] <ROW-ID> description`. The task number and the requirement row ID are required; `[P]` and `[US1]` are optional. Every active row needs a task line and every task names an existing row; `pipelines-hook spec-standard` fails a touched spec that breaks either rule. Include tasks that reuse the named wiring, add positive and negative tests bound to the rows, verify the runtime path, and update the affected docs. Add a final evidence task that reconciles the rows against merged code, tests and documentation. Cross-repository work gets local tasks in each owning repository with links to the contract.224225## Workspace conventions226227- Feature artifacts live in tracked repository-root `specs/<stable-id>/`, never under `.specify/specs/` or `agent_data/`. `.specify/` holds only project configuration, templates and `.specify/memory/constitution.md`.228- Route the feature first with the ecosystem boundaries standard (https://github.com/Knuckles-Team/pipelines/blob/main/reference/ecosystem-boundaries.md). Each behavior has one normative owner. Look up the owning spec and extend it before you add a new one.229- Keep every requirement row ID (`<PREFIX>-<AREA>-R012.4`), every `Spec:` commit trailer and every test binding intact. The delivery state (`SPECIFIED`, `LANDED`, `VERIFIED`, `RETIRED`) is computed by `pipelines-hook spec-status`; never write a `Status:` line or `status.json`.230- Specs and prompts name no private repository, internal host, homelab inventory or local workspace path. A contributor with only public GitHub access must be able to complete the work.231- When `.specify/scripts/` is absent, derive the feature directory from the repository root and the stable ID instead of running a script.