Phase 12: Phase-Task Decomposition - 8 plans in 4 waves - 4 parallel, 4 sequential - Ready for execution
3.4 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous
| phase | plan | type | wave | depends_on | files_modified | autonomous | |||
|---|---|---|---|---|---|---|---|---|---|
| 12-phase-task-decomposition | 02 | execute | 1 |
|
true |
Purpose: Enable creating plans from architect output and querying plans by phase. The decompose agent needs to know what plans exist in a phase to break them into tasks.
Output: PlanRepository with findByPhaseId, getNextNumber, bulk creation methods.
<execution_context>
@/.claude/get-shit-done/workflows/execute-plan.md
@/.claude/get-shit-done/templates/summary.md
</execution_context>
Pattern reference from Phase 11 (repository extensions)
@.planning/phases/11-architect-agent/11-02-SUMMARY.md
Source files to modify
@src/db/repositories/plan-repository.ts @src/db/repositories/drizzle/drizzle-plan-repository.ts @src/db/repositories/phase-repository.ts
Task 1: Extend PlanRepository port interface src/db/repositories/plan-repository.ts Add the following methods to PlanRepository interface (following pattern from PhaseRepository):findByPhaseId(phaseId: string): Promise<Plan[]>- Get all plans for a phase, ordered by numbergetNextNumber(phaseId: string): Promise<number>- Get next available plan number (MAX+1 or 1 if none) npm run build passes (no implementation yet) PlanRepository interface extended with new methods
-
findByPhaseId(phaseId):- Query plans table where phase_id = phaseId
- Order by number ascending
- Return array (empty if none)
-
getNextNumber(phaseId):- Query MAX(number) where phase_id = phaseId
- Return max + 1, or 1 if no plans exist
Follow the pattern from DrizzlePhaseRepository.getNextNumber. npm run build passes, npm test passes DrizzlePlanRepository implements findByPhaseId and getNextNumber
Task 3: Export types from repositories index src/db/repositories/index.ts Verify PlanRepository and its types are properly exported. If not already exported: - Export PlanRepository interface - Export CreatePlanData type - Export UpdatePlanData typeCheck existing exports and add if missing. npm run build passes, types importable from src/db/repositories All PlanRepository types properly exported
Before declaring plan complete: - [ ] npm run build succeeds - [ ] npm test passes all tests - [ ] PlanRepository.findByPhaseId exists and works - [ ] PlanRepository.getNextNumber exists and works - [ ] Types exported from index<success_criteria>
- All tasks completed
- All verification checks pass
- No errors or warnings introduced
- PlanRepository ready for tRPC procedures </success_criteria>