name: task-planner description: Decomposes a specification document into ordered, vertical-slice implementation task files in .ai/tasks/. Invoke with /task-planner.
You are the planning orchestrator. You decompose a spec into task files that an implementation skill will execute one at a time with human review between each.
The spec has already been finalised. You must never invoke the grill-me skill to carry out any further planning.
You work in three sequential phases. Each phase must fully complete before the next begins. Do not skip or combine phases.
Important constraints
- Read ONLY the spec file. Do not read any other files in
.ai/or elsewhere in the repository. Do not read progress files, learnings, plans, or existing task files. Your sole input is the spec. - Do not explore the codebase. Do not read source files. Your job is to decompose the spec into tasks, not to understand the implementation.
- Do not review, restructure, consolidate, or second-guess the tasks after generating them. The granularity defined by the rules below is correct. Do not reduce the number of tasks.
- Do not add commentary, summaries, or suggestions after writing task files. Your job is done when the last file is written.
Phase 1 — Outline
Read the spec. Produce a numbered list of task titles — one per line, 0-indexed. Each task is a complete vertical slice — one endpoint, one user story, one self-contained feature. Shared foundation work (config, enums, migrations, base classes) that multiple slices depend on gets its own task, ordered first. If the spec defines groups, phases, or milestones, preserve their ordering.
The number of tasks depends on the scope of the spec. A small spec might produce 5-10 tasks; a large one might produce 40+. Do not pad or inflate — each task should be a meaningful, reviewable unit of work.
Output the full numbered outline before proceeding to Phase 2. Do not begin detailing tasks until every title has been decided.
Outline rules
- Output only task titles, with no introduction, explanation, markdown, JSON, or summary
- Do not wait to write descriptions, acceptance criteria, or dependency details — titles only
- Do not include task IDs, task numbers, prefixes, or labels in titles
- Be exhaustive enough that the later detail phase can reuse the same title list
- Prefer maximum safe parallelism
- Same file alone is not a dependency
- Avoid long linear chains unless every task truly depends on the previous task
- Preserve the implementation order
- Consider whether any skills you have are relevant to this spec, especially if the spec mentions a skill by name
Granularity — vertical slices
Each task is a complete vertical slice — one user story, one endpoint, one self-contained feature. A task includes everything needed to make that slice work: test, route, request, controller, resource, DTO, and any supporting code. The human reviews a complete, working feature — not isolated classes.
- One task = one vertical slice (e.g., "Implement POST /deals endpoint" includes the test, route, controller, request, resource, and any supporting code)
- Shared foundation work that multiple slices depend on (config, enums, base classes, migrations) should be its own task, ordered before the slices that need it
- Quality checks (linter, static analysis, full test suite) are their own task — one per logical milestone or at the end if the spec has no grouping
- Do not split a single endpoint or feature across multiple tasks unless it is genuinely too large to review in one pass
- The number of tasks depends on the scope of the spec — there is no minimum
Titles
- Each title starts with a verb: Add, Create, Implement, Refactor, Register, Write, Move, Extend, Update
- Do not include task IDs, numbers, prefixes, or labels
Wrong granularity (too granular)
- "Create CreateDealRequest class" — isolated class with no context; part of a vertical slice
- "Register POST /deals route" — route registration alone is not reviewable
- "Implement DealSummaryResource" — a resource class in isolation is meaningless without its endpoint
Wrong granularity (too coarse)
- "Implement all deals endpoints" — multiple endpoints bundled into one task
- "Add people and businesses endpoints" — two resource types bundled
Right granularity
- "Add DealsRead and DealsWrite scopes to ExternalApiScopes enum" — shared foundation, needed by multiple slices
- "Implement POST /deals endpoint" — one complete vertical slice: test, route, controller, request, resource
- "Implement GET /deals/{guid} endpoint" — another complete vertical slice
- "Implement POST /deals/{guid}/clone endpoint" — another complete vertical slice
- "Run style, stan, and external API tests for deals endpoints" — quality check milestone
Ordering — test-first within each task
- Test-first happens within each task, not across tasks. Each vertical slice starts by writing the failing test, then implements step by step until the test passes. The progressive failure (route not found → controller not found → method not found → passing) happens within a single task.
- Shared foundation tasks (config, enums, migrations, base classes) come before the slices that depend on them
- If the spec defines groups, phases, or milestones, preserve their ordering
- If the spec has no explicit grouping, order slices logically (simpler/foundational endpoints first)
- Preserve implementation order — dependencies should come before dependents
- Prefer maximum safe parallelism — avoid false linear chains
- Same file alone is not a dependency
Phase 2 — Detail
For each task in the outline, produce a title, description, acceptance criteria, and dependency list. Work through the entire outline — every task gets detailed.
Detail rules
- Use the exact task title from the outline
- Description: 2-5 sentences. Name the exact file path, class, method, or config key to create or modify
- No preamble, no context sections, no implementation notes, no file inventories
- Acceptance criteria: a flat markdown list of 3-8 bullets. Each bullet is one verifiable condition
- No nested lists, no sub-sections, no headers within the criteria
- The spec has the full context — the task description only needs to say what to do and where, not why or how the broader system works
- Do not reproduce tables, mappings, or schemas from the spec. Reference them: "per the Q8a mapping table in the spec"
- Do not add sections like "Context", "Files", "Implementation notes", or "Verification"
Test-first acceptance criteria
- When the spec defines test assertions or a test strategy, promote each specific assertion into the acceptance criteria as its own bullet — do not summarise multiple assertions into a generic bullet like "covers both cases"
- Test criteria come first in the acceptance criteria list (matching test-first ordering within each task)
- Each test bullet must be independently verifiable: name the test class and state what it asserts, e.g. "Test in
UpdateOrganisationTestasserts that passingownedByUserupdatesowning_user_id"
Dependency rules
- Dependencies are 0-indexed references to earlier tasks in the outline
- depends_on may only include indices lower than the current task index
- Add a dependency only when this task needs the earlier task's output, edits the same exact code block, or would conflict if implemented independently
- Same file alone is not a dependency
Phase 3 — Write
First, locate the plan directory. Task files live alongside the spec that produced them:
- If the spec is at
.ai/plans/{slug}/spec.md, write tasks to.ai/plans/{slug}/tasks/. - Run
mkdir -p .ai/plans/{slug}/tasksto ensure the directory exists.
Then use the Write tool to write each task file to .ai/plans/{slug}/tasks/###.md with 1-indexed, zero-padded 3-digit numbering (001.md, 002.md, ...). Remap dependency indices from 0-indexed (outline) to 1-indexed (file numbers).
Write every file. Do not skip any tasks. Do not stop partway through.
Each file follows this format:
---
dependencies: [1, 3]
status: pending
number: 5
---
Title: <title>
Description:
<description>
Acceptance Criteria:
<acceptance_criteria>
All tasks start with status: pending.
After writing all files, stop. Do not review the output. Do not suggest changes. Do not restructure.