4.6 KiB
№ speckit.tasks.md
Modified Workflow
description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
handoffs:
- label: Analyze For Consistency
agent: speckit.analyze
prompt: Run a project analysis for consistency
send: true
- label: Implement Project
agent: speckit.implement
prompt: Start the implementation in phases
send: true
---
## User Input
```text
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
-
Setup: Run
.specify/scripts/bash/check-prerequisites.sh --jsonfrom repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. -
Load design documents: Read from FEATURE_DIR:
- Required: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities), ux_reference.md (experience source of truth)
- Optional: data-model.md (entities), contracts/ (API endpoints), research.md (decisions)
-
Execute task generation workflow:
- Architecture Analysis (CRITICAL): Scan existing codebase for patterns (DI, Auth, ORM).
- Load plan.md/spec.md.
- Generate tasks organized by user story.
- Apply Fractal Co-location: Ensure all unit tests are mapped to
__tests__subdirectories relative to the code. - Validate task completeness.
-
Generate tasks.md: Use
.specify/templates/tasks-template.mdas structure.- Phase 1: Context & Setup.
- Phase 2: Foundational tasks.
- Phase 3+: User Stories (Priority order).
- Final Phase: Polish.
- Strict Constraint: Ensure tasks follow the Co-location and Mocking rules below.
-
Report: Output path to generated tasks.md and summary.
Context for task generation: $ARGUMENTS
Task Generation Rules
CRITICAL: Tasks MUST be actionable, specific, architecture-aware, and context-local.
Implementation & Testing Constraints (ANTI-LOOP & CO-LOCATION)
To prevent infinite debugging loops and context fragmentation, apply these rules:
-
Fractal Co-location Strategy (MANDATORY):
- Rule: Unit tests MUST live next to the code they verify.
- Forbidden: Do NOT create unit tests in root
tests/orbackend/tests/. Those are for E2E/Integration only. - Pattern (Python):
- Source:
src/domain/order/processing.py - Test Task:
Create tests in src/domain/order/__tests__/test_processing.py
- Source:
- Pattern (Frontend):
- Source:
src/lib/components/UserCard.svelte - Test Task:
Create tests in src/lib/components/__tests__/UserCard.test.ts
- Source:
-
Semantic Relations:
- Test generation tasks must explicitly instruct to add the relation header:
# @RELATION: VERIFIES -> [TargetComponent]
- Test generation tasks must explicitly instruct to add the relation header:
-
Strict Mocking for Unit Tests:
- Any task creating Unit Tests MUST specify: "Use
unittest.mock.MagicMockfor heavy dependencies (DB sessions, Auth). Do NOT instantiate real service classes."
- Any task creating Unit Tests MUST specify: "Use
-
Schema/Model Separation:
- Explicitly separate tasks for ORM Models (SQLAlchemy) and Pydantic Schemas.
UX Preservation (CRITICAL)
- Source of Truth:
ux_reference.mdis the absolute standard. - Verification Task: You MUST add a specific task at the end of each User Story phase:
- [ ] Txxx [USx] Verify implementation matches ux_reference.md (Happy Path & Errors)
Checklist Format (REQUIRED)
Every task MUST strictly follow this format:
- [ ] [TaskID] [P?] [Story?] Description with file path
Examples:
- ✅
- [ ] T005 [US1] Create unit tests for OrderService in src/services/__tests__/test_order.py (Mock DB) - ✅
- [ ] T006 [US1] Implement OrderService in src/services/order.py - ❌
- [ ] T005 [US1] Create tests in backend/tests/test_order.py(VIOLATION: Wrong location)
Task Organization & Phase Structure
Phase 1: Context & Setup
- Goal: Prepare environment and understand existing patterns.
- Mandatory Task:
- [ ] T001 Analyze existing project structure, auth patterns, andconftest.pylocation
Phase 2: Foundational (Data & Core)
- Database Models (ORM).
- Pydantic Schemas (DTOs).
- Core Service interfaces.
Phase 3+: User Stories (Iterative)
- Step 1: Isolation Tests (Co-located):
- [ ] Txxx [USx] Create unit tests for [Component] in [Path]/__tests__/test_[name].py- Note: Specify using MagicMock for external deps.
- Step 2: Implementation: Services -> Endpoints.
- Step 3: Integration: Wire up real dependencies (if E2E tests requested).
- Step 4: UX Verification.
Final Phase: Polish
- Linting, formatting, final manual verify.