Implementation Tasks Generator
Step 1: Load Context
Read all necessary context:
{{KIRO_DIR}}/specs/$1/spec.json, requirements.md, design.md
{{KIRO_DIR}}/specs/$1/tasks.md (if exists, for merge mode)
- Core steering context:
product.md, tech.md, structure.md
- Additional steering files only when directly relevant to requirements coverage, design boundaries, runtime prerequisites, or team conventions that affect task executability
Validate approvals:
- If
-y flag provided: Auto-approve requirements and design in spec.json. Tasks approval is also handled automatically in Step 4.
- Otherwise: Verify both approved (stop if not, see Safety & Fallback)
- Determine sequential mode based on presence of
--sequential
Step 2: Generate Implementation Tasks
Load generation rules and template:
- Read
rules/tasks-generation.md from this skill's directory for principles
- If
sequential is false: Read rules/tasks-parallel-analysis.md from this skill's directory for parallel judgement criteria
- Read
{{KIRO_DIR}}/settings/templates/specs/tasks.md for format (supports (P) markers)
Parallel Research
The following research areas are independent and can be executed in parallel:
- Context loading: Spec documents (requirements.md, design.md), steering files
- Rules loading: tasks-generation.md, tasks-parallel-analysis.md, tasks template
If multi-agent is enabled, spawn sub-agents for each area above. Otherwise execute sequentially.
After all parallel research completes, synthesize findings before generating tasks.
Generate task list following all rules:
- Use language specified in spec.json
- Map all requirements to tasks
- When documenting requirement coverage, list numeric requirement IDs only (comma-separated) without descriptive suffixes, parentheses, translations, or free-form labels
- Ensure all design components included
- Verify task progression is logical and incremental
- Ensure each executable sub-task includes at least one detail bullet that states what "done" looks like in observable terms
- Keep normal implementation tasks within a single responsibility boundary; if work crosses boundaries, make it an explicit integration task
- Collapse single-subtask structures by promoting them to major tasks and avoid duplicating details on container-only major tasks (use template patterns accordingly)
- Apply
(P) markers to tasks that satisfy parallel criteria (omit markers when sequential mode requested)
- Mark optional test coverage subtasks with
- [ ]* only when they strictly cover acceptance criteria already satisfied by core implementation and can be deferred post-MVP
- If existing tasks.md found, merge with new content
Step 3: Review Task Plan
- Keep the draft task plan in working memory; do NOT write
tasks.md yet
- Run the
Task Plan Review Gate from rules/tasks-generation.md
- Review coverage:
- Every requirement ID appears in at least one task
- Every design component, contract, integration point, runtime prerequisite, and validation concern is represented
- Review executability:
- Each sub-task is an executable 1-3 hour work unit
- Each sub-task has a verifiable deliverable
- Each executable sub-task includes an observable completion bullet
- No implicit prerequisites remain hidden
_Depends:_, _Boundary:_, and (P) markers still match the dependency graph and architecture boundaries
- If issues are task-plan-local, repair the draft and re-run the review gate before writing
- Keep the review bounded to at most 2 repair passes
- If review exposes a real requirements/design gap or contradiction, stop and send the user back to requirements/design instead of inventing filler tasks
Step 3.5: Run Task-Graph Sanity Review
Before writing tasks.md, run one lightweight independent sanity review of the task graph.
- If fresh subagent dispatch is available, spawn one fresh review subagent for this step. Otherwise perform the same review in the current context.
- Provide only file paths, the draft task plan, and merge context if an existing
tasks.md is being updated. The reviewer should read requirements.md, design.md, and the task-generation rules directly instead of relying on a parent-synthesized coverage summary.
- Check only:
- hidden prerequisites or missing setup tasks
- dependency or ordering mistakes
- boundary overlap or ambiguous ownership between tasks
- tasks that are too large, too vague, cross boundaries without being explicit integration tasks, or are missing a verifiable deliverable
- contradictions introduced between requirements, design, and the task graph
- Return one verdict:
PASS
NEEDS_FIXES
RETURN_TO_DESIGN
- If
NEEDS_FIXES, repair the draft once and re-run the sanity review one time.
- If
RETURN_TO_DESIGN, stop without writing tasks.md and point back to the exact gap in requirements/design.
- Keep this bounded. Do not turn it into a second full planning cycle.
Step 4: Finalize
Write tasks.md:
- Create/update
{{KIRO_DIR}}/specs/$1/tasks.md
- Update spec.json metadata:
- Set
phase: "tasks-generated"
- Set
approvals.tasks.generated: true, approved: false
- Set
approvals.requirements.approved: true
- Set
approvals.design.approved: true
- Update
updated_at timestamp
Approval:
- If auto-approve flag (
-y) is provided:
- Set
approvals.tasks.approved: true in spec.json
- Display task summary (task count, major groups, parallel markers)
- Respond: "Tasks generated and auto-approved. Start implementation with
$kiro-impl $1"
- Otherwise (interactive):
- Display a summary of the generated tasks (task count, major groups, parallel markers)
- Ask the user: "Tasks generated. Approve and proceed to implementation?"
- If the user approves:
- Set
approvals.tasks.approved: true in spec.json
- Respond: "Tasks approved. Start implementation with
$kiro-impl $1"
- If the user wants changes:
- Keep
approvals.tasks.approved: false
- Respond with guidance on what to adjust and re-run
Critical Constraints
- Task Integration: Every task must connect to the system (no orphaned work)
- Boundary annotations: Required for
(P) tasks, recommended for all (_Boundary: ComponentName_)
- Explicit dependencies: Cross-boundary non-obvious dependencies declared with
_Depends: X.X_
- Executable deliverable granularity: Each task must produce a verifiable deliverable (file, endpoint, UI component, config). Infrastructure tasks (project scaffolding, manifest, host integration, build config) must be explicit — never assume they exist
- Observable done state: Each executable sub-task must include at least one detail bullet that makes the completed state visible without adding new bookkeeping fields
- No implicit prerequisites: If a task requires a runtime, SDK, framework setup, or config file, that setup must be a separate preceding task
Output Description
Provide brief summary in the language specified in spec.json:
- Status: Confirm tasks generated at
{{KIRO_DIR}}/specs/$1/tasks.md
- Task Summary:
- Total: X major tasks, Y sub-tasks
- All Z requirements covered
- Average task size: 1-3 hours per sub-task
- Quality Validation:
- ✅ All requirements mapped to tasks
- ✅ Design coverage and runtime prerequisites reviewed
- ✅ Task dependencies verified
- ✅ Task plan review gate passed
- ✅ Independent task-graph sanity review passed
- ✅ Testing tasks included
- Next Action: Review tasks and proceed when ready
Format: Concise (under 200 words)
Safety & Fallback
Error Scenarios
Requirements or Design Not Approved:
- Stop Execution: Cannot proceed without approved requirements and design
- User Message: "Requirements and design must be approved before task generation"
- Suggested Action: "Run
$kiro-spec-tasks $1 -y to auto-approve both and proceed"
Missing Requirements or Design:
- Stop Execution: Both documents must exist
- User Message: "Missing requirements.md or design.md at
{{KIRO_DIR}}/specs/$1/"
- Suggested Action: "Complete requirements and design phases first"
Incomplete Requirements Coverage:
- Warning: "Not all requirements mapped to tasks. Review coverage."
- User Action Required: Confirm intentional gaps or regenerate tasks
Spec Gap Found During Task Review:
- Stop Execution: Do not write a patched-over
tasks.md
- User Message: "Requirements/design do not provide enough clear coverage to generate an executable task plan"
- Suggested Action: "Refine requirements.md or design.md, then re-run
$kiro-spec-tasks $1"
Template/Rules Missing:
- User Message: "Template or rules files missing in
{{KIRO_DIR}}/settings/"
- Fallback: Use inline basic structure with warning
- Suggested Action: "Check repository setup or restore template files"
- Missing Numeric Requirement IDs:
- Stop Execution: All requirements in requirements.md MUST have numeric IDs. If any requirement lacks a numeric ID, stop and request that requirements.md be fixed before generating tasks.
Next Phase: Implementation
Tasks are approved in Step 4 via user confirmation. Once approved:
- Autonomous implementation:
$kiro-impl $1
- Specific tasks only:
$kiro-impl $1 1.1,1.2
1---2name: kiro-spec-tasks3description: Generate implementation tasks for a specification4---5
6
7# Implementation Tasks Generator
8
9<background_information>
10- **Success Criteria**:
11 - All requirements mapped to specific tasks
12 - Tasks properly sized (1-3 hours each)
13 - Clear task progression with proper hierarchy
14 - Natural language descriptions focused on capabilities
15 - A lightweight task-plan sanity review confirms the task graph is executable before `tasks.md` is written
16</background_information>
17
18<instructions>
19## Execution Steps
20
21### Step 1: Load Context
22
23**Read all necessary context**:
24- `{{KIRO_DIR}}/specs/$1/spec.json`, `requirements.md`, `design.md`
25- `{{KIRO_DIR}}/specs/$1/tasks.md` (if exists, for merge mode)
26- Core steering context: `product.md`, `tech.md`, `structure.md`
27- Additional steering files only when directly relevant to requirements coverage, design boundaries, runtime prerequisites, or team conventions that affect task executability
28
29**Validate approvals**:
30- If `-y` flag provided: Auto-approve requirements and design in spec.json. Tasks approval is also handled automatically in Step 4.
31- Otherwise: Verify both approved (stop if not, see Safety & Fallback)
32- Determine sequential mode based on presence of `--sequential`
33
34### Step 2: Generate Implementation Tasks
35
36**Load generation rules and template**:
37- Read `rules/tasks-generation.md` from this skill's directory for principles
38- If `sequential` is false: Read `rules/tasks-parallel-analysis.md` from this skill's directory for parallel judgement criteria
39- Read `{{KIRO_DIR}}/settings/templates/specs/tasks.md` for format (supports `(P)` markers)
40
41#### Parallel Research
42
43The following research areas are independent and can be executed in parallel:
441. **Context loading**: Spec documents (requirements.md, design.md), steering files
452. **Rules loading**: tasks-generation.md, tasks-parallel-analysis.md, tasks template
46
47If multi-agent is enabled, spawn sub-agents for each area above. Otherwise execute sequentially.
48
49After all parallel research completes, synthesize findings before generating tasks.
50
51**Generate task list following all rules**:
52- Use language specified in spec.json
53- Map all requirements to tasks
54- When documenting requirement coverage, list numeric requirement IDs only (comma-separated) without descriptive suffixes, parentheses, translations, or free-form labels
55- Ensure all design components included
56- Verify task progression is logical and incremental
57- Ensure each executable sub-task includes at least one detail bullet that states what "done" looks like in observable terms
58- Keep normal implementation tasks within a single responsibility boundary; if work crosses boundaries, make it an explicit integration task
59- Collapse single-subtask structures by promoting them to major tasks and avoid duplicating details on container-only major tasks (use template patterns accordingly)
60- Apply `(P)` markers to tasks that satisfy parallel criteria (omit markers when sequential mode requested)
61- Mark optional test coverage subtasks with `- [ ]*` only when they strictly cover acceptance criteria already satisfied by core implementation and can be deferred post-MVP
62- If existing tasks.md found, merge with new content
63
64### Step 3: Review Task Plan
65
66- Keep the draft task plan in working memory; do NOT write `tasks.md` yet
67- Run the `Task Plan Review Gate` from `rules/tasks-generation.md`
68- Review coverage:
69 - Every requirement ID appears in at least one task
70 - Every design component, contract, integration point, runtime prerequisite, and validation concern is represented
71- Review executability:
72 - Each sub-task is an executable 1-3 hour work unit
73 - Each sub-task has a verifiable deliverable
74 - Each executable sub-task includes an observable completion bullet
75 - No implicit prerequisites remain hidden
76 - `_Depends:_`, `_Boundary:_`, and `(P)` markers still match the dependency graph and architecture boundaries
77- If issues are task-plan-local, repair the draft and re-run the review gate before writing
78- Keep the review bounded to at most 2 repair passes
79- If review exposes a real requirements/design gap or contradiction, stop and send the user back to requirements/design instead of inventing filler tasks
80
81### Step 3.5: Run Task-Graph Sanity Review
82
83Before writing `tasks.md`, run one lightweight independent sanity review of the task graph.
84
85- If fresh subagent dispatch is available, spawn one fresh review subagent for this step. Otherwise perform the same review in the current context.
86- Provide only file paths, the draft task plan, and merge context if an existing `tasks.md` is being updated. The reviewer should read `requirements.md`, `design.md`, and the task-generation rules directly instead of relying on a parent-synthesized coverage summary.
87- Check only:
88 - hidden prerequisites or missing setup tasks
89 - dependency or ordering mistakes
90 - boundary overlap or ambiguous ownership between tasks
91 - tasks that are too large, too vague, cross boundaries without being explicit integration tasks, or are missing a verifiable deliverable
92 - contradictions introduced between requirements, design, and the task graph
93- Return one verdict:
94 - `PASS`
95 - `NEEDS_FIXES`
96 - `RETURN_TO_DESIGN`
97- If `NEEDS_FIXES`, repair the draft once and re-run the sanity review one time.
98- If `RETURN_TO_DESIGN`, stop without writing `tasks.md` and point back to the exact gap in requirements/design.
99- Keep this bounded. Do not turn it into a second full planning cycle.
100
101### Step 4: Finalize
102
103**Write tasks.md**:
104- Create/update `{{KIRO_DIR}}/specs/$1/tasks.md`
105- Update spec.json metadata:
106 - Set `phase: "tasks-generated"`
107 - Set `approvals.tasks.generated: true, approved: false`
108 - Set `approvals.requirements.approved: true`
109 - Set `approvals.design.approved: true`
110 - Update `updated_at` timestamp
111
112**Approval**:
113- If auto-approve flag (`-y`) is provided:
114 - Set `approvals.tasks.approved: true` in spec.json
115 - Display task summary (task count, major groups, parallel markers)
116 - Respond: "Tasks generated and auto-approved. Start implementation with `$kiro-impl $1`"
117- Otherwise (interactive):
118 - Display a summary of the generated tasks (task count, major groups, parallel markers)
119 - Ask the user: "Tasks generated. Approve and proceed to implementation?"
120 - If the user approves:
121 - Set `approvals.tasks.approved: true` in spec.json
122 - Respond: "Tasks approved. Start implementation with `$kiro-impl $1`"
123 - If the user wants changes:
124 - Keep `approvals.tasks.approved: false`
125 - Respond with guidance on what to adjust and re-run
126
127## Critical Constraints
128- **Task Integration**: Every task must connect to the system (no orphaned work)
129- **Boundary annotations**: Required for `(P)` tasks, recommended for all (`_Boundary: ComponentName_`)
130- **Explicit dependencies**: Cross-boundary non-obvious dependencies declared with `_Depends: X.X_`
131- **Executable deliverable granularity**: Each task must produce a verifiable deliverable (file, endpoint, UI component, config). Infrastructure tasks (project scaffolding, manifest, host integration, build config) must be explicit — never assume they exist
132- **Observable done state**: Each executable sub-task must include at least one detail bullet that makes the completed state visible without adding new bookkeeping fields
133- **No implicit prerequisites**: If a task requires a runtime, SDK, framework setup, or config file, that setup must be a separate preceding task
134</instructions>
135
136## Output Description
137
138Provide brief summary in the language specified in spec.json:
139
1401. **Status**: Confirm tasks generated at `{{KIRO_DIR}}/specs/$1/tasks.md`
1412. **Task Summary**:
142 - Total: X major tasks, Y sub-tasks
143 - All Z requirements covered
144 - Average task size: 1-3 hours per sub-task
1453. **Quality Validation**:
146 - ✅ All requirements mapped to tasks
147 - ✅ Design coverage and runtime prerequisites reviewed
148 - ✅ Task dependencies verified
149 - ✅ Task plan review gate passed
150 - ✅ Independent task-graph sanity review passed
151 - ✅ Testing tasks included
1524. **Next Action**: Review tasks and proceed when ready
153
154**Format**: Concise (under 200 words)
155
156## Safety & Fallback
157
158### Error Scenarios
159
160**Requirements or Design Not Approved**:
161- **Stop Execution**: Cannot proceed without approved requirements and design
162- **User Message**: "Requirements and design must be approved before task generation"
163- **Suggested Action**: "Run `$kiro-spec-tasks $1 -y` to auto-approve both and proceed"
164
165**Missing Requirements or Design**:
166- **Stop Execution**: Both documents must exist
167- **User Message**: "Missing requirements.md or design.md at `{{KIRO_DIR}}/specs/$1/`"
168- **Suggested Action**: "Complete requirements and design phases first"
169
170**Incomplete Requirements Coverage**:
171- **Warning**: "Not all requirements mapped to tasks. Review coverage."
172- **User Action Required**: Confirm intentional gaps or regenerate tasks
173
174**Spec Gap Found During Task Review**:
175- **Stop Execution**: Do not write a patched-over `tasks.md`
176- **User Message**: "Requirements/design do not provide enough clear coverage to generate an executable task plan"
177- **Suggested Action**: "Refine requirements.md or design.md, then re-run `$kiro-spec-tasks $1`"
178
179**Template/Rules Missing**:
180- **User Message**: "Template or rules files missing in `{{KIRO_DIR}}/settings/`"
181- **Fallback**: Use inline basic structure with warning
182- **Suggested Action**: "Check repository setup or restore template files"
183- **Missing Numeric Requirement IDs**:
184 - **Stop Execution**: All requirements in requirements.md MUST have numeric IDs. If any requirement lacks a numeric ID, stop and request that requirements.md be fixed before generating tasks.
185
186### Next Phase: Implementation
187
188Tasks are approved in Step 4 via user confirmation. Once approved:
189- Autonomous implementation: `$kiro-impl $1`
190- Specific tasks only: `$kiro-impl $1 1.1,1.2`