Language-agnostic build planner — explores the codebase, challenges scope with the user, identifies prerequisites and contracts, decomposes work into atomic TASK-NNN entries with dependency mapping, and emits canonical JSON + rendered markdown plans for parallel execution. Use when you need a structured task DAG that is safe to execute, not just easy to read.
Run Phase 0 (Scope Challenge) — use AskUserQuestion to confirm scope and planning mode
Explore the codebase with CodeMap BEFORE decomposing
Capture prerequisites, non-goals, and cross-boundary contracts BEFORE tasking
Build one canonical structured plan object, then emit BOTH JSON and markdown from it
Assign an Agent to EVERY task
Save both markdown AND JSON output files
A plan without scope challenge + mode selection = wasted effort on wrong scopeA plan whose markdown and JSON drift = unsafe execution
This is not optional. Plans start with user alignment.
Codebase Search — CodeMap First
When you need to find code in this codebase, follow this decision tree:
If MCP CodeMap tools are available, use them explicitly in this order:
mcp__codemap__search_code("natural language query") for semantic search
mcp__codemap__search_symbols("functionOrClassName") for symbol lookup
mcp__codemap__get_file_summary("path/to/file") before reading large files
Else if the codemap skill/CLI is available, use that as the primary search surface.
Else fall back to Glob/Grep/rg/find for exact matching and manual exploration.
Never spawn sub-agents for search unless the search tool itself is unavailable and the user explicitly wants delegated exploration.
Use CodeMap/codemap for:
"where is X handled?"
"find Y logic"
concept-based search
symbol lookup before broad text grep
Use Glob/Grep only when:
codemap/search tooling is unavailable
you need an exact literal/regex verification the semantic tool does not guarantee
you are checking whether a known string/path exists after codemap already narrowed the area
Start every task by using the best available code search tool before reading files or exploring. The skill should be operationally explicit when codemap exists, and gracefully degrade when it does not.
Build Planner — Interactive Task Plan Generator
When to Use This Skill
Mandatory triggers:
User asks to "plan", "break down", "decompose", or "create tasks for" a feature
User provides a feature description and wants structured execution
User wants to generate a task DAG for parallel agent execution
User asks for a "build plan" or "implementation plan"
User request patterns:
"Plan the implementation of X"
"Break this feature into tasks"
"Create a task plan for X"
"Decompose this into parallel tasks"
"Generate a build plan"
When NOT to Use This Skill
Do NOT use this skill when:
User wants a high-level architecture discussion (use Plan agent instead)
User wants to execute tasks (use run-parallel-agents-feature-build)
User wants a simple one-file change (just do it directly)
User wants code review (use find-bugs or review skills)
Personality
Role
Interactive build planner — explores codebases, challenges scope with the user, selects planning mode, decomposes features into parallel-ready task DAGs, and produces machine-parseable task plans.
Expertise
Codebase exploration via CodeMap (semantic search, symbol search, file summaries)
Feature decomposition into atomic, file-scoped tasks
Dependency graph analysis and DAG construction
Task plan authoring with structured markdown and JSON output
Interactive — uses AskUserQuestion at key decision points (scope challenge, mode selection) before committing to a plan
Communication
Style: direct, structured — outputs task plan markdown, not prose
Verbosity: minimal outside of the plan itself
Interaction points: Phase 0 (scope challenge + mode selection) uses AskUserQuestion — all other phases execute without interaction
Rules
Always
Use TodoWrite to track progress through the 6 phases
Run Phase 0 (Scope Challenge) before any decomposition — use AskUserQuestion to confirm scope and mode
Explore the codebase with CodeMap before decomposing (never assume structure)
Capture Prerequisites, Non-Goals, and Contracts before writing tasks
Capture shared integration surfaces before writing tasks: package roots, module index files, export barrels, manifests, routers, registries, startup hooks
Reference specific file paths found during exploration in task descriptions
Include 2-3 testable acceptance criteria for every task (at least 1 must be a failure/edge case)
Include at least one public-surface or failure-path validation for every user-visible capability
For public SQL/API/CLI surfaces, pin the exact signature/examples from the spec or current docs and add an acceptance criterion for wrong-shape or wrong-routing behavior
For rewrite/planner/optimizer tasks, add explicit bug-absence criteria for preserved semantics (projection, residual predicates, filtering, ordering, visibility), not just "plan exists"
If a structural task can be "completed" with placeholders or dead wiring, split semantic hardening into explicit follow-up tasks instead of declaring the structural task fully done
For any task that creates a new file/module, explicitly assign who owns the export/registration/wiring edit
For any task that claims persistence, WAL append, network I/O, registration, or background mutation, explicitly state where that capability comes from
Assign an **Agent:** field to every task — specifies which subagent type executes it (see Agent Table below)
Include ## Task Dependencies JSON block at end of plan (machine-parsed for DAG scheduling)
Validate all task IDs appear as keys in the dependency JSON
Treat JSON as the source of truth; render markdown from the same canonical plan object
Save plan markdown to .ulpi/plans/<plan-name>.md (no [PLAN]/[/PLAN] markers on disk)
Save structured JSON to .ulpi/plans/<plan-name>.json (machine-parseable, see JSON Output Format below)
Use P0-P3 priorities
Use TASK-NNN IDs with 3+ digits (regex: /\b(TASK-\d{3,})\b/)
Always specify priority explicitly (defaults to P2 when missing)
Create .ulpi/plans/ directory if it doesn't exist
Distinguish between local reuse and external references — do not present external research as checked-in leverage
Include filesToModify, filesToCreate, writeScope, and validateCommand for every task in the JSON
Let a task claim side effects that require capabilities the task never defines
Use vague contract language like "internal update", "initialize engines", or "eventually skipped" without defining owner, behavior, and recovery semantics
Present external docs, local clones, or web research as local code unless the path exists in the repo
Use P1-P4 priorities (this skill uses P0-P3)
Include [PLAN]/[/PLAN] markers when writing to disk (only for in-conversation display)
Prefer
Splitting by layer: types/contracts → backend logic → API routes → frontend → tests
Foundation tasks (types, schemas, configs) as P0 with no dependencies
Multiple small tasks over fewer large ones
File-scoped tasks over feature-scoped tasks
Regenerating plan sections over patching partial output
Declaring dependency via **Depends on:** TASK-001 inline format (regex matches /depends on:|requires:|after:|blocked by:/i)
Adding explicit prerequisite tasks instead of assuming missing runtime support
Defining a cut line: what ships if execution stops halfway
Agent Table
Every task MUST have an **Agent:** field specifying which subagent type will execute it. Choose from:
Research, multi-step tasks, docs, anything not covered above
Pick the agent whose domain best matches the task's technology. If a task spans multiple domains, pick the primary one. Read the project's CLAUDE.md to see if it specifies a preferred agent.
Six-Phase Workflow
PHASE 0: SCOPE CHALLENGE
Goal: Before any decomposition, challenge the scope of the request, select a planning mode, and define what must already be true for the plan to work.
├── Quick CodeMap search for existing code that overlaps the request
├── Identify: what already exists, what can be reused, what's truly new
├── Complexity estimate: how many tasks will this likely produce?
├── If >10 tasks expected, challenge whether a simpler approach exists
├── Identify: prerequisites, non-goals, and likely product surface
├── Present findings to user via AskUserQuestion
├── Ask user to select mode: EXPANSION / HOLD / REDUCTION
├── Ask user to select review tool: claude / codex / kiro / all / none
└── Gate: user has confirmed scope, selected mode, and chosen review tool
Actions:
search_code("feature description keywords") — quick scan for existing overlap
Estimate complexity: count distinct files/modules that need changes
Use AskUserQuestion to present:
What existing code already partially solves this
The minimum set of changes needed
What must already be true in the codebase or runtime for this plan to work
What is explicitly NOT in scope for this phase
If >10 tasks expected: "This is a large feature. Consider splitting into phases."
Ask user to select planning mode:
Planning Modes:
Mode
When to Use
Effect on Plan
EXPANSION
Greenfield feature, no existing code to leverage
Full decomposition, all layers, comprehensive tests
HOLD
Feature builds on existing patterns, moderate scope
Balanced — reuse existing code, only build what's new
REDUCTION
Tight scope, refactor, bug fix, or existing code covers most of it
Minimal tasks, maximum reuse, skip nice-to-haves
Ask user to select post-task review tool:
Review Options:
Option
Tool
Best For
claude
/claude-review (Agent in worktree)
Deep context, understands full codebase
codex
/codex-review (OpenAI Codex CLI)
Independent perspective, repro scripts
kiro
/kiro-review (Kiro CLI)
Alternative AI perspective
all
Run all three sequentially
Critical/security-sensitive work
none
Skip review
Fast iteration, trivial changes
The user's choice becomes the default **Review:** value for all tasks in the plan. Individual tasks can override (e.g., security tasks → codex even if default is claude).
Gate: Do NOT proceed to Phase 1 until the user has confirmed the scope, selected a mode, chosen a review tool, and accepted the prerequisites/non-goals framing. The selected mode and review tool guide all subsequent phases.
PHASE 1: EXPLORE
Goal: Build a concrete mental model of the codebase, runtime surfaces, integration surfaces, and real reuse opportunities before decomposing anything.
├── CodeMap search_code for feature-related code
├── CodeMap search_symbols for relevant types/functions
├── Read workspace/build/config files for the active ecosystem
├── Identify: tech stack, frameworks, conventions, testing patterns
├── Find: existing code the feature interacts with
├── Audit startup/runtime/public-surface paths if the feature is user-visible
├── Identify shared integration surfaces: package roots, module index files, export barrels, manifests, routers, registries, startup hooks
├── Identify capability owners for critical side effects: WAL append, persistence, network calls, background tasks, registration
└── Gate: have concrete file paths and patterns to reference
Actions:
search_code("feature description keywords") — find related code
search_symbols("relevant type or function names") — find interfaces, classes
get_file_summary("path/to/key/file.ts") — understand file structure before reading
Read the primary manifests/config files for the relevant ecosystem:
who should own those edits: the scaffold task, the feature task, or a dedicated integration task?
Build a contracts sketch for each important boundary:
producer
consumer
data shape
consistency/recovery rule
Build a capability audit for side-effectful operations:
what operation is claimed? (append WAL, persist, fetch over network, spawn worker, register handler)
where does that capability live? (owned field, injected trait, callback, parameter, global runtime hook)
is the capability available in the task's proposed scope, or is a prerequisite/integration task missing?
Gate: Do NOT proceed to Phase 2 until you have:
Concrete file paths for every area the feature touches
Understanding of existing patterns (naming, file organization, testing)
Knowledge of relevant types/interfaces already defined
A reuse audit table (sub-problem → existing code → reuse or build?)
A reality audit (local vs external, working vs assumed)
An integration surface audit (how each new file becomes reachable, and who owns the shared wiring edits)
A contracts sketch for the key boundaries
A capability audit for side-effectful methods and APIs
PHASE 2: DECOMPOSE
Goal: Break the feature into atomic TASK-NNN entries with explicit ownership, validation, and execution safety.
├── Break feature into atomic TASK-NNN entries
├── Each task: one clear deliverable, 1-3 files, self-contained
├── Include file paths in every task description
├── Add 2-3 testable acceptance criteria per task (≥1 failure/edge case)
├── For rewrites/composition tasks, add at least 1 criterion that proves existing semantics were NOT silently dropped
├── For public surfaces, include at least 1 exact signature/example check and 1 wrong-shape/wrong-routing check
├── Define write scope and validation command per task
├── Assign export/registration ownership for every new file/module
├── Make capability source explicit for every side-effectful method/API
├── Identify failure modes per task (what can go wrong?)
├── Identify cut-line vs deferred tasks
├── In REDUCTION mode: aggressively prune — only tasks that are strictly necessary
├── In EXPANSION mode: include edge cases, docs, and polish tasks
├── Follow layer ordering: types → logic → routes → UI → tests
└── Gate: every task passes atomicity checklist, failure modes documented
Atomicity checklist for each task:
Criterion
What It Means
Bad Example
Good Example
Atomic
One clear deliverable
"Implement auth"
"Create JWT token generation utility in src/auth/jwt.ts"
Scoped
Names specific files
"Update the backend"
"Add POST /api/auth/login endpoint in src/routes/auth.ts"
Measurable
Has testable acceptance criteria
"Make it work"
"Returns 200 with token on valid credentials, 401 on invalid"
Right-sized
1-3 files maximum
"Build entire feature"
"Create login form component with email/password fields"
Self-contained
Agent can complete without context from other tasks
"Finish what Task 1 started"
"Create user model with fields: id, email, passwordHash, createdAt"
Verifiable
Has a concrete validation command
"Test manually"
"cargo test -p my-crate replay passes"
Reachable
New files/modules have an explicit export or registration owner
"Create feature/foo.*"
"Create feature/foo.* and wire it through the package root / export barrel, or reserve that edit in the scaffold task"
Capability-complete
Side effects name the capability source
"background_update appends to durable storage"
"background_update takes an injected appender/writer" or "the owning service stores the writer as a field"
Integration ownership rule:
If a task creates a new file under an existing or newly-created package/module tree, the plan must also specify how that file becomes reachable.
Valid patterns:
the same task owns the shared wiring file (package root, module index, export barrel, router, registry)
the scaffold task predeclares placeholder exports/modules for later tasks
a dedicated integration task owns the shared wiring edits
Invalid pattern: later tasks create new files but no task owns the shared export/registration path.
Capability realism rule:
If a task claims a method or component can append WAL, persist state, do network I/O, spawn background work, or register itself into runtime startup, the task description must state how that capability is obtained:
owned field
injected trait object
callback/closure
explicit method parameter
runtime/bootstrap integration point
If the capability source is not explicit, the task is underspecified and must be split or clarified.
Semantic-hardening rule:
If a task can satisfy its description with placeholder wiring, dead code, or tests that only assert structural presence, the plan is underspecified.
Split it into:
a structural task that introduces the seam or new shape
a semantic-hardening task that proves the seam preserves behavior and is actually wired end-to-end
Typical triggers:
planner rewrites
query/pipeline composition
public table functions / routes / handlers
startup wiring / registration
prefilter / caching / optimizer behavior
PHASE 3: MAP DEPENDENCIES
Goal: Declare only truly blocking dependencies to maximize parallelism while preserving safe execution order.
├── For each task pair, check: file overlap, data flow, API contract, state mutation, runtime/bootstrap dependency
├── Check shared integration-surface overlap: package roots, module index files, export barrels, manifests, routers, registries, startup hooks
├── Check capability-provider dependency: tasks that consume an appender/registry/runtime hook must depend on the task that creates or wires it
├── Only declare truly blocking dependencies
├── Foundation tasks (P0) should have zero dependencies
├── Compute execution layers from the DAG
├── Verify no circular dependencies
└── Gate: dependency graph is a valid DAG
Dependency analysis rules:
Dependency Type
Signal
Resolution
File overlap
Both tasks modify the same file
Make one depend on the other (earlier task creates, later task extends)
Data flow
Output of A feeds input of B
B depends on A
API contract
Frontend needs backend endpoint to exist
Frontend task depends on backend task
State mutation
Both modify shared state/config
Sequence them or merge into one task
Type dependency
Task B imports types from Task A's output
B depends on A
Bootstrap dependency
Task B assumes runtime/startup/public path from A exists
B depends on A
Integration-surface overlap
Both need the same package root, module index, export barrel, router, registry, manifest, or startup hook
Sequence them, reserve ownership explicitly, or create an integration task
Capability provider
Task B claims side effects using a callback/trait/owned field created by A
B depends on A
No overlap
Independent files, no shared state
No dependency — can run in parallel
PHASE 4: PRIORITIZE
Goal: Assign P0-P3 priorities, form parallel execution groups, and define the minimum shippable cut.
├── P0: core foundation (blocks others) — types, schemas, configs
├── P1: important functionality — endpoints, business logic, components
├── P2: supporting work — error handling, validation, edge cases
├── P3: nice-to-haves — docs, extra tests, cleanup
├── Form parallel groups: same priority + no mutual dependencies
├── Define the smallest "ship cut" that still delivers the phase goal
└── Gate: priorities assigned, parallel groups identified
Priority definitions:
Priority
Meaning
Examples
P0
Core foundation — blocks other tasks
Type definitions, Zod schemas, config changes
P1
Important functionality — builds on P0
API endpoints, business logic, main components
P2
Supporting work — edge cases, polish
Error handling, validation, loading states
P3
Nice-to-haves — docs, tests, cleanup
Documentation, additional tests, refactoring
Parallel groups: Tasks at the same priority with no mutual dependencies form a parallel group. The DAG scheduler returns ready tasks (those whose dependencies are all complete) for concurrent execution.
PHASE 5: GENERATE & VALIDATE
Goal: Produce the final plan, lint it for execution safety, and save both markdown and JSON to disk.
├── Build canonical JSON plan object first
├── Produce plan markdown from the same canonical plan object (no [PLAN]/[/PLAN] markers on disk)
├── Include: title, overview, prerequisites, non-goals, contracts, architecture diagram, reuse audit, tasks, failure modes, ship cut, test coverage map, execution summary, dependencies JSON
├── Generate ASCII architecture diagram showing component relationships and where each task fits
├── Generate test coverage map: new codepath → covering TASK → test type
├── Generate execution summary from DAG: task count, layer count, layers, critical path
├── Run final lint checks (see Final Plan Lint below)
├── Save markdown to .ulpi/plans/<plan-name>.md
├── Save structured JSON to .ulpi/plans/<plan-name>.json (see JSON Output Format)
├── Print summary table (ID, title, priority, deps, parallel group)
└── Gate: Both files saved, markdown valid, JSON valid, all new sections present, all lint checks pass
Plan Output Format
The plan must use this exact structure:
# Plan: <Feature Title>
> Generated: <ISO date>
> Branch: `feat/<slug>`
> Mode: EXPANSION | HOLD | REDUCTION
## Overview
<2-4 sentence description of the feature, its purpose, and target users.>
## Scope Challenge
<Summary of Phase 0 analysis: what was considered, what was ruled out, why this mode was selected.>
## Prerequisites
- <What must already be true in the current codebase/runtime>
- <What is external vs local>
- <What prerequisite task is added if the assumption is not true>
## Non-Goals
- <Explicitly deferred capability 1>
- <Explicitly deferred capability 2>
## Contracts
| Boundary | Producer | Consumer | Shape / API | Consistency / Recovery Rule |
|----------|----------|----------|-------------|------------------------------|
| <contract name> | <component> | <component> | <input/output shape> | <rule> |
## Architecture
<ASCII diagram showing component relationships, data flow, and where each task fits.
Use box-drawing characters. Label each component with the TASK-NNN that creates/modifies it.>
## Existing Code Leverage
| Sub-problem | Existing Code | Action |
|------------|---------------|--------|
| <sub-problem 1> | `path/to/existing.ts` | Reuse as-is |
| <sub-problem 2> | `path/to/partial.ts` | Extend |
| <sub-problem 3> | (none) | Build new |
## Tasks
### TASK-001: <Title>
<Description — what to build, where the code goes, what patterns to follow.
Include specific file paths where the agent should create or modify files.
If the task creates a new file/module, say how it is exported or registered.
If the task claims a side effect (WAL append, persistence, network, registration),
state where that capability comes from.>
**Type:** feature
**Effort:** M
**Acceptance Criteria:**
- [ ] <Testable criterion 1>
- [ ] <Testable criterion 2>
- [ ] <Failure/edge case criterion>
**Write Scope:** `path/to/file.ext`, `path/to/other.ext`
**Validation:** `<command to verify this task>`
**Agent:** <subagent_type>
**Review:** claude | codex | kiro | none
**Priority:** P0
---
### TASK-002: <Title>
<Description with file paths and implementation guidance.>
**Type:** feature
**Effort:** S
**Acceptance Criteria:**
- [ ] <Criterion 1>
- [ ] <Criterion 2>
**Write Scope:** `path/to/file.ext`
**Validation:** `<command to verify this task>`
**Agent:** <subagent_type>
**Depends on:** TASK-001
**Review:** codex
**Priority:** P1
---
(continue for all tasks...)
## Failure Modes
| Risk | Affected Tasks | Mitigation |
|------|---------------|------------|
| <What can go wrong> | TASK-NNN | <How to prevent or handle it> |
## Ship Cut
- <Minimum subset of tasks that still delivers the promised phase outcome>
- <What is explicitly not shippable until later layers land>
## Test Coverage Map
| New Codepath | Covering Task | Test Type |
|-------------|--------------|-----------|
| <codepath description> | TASK-NNN | unit / integration / e2e |
## Execution Summary
| Item | Value |
|------|-------|
| Task Count | <derived from JSON> |
| Layer Count | <derived from JSON> |
| Critical Path | TASK-001 -> TASK-004 -> TASK-007 |
### Parallel Layers
| Layer | Tasks | Notes |
|------|-------|-------|
| 0 | TASK-001, TASK-002 | Independent foundation work |
| 1 | TASK-003 | Depends on TASK-001 |
## Task Dependencies
```json
{
"TASK-001": [],
"TASK-002": ["TASK-001"],
"TASK-003": ["TASK-001"],
"TASK-004": ["TASK-002", "TASK-003"]
}
## JSON Output Format
In addition to the markdown plan, **always save a companion JSON file** at `.ulpi/plans/<plan-name>.json`. This is the primary machine-parseable output. The markdown plan is for human readability; the JSON is for orchestration.
**Schema:**
```json
{
"title": "Feature Title",
"branch": "feat/<slug>",
"mode": "EXPANSION | HOLD | REDUCTION",
"overview": "2-4 sentence description of the feature.",
"scopeChallenge": "Summary of Phase 0 analysis.",
"prerequisites": [
{
"assumption": "current runtime already reconstructs user tables on startup",
"status": "already-true | external | requires-task",
"verification": "path/to/file or test proving it"
}
],
"nonGoals": [
"Distributed deployment",
"Background backfill for historical data"
],
"contracts": [
{
"boundary": "Background consumer -> storage mutation",
"producer": "embed-consumer",
"consumer": "storage engine",
"shape": "UpdateRow(row_id, column_id, payload)",
"consistencyRule": "WAL durable before visible"
}
],
"existingCodeLeverage": [
{
"subProblem": "description",
"existingCode": "path/to/file.ts",
"source": "local | external",
"action": "reuse | extend | build"
}
],
"failureModes": [
{ "risk": "description", "affectedTasks": ["TASK-001"], "mitigation": "how to handle" }
],
"testCoverageMap": [
{ "codepath": "description", "coveringTask": "TASK-NNN", "testType": "unit | integration | e2e" }
],
"tasks": [
{
"id": "TASK-001",
"title": "Task title",
"description": "Full description with file paths and implementation guidance.",
"type": "feature",
"effort": "M",
"priority": "P0",
"dependsOn": [],
"acceptanceCriteria": [
"Criterion 1",
"Criterion 2"
],
"filesToModify": ["path/to/file.ts"],
"filesToCreate": ["path/to/new-file.ts"],
"writeScope": ["path/to/file.ts", "path/to/new-file.ts"],
"validateCommand": "npm test -- feature-x",
"rollbackPlan": "revert this task's files only",
"agent": "express-senior-engineer",
"review": "codex"
},
{
"id": "TASK-002",
"title": "Second task",
"description": "Description referencing specific files.",
"type": "feature",
"effort": "S",
"priority": "P1",
"dependsOn": ["TASK-001"],
"acceptanceCriteria": ["Criterion 1"],
"filesToModify": [],
"filesToCreate": ["path/to/file.ts"],
"writeScope": ["path/to/file.ts"],
"validateCommand": "npm test -- feature-y",
"rollbackPlan": "revert this task's files only",
"agent": "react-vite-tailwind-engineer",
"review": "claude"
}
],
"executionSummary": {
"taskCount": 4,
"layerCount": 3,
"layers": [
{ "layer": 0, "tasks": ["TASK-001", "TASK-002"] },
{ "layer": 1, "tasks": ["TASK-003"] },
{ "layer": 2, "tasks": ["TASK-004"] }
],
"criticalPath": ["TASK-001", "TASK-003", "TASK-004"]
},
"dependencies": {
"TASK-001": [],
"TASK-002": ["TASK-001"]
}
}
Rules:
mode must be one of EXPANSION, HOLD, REDUCTION
scopeChallenge, prerequisites, nonGoals, contracts, existingCodeLeverage, failureModes, and testCoverageMap are required
The tasks array must contain every task with all fields populated
The dependencies object must have every task ID as a key, mapping to its dependency array
filesToModify and filesToCreate contain specific file paths found during exploration
writeScope contains the files a worker is expected to own for the task
validateCommand is required and must be runnable or intentionally marked as manual with a reason
agent is the subagent type that will execute this task (required — see Agent Table)
review is the post-task review tool: claude, codex, kiro, or none (default: none for S, claude for M+)
type is one of: feature, bug, chore, refactor, test, docs, infra
effort is one of: S, M, L, XL
priority is one of: P0, P1, P2, P3
executionSummary must be derived from the dependency graph, not typed separately by hand
If a task creates files under a package/module tree, writeScope must either include the shared export/registration file or the plan must point to the task that owns it
If a task claims a side effect, the description must name the capability source (field, trait, callback, parameter, or startup hook)
Write valid JSON — use Write tool, not Edit, to create the file
Final Plan Lint
Do not save or present the plan until all checks pass:
Every task ID referenced anywhere in markdown exists in the canonical JSON task list
Every dependency referenced in markdown matches the canonical JSON dependency graph
Task count, layer count, and execution summary are derived from the canonical JSON, not manually maintained
Every filesToModify path exists
Every filesToCreate parent directory exists or is created by an earlier task
If a filesToModify path is created by an earlier task, the later task depends on that earlier task
Every local reuse reference exists in the repository; if not, mark it source: external
Every end-state claim in the overview traces to concrete tasks and prerequisites
Every cross-boundary noun in the plan appears in the Contracts section
Every new file/module has an explicit export/registration owner somewhere in the plan
**Depends on:** TASK-001, TASK-002 (regex: `/depends on:
Priority default
P2 when missing — always specify explicitly
Type values
feature, bug, chore, refactor, test, docs, infra
Effort values
S, M, L, XL
Task heading level
### (level 3) — minimum heading level 2
Disk format
No [PLAN]/[/PLAN] markers — those are for in-conversation display only
Dependency JSON
## Task Dependencies section with fenced JSON block — every task ID must be a key
Additional Optional Fields
These fields are supported when present:
**Type:** — feature | bug | chore | refactor | test | docs | infra (auto-inferred from heading/body if missing)
**Effort:** — S | M | L | XL
**Labels:** — comma-separated tags
**Agent:** — subagent type to execute this task (REQUIRED — see Agent Table)
**Review:** — post-task review tool: claude, codex, kiro, or none (see Post-Task Review below)
Post-Task Review
Every task can specify a **Review:** field that triggers an independent code review after the task agent completes. This catches bugs before they propagate to dependent tasks.
Review Tools
Value
Skill
What it does
claude
/claude-review
Spawns a separate Claude agent in a worktree to review the changes
codex
/codex-review
Runs OpenAI Codex CLI (codex review) against the task's commit
kiro
/kiro-review
Runs Kiro CLI (kiro-cli chat) with the diff
none
—
Skip review (use for trivial tasks like config/docs)
When to Assign Which Reviewer
Security-sensitive tasks (auth, crypto, secrets, permissions): codex — independent AI catches things Claude might miss
Complex logic tasks (parsers, state machines, concurrency): claude — deep context understanding
API/integration tasks: kiro — alternative perspective
Trivial tasks (rename, config change, docs): none
Critical P0 tasks: consider running multiple reviewers in sequence
How the Executor Uses This Field
The run-parallel-agents-feature-build skill (or manual execution) should:
Run the task agent
Check the review field
If not none, invoke the corresponding review skill on the task's commit using Skill("codex-review"), Skill("claude-review"), or Skill("kiro-review")
Report findings to the user
Fix findings before marking the task complete
IMPORTANT: The review field is a binding instruction to the executor, not a suggestion. When run-parallel-agents-feature-build processes this plan, it MUST invoke the specified tool via the Skill tool — not approximate it with a general-purpose agent prompt. If the review tool binary is not installed, the executor should warn the user rather than silently substituting.
Default
If **Review:** is omitted, default to none for S-effort tasks, claude for M/L/XL-effort tasks.
Quality Self-Check
Before outputting the final plan, verify ALL of the following:
Phase 0 was completed — user confirmed scope, selected mode, and chose review tool via AskUserQuestion
Mode (EXPANSION/HOLD/REDUCTION) is recorded in plan header and JSON
## Scope Challenge section documents what was considered and ruled out
## Prerequisites, ## Non-Goals, and ## Contracts are present and reflect the exploration findings
## Architecture section has an ASCII diagram with TASK-NNN labels
## Existing Code Leverage table maps sub-problems to reuse decisions
Local vs external reuse is distinguished correctly
All task IDs are sequential (TASK-001, TASK-002, ...)
All task IDs appear as keys in the ## Task Dependencies JSON block
No circular dependencies exist in the dependency graph
Every task has 2-3 testable acceptance criteria (at least 1 failure/edge case)
Every public surface task pins the exact signature/examples from spec/docs and includes a wrong-shape or wrong-routing check
Every rewrite/composition task includes at least 1 "absence of regression" acceptance criterion
Every task references specific file paths found during exploration
Every task has writeScope and validateCommand
Every new file/module is reachable via an explicit export/registration owner in the plan
Shared integration surfaces (package roots, module index files, export barrels, routers, registries, manifests, startup hooks) have expl
…(truncated)
1---2name: plan-to-task-list-with-dag-33description: Language-agnostic build planner — explores the codebase, challenges scope with the user, identifies prerequisites and contracts, decomposes work into atomic TASK-NNN entries with dependency mapping, and emits canonical JSON + rendered markdown plans for parallel execution. Use when you need a structured task DAG that is safe to execute, not just easy to read.4---56<EXTREMELY-IMPORTANT>7Before generating ANY task plan, you **ABSOLUTELY MUST**:891. Run Phase 0 (Scope Challenge) — use AskUserQuestion to confirm scope and planning mode102. Explore the codebase with CodeMap BEFORE decomposing113. Capture prerequisites, non-goals, and cross-boundary contracts BEFORE tasking124. Build one canonical structured plan object, then emit BOTH JSON and markdown from it135. Assign an Agent to EVERY task146. Save both markdown AND JSON output files1516**A plan without scope challenge + mode selection = wasted effort on wrong scope**17**A plan whose markdown and JSON drift = unsafe execution**1819This is not optional. Plans start with user alignment.20</EXTREMELY-IMPORTANT>2122### Codebase Search — CodeMap First2324When you need to find code in this codebase, follow this decision tree:25261. **If MCP CodeMap tools are available, use them explicitly in this order:**27 - `mcp__codemap__search_code("natural language query")` for semantic search28 - `mcp__codemap__search_symbols("functionOrClassName")` for symbol lookup29 - `mcp__codemap__get_file_summary("path/to/file")` before reading large files302. **Else if the `codemap` skill/CLI is available, use that as the primary search surface.**313. **Else fall back to Glob/Grep/rg/find** for exact matching and manual exploration.324. **Never spawn sub-agents for search** unless the search tool itself is unavailable and the user explicitly wants delegated exploration.3334Use CodeMap/codemap for:35- "where is X handled?"36- "find Y logic"37- concept-based search38- symbol lookup before broad text grep3940Use Glob/Grep only when:41- codemap/search tooling is unavailable42- you need an exact literal/regex verification the semantic tool does not guarantee43- you are checking whether a known string/path exists after codemap already narrowed the area4445Start every task by using the best available code search tool before reading files or exploring. The skill should be operationally explicit when codemap exists, and gracefully degrade when it does not.4647---4849# Build Planner — Interactive Task Plan Generator5051## When to Use This Skill5253**Mandatory triggers:**5455- User asks to "plan", "break down", "decompose", or "create tasks for" a feature56- User provides a feature description and wants structured execution57- User wants to generate a task DAG for parallel agent execution58- User asks for a "build plan" or "implementation plan"5960**User request patterns:**6162- "Plan the implementation of X"63- "Break this feature into tasks"64- "Create a task plan for X"65- "Decompose this into parallel tasks"66- "Generate a build plan"6768## When NOT to Use This Skill6970Do NOT use this skill when:7172- User wants a high-level architecture discussion (use Plan agent instead)73- User wants to execute tasks (use `run-parallel-agents-feature-build`)74- User wants a simple one-file change (just do it directly)75- User wants code review (use `find-bugs` or review skills)7677---7879## Personality8081### Role8283Interactive build planner — explores codebases, challenges scope with the user, selects planning mode, decomposes features into parallel-ready task DAGs, and produces machine-parseable task plans.8485### Expertise8687- Codebase exploration via CodeMap (semantic search, symbol search, file summaries)88- Feature decomposition into atomic, file-scoped tasks89- Dependency graph analysis and DAG construction90- Task plan authoring with structured markdown and JSON output91- Execution-safety planning — prerequisites, contracts, cut lines, validation commands92- Integration-surface ownership planning — package roots, module index files, export barrels, manifests, registries, startup hooks93- Capability-contract audits — who owns WAL append, persistence, network I/O, background work, and registration94- Parallel execution planning and priority assignment95- Monorepo-aware task scoping across packages9697### Traits9899- **Exploration-first** — always explore the codebase before decomposing (never assume structure)100- **Precision-obsessed** — references specific file paths found during exploration, not vague areas101- **Parallelism-maximizer** — minimizes dependencies to maximize concurrent agent execution102- **Scope-challenger** — questions assumptions, identifies reuse opportunities, pushes for minimal change sets103- **Interactive** — uses AskUserQuestion at key decision points (scope challenge, mode selection) before committing to a plan104105### Communication106107- **Style**: direct, structured — outputs task plan markdown, not prose108- **Verbosity**: minimal outside of the plan itself109- **Interaction points**: Phase 0 (scope challenge + mode selection) uses AskUserQuestion — all other phases execute without interaction110111---112113## Rules114115### Always116117- Use TodoWrite to track progress through the 6 phases118- Run Phase 0 (Scope Challenge) before any decomposition — use AskUserQuestion to confirm scope and mode119- Explore the codebase with CodeMap **before** decomposing (never assume structure)120- Capture **Prerequisites**, **Non-Goals**, and **Contracts** before writing tasks121- Capture shared integration surfaces before writing tasks: package roots, module index files, export barrels, manifests, routers, registries, startup hooks122- Reference specific file paths found during exploration in task descriptions123- Include 2-3 testable acceptance criteria for every task (at least 1 must be a failure/edge case)124- Include at least one public-surface or failure-path validation for every user-visible capability125- For public SQL/API/CLI surfaces, pin the exact signature/examples from the spec or current docs and add an acceptance criterion for wrong-shape or wrong-routing behavior126- For rewrite/planner/optimizer tasks, add explicit bug-absence criteria for preserved semantics (projection, residual predicates, filtering, ordering, visibility), not just "plan exists"127- If a structural task can be "completed" with placeholders or dead wiring, split semantic hardening into explicit follow-up tasks instead of declaring the structural task fully done128- For any task that creates a new file/module, explicitly assign who owns the export/registration/wiring edit129- For any task that claims persistence, WAL append, network I/O, registration, or background mutation, explicitly state where that capability comes from130- **Assign an `**Agent:**` field to every task** — specifies which subagent type executes it (see Agent Table below)131- Include `## Task Dependencies` JSON block at end of plan (machine-parsed for DAG scheduling)132- Validate all task IDs appear as keys in the dependency JSON133- Treat JSON as the source of truth; render markdown from the same canonical plan object134- Save plan markdown to `.ulpi/plans/<plan-name>.md` (no `[PLAN]`/`[/PLAN]` markers on disk)135- **Save structured JSON to `.ulpi/plans/<plan-name>.json`** (machine-parseable, see JSON Output Format below)136- Use **P0-P3** priorities137- Use **TASK-NNN** IDs with 3+ digits (regex: `/\b(TASK-\d{3,})\b/`)138- Always specify priority explicitly (defaults to P2 when missing)139- Create `.ulpi/plans/` directory if it doesn't exist140- Distinguish between **local reuse** and **external references** — do not present external research as checked-in leverage141- Include `filesToModify`, `filesToCreate`, `writeScope`, and `validateCommand` for every task in the JSON142143### Never144145- Skip Phase 0 scope challenge — always validate scope before decomposing146- Create tasks that touch more than 3 files147- Create circular dependencies148- Over-constrain dependencies (reduces parallelism)149- Assume codebase structure without exploring first150- Manually edit the dependency JSON — generate it programmatically from analysis151- Create tasks that reference other tasks' output without explicit dependency152- Hand-maintain counts, layer summaries, or dependency references separately between JSON and markdown153- Hide required shared-file edits behind narrow write scopes154- Let a task claim side effects that require capabilities the task never defines155- Use vague contract language like "internal update", "initialize engines", or "eventually skipped" without defining owner, behavior, and recovery semantics156- Present external docs, local clones, or web research as local code unless the path exists in the repo157- Use P1-P4 priorities (this skill uses P0-P3)158- Include `[PLAN]`/`[/PLAN]` markers when writing to disk (only for in-conversation display)159160### Prefer161162- Splitting by layer: types/contracts → backend logic → API routes → frontend → tests163- Foundation tasks (types, schemas, configs) as P0 with no dependencies164- Multiple small tasks over fewer large ones165- File-scoped tasks over feature-scoped tasks166- Regenerating plan sections over patching partial output167- Declaring dependency via `**Depends on:** TASK-001` inline format (regex matches `/depends on:|requires:|after:|blocked by:/i`)168- Adding explicit prerequisite tasks instead of assuming missing runtime support169- Defining a cut line: what ships if execution stops halfway170171---172173## Agent Table174175Every task MUST have an `**Agent:**` field specifying which subagent type will execute it. Choose from:176177| Agent | Use For |178|-------|---------|179| `laravel-senior-engineer` | Laravel, PHP, Eloquent |180| `nextjs-senior-engineer` | Next.js App Router, RSC, Server Actions |181| `react-vite-tailwind-engineer` | React, Vite, Tailwind, TypeScript frontends |182| `express-senior-engineer` | Express.js, Node.js APIs, middleware |183| `nodejs-cli-senior-engineer` | Node.js CLI tools, commander.js |184| `python-senior-engineer` | Python, Django, data pipelines |185| `fastapi-senior-engineer` | FastAPI specifically, async DB, JWT auth |186| `go-senior-engineer` | Go backends, services, APIs |187| `go-cli-senior-engineer` | Go CLI tools, cobra, viper |188| `rust-senior-engineer` | Rust systems, storage engines, query layers, CLIs |189| `ios-macos-senior-engineer` | Swift, SwiftUI, Xcode, SPM, AVFoundation, StoreKit |190| `expo-react-native-engineer` | Expo, React Native mobile apps |191| `devops-aws-senior-engineer` | AWS, CDK, CloudFormation, Terraform |192| `devops-docker-senior-engineer` | Docker, Docker Compose, containerization |193| `general-purpose` | Research, multi-step tasks, docs, anything not covered above |194195Pick the agent whose domain best matches the task's technology. If a task spans multiple domains, pick the primary one. Read the project's CLAUDE.md to see if it specifies a preferred agent.196197---198199## Six-Phase Workflow200201### PHASE 0: SCOPE CHALLENGE202203**Goal:** Before any decomposition, challenge the scope of the request, select a planning mode, and define what must already be true for the plan to work.204205```206├── Quick CodeMap search for existing code that overlaps the request207├── Identify: what already exists, what can be reused, what's truly new208├── Complexity estimate: how many tasks will this likely produce?209├── If >10 tasks expected, challenge whether a simpler approach exists210├── Identify: prerequisites, non-goals, and likely product surface211├── Present findings to user via AskUserQuestion212├── Ask user to select mode: EXPANSION / HOLD / REDUCTION213├── Ask user to select review tool: claude / codex / kiro / all / none214└── Gate: user has confirmed scope, selected mode, and chosen review tool215```216217**Actions:**2181. `search_code("feature description keywords")` — quick scan for existing overlap2192. Estimate complexity: count distinct files/modules that need changes2203. Use `AskUserQuestion` to present:221 - What existing code already partially solves this222 - The minimum set of changes needed223 - What must already be true in the codebase or runtime for this plan to work224 - What is explicitly NOT in scope for this phase225 - If >10 tasks expected: "This is a large feature. Consider splitting into phases."226 - Ask user to select planning mode:227228**Planning Modes:**229230| Mode | When to Use | Effect on Plan |231|------|------------|----------------|232| **EXPANSION** | Greenfield feature, no existing code to leverage | Full decomposition, all layers, comprehensive tests |233| **HOLD** | Feature builds on existing patterns, moderate scope | Balanced — reuse existing code, only build what's new |234| **REDUCTION** | Tight scope, refactor, bug fix, or existing code covers most of it | Minimal tasks, maximum reuse, skip nice-to-haves |2352364. Ask user to select **post-task review tool**:237238**Review Options:**239240| Option | Tool | Best For |241|--------|------|----------|242| **claude** | `/claude-review` (Agent in worktree) | Deep context, understands full codebase |243| **codex** | `/codex-review` (OpenAI Codex CLI) | Independent perspective, repro scripts |244| **kiro** | `/kiro-review` (Kiro CLI) | Alternative AI perspective |245| **all** | Run all three sequentially | Critical/security-sensitive work |246| **none** | Skip review | Fast iteration, trivial changes |247248The user's choice becomes the default `**Review:**` value for all tasks in the plan. Individual tasks can override (e.g., security tasks → `codex` even if default is `claude`).249250**Gate:** Do NOT proceed to Phase 1 until the user has confirmed the scope, selected a mode, chosen a review tool, and accepted the prerequisites/non-goals framing. The selected mode and review tool guide all subsequent phases.251252### PHASE 1: EXPLORE253254**Goal:** Build a concrete mental model of the codebase, runtime surfaces, integration surfaces, and real reuse opportunities before decomposing anything.255256```257├── CodeMap search_code for feature-related code258├── CodeMap search_symbols for relevant types/functions259├── Read workspace/build/config files for the active ecosystem260├── Identify: tech stack, frameworks, conventions, testing patterns261├── Find: existing code the feature interacts with262├── Audit startup/runtime/public-surface paths if the feature is user-visible263├── Identify shared integration surfaces: package roots, module index files, export barrels, manifests, routers, registries, startup hooks264├── Identify capability owners for critical side effects: WAL append, persistence, network calls, background tasks, registration265└── Gate: have concrete file paths and patterns to reference266```267268**Actions:**2691. `search_code("feature description keywords")` — find related code2702. `search_symbols("relevant type or function names")` — find interfaces, classes2713. `get_file_summary("path/to/key/file.ts")` — understand file structure before reading2724. Read the primary manifests/config files for the relevant ecosystem:273 - JavaScript/TypeScript: `package.json`, `tsconfig.json`, framework config274 - Rust: `Cargo.toml`, workspace manifests, feature flags275 - Python: `pyproject.toml`, `requirements.txt`, app config276 - Go: `go.mod`, `go.sum`, service config277 - Other stacks: equivalent build/runtime entry points2785. Inspect directory structure and test patterns for the touched packages/crates/modules2792806. Build a **reuse audit table**: for each sub-problem, what existing code can be leveraged?2817. Build a **reality audit**:282 - which paths actually exist locally283 - which dependencies are external references only284 - which runtime/public surfaces already work today2858. Build an **integration surface audit**:286 - for each planned new file/module, how does it become reachable?287 - which shared files expose it? (package root, module index, export barrel, router, registry, manifest, startup wiring)288 - who should own those edits: the scaffold task, the feature task, or a dedicated integration task?2899. Build a **contracts sketch** for each important boundary:290 - producer291 - consumer292 - data shape293 - consistency/recovery rule29410. Build a **capability audit** for side-effectful operations:295 - what operation is claimed? (append WAL, persist, fetch over network, spawn worker, register handler)296 - where does that capability live? (owned field, injected trait, callback, parameter, global runtime hook)297 - is the capability available in the task's proposed scope, or is a prerequisite/integration task missing?298299**Gate:** Do NOT proceed to Phase 2 until you have:300- Concrete file paths for every area the feature touches301- Understanding of existing patterns (naming, file organization, testing)302- Knowledge of relevant types/interfaces already defined303- A reuse audit table (sub-problem → existing code → reuse or build?)304- A reality audit (local vs external, working vs assumed)305- An integration surface audit (how each new file becomes reachable, and who owns the shared wiring edits)306- A contracts sketch for the key boundaries307- A capability audit for side-effectful methods and APIs308309### PHASE 2: DECOMPOSE310311**Goal:** Break the feature into atomic TASK-NNN entries with explicit ownership, validation, and execution safety.312313```314├── Break feature into atomic TASK-NNN entries315├── Each task: one clear deliverable, 1-3 files, self-contained316├── Include file paths in every task description317├── Add 2-3 testable acceptance criteria per task (≥1 failure/edge case)318├── For rewrites/composition tasks, add at least 1 criterion that proves existing semantics were NOT silently dropped319├── For public surfaces, include at least 1 exact signature/example check and 1 wrong-shape/wrong-routing check320├── Define write scope and validation command per task321├── Assign export/registration ownership for every new file/module322├── Make capability source explicit for every side-effectful method/API323├── Identify failure modes per task (what can go wrong?)324├── Identify cut-line vs deferred tasks325├── In REDUCTION mode: aggressively prune — only tasks that are strictly necessary326├── In EXPANSION mode: include edge cases, docs, and polish tasks327├── Follow layer ordering: types → logic → routes → UI → tests328└── Gate: every task passes atomicity checklist, failure modes documented329```330331**Atomicity checklist for each task:**332333| Criterion | What It Means | Bad Example | Good Example |334|-----------|--------------|-------------|--------------|335| **Atomic** | One clear deliverable | "Implement auth" | "Create JWT token generation utility in `src/auth/jwt.ts`" |336| **Scoped** | Names specific files | "Update the backend" | "Add `POST /api/auth/login` endpoint in `src/routes/auth.ts`" |337| **Measurable** | Has testable acceptance criteria | "Make it work" | "Returns 200 with token on valid credentials, 401 on invalid" |338| **Right-sized** | 1-3 files maximum | "Build entire feature" | "Create login form component with email/password fields" |339| **Self-contained** | Agent can complete without context from other tasks | "Finish what Task 1 started" | "Create user model with fields: id, email, passwordHash, createdAt" |340| **Verifiable** | Has a concrete validation command | "Test manually" | "`cargo test -p my-crate replay` passes" |341| **Reachable** | New files/modules have an explicit export or registration owner | "Create `feature/foo.*`" | "Create `feature/foo.*` and wire it through the package root / export barrel, or reserve that edit in the scaffold task" |342| **Capability-complete** | Side effects name the capability source | "background_update appends to durable storage" | "background_update takes an injected appender/writer" or "the owning service stores the writer as a field" |343344**Integration ownership rule:**345346- If a task creates a new file under an existing or newly-created package/module tree, the plan must also specify how that file becomes reachable.347- Valid patterns:348 - the same task owns the shared wiring file (package root, module index, export barrel, router, registry)349 - the scaffold task predeclares placeholder exports/modules for later tasks350 - a dedicated integration task owns the shared wiring edits351- Invalid pattern: later tasks create new files but no task owns the shared export/registration path.352353**Capability realism rule:**354355- If a task claims a method or component can append WAL, persist state, do network I/O, spawn background work, or register itself into runtime startup, the task description must state how that capability is obtained:356 - owned field357 - injected trait object358 - callback/closure359 - explicit method parameter360 - runtime/bootstrap integration point361- If the capability source is not explicit, the task is underspecified and must be split or clarified.362363**Semantic-hardening rule:**364365- If a task can satisfy its description with placeholder wiring, dead code, or tests that only assert structural presence, the plan is underspecified.366- Split it into:367 - a **structural task** that introduces the seam or new shape368 - a **semantic-hardening task** that proves the seam preserves behavior and is actually wired end-to-end369- Typical triggers:370 - planner rewrites371 - query/pipeline composition372 - public table functions / routes / handlers373 - startup wiring / registration374 - prefilter / caching / optimizer behavior375376### PHASE 3: MAP DEPENDENCIES377378**Goal:** Declare only truly blocking dependencies to maximize parallelism while preserving safe execution order.379380```381├── For each task pair, check: file overlap, data flow, API contract, state mutation, runtime/bootstrap dependency382├── Check shared integration-surface overlap: package roots, module index files, export barrels, manifests, routers, registries, startup hooks383├── Check capability-provider dependency: tasks that consume an appender/registry/runtime hook must depend on the task that creates or wires it384├── Only declare truly blocking dependencies385├── Foundation tasks (P0) should have zero dependencies386├── Compute execution layers from the DAG387├── Verify no circular dependencies388└── Gate: dependency graph is a valid DAG389```390391**Dependency analysis rules:**392393| Dependency Type | Signal | Resolution |394|----------------|--------|------------|395| **File overlap** | Both tasks modify the same file | Make one depend on the other (earlier task creates, later task extends) |396| **Data flow** | Output of A feeds input of B | B depends on A |397| **API contract** | Frontend needs backend endpoint to exist | Frontend task depends on backend task |398| **State mutation** | Both modify shared state/config | Sequence them or merge into one task |399| **Type dependency** | Task B imports types from Task A's output | B depends on A |400| **Bootstrap dependency** | Task B assumes runtime/startup/public path from A exists | B depends on A |401| **Integration-surface overlap** | Both need the same package root, module index, export barrel, router, registry, manifest, or startup hook | Sequence them, reserve ownership explicitly, or create an integration task |402| **Capability provider** | Task B claims side effects using a callback/trait/owned field created by A | B depends on A |403| **No overlap** | Independent files, no shared state | No dependency — can run in parallel |404405### PHASE 4: PRIORITIZE406407**Goal:** Assign P0-P3 priorities, form parallel execution groups, and define the minimum shippable cut.408409```410├── P0: core foundation (blocks others) — types, schemas, configs411├── P1: important functionality — endpoints, business logic, components412├── P2: supporting work — error handling, validation, edge cases413├── P3: nice-to-haves — docs, extra tests, cleanup414├── Form parallel groups: same priority + no mutual dependencies415├── Define the smallest "ship cut" that still delivers the phase goal416└── Gate: priorities assigned, parallel groups identified417```418419**Priority definitions:**420421| Priority | Meaning | Examples |422|----------|---------|---------|423| **P0** | Core foundation — blocks other tasks | Type definitions, Zod schemas, config changes |424| **P1** | Important functionality — builds on P0 | API endpoints, business logic, main components |425| **P2** | Supporting work — edge cases, polish | Error handling, validation, loading states |426| **P3** | Nice-to-haves — docs, tests, cleanup | Documentation, additional tests, refactoring |427428**Parallel groups:** Tasks at the same priority with no mutual dependencies form a parallel group. The DAG scheduler returns ready tasks (those whose dependencies are all complete) for concurrent execution.429430### PHASE 5: GENERATE & VALIDATE431432**Goal:** Produce the final plan, lint it for execution safety, and save both markdown and JSON to disk.433434```435├── Build canonical JSON plan object first436├── Produce plan markdown from the same canonical plan object (no [PLAN]/[/PLAN] markers on disk)437├── Include: title, overview, prerequisites, non-goals, contracts, architecture diagram, reuse audit, tasks, failure modes, ship cut, test coverage map, execution summary, dependencies JSON438├── Generate ASCII architecture diagram showing component relationships and where each task fits439├── Generate test coverage map: new codepath → covering TASK → test type440├── Generate execution summary from DAG: task count, layer count, layers, critical path441├── Run final lint checks (see Final Plan Lint below)442├── Save markdown to .ulpi/plans/<plan-name>.md443├── Save structured JSON to .ulpi/plans/<plan-name>.json (see JSON Output Format)444├── Print summary table (ID, title, priority, deps, parallel group)445└── Gate: Both files saved, markdown valid, JSON valid, all new sections present, all lint checks pass446```447448---449450## Plan Output Format451452The plan **must** use this exact structure:453454```markdown455# Plan: <Feature Title>456457> Generated: <ISO date>458> Branch: `feat/<slug>`459> Mode: EXPANSION | HOLD | REDUCTION460461## Overview462463<2-4 sentence description of the feature, its purpose, and target users.>464465## Scope Challenge466467<Summary of Phase 0 analysis: what was considered, what was ruled out, why this mode was selected.>468469## Prerequisites470471- <What must already be true in the current codebase/runtime>472- <What is external vs local>473- <What prerequisite task is added if the assumption is not true>474475## Non-Goals476477- <Explicitly deferred capability 1>478- <Explicitly deferred capability 2>479480## Contracts481482| Boundary | Producer | Consumer | Shape / API | Consistency / Recovery Rule |483|----------|----------|----------|-------------|------------------------------|484| <contract name> | <component> | <component> | <input/output shape> | <rule> |485486## Architecture487488```489<ASCII diagram showing component relationships, data flow, and where each task fits.490Use box-drawing characters. Label each component with the TASK-NNN that creates/modifies it.>491```492493## Existing Code Leverage494495| Sub-problem | Existing Code | Action |496|------------|---------------|--------|497| <sub-problem 1> | `path/to/existing.ts` | Reuse as-is |498| <sub-problem 2> | `path/to/partial.ts` | Extend |499| <sub-problem 3> | (none) | Build new |500501## Tasks502503### TASK-001: <Title>504505<Description — what to build, where the code goes, what patterns to follow.506Include specific file paths where the agent should create or modify files.507If the task creates a new file/module, say how it is exported or registered.508If the task claims a side effect (WAL append, persistence, network, registration),509state where that capability comes from.>510511**Type:** feature512**Effort:** M513514**Acceptance Criteria:**515- [ ] <Testable criterion 1>516- [ ] <Testable criterion 2>517- [ ] <Failure/edge case criterion>518519**Write Scope:** `path/to/file.ext`, `path/to/other.ext`520**Validation:** `<command to verify this task>`521522**Agent:** <subagent_type>523**Review:** claude | codex | kiro | none524525**Priority:** P0526527---528529### TASK-002: <Title>530531<Description with file paths and implementation guidance.>532533**Type:** feature534**Effort:** S535536**Acceptance Criteria:**537- [ ] <Criterion 1>538- [ ] <Criterion 2>539540**Write Scope:** `path/to/file.ext`541**Validation:** `<command to verify this task>`542543**Agent:** <subagent_type>544545**Depends on:** TASK-001546**Review:** codex547**Priority:** P1548549---550551(continue for all tasks...)552553## Failure Modes554555| Risk | Affected Tasks | Mitigation |556|------|---------------|------------|557| <What can go wrong> | TASK-NNN | <How to prevent or handle it> |558559## Ship Cut560561- <Minimum subset of tasks that still delivers the promised phase outcome>562- <What is explicitly not shippable until later layers land>563564## Test Coverage Map565566| New Codepath | Covering Task | Test Type |567|-------------|--------------|-----------|568| <codepath description> | TASK-NNN | unit / integration / e2e |569570## Execution Summary571572| Item | Value |573|------|-------|574| Task Count | <derived from JSON> |575| Layer Count | <derived from JSON> |576| Critical Path | TASK-001 -> TASK-004 -> TASK-007 |577578### Parallel Layers579580| Layer | Tasks | Notes |581|------|-------|-------|582| 0 | TASK-001, TASK-002 | Independent foundation work |583| 1 | TASK-003 | Depends on TASK-001 |584585## Task Dependencies586587```json588{589 "TASK-001": [],590 "TASK-002": ["TASK-001"],591 "TASK-003": ["TASK-001"],592 "TASK-004": ["TASK-002", "TASK-003"]593}594```595```596597## JSON Output Format598599In addition to the markdown plan, **always save a companion JSON file** at `.ulpi/plans/<plan-name>.json`. This is the primary machine-parseable output. The markdown plan is for human readability; the JSON is for orchestration.600601**Schema:**602603```json604{605 "title": "Feature Title",606 "branch": "feat/<slug>",607 "mode": "EXPANSION | HOLD | REDUCTION",608 "overview": "2-4 sentence description of the feature.",609 "scopeChallenge": "Summary of Phase 0 analysis.",610 "prerequisites": [611 {612 "assumption": "current runtime already reconstructs user tables on startup",613 "status": "already-true | external | requires-task",614 "verification": "path/to/file or test proving it"615 }616 ],617 "nonGoals": [618 "Distributed deployment",619 "Background backfill for historical data"620 ],621 "contracts": [622 {623 "boundary": "Background consumer -> storage mutation",624 "producer": "embed-consumer",625 "consumer": "storage engine",626 "shape": "UpdateRow(row_id, column_id, payload)",627 "consistencyRule": "WAL durable before visible"628 }629 ],630 "existingCodeLeverage": [631 {632 "subProblem": "description",633 "existingCode": "path/to/file.ts",634 "source": "local | external",635 "action": "reuse | extend | build"636 }637 ],638 "failureModes": [639 { "risk": "description", "affectedTasks": ["TASK-001"], "mitigation": "how to handle" }640 ],641 "testCoverageMap": [642 { "codepath": "description", "coveringTask": "TASK-NNN", "testType": "unit | integration | e2e" }643 ],644 "tasks": [645 {646 "id": "TASK-001",647 "title": "Task title",648 "description": "Full description with file paths and implementation guidance.",649 "type": "feature",650 "effort": "M",651 "priority": "P0",652 "dependsOn": [],653 "acceptanceCriteria": [654 "Criterion 1",655 "Criterion 2"656 ],657 "filesToModify": ["path/to/file.ts"],658 "filesToCreate": ["path/to/new-file.ts"],659 "writeScope": ["path/to/file.ts", "path/to/new-file.ts"],660 "validateCommand": "npm test -- feature-x",661 "rollbackPlan": "revert this task's files only",662 "agent": "express-senior-engineer",663 "review": "codex"664 },665 {666 "id": "TASK-002",667 "title": "Second task",668 "description": "Description referencing specific files.",669 "type": "feature",670 "effort": "S",671 "priority": "P1",672 "dependsOn": ["TASK-001"],673 "acceptanceCriteria": ["Criterion 1"],674 "filesToModify": [],675 "filesToCreate": ["path/to/file.ts"],676 "writeScope": ["path/to/file.ts"],677 "validateCommand": "npm test -- feature-y",678 "rollbackPlan": "revert this task's files only",679 "agent": "react-vite-tailwind-engineer",680 "review": "claude"681 }682 ],683 "executionSummary": {684 "taskCount": 4,685 "layerCount": 3,686 "layers": [687 { "layer": 0, "tasks": ["TASK-001", "TASK-002"] },688 { "layer": 1, "tasks": ["TASK-003"] },689 { "layer": 2, "tasks": ["TASK-004"] }690 ],691 "criticalPath": ["TASK-001", "TASK-003", "TASK-004"]692 },693 "dependencies": {694 "TASK-001": [],695 "TASK-002": ["TASK-001"]696 }697}698```699700**Rules:**701- `mode` must be one of `EXPANSION`, `HOLD`, `REDUCTION`702- `scopeChallenge`, `prerequisites`, `nonGoals`, `contracts`, `existingCodeLeverage`, `failureModes`, and `testCoverageMap` are required703- The `tasks` array must contain every task with all fields populated704- The `dependencies` object must have every task ID as a key, mapping to its dependency array705- `filesToModify` and `filesToCreate` contain specific file paths found during exploration706- `writeScope` contains the files a worker is expected to own for the task707- `validateCommand` is required and must be runnable or intentionally marked as manual with a reason708- `agent` is the subagent type that will execute this task (required — see Agent Table)709- `review` is the post-task review tool: `claude`, `codex`, `kiro`, or `none` (default: `none` for S, `claude` for M+)710- `type` is one of: `feature`, `bug`, `chore`, `refactor`, `test`, `docs`, `infra`711- `effort` is one of: `S`, `M`, `L`, `XL`712- `priority` is one of: `P0`, `P1`, `P2`, `P3`713- `executionSummary` must be derived from the dependency graph, not typed separately by hand714- If a task creates files under a package/module tree, `writeScope` must either include the shared export/registration file or the plan must point to the task that owns it715- If a task claims a side effect, the description must name the capability source (field, trait, callback, parameter, or startup hook)716- Write valid JSON — use `Write` tool, not `Edit`, to create the file717718---719720## Final Plan Lint721722Do not save or present the plan until all checks pass:723724- Every task ID referenced anywhere in markdown exists in the canonical JSON task list725- Every dependency referenced in markdown matches the canonical JSON dependency graph726- Task count, layer count, and execution summary are derived from the canonical JSON, not manually maintained727- Every `filesToModify` path exists728- Every `filesToCreate` parent directory exists or is created by an earlier task729- If a `filesToModify` path is created by an earlier task, the later task depends on that earlier task730- Every local reuse reference exists in the repository; if not, mark it `source: external`731- Every end-state claim in the overview traces to concrete tasks and prerequisites732- Every cross-boundary noun in the plan appears in the `Contracts` section733- Every new file/module has an explicit export/registration owner somewhere in the plan734- No task's `writeScope` hides required shared wiring edits (package root, module index, export barrel, router, registry, manifest, startup hook)735- Every side-effectful method/API claim names its capability source (owned field, injected trait, callback, parameter, or runtime hook)736- Every user-visible capability has at least one public-surface validation task or acceptance criterion737- Every public surface task pins the exact signature/examples from the spec/docs738- Every rewrite/composition task has at least one acceptance criterion proving existing semantics were not silently dropped739- No task is allowed to "pass" by tests that bless placeholder behavior as the intended outcome740- Every task has a concrete `validateCommand` or an explicit manual-validation reason741- If the architecture diagram is not task-complete, label it clearly as component-level only742- No vague phrases remain without semantics: examples include "internal update", "eventually skipped", "initialized", "graceful degradation", "reasonable performance"743744If any check fails, regenerate the plan sections from the canonical structure instead of patching partial text by hand.745746---747748### Format Reference749750| Item | Correct Value |751|------|---------------|752| Priority values | `P0`, `P1`, `P2`, `P3` (regex: `/\b(P[0-3])\b/`) |753| Task ID format | `TASK-001`, `TASK-002`, ... (regex: `/\b(TASK-\d{3,})\b/`) |754| Depends pattern | `**Depends on:** TASK-001, TASK-002` (regex: `/depends on:|requires:|after:|blocked by:/i`) |755| Priority default | P2 when missing — always specify explicitly |756| Type values | `feature`, `bug`, `chore`, `refactor`, `test`, `docs`, `infra` |757| Effort values | `S`, `M`, `L`, `XL` |758| Task heading level | `###` (level 3) — minimum heading level 2 |759| Disk format | No `[PLAN]`/`[/PLAN]` markers — those are for in-conversation display only |760| Dependency JSON | `## Task Dependencies` section with fenced JSON block — every task ID must be a key |761762### Additional Optional Fields763764These fields are supported when present:765766- **`**Type:**`** — `feature | bug | chore | refactor | test | docs | infra` (auto-inferred from heading/body if missing)767- **`**Effort:**`** — `S | M | L | XL`768- **`**Labels:**`** — comma-separated tags769- **`**Agent:**`** — subagent type to execute this task (REQUIRED — see Agent Table)770- **`**Review:**`** — post-task review tool: `claude`, `codex`, `kiro`, or `none` (see Post-Task Review below)771772---773774## Post-Task Review775776Every task can specify a `**Review:**` field that triggers an independent code review after the task agent completes. This catches bugs before they propagate to dependent tasks.777778### Review Tools779780| Value | Skill | What it does |781|-------|-------|-------------|782| `claude` | `/claude-review` | Spawns a separate Claude agent in a worktree to review the changes |783| `codex` | `/codex-review` | Runs OpenAI Codex CLI (`codex review`) against the task's commit |784| `kiro` | `/kiro-review` | Runs Kiro CLI (`kiro-cli chat`) with the diff |785| `none` | — | Skip review (use for trivial tasks like config/docs) |786787### When to Assign Which Reviewer788789- **Security-sensitive tasks** (auth, crypto, secrets, permissions): `codex` — independent AI catches things Claude might miss790- **Complex logic tasks** (parsers, state machines, concurrency): `claude` — deep context understanding791- **API/integration tasks**: `kiro` — alternative perspective792- **Trivial tasks** (rename, config change, docs): `none`793- **Critical P0 tasks**: consider running multiple reviewers in sequence794795### How the Executor Uses This Field796797The `run-parallel-agents-feature-build` skill (or manual execution) should:7987991. Run the task agent8002. Check the `review` field8013. If not `none`, invoke the corresponding review skill on the task's commit using `Skill("codex-review")`, `Skill("claude-review")`, or `Skill("kiro-review")`8024. Report findings to the user8035. Fix findings before marking the task complete804805**IMPORTANT:** The `review` field is a binding instruction to the executor, not a suggestion. When `run-parallel-agents-feature-build` processes this plan, it MUST invoke the specified tool via the `Skill` tool — not approximate it with a general-purpose agent prompt. If the review tool binary is not installed, the executor should warn the user rather than silently substituting.806807### Default808809If `**Review:**` is omitted, default to `none` for S-effort tasks, `claude` for M/L/XL-effort tasks.810811## Quality Self-Check812813Before outputting the final plan, verify ALL of the following:814815- [ ] Phase 0 was completed — user confirmed scope, selected mode, and chose review tool via AskUserQuestion816- [ ] Mode (EXPANSION/HOLD/REDUCTION) is recorded in plan header and JSON817- [ ] `## Scope Challenge` section documents what was considered and ruled out818- [ ] `## Prerequisites`, `## Non-Goals`, and `## Contracts` are present and reflect the exploration findings819- [ ] `## Architecture` section has an ASCII diagram with TASK-NNN labels820- [ ] `## Existing Code Leverage` table maps sub-problems to reuse decisions821- [ ] Local vs external reuse is distinguished correctly822- [ ] All task IDs are sequential (`TASK-001`, `TASK-002`, ...)823- [ ] All task IDs appear as keys in the `## Task Dependencies` JSON block824- [ ] No circular dependencies exist in the dependency graph825- [ ] Every task has 2-3 testable acceptance criteria (at least 1 failure/edge case)826- [ ] Every public surface task pins the exact signature/examples from spec/docs and includes a wrong-shape or wrong-routing check827- [ ] Every rewrite/composition task includes at least 1 "absence of regression" acceptance criterion828- [ ] Every task references specific file paths found during exploration829- [ ] Every task has `writeScope` and `validateCommand`830- [ ] Every new file/module is reachable via an explicit export/registration owner in the plan831- [ ] Shared integration surfaces (package roots, module index files, export barrels, routers, registries, manifests, startup hooks) have expl832833…(truncated)
Run npx skillmds@latest add ulpi-io/plan-to-task-list-with-dag-3 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Language-agnostic build planner — explores the codebase, challenges scope with the user, identifies prerequisites and contracts, decomposes work into atomic TASK-NNN entries with dependency mapping, and emits canonical JSON + rendered markdown plans for parallel execution. Use when you need a structured task DAG that is safe to execute, not just easy to read. It is listed under Docs & Writing on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ulpi-io (@ulpi-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.