Plan and execute work: resolve consequential design decisions before implementation, then break them into tasks

A cross-agent plugin for planning and executing work: resolve consequential decisions first, then break them into tasks and carry them out.
decision-driven-designInspects an existing system, interviews for high-leverage product and engineering decisions, reconciles revisions, and produces dependency-ordered implementation tasks without speculative abstractions.
tasklistCreates and maintains <DocDir>/Tasklist.md with unique phase/group/task IDs, dependencies, minimum-model tiers, and standard markers (OBSOLETE, INVALID, SUPERSEDED, DEFERRED, BLOCKED) so any model can pick up a task.
tasklist-runExecutes the open tasks in a tasklist-format Tasklist.md, one reviewable commit at a time: a subagent on the cheapest adequate model implements each batch, an Opus reviewer checks it against the task's intent, corrections loop back to the implementer, and the passing change is committed before the next batch. Supports one-task runs, named task/group/phase scope, no-commit, confirm-before-commit, and parallel worktrees, and queues token-efficiency fixes in the tasklist.
tools/plantools/ holds three small Swift command-line tools: tasklist and roadmap apply the list and roadmap rules mechanically (next eligible task, lint, next ID, tick, one-rung and one-section reads), and metrics reads the run log and the repository (exact per-batch tokens from transcripts, a rung's retrospective numbers, zero-token code-quality signals). tools/plantools/build.sh runs swift build -c release and copies the binaries to ~/.cache/danny-agent-skills/bin/ (outside PATH; safe to delete, it is rebuilt). The skills run it themselves when the binaries are missing or stale, call the binaries by full path, and work without them.
tasklist-monitor (Claude Code mod)Opens a pane during /tasklist-run showing each task's status, tokens, estimated cost, runtime, and completion time, with phase and group subtotals. It polls the tasklist from a local timer and never calls the model, so it adds no token cost. Reopen it with /tasklist-monitor.
See the repository installation guide for the complete supported-tool matrix and direct skill installation options.
hooks/register.tsx 253 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { NextStep, TaskRow, TasklistRun } from '../types'
5import { costOf, hasLiveAgents, modelColumn, modelLabel, fmtClock, fmtCost, fmtDuration, fmtTokens, layout, mergeTodo, nextBand, nextStep, parseNext, parseTodo, summarize, taskIdsMentioned } from './todo'
6
7const PANE = 'tasklist-monitor'
8const run = atom({ plugin: 'task-workflow', key: 'run' } as const, null)
9const upNext = atom({ plugin: 'task-workflow', key: 'next' } as const, null)
10const DIRS = ['.', 'docs', 'Docs', 'doc', 'Documentation']
11const ICON = { open: '[ ]', running: '[~]', done: '[x]', closed: '[-]', blocked: '[!]', user: '[u]' } as const
12
13async function findTodo($: any): Promise<string | undefined> {
14 let best: { path: string; mtimeMs: number } | undefined
15 for (const dir of DIRS) {
16 const entries = await $.fs.list(dir).catch(() => [])
17 for (const f of entries) {
18 if (f.kind !== 'file' || !/^(Tasklist|TODO).*\.md$/.test(f.name)) continue
19 if (!best || f.mtimeMs > best.mtimeMs) best = { path: dir === '.' ? f.name : `${dir}/${f.name}`, mtimeMs: f.mtimeMs }
20 }
21 }
22 return best?.path
23}
24
25// Runs in the mod's own process on a timer: no model call, so it costs no tokens.
26async function refresh($: any) {
27 const now = await $.clock.now()
28 const current = await read($, run)
29 if (!current?.isActive) return
30 const text = await $.fs.read(current.file).catch(() => undefined)
31 await update($, run, (r: TasklistRun | null) =>
32 r ? (typeof text === 'string' ? mergeTodo(r, text, now) : { ...r, now }) : r,
33 )
34}
35
36// Asks the plan tools for the project's next step: at session start and after each main turn outside a run, never on a timer.
37// A missing binary, a non-zero exit or a hung call leaves nothing to show.
38async function refreshNext($: any) {
39 const home = await $.env.get('HOME').catch(() => undefined)
40 const out = home
41 ? await $.process.run([`${home}/.cache/danny-agent-skills/bin/roadmap`, 'next'], { timeoutMs: 5000 }).catch(() => undefined)
42 : undefined
43 const step = out && out.exitCode === 0 ? parseNext(out.stdout) : undefined
44 await update($, upNext, () => step ?? null)
45}
46
47// Debug log only (`claude --debug`): never reaches the model, so diagnosing costs no tokens.
48const trace = ($: any, text: string) => $.ui.log(`task-workflow: ${text}`, { to: 'debug' })
49
50// Creates the run for the newest tasklist. With isFresh false, a run already in memory is reactivated instead of reset.
51async function startRun($: any, isFresh: boolean): Promise<TasklistRun | undefined> {
52 const existing: TasklistRun | null = await read($, run)
53 if (existing?.isActive && !isFresh) return existing
54 if (existing && !isFresh) {
55 await update($, run, (r: TasklistRun | null) => r && { ...r, isActive: true })
56 return { ...existing, isActive: true }
57 }
58 const file = await findTodo($)
59 if (!file) {
60 trace($, 'startRun: no Tasklist*.md found')
61 return undefined
62 }
63 const now = await $.clock.now()
64 const text = await $.fs.read(file).catch(() => '')
65 const base: TasklistRun = {
66 isActive: true, file, startedAt: now, now, tasks: [], agents: {},
67 doneAtStart: [], orchestratorTokens: 0, orchestratorCostUsd: 0,
68 }
69 const first = mergeTodo(base, text, now)
70 const doneAtStart = first.tasks.filter(t => t.status === 'done' || t.status === 'closed').map(t => t.id)
71 const started = { ...first, doneAtStart }
72 await update($, run, () => started)
73 trace($, `startRun: ${file}, ${started.tasks.length} tasks, ${doneAtStart.length} done at start`)
74 void $.ui.open({ id: PANE, title: 'Tasklist run' })
75 return started
76}
77
78export const register: Register = on => {
79 on('session.start', async ($, e, next) => {
80 await $.command.register({
81 name: 'tasklist-monitor',
82 description: 'Show the tasklist-run progress pane',
83 })
84 $.clock.every(5000, () => void refresh($))
85 void refreshNext($)
86 return next(e)
87 })
88
89 on('command.run', { command: 'tasklist-monitor' }, async $ => {
90 await $.ui.open({ id: PANE, title: 'Tasklist run' })
91 return { text: 'Tasklist pane opened.' }
92 })
93
94 on('skill.prompt', async ($, e, next) => {
95 trace($, `skill.prompt skill=${JSON.stringify(e.skill)}`)
96 if (e.skill.endsWith('tasklist-run')) await startRun($, true)
97 return next(e)
98 })
99
100 // A typed /task-workflow:tasklist-run may reach the engine as a command rather than a skill prompt.
101 on('command.run', async ($, e, next) => {
102 if (e.command.endsWith('tasklist-run')) {
103 trace($, `command.run command=${JSON.stringify(e.command)}`)
104 const existing = await read($, run)
105 if (!existing?.isActive) await startRun($, true)
106 }
107 return next(e)
108 })
109
110 on('agent.spawn', async ($, e, next) => {
111 const result = await next(e)
112 const mentioned = taskIdsMentioned(e.description, e.prompt)
113 trace($, `agent.spawn description=${JSON.stringify(e.description)} ids=[${mentioned}] agentId=${result.agentId}`)
114 if (mentioned.length === 0 || result.agentId === undefined) return result
115 // The skill hook may not have fired (or the run ended): task IDs in a spawn mean a run is under way.
116 // Only IDs the TODO has count, so a stray "T5" in an unrelated agent's description starts nothing.
117 const file = (await read($, run))?.file ?? (await findTodo($))
118 const known = new Set(parseTodo((file && (await $.fs.read(file).catch(() => ''))) || '').map(t => t.id))
119 const ids = mentioned.filter(id => known.has(id))
120 if (ids.length === 0) return result
121 const current = await startRun($, false)
122 if (!current) return result
123 const now = await $.clock.now()
124 const role: 'review' | 'implement' = /review/i.test(e.description) ? 'review' : 'implement'
125 const agentId = result.agentId
126 const model: string | undefined = (result as { model?: string }).model
127 await update($, run, (r: TasklistRun | null) =>
128 r && {
129 ...r,
130 now,
131 agents: { ...r.agents, [agentId]: { taskIds: ids, role, model } },
132 tasks: r.tasks
133 .map(t =>
134 ids.includes(t.id) && t.status === 'open'
135 ? { ...t, status: 'running' as const, startedAt: t.startedAt ?? now }
136 : t,
137 )
138 .map(t => (ids.includes(t.id) && role === 'implement' && model ? { ...t, model } : t)),
139 },
140 )
141 return result
142 }).catch(($, e, next) => next(e))
143
144 on('turn.complete', async ($, e, next) => {
145 const current = await read($, run)
146 if (current?.isActive) {
147 const u = e.usage
148 const tokens = u ? u.input_tokens + u.output_tokens + u.cache_creation_input_tokens : 0
149 const cost = u ? costOf(u) : 0
150 const agent = e.agentId === undefined ? undefined : current.agents[e.agentId]
151 if (agent) {
152 await update($, run, (r: TasklistRun | null) =>
153 r && {
154 ...r,
155 agents: { ...r.agents, [e.agentId!]: { ...agent, isDone: true } },
156 tasks: r.tasks.map((t: TaskRow) =>
157 agent.taskIds.includes(t.id)
158 ? { ...t, tokens: t.tokens + tokens / agent.taskIds.length, costUsd: t.costUsd + cost / agent.taskIds.length }
159 : t,
160 ),
161 },
162 )
163 await refresh($)
164 } else if (e.agentId === undefined) {
165 await update($, run, (r: TasklistRun | null) =>
166 r && { ...r, orchestratorTokens: r.orchestratorTokens + tokens, orchestratorCostUsd: r.orchestratorCostUsd + cost },
167 )
168 await refresh($)
169 // the orchestrator's turn ended: the run is over unless spawned agents are still working
170 // (it resumes when they finish, and its next turn end re-checks)
171 await update($, run, (r: TasklistRun | null) => r && (hasLiveAgents(r) ? r : { ...r, isActive: false }))
172 }
173 }
174 // Any main turn may have moved the project on (a plan, a close): re-ask, unless a run is still going.
175 const after = await read($, run)
176 if (e.agentId === undefined && !after?.isActive) void refreshNext($)
177 return next(e)
178 })
179
180 // One line above the prompt; the pane covers a run in progress.
181 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
182 const step: NextStep | null = await read($, upNext)
183 const band = step && nextBand(step)
184 if (!band || e.props.hasSurvey || (await read($, run))?.isActive) return next(e)
185 const { Box, Text } = $.ui.resolve(e)
186 return (
187 <Box>
188 <Text bold>{band.text}</Text>
189 {band.why && <Text dimColor>{` ${band.why}`}</Text>}
190 </Box>
191 )
192 })
193
194 on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
195 const { Box, Text } = $.ui.resolve(e)
196 const r = await read($, run)
197 if (!r) {
198 const todo = await findTodo($)
199 return (
200 <Text dimColor>
201 Waiting for /tasklist-run or an agent spawn that names a task ID. Tasklist found: {todo ?? 'none'}
202 </Text>
203 )
204 }
205 const s = summarize(r)
206 const width = (e as any).props?.bodyColumns ?? 80
207 const mode = modelColumn(width)
208 const modelW = mode === 'long' ? 10 : 6
209 const cols = (tok: number, usd: number, ms: number | undefined, at?: number, model?: string) =>
210 (mode === 'none' ? '' : `${(model ? modelLabel(model, mode === 'short') : '').padEnd(modelW)} `) +
211 `${(tok > 0 ? fmtTokens(tok) : '').padStart(7)} ${fmtCost(usd).padStart(7)} ${(ms === undefined ? '' : fmtDuration(ms)).padStart(8)} ${at ? fmtClock(at) : ' '}`
212 const row = (head: string, tail: string) => {
213 const room = Math.max(10, width - tail.length - 1)
214 return head.slice(0, room).padEnd(room) + ' ' + tail
215 }
216 const lines = layout(r.tasks)
217 return (
218 <Box flexDirection="column">
219 <Text bold>
220 {r.isActive ? 'Running' : 'Finished'} {s.done}/{s.total} done · {fmtTokens(s.tokens)} tokens · {fmtCost(s.costUsd) || '$0'} est. · {fmtDuration(s.elapsedMs)}
221 {r.doneAtStart.length > 0 ? ` · ${r.doneAtStart.length} already done at start, not costed` : ''}
222 </Text>
223 <Text dimColor>{row('', `${mode === 'none' ? '' : 'model'.padEnd(modelW) + ' '}${'tokens'.padStart(7)} ${'cost'.padStart(7)} ${'duration'.padStart(8)} done `)}</Text>
224 {lines.map(l => {
225 if (l.kind === 'heading') {
226 const ts = l.tasks
227 const started = ts.map(t => t.startedAt).filter((x): x is number => x !== undefined)
228 const isEnded = ts.every(t => t.endedAt !== undefined || t.status === 'closed')
229 const end = isEnded ? Math.max(...ts.map(t => t.endedAt ?? 0)) : r.now
230 const ms = started.length === 0 ? undefined : end - Math.min(...started)
231 return (
232 <Text bold>
233 {row(' '.repeat(l.depth) + l.title, cols(ts.reduce((n, t) => n + t.tokens, 0), ts.reduce((n, t) => n + t.costUsd, 0), ms))}
234 </Text>
235 )
236 }
237 const t = l.task
238 const ms = t.startedAt === undefined ? undefined : (t.endedAt ?? r.now) - t.startedAt
239 return (
240 <Text
241 dimColor={t.status === 'done' || t.status === 'closed'}
242 color={t.status === 'blocked' ? 'red' : t.status === 'running' ? 'yellow' : undefined}
243 >
244 {row(' '.repeat(l.depth) + `${ICON[t.status]} ${t.id} ${t.title}`, cols(t.tokens, t.costUsd, ms, t.endedAt, t.model))}
245 </Text>
246 )
247 })}
248 {nextStep(r) && <Text bold>{nextStep(r)}</Text>}
249 </Box>
250 )
251 })
252}
253hooks/todo.ts 212 lines1import type { TaskRow, TaskStatus, TasklistRun } from '../types'
2
3type Parsed = Pick<TaskRow, 'id' | 'title' | 'phase' | 'group' | 'status'>
4
5const TASK = /^- \[([ x-])\] (T\d+)\s+(.*)$/
6const HEADING = /^#{2,3} ([PG])\d+\b.*$/
7
8export function parseTodo(text: string): Parsed[] {
9 const rows: Parsed[] = []
10 let phase = ''
11 let group = ''
12 for (const line of text.split('\n')) {
13 const heading = HEADING.exec(line)
14 if (heading) {
15 const title = line.replace(/^#+ /, '')
16 if (heading[1] === 'P') {
17 phase = title
18 group = ''
19 } else group = title
20 continue
21 }
22 const task = TASK.exec(line)
23 if (!task) continue
24 const mark = task[1]!, id = task[2]!, rest = task[3]!
25 let status: TaskStatus = 'open'
26 if (mark === 'x') status = 'done'
27 else if (mark === '-') status = 'closed'
28 else if (/^BLOCKED\b/.test(rest)) status = 'blocked'
29 else if (/^USER\b/.test(rest)) status = 'user'
30 rows.push({
31 id,
32 title: rest.replace(/^(BLOCKED\([^)]*\)|IN-PROGRESS|USER)\s*(—|-)?\s*/, ''),
33 phase,
34 group,
35 status,
36 })
37 }
38 return rows
39}
40
41export function hasLiveAgents(run: TasklistRun): boolean {
42 return Object.values(run.agents).some(a => !a.isDone)
43}
44
45export function taskIdsIn(prompt: string): string[] {
46 const blocks = [...prompt.matchAll(/^- \[[ x-]\] (T\d+)\b/gm)].map(m => m[1]!)
47 return [...new Set(blocks)]
48}
49
50/** Task IDs named anywhere in a spawn's description or the start of its prompt ("T18: ...", "Implement T16 gitignore"). */
51export function taskIdsMentioned(description: string, prompt: string): string[] {
52 const found = `${description}\n${prompt.slice(0, 300)}`.match(/\bT\d+\b/g) ?? []
53 return [...new Set([...found, ...taskIdsIn(prompt)])]
54}
55
56/** "claude-opus-5-5" as "Opus 5.5", or "Opu5.5" when short; an alias without a version drops the number. */
57export function modelLabel(id: string, isShort: boolean): string {
58 const m = id.match(/(fable|opus|sonnet|haiku|mythos)(?:-(\d+)(?:-(\d))?)?/i)
59 if (!m) return id.slice(0, isShort ? 6 : 10)
60 const name = m[1]![0]!.toUpperCase() + m[1]!.slice(1).toLowerCase()
61 const version = m[2] === undefined ? '' : m[3] === undefined || m[3].length > 1 ? m[2] : `${m[2]}.${m[3]}`
62 return isShort ? `${name.slice(0, 3)}${version}` : `${name}${version ? ' ' + version : ''}`
63}
64
65/** Model column width by pane width: full names when roomy, 3 letters + version when tight, none when narrow. */
66export function modelColumn(width: number): 'long' | 'short' | 'none' {
67 return width >= 110 ? 'long' : width >= 70 ? 'short' : 'none'
68}
69
70/** Folds a fresh read of the TODO into the run, stamping tasks as they finish. */
71export function mergeTodo(run: TasklistRun, text: string, now: number): TasklistRun {
72 const old = new Map(run.tasks.map(t => [t.id, t]))
73 const running = new Set(Object.values(run.agents).flatMap(a => a.taskIds))
74 const tasks = parseTodo(text).map(p => {
75 const prev = old.get(p.id)
76 const task: TaskRow = { tokens: 0, costUsd: 0, ...prev, ...p }
77 if (p.status === 'done' || p.status === 'closed') {
78 if (prev && prev.status !== p.status && task.endedAt === undefined && !run.doneAtStart.includes(p.id)) task.endedAt = now
79 } else if (p.status === 'open' && running.has(p.id) && task.startedAt !== undefined) {
80 task.status = 'running'
81 }
82 return task
83 })
84 return { ...run, tasks, now }
85}
86
87// USD per million tokens, from the published first-party prices: [input, output, cache read].
88// Cache writes are billed at 1.25x input (5-minute cache); a model not listed costs nothing here.
89const RATES: [RegExp, [number, number, number]][] = [
90 [/fable-5|mythos-5/, [10, 50, 0.25]],
91 [/opus-5-5/, [4, 20, 0.2]],
92 [/opus-(5|4)/, [5, 25, 0.5]],
93 [/sonnet-5/, [2, 10, 0.2]],
94 [/sonnet-4/, [3, 15, 0.3]],
95 [/haiku-5/, [0.1, 0.5, 0.01]],
96 [/haiku-4/, [1, 5, 0.1]],
97]
98
99export type Usage = {
100 model: string
101 input_tokens: number
102 output_tokens: number
103 cache_read_input_tokens: number
104 cache_creation_input_tokens: number
105}
106
107/** The command to run once a run has stopped, with its model: the same advice the skills end with. Undefined while running or when nothing follows. */
108export function nextStep(run: TasklistRun): string | undefined {
109 if (run.isActive || run.tasks.length === 0) return undefined
110 const waiting = run.tasks.filter(t => t.status !== 'done' && t.status !== 'closed').length
111 const rung = /^Tasklist-([A-Za-z]+\d+)-/.exec(run.file.split('/').pop() ?? '')?.[1]
112 if (waiting > 0) {
113 const command = rung ? `/rung run ${rung}` : `/tasklist-run ${run.file}`
114 return `Next: ${waiting} task${waiting === 1 ? '' : 's'} still open. Resolve blocked or USER tasks, then ${command} (same model).`
115 }
116 return rung ? `Next: /rung → close ${rung} (Opus: /model opus).` : undefined
117}
118
119/** What `roadmap next` printed: its `key: value` lines, keys step, rung, list, model, command, why. */
120export type NextStep = { step: string; rung?: string; list?: string; model?: string; command?: string; why?: string }
121
122/** Parses `roadmap next` output; undefined when it has no step or the project has no roadmap yet (`design`). */
123export function parseNext(text: string): NextStep | undefined {
124 const found: Record<string, string> = {}
125 for (const line of text.split('\n')) {
126 const m = /^(step|rung|list|model|command|why):\s*(.*?)\s*$/.exec(line)
127 if (m && m[2]) found[m[1]!] = m[2]
128 }
129 if (!found.step || found.step === 'design') return undefined
130 return found as NextStep
131}
132
133/** The band's line, `Next: /rung → close L3 (Opus)`, and the dimmed why; undefined when there is nothing to run. */
134export function nextBand(n: NextStep): { text: string; why?: string } | undefined {
135 if (!n.command) return undefined
136 const rest = /^\/rung\s+(.+)$/.exec(n.command)?.[1]
137 const model = n.model ? ` (${n.model[0]!.toUpperCase()}${n.model.slice(1)})` : ''
138 return { text: `Next: ${rest ? `/rung → ${rest}` : n.command}${model}`, why: n.why }
139}
140
141export function costOf(u: Usage): number {
142 const rate = RATES.find(([re]) => re.test(u.model))?.[1]
143 if (!rate) return 0
144 const [inp, out, read] = rate
145 return (
146 (u.input_tokens * inp + u.output_tokens * out + u.cache_read_input_tokens * read + u.cache_creation_input_tokens * inp * 1.25) /
147 1e6
148 )
149}
150
151export type Summary = { done: number; total: number; tokens: number; costUsd: number; elapsedMs: number }
152
153export function summarize(run: TasklistRun): Summary {
154 return {
155 done: run.tasks.filter(t => t.status === 'done').length,
156 total: run.tasks.filter(t => t.status !== 'closed').length,
157 tokens: run.tasks.reduce((n, t) => n + t.tokens, 0) + run.orchestratorTokens,
158 costUsd: run.tasks.reduce((n, t) => n + t.costUsd, 0) + run.orchestratorCostUsd,
159 elapsedMs: run.now - run.startedAt,
160 }
161}
162
163export type Line =
164 | { kind: 'heading'; depth: number; title: string; tasks: TaskRow[] }
165 | { kind: 'task'; depth: number; task: TaskRow }
166
167/** Lays tasks out by whatever hierarchy the list has: phases, groups, both or neither. */
168export function layout(tasks: TaskRow[]): Line[] {
169 const hasPhases = tasks.some(t => t.phase)
170 const hasGroups = tasks.some(t => t.group)
171 const taskDepth = (hasPhases ? 1 : 0) + (hasGroups ? 1 : 0)
172 const lines: Line[] = []
173 let phase: string | undefined
174 let group: string | undefined
175 for (const t of tasks) {
176 if (hasPhases && t.phase !== phase) {
177 phase = t.phase
178 group = undefined
179 lines.push({ kind: 'heading', depth: 0, title: t.phase || 'Other', tasks: tasks.filter(x => x.phase === t.phase) })
180 }
181 if (hasGroups && t.group !== group) {
182 group = t.group
183 lines.push({
184 kind: 'heading',
185 depth: hasPhases ? 1 : 0,
186 title: t.group || 'Other',
187 tasks: tasks.filter(x => x.phase === t.phase && x.group === t.group),
188 })
189 }
190 lines.push({ kind: 'task', depth: taskDepth, task: t })
191 }
192 return lines
193}
194
195export const fmtTokens = (n: number) =>
196 n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1e3 ? `${(n / 1e3).toFixed(1)}k` : String(Math.round(n))
197
198export const fmtCost = (n: number) => (n === 0 ? '' : n < 0.01 ? '<$0.01' : `$${n.toFixed(2)}`)
199
200export function fmtDuration(ms: number) {
201 const s = Math.max(0, Math.round(ms / 1000))
202 const h = Math.floor(s / 3600)
203 const m = Math.floor((s % 3600) / 60)
204 return h > 0 ? `${h}h${String(m).padStart(2, '0')}m` : m > 0 ? `${m}m${String(s % 60).padStart(2, '0')}s` : `${s}s`
205}
206
207export function fmtClock(ms: number) {
208 const d = new Date(ms)
209 const p = (n: number) => String(n).padStart(2, '0')
210 return `${p(d.getHours())}:${p(d.getMinutes())}`
211}
212types/index.d.ts 41 lines1export type TaskStatus = 'open' | 'running' | 'done' | 'closed' | 'blocked' | 'user'
2
3export type TaskRow = {
4 id: string
5 title: string
6 /** Phase heading (`## P1 ...`), empty when the list has none. */
7 phase: string
8 /** Group heading (`### G1 ...`), empty when the list has none. */
9 group: string
10 status: TaskStatus
11 /** Model of the implementer agent, as the engine resolved it. */
12 model?: string
13 tokens: number
14 costUsd: number
15 startedAt?: number
16 endedAt?: number
17}
18
19export type AgentRow = { taskIds: string[]; role: 'implement' | 'review'; model?: string; isDone?: boolean }
20
21export type TasklistRun = {
22 isActive: boolean
23 file: string
24 startedAt: number
25 now: number
26 tasks: TaskRow[]
27 agents: Record<string, AgentRow>
28 doneAtStart: string[]
29 orchestratorTokens: number
30 orchestratorCostUsd: number
31}
32
33/** The project's next step as `roadmap next` printed it; see `parseNext` in hooks/todo.ts. */
34export type NextStep = { step: string; rung?: string; list?: string; model?: string; command?: string; why?: string }
35
36declare module 'claude-code' {
37 interface PluginState {
38 'task-workflow': { run: TasklistRun | null; next: NextStep | null }
39 }
40}
41