--- description: "Task list template for feature implementation" --- # Tasks: [FEATURE NAME] **Input**: Design documents from `/specs/[###-feature-name]/` **Prerequisites**: plan.md (required), spec.md (required for user stories), research.md, data-model.md, contracts/ **Tests**: Include test tasks whenever required by the feature specification, the semantic contracts, or any Complexity 5 / audit-critical boundary. Test work must trace to contract requirements, not only to implementation details. **Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story. ## Format: `[ID] [P?] [Story] Description` - **[P]**: Can run in parallel (different files, no dependencies) - **[Story]**: Which user story this task belongs to (e.g., US1, US2, US3) - Include exact file paths in descriptions ## Path Conventions - **Single project**: `src/`, `tests/` at repository root - **Web app**: `backend/src/`, `frontend/src/` - **Mobile**: `api/src/`, `ios/src/` or `android/src/` - Paths shown below assume single project - adjust based on plan.md structure ## Phase 1: Setup (Shared Infrastructure) **Purpose**: Project initialization and basic structure - [ ] T001 Create project structure per implementation plan - [ ] T002 Initialize [language] project with [framework] dependencies - [ ] T003 [P] Configure linting and formatting tools --- ## Phase 2: Foundational (Blocking Prerequisites) **Purpose**: Core infrastructure that MUST be complete before ANY user story can be implemented **⚠️ CRITICAL**: No user story work can begin until this phase is complete Examples of foundational tasks (adjust based on your project): - [ ] T004 Setup database schema and migrations framework - [ ] T005 [P] Implement authentication/authorization framework - [ ] T006 [P] Setup API routing and middleware structure - [ ] T007 Create base models/entities that all stories depend on - [ ] T008 Configure error handling and logging infrastructure - [ ] T009 Setup environment configuration management - [ ] T00A [P] Materialize canonical fixtures from specs//fixtures/api/ into backend/tests/fixtures/ - [ ] T00B [P] Materialize canonical fixtures from specs//fixtures/model/ into frontend/src/lib/models/__fixtures__/ **Checkpoint**: Foundation ready - user story implementation can now begin in parallel --- ## Phase 3: User Story 1 - [Title] (Priority: P1) 🎯 MVP **Goal**: [Brief description of what this story delivers] **Independent Test**: [How to verify this story works on its own] ### Tests for User Story 1 (OPTIONAL - only if tests requested) ⚠️ > **NOTE: Write these tests FIRST, ensure they FAIL before implementation** > **For frontend stories: L1 model tests (no render) come BEFORE L2 component tests (with render).** - [ ] T010 [P] [US1] L1 model test for [ModelName] invariants in frontend/src/lib/models/__tests__/[ModelName].test.ts - [ ] T011 [P] [US1] L2 UX test for [Component] in frontend/src/routes/[path]/__tests__/[page].ux.test.ts - [ ] T012 [P] [US1] Contract test for [endpoint] in tests/contract/test_[name].py - [ ] T013 [P] [US1] Integration test for [user journey] in tests/integration/test_[name].py ### Implementation for User Story 1 - [ ] T014 [P] [US1] Define TypeScript types in frontend/src/types/[feature].ts (DTOs matching backend Pydantic schemas) - [ ] T015 [P] [US1] Create [ScreenName]Model in frontend/src/lib/models/[ScreenName]Model.svelte.ts - [ ] T016 [P] [US1] Create [Entity] model in backend/src/models/[entity].py - [ ] T017 [US1] Implement [function_name] in backend/src/api/[file].py @PRE: [precondition 1], [precondition 2] @POST: [output guarantee] @DATA_CONTRACT: [InputDTO] → [OutputDTO] @TEST_EDGE: [scenario→outcome], [scenario→outcome] - [ ] T018 [US1] Implement [Service.action] in backend/src/services/[service].py @PRE: [guard conditions] @POST: [post state] @SIDE_EFFECT: [external calls, DB writes] @TEST_EDGE: [scenario→outcome] - [ ] T019 [US1] Implement [Model.action] in frontend/src/lib/models/[Model].svelte.ts @ACTION [action_name](params): [description] @POST: [state guarantee] @SIDE_EFFECT: [API call, store mutation] @TEST_EDGE: [scenario→outcome] - [ ] T020 [US1] Create [Component] in frontend/src/routes/[...] (bind to model via @RELATION BINDS_TO -> [ModelId]) - [ ] T021 [US1] Add @INVARIANT validation in model actions - [ ] T022 [US1] Add belief-runtime instrumentation in model actions for C4/C5 flows **Checkpoint**: At this point, User Story 1 should be fully functional and testable independently --- ## Phase 4: User Story 2 - [Title] (Priority: P2) **Goal**: [Brief description of what this story delivers] **Independent Test**: [How to verify this story works on its own] ### Tests for User Story 2 (OPTIONAL - only if tests requested) ⚠️ - [ ] T018 [P] [US2] Contract test for [endpoint] in tests/contract/test_[name].py - [ ] T019 [P] [US2] Integration test for [user journey] in tests/integration/test_[name].py ### Implementation for User Story 2 - [ ] T020 [P] [US2] Create [Entity] model in src/models/[entity].py - [ ] T021 [US2] Implement [Service] in src/services/[service].py - [ ] T022 [US2] Implement [endpoint/feature] in src/[location]/[file].py - [ ] T023 [US2] Integrate with User Story 1 components (if needed) **Checkpoint**: At this point, User Stories 1 AND 2 should both work independently --- ## Phase 5: User Story 3 - [Title] (Priority: P3) **Goal**: [Brief description of what this story delivers] **Independent Test**: [How to verify this story works on its own] ### Tests for User Story 3 (OPTIONAL - only if tests requested) ⚠️ - [ ] T024 [P] [US3] Contract test for [endpoint] in tests/contract/test_[name].py - [ ] T025 [P] [US3] Integration test for [user journey] in tests/integration/test_[name].py ### Implementation for User Story 3 - [ ] T026 [P] [US3] Create [Entity] model in src/models/[entity].py - [ ] T027 [US3] Implement [Service] in src/services/[service].py - [ ] T028 [US3] Implement [endpoint/feature] in src/[location]/[file].py **Checkpoint**: All user stories should now be independently functional --- [Add more user story phases as needed, following the same pattern] --- ## Phase N: Polish & Cross-Cutting Concerns **Purpose**: Improvements that affect multiple user stories - [ ] TXXX [P] Documentation updates in docs/ - [ ] TXXX Code cleanup and refactoring - [ ] TXXX Performance optimization across all stories - [ ] TXXX [P] Additional unit tests (if requested) in tests/unit/ - [ ] TXXX Security hardening - [ ] TXXX Run quickstart.md validation - [ ] TXXX [P] **Attention compliance audit**: verify ATTN_1 (first-line density), ATTN_2 (hierarchical IDs), ATTN_3 (`@SEMANTICS` keyword consistency across same-domain contracts), ATTN_4 (contract ≤150 lines, module ≤400 lines) per `semantics-core` §VIII - [ ] TXXX [P] **Semantic index rebuild**: `axiom_semantic_index rebuild rebuild_mode="full"` — 0 parse warnings required - [ ] TXXX [P] **Orphan audit**: `axiom_semantic_context workspace_health` — confirm no new orphans from this feature --- ## Dependencies & Execution Order ### Phase Dependencies - **Setup (Phase 1)**: No dependencies - can start immediately - **Foundational (Phase 2)**: Depends on Setup completion - BLOCKS all user stories - **User Stories (Phase 3+)**: All depend on Foundational phase completion - User stories can then proceed in parallel (if staffed) - Or sequentially in priority order (P1 → P2 → P3) - **Polish (Final Phase)**: Depends on all desired user stories being complete ### User Story Dependencies - **User Story 1 (P1)**: Can start after Foundational (Phase 2) - No dependencies on other stories - **User Story 2 (P2)**: Can start after Foundational (Phase 2) - May integrate with US1 but should be independently testable - **User Story 3 (P3)**: Can start after Foundational (Phase 2) - May integrate with US1/US2 but should be independently testable ### Within Each User Story - Tests (if included) MUST be written and FAIL before implementation - Models before services - Services before endpoints - Core implementation before integration - Story complete before moving to next priority ### Parallel Opportunities - All Setup tasks marked [P] can run in parallel - All Foundational tasks marked [P] can run in parallel (within Phase 2) - Once Foundational phase completes, all user stories can start in parallel (if team capacity allows) - All tests for a user story marked [P] can run in parallel - Models within a story marked [P] can run in parallel - Different user stories can be worked on in parallel by different team members --- ## Parallel Example: User Story 1 ```bash # Launch all tests for User Story 1 together (if tests requested): Task: "Contract test for [endpoint] in tests/contract/test_[name].py" Task: "Integration test for [user journey] in tests/integration/test_[name].py" # Launch all models for User Story 1 together: Task: "Create [Entity1] model in src/models/[entity1].py" Task: "Create [Entity2] model in src/models/[entity2].py" ``` --- ## Implementation Strategy ### MVP First (User Story 1 Only) 1. Complete Phase 1: Setup 2. Complete Phase 2: Foundational (CRITICAL - blocks all stories) 3. Complete Phase 3: User Story 1 4. **STOP and VALIDATE**: Test User Story 1 independently 5. Deploy/demo if ready ### Incremental Delivery 1. Complete Setup + Foundational → Foundation ready 2. Add User Story 1 → Test independently → Deploy/Demo (MVP!) 3. Add User Story 2 → Test independently → Deploy/Demo 4. Add User Story 3 → Test independently → Deploy/Demo 5. Each story adds value without breaking previous stories ### Parallel Team Strategy With multiple developers: 1. Team completes Setup + Foundational together 2. Once Foundational is done: - Developer A: User Story 1 - Developer B: User Story 2 - Developer C: User Story 3 3. Stories complete and integrate independently --- ## Notes - [P] tasks = different files, no dependencies - [Story] label maps task to specific user story for traceability - Each user story should be independently completable and testable - Verify tests fail before implementing - Commit after each task or logical group - Stop at any checkpoint to validate story independently - Avoid: vague tasks, same file conflicts, cross-story dependencies that break independence - Derive implementation tasks from semantic contracts in `contracts/modules.md`, especially `@PRE`, `@POST`, `@SIDE_EFFECT`, `@DATA_CONTRACT`, and UI `@UX_*` tags - **For C3+ functions with pre-generated contracts: inline @PRE/@POST/@SIDE_EFFECT/@DATA_CONTRACT/@TEST_EDGE directly into the task description** (see format above at T017-T019). This eliminates cross-file navigation — the implementing agent sees the contract in the task line. - For Complexity 4/5 Python modules, include tasks for belief-state logging paths with `logger.reason()`, `logger.reflect()`, and `belief_scope` where required - For Complexity 5 or explicitly test-governed contracts, include tasks that cover `@TEST_CONTRACT`, `@TEST_SCENARIO`, `@TEST_FIXTURE`, `@TEST_EDGE`, and `@TEST_INVARIANT` - Never create tasks from legacy `@TIER` alone; complexity is the primary execution signal - **Model-first frontend tasks follow this order: types → model → L1 model tests → component → L2 UX tests** - **Screen Models use `.svelte.ts` extension** — create them in `frontend/src/lib/models/` - **Two-layer testing: L1 (model invariants, no render, ~27ms) comes BEFORE L2 (UX contracts, with render)** - **Backend tasks are pinned to `backend/src/`, frontend tasks to `frontend/src/`** — cross-stack tasks reference both - **Fixture materialization tasks come BEFORE test-writing tasks** — tests import fixtures, not generate data - **Canonical fixtures live in `specs//fixtures/`** — materialize to `tests/` via tasks, never edit canonical source in test directories