Non-negotiable rules:
- Start with scope challenge and mode selection using AskUserQuestion.
- Explore existing code before decomposing. Never invent file paths.
- Build one canonical plan object, then emit both markdown and JSON from it.
- Every task must have explicit ownership, validation, dependency handling, and an Agent field.
- Keep the skill body focused on workflow. Load plan schema, agent mapping, and examples from references.
- Every task needs 2-3 testable acceptance criteria, at least one covering a failure or edge case.
- Never create tasks touching more than 3 files, never create circular dependencies, never assume codebase structure.
- If a task claims side effects (persistence, WAL, network I/O, registration), state where the capability comes from.
- For new files, explicitly assign export/registration/wiring ownership to a task.
- If a task can be "completed" with placeholders or dead wiring, split semantic hardening into an explicit follow-up.
- Treat JSON as the source of truth. Render markdown from the same canonical plan object.
- Do not use vague contract language ("internal update", "eventually skipped", "graceful degradation") without defining owner, behavior, and recovery.
- Distinguish local reuse from external references. Do not present external docs or clones as local code.
Plan To Task List With DAG
Inputs
$request: Optional feature or planning request text
Goal
Produce a concrete task DAG that is safe to execute:
- scope-challenged
- grounded in real repository structure
- atomic enough for parallel work
- persisted to
.ulpi/plans/<plan-name>.md and .ulpi/plans/<plan-name>.json
Step 0: Challenge scope before planning
Before decomposing, do a quick overlap check:
- prefer the
codemap skill if available for semantic search
- otherwise use
Glob, Grep, and Read
Identify:
- what already exists
- what can be reused
- what is truly new
- likely prerequisites
- likely non-goals
- whether the request is small enough to execute directly instead of planning
Then use AskUserQuestion to confirm:
- planning mode:
EXPANSION, HOLD, or REDUCTION
- default post-task review:
claude, codex, kiro, all, or none
- any scope cuts or explicit non-goals
Do not proceed until the scope framing is confirmed.
Success criteria: The user has confirmed the scope, selected a planning mode, and chosen a default review posture.
Step 1: Explore the real code surface
Explore the repository before writing any task:
- likely modules and directories involved
- existing code that partially solves the request
- shared integration surfaces:
- package roots
- export barrels
- registries
- routers
- manifests
- startup hooks
- public surfaces:
- API routes
- CLI commands
- config files
- schemas
- persisted formats
Rules:
- prefer semantic search via
codemap skill when available
- use
Grep for exact-string validation
- use
Read on the actual files before naming them in tasks
- never invent paths, modules, or existing helpers
Success criteria: Every path named in the plan comes from observed repository state.
Step 2: Capture planning contracts
Before tasking, record the conditions that make the plan valid:
- prerequisites
- non-goals
- cross-boundary contracts
- capability providers for side effects
- shared integration points
- ship cut if execution stops halfway
Explicitly note:
- where persistence comes from
- who owns export and registration edits
- which public surfaces must remain stable
- which failure paths or isolation invariants must be preserved
Success criteria: The plan explains what must already be true and what is explicitly out of scope.
Step 3: Decompose into atomic tasks
Create tasks that are:
- atomic
- file-scoped
- dependency-aware
- reviewable
Task rules:
- prefer 1 to 3 files per task
- every file in
writeScope must have an explicit role
- every task needs:
TASK-NNN id
- title
- description
Type
Priority
Effort
Agent (see Agent Selection Reference in references/output-format.md)
- acceptance criteria
writeScope
validateCommand
- include 2-3 testable acceptance criteria per task; at least one must cover a failure or edge case
- for public surfaces, pin the exact signature/examples and add a wrong-shape or wrong-routing check
- for rewrite or composition tasks, add at least one criterion proving existing semantics were not silently dropped
- if a new file needs export or registration, assign that ownership to a specific task
- if a task only creates structure and semantic hardening is still needed, split that follow-up explicitly
validateCommand MUST be SLICE-SCOPED — greenable by THIS task's writeScope plus its already-integrated dependencies, and runnable independently of unrelated work:
- Scope it to the task's own files, never a whole package. For vitest, use
pnpm --filter <pkg> exec vitest run <path/to/file.test.ts>. Do NOT use pnpm --filter <pkg> test -- <file> — the -- makes vitest ignore the positional and run the ENTIRE package, so unrelated or pre-existing failures leak into this task's gate and can falsely block a correct slice.
- Every test file the command runs must be in this task's
writeScope or guaranteed green by an integrated dependency. Never point a task's validate at a test file another task owns and this task cannot fix.
- Avoid whole-suite/e2e commands that only pass at end-state; if two pieces cannot each validate independently, they belong in ONE task.
Success criteria: Each task is executable without hidden context and small enough for independent review.
Step 4: Map dependencies and maximize parallelism
Add dependencies only when they are real:
- file overlap
- data flow
- API contract
- shared integration surface
- capability provider
- lifecycle or bootstrap dependency
Do not over-constrain:
- independent tasks should stay parallel
- shared-file edits should be made explicit rather than hidden
- circular dependencies are invalid
Use P0 through P3 priorities:
P0: foundations that unblock other tasks
P1: core feature work
P2: supporting work and edge cases
P3: optional polish, docs, or cleanup
Success criteria: The dependency graph is acyclic, minimal, and exposes real parallel layers.
Step 5: Render markdown and JSON from one canonical plan object
Before writing output, load references/output-format.md.
Write both files:
.ulpi/plans/<plan-name>.md
.ulpi/plans/<plan-name>.json
Requirements:
- markdown and JSON must describe the same tasks
- task ids must match exactly in both files
- dependency JSON is the source of truth
- markdown must not contain
[PLAN] markers on disk
Success criteria: Both artifacts exist and describe the same DAG.
Step 6: Validate before finishing
Run a final structural pass:
- all task ids exist in markdown and JSON
- every dependency target exists
- no cycles
- no phantom file paths
- no task exceeds sensible write scope
- acceptance criteria include edge or failure behavior where needed
- review default is present
Load references/examples.md only if you need a pattern for presentation shape.
Success criteria: The plan is schedulable, internally consistent, and ready for execution.
Guardrails
- Do not skip AskUserQuestion-based scope challenge.
- Do not turn this into direct implementation.
- Do not invent existing files, helpers, or package boundaries.
- Do not keep giant examples or output templates inline in
SKILL.md.
- Do not add
paths:. This is a generic workflow skill.
- Do not add
context: fork. This workflow depends on user interaction mid-process.
- Do not introduce agent-only headers.
- Do not create tasks that touch more than 3 files.
- Do not over-constrain dependencies -- independent tasks must stay parallel.
- Do not hide required shared-file edits behind narrow write scopes.
- Do not let a task claim side effects that require capabilities the task never defines.
- Do not present external docs, clones, or web research as local code unless the path exists in the repo.
- Do not use P1-P4 priorities. This skill uses P0-P3.
- Do not hand-maintain counts, layer summaries, or dependency references separately between JSON and markdown -- derive from canonical plan object.
When To Load References
references/personality.md
Use at session start for role, expertise, traits, and communication style.
references/knowledge.md
Use for DAG semantics, parser assumptions, and plan-object knowledge.
references/output-format.md
Use before rendering final markdown and JSON artifacts.
references/examples.md
Use only when you need an example shape for a similar request.
Output Contract
Report:
- selected mode and review default
- plan file paths
- task count and critical path summary
- major prerequisites and non-goals
- any notable risks or cut-line decisions
1---2name: plan-to-task-list-with-dag3description: Turn a request into a SCHEDULABLE task DAG — atomic tasks with real dependencies, not planning prose: challenge scope and pick a planning mode with the user first, explore the real repo so no path is invented, then decompose into atomic TASK-NNN entries — each with a ≤3-file write scope, 2-3 testable acceptance criteria, a slice-scoped validate command, explicit dependencies, and an assigned agent — emitted as one canonical object into matching `.ulpi/plans/<name>.md` and `.json`. Every named path comes from observed repo state, the dependency graph stays acyclic, and JSON is the source of truth the markdown is rendered from — no phantom files, no circular edges, no task that hides side effects it never provisions. Use when the user asks to plan, decompose, or break work into execution-ready tasks.4---5
6<EXTREMELY-IMPORTANT>
7This skill creates schedulable plan artifacts, not loose planning prose.
8
9Non-negotiable rules:
101. Start with scope challenge and mode selection using AskUserQuestion.
112. Explore existing code before decomposing. Never invent file paths.
123. Build one canonical plan object, then emit both markdown and JSON from it.
134. Every task must have explicit ownership, validation, dependency handling, and an Agent field.
145. Keep the skill body focused on workflow. Load plan schema, agent mapping, and examples from references.
156. Every task needs 2-3 testable acceptance criteria, at least one covering a failure or edge case.
167. Never create tasks touching more than 3 files, never create circular dependencies, never assume codebase structure.
178. If a task claims side effects (persistence, WAL, network I/O, registration), state where the capability comes from.
189. For new files, explicitly assign export/registration/wiring ownership to a task.
1910. If a task can be "completed" with placeholders or dead wiring, split semantic hardening into an explicit follow-up.
2011. Treat JSON as the source of truth. Render markdown from the same canonical plan object.
2112. Do not use vague contract language ("internal update", "eventually skipped", "graceful degradation") without defining owner, behavior, and recovery.
2213. Distinguish local reuse from external references. Do not present external docs or clones as local code.
23</EXTREMELY-IMPORTANT>
24
25# Plan To Task List With DAG
26
27## Inputs
28
29- `$request`: Optional feature or planning request text
30
31## Goal
32
33Produce a concrete task DAG that is safe to execute:
34
35- scope-challenged
36- grounded in real repository structure
37- atomic enough for parallel work
38- persisted to `.ulpi/plans/<plan-name>.md` and `.ulpi/plans/<plan-name>.json`
39
40## Step 0: Challenge scope before planning
41
42Before decomposing, do a quick overlap check:
43
44- prefer the `codemap` skill if available for semantic search
45- otherwise use `Glob`, `Grep`, and `Read`
46
47Identify:
48
49- what already exists
50- what can be reused
51- what is truly new
52- likely prerequisites
53- likely non-goals
54- whether the request is small enough to execute directly instead of planning
55
56Then use `AskUserQuestion` to confirm:
57
58- planning mode: `EXPANSION`, `HOLD`, or `REDUCTION`
59- default post-task review: `claude`, `codex`, `kiro`, `all`, or `none`
60- any scope cuts or explicit non-goals
61
62Do not proceed until the scope framing is confirmed.
63
64**Success criteria**: The user has confirmed the scope, selected a planning mode, and chosen a default review posture.
65
66## Step 1: Explore the real code surface
67
68Explore the repository before writing any task:
69
70- likely modules and directories involved
71- existing code that partially solves the request
72- shared integration surfaces:
73 - package roots
74 - export barrels
75 - registries
76 - routers
77 - manifests
78 - startup hooks
79- public surfaces:
80 - API routes
81 - CLI commands
82 - config files
83 - schemas
84 - persisted formats
85
86Rules:
87
88- prefer semantic search via `codemap` skill when available
89- use `Grep` for exact-string validation
90- use `Read` on the actual files before naming them in tasks
91- never invent paths, modules, or existing helpers
92
93**Success criteria**: Every path named in the plan comes from observed repository state.
94
95## Step 2: Capture planning contracts
96
97Before tasking, record the conditions that make the plan valid:
98
99- prerequisites
100- non-goals
101- cross-boundary contracts
102- capability providers for side effects
103- shared integration points
104- ship cut if execution stops halfway
105
106Explicitly note:
107
108- where persistence comes from
109- who owns export and registration edits
110- which public surfaces must remain stable
111- which failure paths or isolation invariants must be preserved
112
113**Success criteria**: The plan explains what must already be true and what is explicitly out of scope.
114
115## Step 3: Decompose into atomic tasks
116
117Create tasks that are:
118
119- atomic
120- file-scoped
121- dependency-aware
122- reviewable
123
124Task rules:
125
126- prefer 1 to 3 files per task
127- every file in `writeScope` must have an explicit role
128- every task needs:
129 - `TASK-NNN` id
130 - title
131 - description
132 - `Type`
133 - `Priority`
134 - `Effort`
135 - `Agent` (see Agent Selection Reference in `references/output-format.md`)
136 - acceptance criteria
137 - `writeScope`
138 - `validateCommand`
139- include 2-3 testable acceptance criteria per task; at least one must cover a failure or edge case
140- for public surfaces, pin the exact signature/examples and add a wrong-shape or wrong-routing check
141- for rewrite or composition tasks, add at least one criterion proving existing semantics were not silently dropped
142- if a new file needs export or registration, assign that ownership to a specific task
143- if a task only creates structure and semantic hardening is still needed, split that follow-up explicitly
144- `validateCommand` MUST be SLICE-SCOPED — greenable by THIS task's `writeScope` plus its already-integrated dependencies, and runnable independently of unrelated work:
145 - Scope it to the task's own files, never a whole package. For vitest, use `pnpm --filter <pkg> exec vitest run <path/to/file.test.ts>`. Do NOT use `pnpm --filter <pkg> test -- <file>` — the `--` makes vitest ignore the positional and run the ENTIRE package, so unrelated or pre-existing failures leak into this task's gate and can falsely block a correct slice.
146 - Every test file the command runs must be in this task's `writeScope` or guaranteed green by an integrated dependency. Never point a task's validate at a test file another task owns and this task cannot fix.
147 - Avoid whole-suite/e2e commands that only pass at end-state; if two pieces cannot each validate independently, they belong in ONE task.
148
149**Success criteria**: Each task is executable without hidden context and small enough for independent review.
150
151## Step 4: Map dependencies and maximize parallelism
152
153Add dependencies only when they are real:
154
155- file overlap
156- data flow
157- API contract
158- shared integration surface
159- capability provider
160- lifecycle or bootstrap dependency
161
162Do not over-constrain:
163
164- independent tasks should stay parallel
165- shared-file edits should be made explicit rather than hidden
166- circular dependencies are invalid
167
168Use `P0` through `P3` priorities:
169
170- `P0`: foundations that unblock other tasks
171- `P1`: core feature work
172- `P2`: supporting work and edge cases
173- `P3`: optional polish, docs, or cleanup
174
175**Success criteria**: The dependency graph is acyclic, minimal, and exposes real parallel layers.
176
177## Step 5: Render markdown and JSON from one canonical plan object
178
179Before writing output, load `references/output-format.md`.
180
181Write both files:
182
183- `.ulpi/plans/<plan-name>.md`
184- `.ulpi/plans/<plan-name>.json`
185
186Requirements:
187
188- markdown and JSON must describe the same tasks
189- task ids must match exactly in both files
190- dependency JSON is the source of truth
191- markdown must not contain `[PLAN]` markers on disk
192
193**Success criteria**: Both artifacts exist and describe the same DAG.
194
195## Step 6: Validate before finishing
196
197Run a final structural pass:
198
199- all task ids exist in markdown and JSON
200- every dependency target exists
201- no cycles
202- no phantom file paths
203- no task exceeds sensible write scope
204- acceptance criteria include edge or failure behavior where needed
205- review default is present
206
207Load `references/examples.md` only if you need a pattern for presentation shape.
208
209**Success criteria**: The plan is schedulable, internally consistent, and ready for execution.
210
211## Guardrails
212
213- Do not skip AskUserQuestion-based scope challenge.
214- Do not turn this into direct implementation.
215- Do not invent existing files, helpers, or package boundaries.
216- Do not keep giant examples or output templates inline in `SKILL.md`.
217- Do not add `paths:`. This is a generic workflow skill.
218- Do not add `context: fork`. This workflow depends on user interaction mid-process.
219- Do not introduce agent-only headers.
220- Do not create tasks that touch more than 3 files.
221- Do not over-constrain dependencies -- independent tasks must stay parallel.
222- Do not hide required shared-file edits behind narrow write scopes.
223- Do not let a task claim side effects that require capabilities the task never defines.
224- Do not present external docs, clones, or web research as local code unless the path exists in the repo.
225- Do not use P1-P4 priorities. This skill uses P0-P3.
226- Do not hand-maintain counts, layer summaries, or dependency references separately between JSON and markdown -- derive from canonical plan object.
227
228## When To Load References
229
230- `references/personality.md`
231 Use at session start for role, expertise, traits, and communication style.
232- `references/knowledge.md`
233 Use for DAG semantics, parser assumptions, and plan-object knowledge.
234- `references/output-format.md`
235 Use before rendering final markdown and JSON artifacts.
236- `references/examples.md`
237 Use only when you need an example shape for a similar request.
238
239## Output Contract
240
241Report:
242
2431. selected mode and review default
2442. plan file paths
2453. task count and critical path summary
2464. major prerequisites and non-goals
2475. any notable risks or cut-line decisions