Task generation

From attilaszasz/sdd-pilot · View interactive version

Task generation is an AI agent skill from the GitHub repository attilaszasz/sdd-pilot. Reference material with the canonical task-format grammar and decomposition rules for plan-to-tasks expansion. Loaded on demand by `generate-tasks`; not directly invokable.

How to use this skill

Skill file

Task Generation Guide

Task Format (REQUIRED)

Every task MUST strictly follow this format:

- [ ] T### [P?] [US#|OBJ#?] {(FR|TR|OR|RR)-###?} [COMPLETES (FR|TR|OR|RR)-###?] Description with file path [after:T###?] [← T###:Symbol?] [→ exports: Symbol?] [VERIFY: <command>]?*

[VERIFY: <command>] is optional and repeatable (zero or more; typically 0–3). It appends after → exports: (and after [COMPLETES ...]). The command text runs from [VERIFY: to the next ] and MUST NOT contain a literal ] — move such checks into a verify script and reference it when needed.

Format Components

  1. Checkbox: Always - [ ] (markdown checkbox)
  2. Task ID: Sequential (T001, T002...) in execution order
  3. [P] marker: Only if parallelizable (different files, no dependencies)
  4. [US#|OBJ#] label: Required for delivery phases only
  1. {(FR|TR|OR|RR)-###} tag: Links task to the requirement(s) it implements
  1. Description: Clear action with exact file path
  2. after:T### clause (optional): Explicit task-level dependency when a task depends on artifacts from a different phase or a non-adjacent task within the same phase. Omit when sequential T### ordering within a phase already implies the dependency.
  3. ← T###:Symbol import hint (optional): Lists specific symbols consumed from another task's output file, by source task ID. Use when data-model.md, contracts/, or the Requirement Coverage Map Function(s)/Symbol(s) column provide enough detail to name the symbols. Omit for leaf tasks with no cross-file coupling.
  4. → exports: Symbol(params) export hint (optional): Lists the 1–3 most important symbols this task's file will export, with key parameter or field hints. Source from data-model.md entities, contracts/ schemas, or the Requirement Coverage Map Function(s)/Symbol(s) column. Omit when no downstream task depends on this file.
  5. [COMPLETES (FR|TR|OR|RR)-###] marker (optional): Placed on the last task implementing a requirement that spans 3+ tasks. Signals the implementing agent to verify the full requirement chain at this task's completion.
  6. [VERIFY: <command>] annotation (optional, repeatable): A machine-checkable acceptance assertion the Developer MUST run from the repo root before marking the task [X]. Non-zero exit (for commands) or no match (for grep patterns) is FAILURE — the task stays [ ] and routes into the error-recovery loop. Emit when a deterministic check is derivable: prefer a plan.md ## Testing Strategy test command scoped to the task's file/requirement; else a grep for a → exports: symbol declaration; else a build/typecheck command targeting the task's file. Omit when no deterministic check is derivable. Commands MUST NOT contain a literal ].

Annotation Constraints

Examples

Phase Structure

Optional preamble sections (Project Mode, Epic / Capability Map, Brownfield Notes) may precede the first phase header — see the template for details.

Optional Phase 1: Setup (Repository / Workspace Delta)

Optional Phase 2: Foundational (Cross-Work-Item Blockers)

Phase 3+: Delivery Work Items (One Phase Per Story or Objective, by Priority)

Optional Final Phase: Polish & Cross-Cutting Concerns

Project Mode

Infer the task-generation mode from the plan and repository context:

Record the mode in tasks.md when helpful. Use it to guide whether Setup/Foundational phases are warranted.

Number phases sequentially based on the phases that are actually present. If Setup and/or Foundational are omitted, the first included delivery phase should use the next sequential phase number.

Organization Rules

  1. From Requirement Coverage Map (PRIMARY): If plan.md has a ## Requirement Coverage Map table, use it as the authoritative source for mapping requirements to components, file paths, and exported symbols. Each row provides Req ID → Component(s) → File Path(s) → Function(s)/Symbol(s) — use the file paths to assign tasks to the correct work-item phases and the Function(s)/Symbol(s) column to populate → exports: annotations.
  2. From Product User Stories or Non-Product Objectives: Each P1/P2/P3 work item gets its own phase
  3. From Contracts (if generated): Map each endpoint to the relevant story or objective
  4. From Data Model (if generated): Map entities to work items; lift entities into Setup/Foundational only when they truly block multiple work items
  5. From Infrastructure:
  1. Brownfield Heuristics: Prefer integration, compatibility, migration/backfill, feature-flag, rollout, and regression-verification tasks over generic project initialization in mature repositories
  2. Just-in-Time Shared Work: Create shared structures in the earliest work item that needs them unless they are true cross-work-item blockers
  3. Requirement Completion Point: When a requirement {FR-###} (or TR-###/OR-###/RR-###) is implemented across 3+ tasks, the LAST task carrying that tag MUST include the suffix [COMPLETES (FR|TR|OR|RR)-###]. This signals the implementing agent to verify the full requirement at that task's completion rather than deferring to QC.

Dependency Rules

Tests

Tests are OPTIONAL — only include if explicitly requested in the spec or user asks for TDD.

If included, tests MUST be written and FAIL before implementation.

Acceptance Test Stubs

When plan.md has a populated ## Acceptance Test Stubs section (not N/A — no P1 requirements), stub-creation tasks are MANDATORY for every listed P1 requirement and MUST precede that requirement's implementation tasks within the same work-item phase. A stub task creates the framework-native describe/it (or equivalent) blocks named in the plan row for one P1 reqID; the stub MUST be RED (pending/skip/failing-assertion) at creation. Implementation tasks tagged with a stubbed reqID MUST make their linked stub block GREEN before they can be marked [X].

Stub task format: - [ ] T### [US#|OBJ#] {FR-###|TR-###|OR-###|RR-###} Create acceptance test stub in <test file path> ← plan:AcceptanceTestStubs — the ← plan:AcceptanceTestStubs import hint points the Developer at the plan row to read the block names. Use one stub task per P1 requirement unless the plan groups multiple reqIDs into a single test file (then one stub task carrying {FR-001,FR-002} covering that file is acceptable). Stub tasks are never [P]-batched with the implementation tasks that satisfy them.

Artifact Conventions

Preservation rules: see AGENTS.md §Artifact Conventions. Consult the expanded reference only for exceptions or remediation details not covered by the primer.

Template

Use the template at assets/tasks-template.md.

Use the fixture at assets/tasks-annotation-fixture.md to dry-run parser behavior, dependency edges, and completion-point examples before changing task format rules.

When generating tasks.md, omit empty optional sections rather than leaving placeholder phases with filler tasks.

Size budget: Keep tasks.md at or below 6KB. Target 5–10 tasks per work-item phase; if total tasks exceed 40, split the feature into sub-features.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.