$npx -y skills add pavel-molyanov/molyanov-ai-dev --skill task-decompositionDecompose approved tech-spec into atomic task files with parallel creation and validation. Use when: "разбей на задачи", "декомпозиция", "decompose tech-spec", "создай задачи из техспека", "/decompose-tech-spec
| 1 | <!-- Generated by sync-to-codex v1. Do not edit directly. --> |
| 2 | |
| 3 | # Task Decomposition |
| 4 | |
| 5 | Decompose tech-spec Implementation Tasks into individual task files with parallel creation and validation. |
| 6 | |
| 7 | **Input:** `work/{feature}/tech-spec.md` (status: approved) |
| 8 | **Output:** `work/{feature}/tasks/*.md` (validated) |
| 9 | **Language:** Task files in English; communication with the user in the language the user writes in |
| 10 | |
| 11 | ## Phase 1: Create Tasks |
| 12 | |
| 13 | 1. Ask user for feature name if not provided. |
| 14 | |
| 15 | 2. Read `work/{feature}/tech-spec.md`. Check frontmatter `status: approved`. |
| 16 | If not approved — tell the user (in their language): "tech-spec is not approved. Run `/new-tech-spec` first and get it to approved." Stop. |
| 17 | |
| 18 | 3. Read `work/{feature}/user-spec.md`. |
| 19 | |
| 20 | 4. Note the task template path: `~/.claude/shared/work-templates/tasks/task.md.template` |
| 21 | |
| 22 | 5. Read skills/reviewers catalog from [skills-and-reviewers.md](~/.claude/skills/tech-spec-planning/references/skills-and-reviewers.md) — for passing correct skills/reviewers to task-creators. |
| 23 | |
| 24 | 6. For each task in Implementation Tasks — launch [`task-creator`](~/.claude/agents/task-creator.md) subagent in parallel. |
| 25 | Pass each task-creator: |
| 26 | - feature_path, task_number, task_name |
| 27 | - template_path: `~/.claude/shared/work-templates/tasks/task.md.template` |
| 28 | - files_to_modify, files_to_read (from tech-spec) |
| 29 | - depends_on, wave, skills, reviewers, verify (from tech-spec) |
| 30 | - teammate_name (if specified in tech-spec, optional) |
| 31 | Each task-creator copies the template to `tasks/{N}.md` first, then edits each section in place. This ensures no sections are skipped. |
| 32 | |
| 33 | 7. Confirm each task-creator returned a file path. Skip reading task content — preserve context budget for validation phase. |
| 34 | 8. Git commit: `draft(tasks): create {N} tasks from tech-spec for {feature}` |
| 35 | |
| 36 | **Checkpoint:** |
| 37 | - [ ] All `tasks/*.md` files created |
| 38 | - [ ] Each task-creator returned file path |
| 39 | - [ ] Draft committed |
| 40 | |
| 41 | ## Phase 2: Validation (up to 3 iterations) |
| 42 | |
| 43 | Tech-spec was already validated by 6 validators. This phase checks only: (1) task-creator correctly expanded tasks by template, (2) no mismatches with real code appeared during detailing. |
| 44 | |
| 45 | ### Validators |
| 46 | |
| 47 | Launch both in parallel: |
| 48 | |
| 49 | [`task-validator`](~/.claude/agents/task-validator.md) (sonnet) — Template Compliance + AC/TDD carry-forward: |
| 50 | - Batch: 5 tasks per call |
| 51 | - Pass: feature_path, task_numbers array, batch_number, iteration |
| 52 | - Report: `logs/tasks/template-batch{N}-review.json` |
| 53 | |
| 54 | [`reality-checker`](~/.claude/agents/reality-checker.md) (sonnet) — Reality & Adequacy: |
| 55 | - Batch: 3 tasks per call |
| 56 | - Pass: feature_path, task_numbers array, batch_number, iteration |
| 57 | - Report: `logs/tasks/reality-batch{N}-review.json` |
| 58 | |
| 59 | ### Process |
| 60 | |
| 61 | 1. Launch both validators in parallel (task-validator in batches of 5, reality-checker in batches of 3). |
| 62 | 2. Read JSON reports, collect findings. |
| 63 | 3. If issues found — for each task with issues, launch [`task-creator`](~/.claude/agents/task-creator.md) in fix mode: |
| 64 | - Pass: same inputs as creation + `mode: fix` + `findings` from validators |
| 65 | - task-creator reads existing task, applies fixes, overwrites file |
| 66 | 4. After each validation round, git commit: `chore(tasks): validation round {N} — {summary}` |
| 67 | 5. Re-validate fixed tasks (repeat 1-4). Maximum 3 iterations. |
| 68 | 6. If problems remain after 3rd iteration — show the user (in their language): "Here's what's left — let's resolve it together." |
| 69 | |
| 70 | ### Cross-Task Integration Check |
| 71 | |
| 72 | After individual validation passes, run a final cross-task check: |
| 73 | |
| 74 | 1. Launch both validators on ALL tasks in a single batch (not split into smaller batches): |
| 75 | - `task-validator` — focus: shared resource ownership (one owner, consumers depend_on owner), no competing instances in same wave |
| 76 | - `reality-checker` — focus: duplicate heavy resource init, hidden dependencies, inconsistent approaches across tasks |
| 77 | |
| 78 | 2. If issues found → launch `task-creator` in fix mode for affected tasks. Re-validate fixed tasks. |
| 79 | |
| 80 | 3. Max 2 iterations for cross-task check (on top of the 3 individual iterations). |
| 81 | |
| 82 | **Checkpoint:** |
| 83 | - [ ] Both validators: status=approved OR user resolved remaining issues |
| 84 | - [ ] Cross-task integration check: no cross-task conflicts |
| 85 | |
| 86 | ## Phase 3: Present to User |
| 87 | |
| 88 | 1. Summary: task count, waves, dependencies, validation results (iterations, issues found/fixed). |
| 89 | 2. Wait for user approval. |
| 90 | 3. Git commit: `chore(tasks): task decomposition approved for {feature}` |
| 91 | 4. Suggest next step: `/do-task` for individual tasks. |
| 92 | |
| 93 | **Checkpoint:** |
| 94 | - [ ] Summary presented to user |
| 95 | - [ ] User approved task decomposition |
| 96 | - [ ] Approval committed |
| 97 | |
| 98 | ## Final Check |
| 99 | |
| 100 | - [ ] All phases completed (tasks created, validation passed) |
| 101 | - [ ] All tasks match template (frontmatter: status, depends_on, wave, sk |