@@ -8,14 +8,44 @@ description: Generate an actionable, dependency-ordered tasks.md for the feature
88$ARGUMENTS
99```
1010
11- You ** MUST** consider the user input before proceeding (if not empty).
11+ You ** MUST** consider the user input before proceeding (if not empty). Include ** explicit skill references ** in tasks so each task can be efficiently implemented.
1212
1313## Core Directive
1414
1515** Default to Action** : Generate the complete tasks.md immediately from available design artifacts. Extract tasks systematically from spec user stories, plan structure, and data model. Only flag issues that genuinely block task generation.
1616
1717** WHY** : Task generation is mechanical extraction from spec/plan. The artifacts contain all necessary information. Generate the task list and let implementation surface any gaps—don't over-analyze before producing output.
1818
19+ ## Anti-Pattern Prevention
20+
21+ ** CRITICAL** : Most workflows fail at task breakdown. Specs and plans look perfect, then "tasks break everything cause buggy." Apply these preventions:
22+
23+ ### Common Anti-Patterns and Solutions
24+
25+ | Anti-Pattern | Prevention | Example |
26+ | --------------| ------------| ---------|
27+ | ** Vague tasks** | Include exact file paths | ✅ ` helm/taskflow/templates/api/deployment.yaml ` ❌ "Create API deployment" |
28+ | ** Wrong granularity** | 1-2 hour sweet spot per task | ✅ 80 tasks @ 2.7 min avg ❌ "Create Helm chart" = 8 hours |
29+ | ** Wrong order** | Explicit dependency graph | ✅ postgres → sso → api (with initContainers) |
30+ | ** Untestable** | Per-phase acceptance criteria with commands | ✅ ` helm template --dry-run ` ❌ "Should work" |
31+ | ** Spec drift** | FR mapping + US labels trace back to spec | ✅ ` [US1] FR-014: Create sso deployment ` |
32+ | ** No done condition** | Checkboxes with expected outputs | ✅ "Renders valid YAML" ❌ No criteria |
33+ | ** Guessing syntax** | Documentation-first with Context7 queries | ✅ Query Helm docs before implementation |
34+
35+ ### Granularity Rules (MANDATORY)
36+
37+ ** Sweet Spot** : 1-2 hours per task for human implementation
38+ - ** Too Big** : "Create complete Helm chart" (8+ hours) → leads to mid-task blocking
39+ - ** Too Small** : "Add one line to values.yaml" (30 seconds) → creates hundreds of tasks
40+ - ** Just Right** : "Create deployment.yaml with initContainer" (1-2 hours) → atomic, testable, clear done condition
41+
42+ ** Target Metrics** :
43+ - 60-100 tasks for 3-hour implementation
44+ - Average ~ 2-3 minutes per task
45+ - 40-60% parallelizable (mark with [ P] )
46+
47+ ** Test** : If task takes >2 hours, split it. If <30 minutes, merge with related task.
48+
1949## Outline
2050
21511 . ** Setup** : Run ` .specify/scripts/bash/check-prerequisites.sh --json ` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. 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").
@@ -62,6 +92,120 @@ Context for task generation: $ARGUMENTS
6292
6393The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
6494
95+ ## Documentation-First Pattern (MANDATORY)
96+
97+ ** CRITICAL** : NEVER guess syntax or API patterns. Query official documentation BEFORE task implementation.
98+
99+ ### Integration with Context7 MCP
100+
101+ Each tasks.md MUST include an "AI-Native Execution Guide" section mapping phases to documentation queries:
102+
103+ ``` markdown
104+ ## AI-Native Execution Guide
105+
106+ ### Official Documentation (Query via Context7 MCP)
107+
108+ ** Phase X: [ Phase Name] **
109+ mcp__ context7__ resolve-library-id --libraryName "[ library] "
110+ mcp__ context7__ get-library-docs --context7CompatibleLibraryID "/org/project" --topic "[ topic] "
111+
112+ ** Examples** :
113+ - Helm Charts: ` /helm/helm ` topics: "chart structure", "deployment spec", "values schema"
114+ - Kubernetes: ` /kubernetes/kubernetes ` topics: "initContainers", "probes", "services"
115+ - Docker: ` /docker/docs ` topics: "docker build", "multi-stage", "compose"
116+ - Next.js: ` /vercel/next.js ` topics: "app router", "server actions", "middleware"
117+ - FastAPI: ` /tiangolo/fastapi ` topics: "async routes", "dependencies", "middleware"
118+
119+ ### Implementation Pattern (For Each Task)
120+ 1 . Query relevant official docs via Context7 ← NEVER SKIP
121+ 2 . Review plan.md for architecture decisions
122+ 3 . Check spec.md for functional requirements
123+ 4 . Implement using official patterns (not guessing)
124+ 5 . Verify with acceptance criteria commands
125+ 6 . Mark task complete with checkbox
126+ ```
127+
128+ ### Skills Mapping
129+
130+ ** CRITICAL** : Check for existing skills BEFORE assuming they don't exist.
131+
132+ ``` bash
133+ # Discover available skills
134+ ls -1 .claude/skills/engineering/
135+ ```
136+
137+ Map task phases to available skills in ` .claude/skills/engineering/ ` :
138+
139+ ``` markdown
140+ ### Skills to Use (from ` .claude/skills/engineering/ ` )
141+
142+ ** Required Skills for This Feature:**
143+ - ** ` [skill-name] ` ** - [ description from SKILL.md]
144+ (Verify skill exists by reading ` .claude/skills/engineering/[skill-name]/SKILL.md ` )
145+
146+ ** Optional Skills (for troubleshooting):**
147+ - ** ` [skill-name] ` ** - [ when to use]
148+ - Use for: [ specific use cases]
149+ - NOT for: [ what to avoid]
150+
151+ ** If skill doesn't exist** : Recommend creating it for future reuse
152+ ```
153+
154+ ** Common Skills by Technology** (check if they exist first):
155+ - Helm/K8s/Minikube → ` helm-charts ` , ` kubernetes-essentials ` , ` minikube ` , ` kubectl-ai `
156+ - FastAPI/SQLModel → ` fastapi-backend ` , ` sqlmodel-database `
157+ - Auth → ` better-auth-sso ` , ` better-auth-setup `
158+ - Frontend → ` nextjs-16 ` , ` shadcn-ui ` , ` chatkit-integration ` , ` frontend-design `
159+ - Infrastructure → ` containerize-apps ` , ` mcp-builder `
160+
161+ ## Acceptance Criteria Format (MANDATORY)
162+
163+ ** CRITICAL** : Each phase MUST have testable acceptance criteria with verification commands.
164+
165+ ### Per-Phase Structure
166+
167+ ``` markdown
168+ ### Phase N: [ Phase Name] (X tasks, Y minutes)
169+
170+ ** Acceptance Criteria** :
171+ - [ ] [ Measurable outcome 1]
172+ ``` bash
173+ # Verification command
174+ [command that proves criterion is met]
175+ ```
176+ - [ ] [ Measurable outcome 2]
177+ ``` bash
178+ [verification command]
179+ ```
180+
181+ ** Expected Output** : [ Exact output that proves phase completion]
182+
183+ ** Tasks** :
184+ - [ ] T0XX [ P] [ Story] Task description with file path
185+ ```
186+
187+ ### Example Acceptance Criteria
188+
189+ ** Good** (testable with command):
190+ ``` markdown
191+ ** Acceptance Criteria** :
192+ - [ ] All 20 templates created, helm template renders valid YAML
193+ ``` bash
194+ helm template taskflow ./helm/taskflow --dry-run
195+ # Expected: No errors, 20 resource definitions output
196+ ```
197+ - [ ] All 4 Docker images built successfully
198+ ``` bash
199+ docker images | grep -E ' (sso|api|mcp|web).*:dev'
200+ # Expected: 4 images with 'dev' tag
201+ ```
202+ ```
203+
204+ ** Bad** (not testable):
205+ - ❌ "Helm chart should work"
206+ - ❌ "Code looks good"
207+ - ❌ "Everything is ready"
208+
65209## Task Generation Rules
66210
67211** CRITICAL** : Tasks MUST be organized by user story to enable independent implementation and testing.
@@ -111,6 +255,17 @@ Every task MUST strictly follow this format:
111255 - If tests requested: Tests specific to that story
112256 - Mark story dependencies (most stories should be independent)
113257
258+ 2 . ** Traceability Mapping** (MANDATORY):
259+ - ** Triple Mapping** : Task → User Story → Functional Requirement → File Path
260+ - ** Task Format** : ` - [ ] T0XX [P] [US#] FR-XXX: Description with path/to/file.ext `
261+ - ** Example** : ` - [ ] T014 [P] [US1] FR-014: Create sso-platform deployment.yaml with initContainer `
262+ - ** Why** : Enables validation that every FR is implemented and every task traces to requirements
263+ - ** Phase Header** : Include FR mapping per phase
264+ ``` markdown
265+ ### Phase 3: US1 - Service Deployment (22 tasks, 115 min)
266+ **FRs**: FR-014, FR-015, FR-016, FR-017, FR-018
267+ ```
268+
1142692 . ** Cross-Reference Verification Tasks** (For educational content):
115270 - If lessons teach patterns (skills, subagents, ADRs, PHRs), add verification task
116271 - Example: ` - [ ] T0XX [P] [US1] Verify skill format matches Chapter N Lesson 7 canonical source `
@@ -135,6 +290,59 @@ Every task MUST strictly follow this format:
135290 - Foundational/blocking tasks → Foundational phase (Phase 2)
136291 - Story-specific setup → within that story's phase
137292
293+ ### Dependency Graph & Parallel Execution (MANDATORY)
294+
295+ ** CRITICAL** : Include explicit dependency graph and parallel opportunities to prevent wrong ordering and enable fast execution.
296+
297+ ** Required Sections in tasks.md** :
298+
299+ ``` markdown
300+ ## Dependencies
301+
302+ ### User Story Completion Order
303+ Setup → Foundation → US1 → US2 → US4 → Deployment
304+ ↘ US3 ↗
305+ (parallel with US2)
306+
307+ ### Critical Path (minimum time to completion)
308+ - Setup: 15 min
309+ - Foundation: 45 min
310+ - US1: 115 min
311+ - US2: 20 min
312+ - US4: 20 min
313+ - Deployment: 30 min
314+ ** Total Critical Path** : 3h 5min (65 tasks)
315+
316+ ### Parallel Opportunities
317+ - Phase 3A-3D: 4 services can be templated simultaneously (different files)
318+ - Phase 4: 4 image builds can run concurrently
319+ - US3 + US4: Configuration review and dependency implementation can overlap
320+ ** Parallelizable** : 40 tasks (50% of total)
321+
322+ ## Implementation Strategy
323+
324+ ### MVP Scope
325+ ** Critical Path Only** (3h 5min):
326+ - Setup + Foundation + US1 + US2 + US4 + Deployment
327+ ** Skip for MVP** : US3 validation (nice-to-have), US5 documentation (post-launch)
328+
329+ ### Fast Feedback Loop
330+ 1 . Complete Setup + Foundation (1h) → Validate structure
331+ 2 . Complete US1 (2h) → Validate core functionality
332+ 3 . Complete US2 + US4 (40m) → Validate dependencies
333+ 4 . Complete Deployment (30m) → End-to-end validation
334+ ```
335+
336+ ** Parallel Task Identification Rules** :
337+ - Mark task [ P] if:
338+ - ✅ Operates on different files than all in-progress tasks
339+ - ✅ Has no dependencies on incomplete tasks
340+ - ✅ Can be executed by different developers simultaneously
341+ - Do NOT mark [ P] if:
342+ - ❌ Depends on previous task's output
343+ - ❌ Modifies same file as another task
344+ - ❌ Requires previous task's validation to pass
345+
138346### Phase Structure
139347
140348- ** Phase 1** : Setup (project initialization)
@@ -144,6 +352,54 @@ Every task MUST strictly follow this format:
144352 - Each phase should be a complete, independently testable increment
145353- ** Final Phase** : Polish & Cross-Cutting Concerns
146354
355+ ### Quality Checklist (Validate Before Completion)
356+
357+ Before finalizing tasks.md, verify ALL of these conditions:
358+
359+ ** Format Validation** :
360+ - [ ] Every task has checkbox ` - [ ] `
361+ - [ ] Every task has sequential ID (T001, T002, T003...)
362+ - [ ] Parallelizable tasks marked with [ P]
363+ - [ ] User story tasks labeled with [ US#]
364+ - [ ] Every task includes exact file path
365+ - [ ] No task >2 hours (split if needed)
366+ - [ ] No task <30 minutes (merge if needed)
367+ - [ ] 60-100 tasks for 3-hour implementation
368+
369+ ** Traceability Validation** :
370+ - [ ] Every task maps to User Story (or Setup/Foundation/Polish)
371+ - [ ] Every User Story from spec.md has tasks
372+ - [ ] Every Functional Requirement referenced in tasks
373+ - [ ] Phase headers include FR mapping
374+
375+ ** Documentation Validation** :
376+ - [ ] AI-Native Execution Guide section present
377+ - [ ] Context7 MCP queries mapped per phase
378+ - [ ] Skills mapping section present
379+ - [ ] Implementation pattern (5-step) documented
380+
381+ ** Acceptance Criteria Validation** :
382+ - [ ] Every phase has testable acceptance criteria
383+ - [ ] Every criterion has verification command
384+ - [ ] Expected outputs specified
385+ - [ ] No vague criteria ("should work", "looks good")
386+
387+ ** Dependency Validation** :
388+ - [ ] Dependency graph with completion order
389+ - [ ] Critical path calculated with time estimates
390+ - [ ] Parallel opportunities identified (40-60% target)
391+ - [ ] MVP scope defined
392+
393+ ** Anti-Pattern Check** :
394+ - [ ] No vague tasks without file paths
395+ - [ ] No "Create entire X" tasks (wrong granularity)
396+ - [ ] No missing dependencies (wrong order)
397+ - [ ] No untestable phases (missing acceptance criteria)
398+ - [ ] No spec drift (all FRs covered)
399+ - [ ] No "guess the syntax" tasks (docs referenced)
400+
401+ ** Pass Criteria** : All checkboxes must be checked. If ANY fails, fix before completion.
402+
147403---
148404
149405As the main request completes, you MUST create and complete a PHR (Prompt History Record) using agent‑native tools when possible.
0 commit comments