external/tgd-skills/tgd-planning-and-task-breakdown/SKILL.md
Breaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.
npx skillsauth add seikaikyo/dash-skills tgd-planning-and-task-breakdownInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Decompose work into small, verifiable tasks with explicit acceptance criteria. Good task breakdown is the difference between an agent that completes work reliably and one that produces a tangled mess. Every task should be small enough to implement, test, and verify in a single focused session.
When NOT to use: Single-file changes with obvious scope, or when the spec already contains well-defined tasks.
Plans must assume the executor has:
This means every task must contain:
Never write:
Before planning, determine and validate <feature-name>:
$TGD_DIR/ for feature directories — subdirectories containing SPEC.md or PRD.md. Infrastructure dirs (.scans/, wiki/, and any dot-directories) are NOT features — always exclude them. If exactly one feature directory exists, lock that name./tgd-define first.$TGD_DIR/<feature-name>/.Before writing any code, operate in read-only mode to gather context from all available tGD artifacts:
$TGD_DIR/CONTEXT.md: Understand existing project structure, tech stack, and conventions.$TGD_DIR/<feature-name>/PRD.md: Understand the business goals, user pain points, and scope boundaries.$TGD_DIR/<feature-name>/SPEC.md: Analyze technical requirements, API contracts, and database schemas.$TGD_DIR/<feature-name>/DESIGN.md (if present): Review component trees and UI flows.Synthesis: Map dependencies between existing code and new requirements. Note risks and unknowns. If .codegraph/ exists, run codegraph impact "<core-symbol>" on any symbol the feature will modify to assess blast radius and inform task ordering. If planning a large refactor, run the understand-diff skill to visualize the impact of proposed changes before breaking down tasks.
Do NOT write code during planning. Write a plan document at $TGD_DIR/<feature-name>/TASKS.md covering: dependency graph, ordered task list with acceptance criteria, verification checkpoints, and risks with mitigations.
TASKS.md template (save to $TGD_DIR/<feature-name>/TASKS.md):
# TASKS.md: [Feature Name]
> **Corresponding PRD**: [PRD.md](PRD.md)
> **Tech Stack**: [List from SPEC]
## Overview
[One paragraph summary of what we're building]
## Architecture Decisions
- [Key decision 1 and rationale]
- [Key decision 2 and rationale]
---
## Task 1: [User Story Title] (Story ID: US-01)
**Status:** pending <!-- pending | in-progress | complete | blocked: <ref>. The ONLY task-state marker: /tgd-develop flips it, resume + re-plan read it. Do not invent checkboxes/emoji variants. -->
**Spec-Review:** pending <!-- pending | PASS — <one line> | FAIL — <one line>. Flipped by /tgd-develop's two-stage review; /tgd-verify fails closed on a complete task left pending. -->
**Quality-Review:** pending <!-- same states; flipped after the code-quality review pass. -->
### 1. Context & Goal
[What is the goal of this task? Why is it important?]
- **Priority**: [High/Medium/Low]
- **Dependencies**: [None / Task N]
### 2. Technical Design
**Database Schema (if any):**
```[Language]
// Example: Prisma Schema or SQL
API Contract:
/endpoint{ ... }Status Code { ... }Every task must use BDD (Given/When/Then) format — this ensures all criteria are behavior-level, testable, and consistent with REGRESSION-CATALOG entries.
Every criterion carries a stable ID: AC-<task>.<n> (AC-1.1, AC-1.2, …). The verifying test MUST mention this ID in its name, docstring, or a comment — ac-trace.py cross-references them during /tgd-verify.
AC-1.1 — Given [initial context] When [event happens] Then [expected outcome]
[R] / No]tests/path/to/test.ts — filled during /tgd-develop; MANDATORY for [R] criteria]Every criterion declares its carrier — Test: for anything with runtime
behavior, or Doc: for documentation-only criteria (README sections, usage
examples — content with no runtime surface):
README.md contains "getMonthlySummary("
ac-trace.py verifies a Doc: carrier by checking the named file exists and
contains the quoted string — no test reference is required or expected.
Without this, doc-only criteria force a workaround (agents paste the AC id
into an unrelated test file as a comment just to satisfy the trace).
Doc-only criteria can never be [R] — the regression catalog replays
executable tests only.[R] marking rules — must mark [R] if the criterion matches ANY of:
US-xx; the AC-<task>.<n> ids exist only in TASKS.md.)REGRESSION-CATALOG.md[R] if criterion is: cosmetic, internal refactor, dev-only tooling, single-use migration[R]. The cost of an extra catalog entry is low; the cost of missing a regression is high.[R]: a corresponding test MUST be created during /tgd-develop (TDD) and its path recorded in the criterion's Test: field. It will be added to $TGD_DIR/REGRESSION-CATALOG.md during /tgd-release./tgd-verify runs python3 $TGD_REPO_ROOT/scripts/ac-trace.py $TGD_DIR/<feature>/ <client-repo> — it fails when any AC id is unreferenced by tests (or, for Doc: criteria, when the named file is missing or lacks the quoted string), when any [R] criterion lacks a Test: file, or when that file is missing on disk. A TASKS.md without AC ids fails closed.path/to/file.tstests/path/to/test.ts✅ All tests pass (npm test)
✅ Build succeeds
✅ Lint clean
| Risk | Impact | Mitigation | |------|--------|------------| | [Risk] | High/Med/Low | [Strategy] |
**This is the ONLY TASKS.md format.** Everything below describes how to fill
it in — do not invent alternative task layouts; `ac-trace.py` (run by
`/tgd-verify`) fails closed on task lists without `AC-<task>.<n>` ids.
### Step 2: Identify the Dependency Graph
Map what depends on what:
Database schema │ ├── API models/types │ │ │ ├── API endpoints │ │ │ │ │ └── Frontend API client │ │ │ │ │ └── UI components │ │ │ └── Validation logic │ └── Seed data / migrations
Implementation order follows the dependency graph bottom-up: build foundations first.
### Step 3: Slice Vertically
Instead of building all the database, then all the API, then all the UI — build one complete feature path at a time:
**Bad (horizontal slicing):**
Task 1: Build entire database schema Task 2: Build all API endpoints Task 3: Build all UI components Task 4: Connect everything
**Good (vertical slicing):**
Task 1: User can create an account (schema + API + UI for registration) Task 2: User can log in (auth schema + API + UI for login) Task 3: User can create a task (task schema + API + UI for creation) Task 4: User can view task list (query + API + UI for list view)
Each vertical slice delivers working, testable functionality.
### Step 4: Write Tasks
Write each task using the **canonical per-task block from the TASKS.md
template above** (`**Status:** pending` line → Context & Goal → Technical
Design → Acceptance Criteria with `AC-<task>.<n>` ids, `[R]` decision, and
`Test:` field → Files Likely Touched). Do not use a simplified layout — the
AC ids and `Test:` fields are machine-checked downstream, and the `Status:`
line is what `/tgd-develop`'s resume rule and `/tgd-plan`'s re-plan protocol
read; a task without one is invisible to both.
Per-task quality bar (in addition to the template fields):
- **Verification is explicit**: name the exact command (`npm test -- --grep "x"`),
not "run the tests" (Zero-Context Rule)
- **Dependencies declared**: task numbers this depends on, or "None"
- **Scope estimated**: Small (1-2 files) / Medium (3-5) / Large (5+ → split it)
- **No standalone "write tests" tasks**: tests are each task's AC carriers,
written inside that task's TDD cycle — never a separate task scheduled after
the implementation. A "Task N: write the test suite" decomposition
structurally encourages test-after (the implementation task completes
untested, then the test task rubber-stamps it) and produces meta-criteria
("tests exist and pass") that trace to the same test lines as the behavior
criteria they duplicate. If a task's tests feel like a separate work item,
the task is too big — split the task, not the testing.
### Step 5: Order and Checkpoint
Arrange tasks so that:
1. Dependencies are satisfied (build foundation first)
2. Each task leaves the system in a working state
3. Verification checkpoints occur after every 2-3 tasks
4. High-risk tasks are early (fail fast)
Add explicit checkpoints:
```markdown
## Checkpoint: After Tasks 1-3
- [ ] All tests pass (`npm test`)
- [ ] Application builds without errors (`npm run build`)
- [ ] Core user flow works end-to-end
Checkpoint items must be machine-checkable commands — /tgd-develop runs
them when it reaches the checkpoint and stops only on failure; it does NOT
pause for a human. Human review is concentrated in /tgd-release's sign-off
gate, not mid-execution.
If the PRD's §6 Success Metrics names a tracking event that does not exist yet (rule 2 in tgd-spec-driven-development's §6 filling rules), planning owns two outputs:
1. Register the event in $TGD_DIR/TRACKING-PLAN.md — the cumulative event dictionary shared across ALL features and ALL repos of the project (same role as REGRESSION-CATALOG.md: append-only, one source of truth). Create the file on first use with this header, then append one entry per event:
# Tracking Plan
> Cumulative event dictionary across all features and platforms.
> Event names are semantic and platform-agnostic — see the three rules below.
---
### sign_up_completed
- **Semantic trigger:** User completes registration (server returns 201)
- **Source of truth:** server
- **Platforms:** server (web/ios do NOT duplicate this event)
- **Properties:** `method: "email"|"oauth"` · `platform` (auto-attached by SDK) · no PII
- **Feature:** user-login
- **Status:** planned <!-- flipped to "live since vYYYY.MM.DD" by /tgd-release -->
Cross-platform rules (non-negotiable):
sign_up_completed + platform: web|ios|android — never sign_up_web / signUpIos triplets. Split names silently break every funnel that forgets one variant.Naming convention: object_action in snake_case, property keys also snake_case — on every platform. Payload key drift (plan_type vs planType) is exactly what the dictionary exists to prevent.
2. Create one instrumentation task per platform listed in the entry's Platforms field — a normal task in TASKS.md (multi-repo tagged if applicable) with its own BDD acceptance criteria, e.g.:
- **AC-4.1** — **Given** a user completes registration **When** the server responds 201 **Then** `sign_up_completed` is emitted with properties `method`, `platform` and no PII
- **Regression**: No
- **Test**: [filled during /tgd-develop — the test asserts the event fires with the expected payload keys]
A mis-firing event is worse than a missing one — you will trust a wrong number. That is why instrumentation gets tested ACs, not a "remember to add analytics" checklist line.
When TASKS.md already exists (spec changed mid-flight, scope grew), the default is an incremental update, never a from-scratch rewrite — /tgd-develop backfills Test: fields and completion state into TASKS.md, and regenerating the file destroys them, breaking ac-trace.py and the regression chain downstream.
Incremental rules:
**Status:** complete keeps its Status line, criteria, and Test: fields byte-for-byte. (The Status: lines are also how the re-plan prompt counts "M 個已完成" — no marker, no count.)AC-<task>.<n> ids — tests already reference them./tgd-plan's re-plan prompt, option 2).| Size | Files | Scope | Example | |------|-------|-------|---------| | XS | 1 | Single function or config change | Add a validation rule | | S | 1-2 | One component or endpoint | Add a new API endpoint | | M | 3-5 | One feature slice | User registration flow | | L | 5-8 | Multi-component feature | Search with filtering and pagination | | XL | 8+ | Too large — break it down further | — |
If a task is L or larger, it should be broken into smaller tasks. An agent performs best on S and M tasks.
When to break a task down further:
When multiple agents or sessions are available:
| Rationalization | Reality | |---|---| | "I'll figure it out as I go" | That's how you end up with a tangled mess and rework. 10 minutes of planning saves hours. | | "The tasks are obvious" | Write them down anyway. Explicit tasks surface hidden dependencies and forgotten edge cases. | | "Planning is overhead" | Planning is the task. Implementation without a plan is just typing. | | "I can hold it all in my head" | Context windows are finite. Written plans survive session boundaries and compaction. |
Before starting implementation, confirm:
AC-<task>.<n> ids (ac-trace.py fails closed without them)**Status:** line, initialized pending (/tgd-develop resume and re-plan both read it)[R] Yes/No decision; every [R] will get a Test: file reference during /tgd-develop$TGD_DIR/<feature-name>/DESIGN.md exists (created in Define phase)development
拋棄式 HTML mockup 比稿:產出 2 到 3 個設計立場不同的變體(密度 / 版式 / 強調軸,不是換色),各附取捨說明,最後給有立場的對比結論。適用:「畫個草圖」「比較 A 版 B 版」「先看方向再做」「給我看幾種做法」。要 production 元件或設計已定案時不適用。
tools
需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。
development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
testing
Reference for writing and editing agent skills well — the vocabulary and principles that make a skill predictable. Consult when authoring, reviewing, or pruning a SKILL.md.