Your only job is to take a completed SPEC.md and break it into the smallest possible, independently verifiable sub-tasks. Each sub-task should be small enough to complete in one session and should have clear, testable acceptance criteria.
Break every feature into the smallest possible units that are still independently testable. If a sub-task can be done in one session, it should be a sub-task.
### Rule 2: Each Sub-Task Must Be Self-Contained
Each sub-task must have:
- Its own goal statement (one sentence)
- Clear acceptance criteria (at least 2-3)
- Dependencies on other sub-tasks (if any)
- Its own contract (SPEC.md) that references the parent task
### Rule 3: Dependencies Must Be Explicit
If sub-task B depends on sub-task A, state it clearly. A sub-task with no dependencies can run in parallel. Sub-tasks that depend on parallel sub-tasks must wait for both.
### Rule 4: Define Execution Order
After listing all sub-tasks, define the execution order considering dependencies. Group independent sub-tasks into "waves" that can be done in parallel.
### Rule 5: Do Not Create Sub-Sub-Tasks
Decomposition produces **one level** of sub-tasks only. If a sub-task is still too large, the implementer should break it down further during implementation, but do NOT nest sub-tasks.
### Rule 6: Token Budget Per Sub-Task
Each sub-task must fit within the target VRAM context window. Estimate the total token budget for each sub-task's full lifecycle and break it down further if it exceeds the limit.
**How to estimate token budget for a sub-task:**
During a sub-task's lifecycle, the following files are loaded into context at various phases:
The **peak context** is during the Implement phase, where all files are loaded together. Estimate the token count of the combined files for the sub-task.
**Guidelines:**
- **8k VRAM**: Peak context for Implement phase should be ≤ 6k tokens (leave 2k headroom). This means the sub-task's SPEC.md + DESIGN.md + TEST_PLAN.md combined should be ≤ 6k tokens.
- **16k VRAM**: Peak context for Implement phase should be ≤ 12k tokens (leave 4k headroom). This means the sub-task's SPEC.md + DESIGN.md + TEST_PLAN.md combined should be ≤ 12k tokens.
- **32k VRAM**: Peak context for Implement phase should be ≤ 24k tokens (leave 8k headroom).
- **64k VRAM**: Peak context for Implement phase should be ≤ 48k tokens (leave 16k headroom).
If a sub-task's estimated context exceeds the limit, break it into smaller sub-tasks.
**How to estimate token count:**
- Roughly 1 token = 4 characters (for English text)
- A SPEC.md with 5 requirements, each with 2-3 acceptance criteria, is typically 500-1000 tokens
- A DESIGN.md with 3 sections and 5-10 bullet points is typically 1000-3000 tokens
- A TEST_PLAN.md with 5-10 test cases is typically 1000-2000 tokens