@dtlabs/ai-toolkit 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/bin/cli.js +851 -9
  3. package/docs/task-executor-bootstrap.md +195 -0
  4. package/docs/task-executor-cli.md +319 -0
  5. package/docs/workflow-control-plane.md +95 -0
  6. package/lib/agent-registry.js +1018 -0
  7. package/lib/execution-ledger.js +283 -7
  8. package/lib/task-executor/claude-process.js +563 -0
  9. package/lib/task-executor/git.js +1362 -0
  10. package/lib/task-executor/index.js +3729 -0
  11. package/lib/task-executor/ownership.js +590 -0
  12. package/lib/task-executor/plan.js +725 -0
  13. package/lib/task-executor/store.js +1164 -0
  14. package/lib/workflow-artifacts.js +102 -0
  15. package/lib/workflow-control.js +219 -0
  16. package/lib/workflow-runner.js +39 -0
  17. package/package.json +1 -1
  18. package/src/claude/agents/{concurrency-safety-assessment.md → gaia-concurrency-safety-assessment.md} +1 -1
  19. package/src/claude/agents/{define-feature.md → gaia-define-feature.md} +1 -1
  20. package/src/claude/agents/{dependency-injection-refactoring.md → gaia-dependency-injection-refactoring.md} +1 -1
  21. package/src/claude/agents/{dependency-supply-chain-security.md → gaia-dependency-supply-chain-security.md} +1 -1
  22. package/src/claude/agents/{developer-backend.md → gaia-developer-backend.md} +1 -1
  23. package/src/claude/agents/{developer-frontend.md → gaia-developer-frontend.md} +1 -1
  24. package/src/claude/agents/{developer-testing.md → gaia-developer-testing.md} +1 -1
  25. package/src/claude/agents/{domain-model-refactoring.md → gaia-domain-model-refactoring.md} +1 -1
  26. package/src/claude/agents/{generate-requirements.md → gaia-generate-requirements.md} +1 -1
  27. package/src/claude/agents/{generate-tech-spec.md → gaia-generate-tech-spec.md} +1 -1
  28. package/src/claude/agents/{generate-work-breakdown.md → gaia-generate-work-breakdown.md} +5 -5
  29. package/src/claude/agents/{generic-software-assessment.md → gaia-generic-software-assessment.md} +1 -1
  30. package/src/claude/agents/{god-class-decomposition.md → gaia-god-class-decomposition.md} +1 -1
  31. package/src/claude/agents/{init-agents-md.md → gaia-init-agents-md.md} +1 -1
  32. package/src/claude/agents/{install-toolkit.md → gaia-install-toolkit.md} +1 -1
  33. package/src/claude/agents/{intervention-documentation-standard.md → gaia-intervention-documentation-standard.md} +10 -10
  34. package/src/claude/agents/{layered-architecture-assessment.md → gaia-layered-architecture-assessment.md} +1 -1
  35. package/src/claude/agents/{review-solution.md → gaia-review-solution.md} +1 -1
  36. package/src/claude/agents/{security-hardening.md → gaia-security-hardening.md} +1 -1
  37. package/src/claude/agents/{validate-feature-docs.md → gaia-validate-feature-docs.md} +2 -2
  38. package/src/claude/agents/{validate-work-breakdown-semantic.md → gaia-validate-work-breakdown-semantic.md} +1 -1
  39. package/src/claude/commands/next-task.md +4 -4
  40. package/src/claude/skills/assess-codebase/SKILL.md +9 -103
  41. package/src/claude/skills/define-feature/SKILL.md +2 -2
  42. package/src/claude/skills/hi-gaia/SKILL.md +1 -1
  43. package/src/claude/skills/implement-feature/SKILL.md +131 -38
  44. package/src/claude/skills/init-agents/SKILL.md +2 -2
  45. package/src/claude/skills/install-toolkit/SKILL.md +2 -2
  46. package/src/claude/workflows/am-phase1.js +43 -294
  47. package/src/claude/workflows/am-phase2.js +10 -164
  48. package/src/claude/workflows/pm-phase1.js +45 -287
  49. package/src/claude/workflows/pm-phase2.js +51 -511
  50. package/src/claude/workflows/pm-phase3.js +5 -767
@@ -23,14 +23,14 @@ Steps:
23
23
 
24
24
  Suggested agent: <subagent_type>
25
25
  Suggested invocation:
26
- subagent_type: <developer-backend | developer-frontend | developer-testing>
26
+ subagent_type: <gaia-developer-backend | gaia-developer-frontend | gaia-developer-testing>
27
27
  prompt: <feature-md-path> <task-id>
28
28
  ```
29
29
 
30
30
  Domain → agent mapping:
31
- - `DB`, `BE`, `INFRA` → `developer-backend`
32
- - `FE` → `developer-frontend`
33
- - `TEST` → `developer-testing`
31
+ - `DB`, `BE`, `INFRA` → `gaia-developer-backend`
32
+ - `FE` → `gaia-developer-frontend`
33
+ - `TEST` → `gaia-developer-testing`
34
34
 
35
35
  5. If no unblocked task remains, output: `✅ All tasks are either done, in progress, or blocked. Check blockers.`
36
36
 
@@ -9,8 +9,7 @@ Orchestrates the full codebase assessment pipeline by invoking two sequential wo
9
9
  (`am-phase1`, `am-phase2`), handling the Findings Gate in the main loop between the phases,
10
10
  and recording the real token consumption at the end.
11
11
 
12
- Each workflow phase runs as a real subagent boundary, ensuring assessment agents are dispatched
13
- with accurate per-agent `usage` data and their declared `model:` frontmatter honoured.
12
+ Run workflows through the deterministic Node host. Workflows are not agent types. Resolve the absolute Claude executable path using docs/task-executor-bootstrap.md.
14
13
 
15
14
  ---
16
15
 
@@ -25,16 +24,14 @@ found, or start at `ASSESS-001`. This prefix is used for all output files in thi
25
24
 
26
25
  Invoke the `am-phase1` workflow:
27
26
 
28
- ```
29
- subagent_type: am-phase1
30
- prompt: <path> [--scope=<areas>] --prefix ASSESS-NNN [--force]
27
+ ```bash
28
+ ai-toolkit workflow run am-phase1 --project . --claude-path "{ABSOLUTE_CLAUDE_EXE}" -- "<path>" [--scope=<areas>] --prefix ASSESS-NNN
31
29
  ```
32
30
 
33
31
  If no path was provided by the user, use `.` (current working directory).
34
32
  Always pass `--prefix ASSESS-NNN` with the prefix determined in Step 1.
35
33
 
36
- Wait for the workflow to complete. Capture its full result, including the `<usage>` block
37
- (format: `subagent_tokens: N`). Extract from the result:
34
+ Wait for exit 0, then parse stdout JSON. A nonzero exit is a HARD STOP; do not present a successful Findings Gate. The host owns ledger transitions. Extract from the result:
38
35
  - `prefix` — confirmed assessment prefix
39
36
  - `output_dir` — path to `docs/assessments/ASSESS-NNN/`
40
37
  - `assessment_summaries` — list of `{ agent, output_file }` for each completed assessment
@@ -46,8 +43,7 @@ Wait for the workflow to complete. Capture its full result, including the `<usag
46
43
  - `token_estimate_path` — path to `{PREFIX}-Token-Estimate.md`
47
44
  - `errors` — any agent failures during phase 1
48
45
 
49
- If `errors` is non-empty, report them to the user before presenting the Findings Gate.
50
- Partial assessments are acceptable — present the Findings Gate with available data.
46
+ If any worker fails, stop. Partial assessments must not be represented as a completed workflow.
51
47
 
52
48
  ---
53
49
 
@@ -112,9 +108,8 @@ Capture the flagged identifiers (as a comma-separated string, or "none").
112
108
 
113
109
  Invoke the `am-phase2` workflow:
114
110
 
115
- ```
116
- subagent_type: am-phase2
117
- prompt: --prefix {prefix} --output-dir {output_dir} --flagged {flagged_ids} --ack "{acknowledgement_text}"
111
+ ```bash
112
+ ai-toolkit workflow run am-phase2 --project . -- "--prefix" "{prefix}" --output-dir "{output_dir}" --flagged "{flagged_ids}" --ack "{acknowledgement_text}"
118
113
  ```
119
114
 
120
115
  Where `{flagged_ids}` is the comma-separated list of INT-NNN identifiers (or "none").
@@ -126,95 +121,6 @@ Wait for the workflow to complete. Extract from the result:
126
121
 
127
122
  ---
128
123
 
129
- ## Step 5 — Complete Token Estimate file
130
-
131
- From the `<usage>` block of the am-phase1 result, read:
132
- - `subagent_tokens` — total tokens consumed by the am-phase1 workflow
133
- - `duration_ms` — wall-clock duration of am-phase1
134
-
135
- If the `<usage>` block is missing: log warning
136
- `"am-phase1 produced no <usage> block; orchestrator token data unavailable"`
137
- and set `actual_tokens = "N/A"`.
138
-
139
- Read `{token_estimate_path}`. Append the following in order:
140
-
141
- ### 5a — Orchestrator row (for use in 5b only)
142
-
143
- Compute values:
144
- - Estimated tokens: 80,000 (baseline from estimation model)
145
- - Estimated cost: $0.4320 — `80,000 × $0.005400 / 1,000` using sonnet blended rate
146
- - Actual tokens: `subagent_tokens` from `<usage>` block; `"N/A"` if missing
147
- - Actual cost: `(actual_tokens / 1,000) × 0.005400` at 4 decimal places; `"N/A"` if unavailable
148
-
149
- ### 5b — Actuals vs Estimate section
150
-
151
- Append a horizontal rule (`---`) followed by:
152
-
153
- ```markdown
154
- ## Actuals vs Estimate
155
-
156
- | Agent | Task/Scope | Model | Est. tokens | Actual tokens | Delta | Est. cost ($) | Actual cost ($) | Duration |
157
- |-------|------------|-------|-------------|---------------|-------|---------------|-----------------|----------|
158
- | {agent} | {scope} | {model} | {est} | {actual} | {±delta} | {est_cost} | {actual_cost} | {Xmin Ys} |
159
- ...
160
- | assessment-manager/am-phase1 (orchestrator) | — | sonnet | 80,000 | {actual} | ±{delta} | $0.4320 | ${actual_cost} | {duration} |
161
- ```
162
-
163
- Column rules:
164
- - **Delta**: `actual_tokens − est_tokens`; show as `+N` or `−N`. Show `"N/A"` if either missing.
165
- - **Duration**: convert `duration_ms` to `Xmin Ys` where available; use `"—"` where not.
166
- - Rows with `"N/A"` actual tokens are still shown but excluded from aggregate calculations.
167
-
168
- ### 5c — Estimation accuracy by agent type (conditional)
169
-
170
- If 2+ distinct model tiers appear with non-N/A actuals, append:
171
-
172
- ```markdown
173
- ## Estimation accuracy by agent type
174
-
175
- | Model | Count | Avg est. tokens | Avg actual tokens | Avg delta | Trend |
176
- |-------|-------|-----------------|-------------------|-----------|-------|
177
- | {model} | {N} | {avg_est} | {avg_actual} | {avg_delta} | {trend} |
178
- ```
179
-
180
- - One row per model tier (e.g., `haiku`, `sonnet`)
181
- - Exclude N/A rows from averages
182
- - **Trend**: `"over-target"` if avg delta > +20% of avg est; `"under-target"` if < −20%; else `"on-target"`
183
-
184
- ### 5d — Grand Total section
185
-
186
- Update the Grand Total section: replace `"partial — updated at pipeline end"` with Final values:
187
-
188
- ```markdown
189
- ## Grand Total (Final)
190
-
191
- | Metric | Estimated | Actual | Delta | Delta % |
192
- |--------|-----------|--------|-------|---------|
193
- | Total tokens (all agents) | {sum_est} | {sum_actual} | ±{delta} | {delta_pct} |
194
- | Total cost ($) | ${sum_est_cost} | ${sum_actual_cost} | ±${delta_cost} | {delta_cost_pct} |
195
- | Total wall-clock | — | {Xmin Ys} | — | — |
196
- ```
197
-
198
- - **Delta %**: `(delta / estimated) × 100` at 1 decimal place; `"N/A"` if estimated is 0
199
- - Sum all agents' tokens and costs; exclude `"N/A"` rows from sums
200
- - Cost: 2 decimal places for totals; 4 decimal places for per-row costs
201
- - The "Remediation" section contains a static note — leave it as-is
202
- - Wall-clock: convert `duration_ms` from am-phase1 `<usage>` to minutes/seconds
203
-
204
- ---
205
-
206
- ## Step 6 — Report to user
207
-
208
- After writing to the Token Estimate file, report:
209
-
210
- ```
211
- Assessment pipeline complete.
212
- Token estimate + actuals → {token_estimate_path}
213
- Approvals → {approvals_path}
214
- Process log → {output_dir}/{prefix}-process-log.txt
215
-
216
- {summary from am-phase2}
217
- ```
124
+ ## Step 5 — Report results
218
125
 
219
- If the Token Estimate file does not exist (am-phase1 failed before writing it):
220
- note this in the report but do not halt — the skill has completed its work.
126
+ Use the deterministic Token-Estimate and Effort-Estimate files returned by am-phase1, and the summary returned by am-phase2. Worker usage is in token_ledger; missing usage remains unavailable. Do not invent an orchestrator usage block or overwrite the host-generated metrics.
@@ -3,10 +3,10 @@ description: "Define Feature — reads existing repo context, then grills only o
3
3
  disable-model-invocation: true
4
4
  ---
5
5
 
6
- Spawn the `define-feature` agent, passing through whatever the user provided as a source reference (a backlog entry, ticket path, spec path, or free-text description). If the user gave nothing, pass an empty source.
6
+ Spawn the `gaia-define-feature` agent, passing through whatever the user provided as a source reference (a backlog entry, ticket path, spec path, or free-text description). If the user gave nothing, pass an empty source.
7
7
 
8
8
  ```
9
- subagent_type: define-feature
9
+ subagent_type: gaia-define-feature
10
10
  prompt: |
11
11
  Start the feature definition session.
12
12
  Source reference (may be empty): {{user arguments verbatim}}
@@ -37,7 +37,7 @@ Here's what I know and what's available for you:
37
37
  - `/feature-status`, `/check-docs`, `/next-task`, `/pr-description`
38
38
  - `/assessment-status`
39
39
 
40
- **Specialized agents** (spawnable): project-manager, developer-backend, developer-frontend, developer-testing, review-solution, assessment-manager, and more.
40
+ **Specialized agents** (spawnable): developer-backend, developer-frontend, developer-testing, review-solution, and more.
41
41
 
42
42
  Let me take a look at your workspace to understand the context…
43
43
 
@@ -5,25 +5,63 @@ argument-hint: <path-to-feature.md> [--force]
5
5
 
6
6
  # Implement Feature
7
7
 
8
- Orchestrates the full feature delivery pipeline by invoking three sequential workflow phases
9
- (`pm-phase1`, `pm-phase2`, `pm-phase3`), handling approval gates in the main loop between
10
- each phase, and recording the real token consumption at the end.
8
+ Runs documentation and work breakdown through the deterministic Node workflow host, then implementation through the FTR-018 task executor. Approval gates remain in the main loop.
11
9
 
12
- Each workflow phase runs as a real subagent boundary, ensuring worker agents are dispatched
13
- with their declared `model:` frontmatter honoured and producing accurate per-agent `usage` data.
10
+ Workflows are JavaScript assets, never agent types. Do not pass pm-phase1/2/3 or am-phase1/2 to agentType, subagent_type, or --agent. Use the workflow CLI below. Resolve the absolute Claude executable path as described in docs/task-executor-bootstrap.md.
11
+
12
+ ---
13
+
14
+ ## Step 0 — Agent Preflight (fail-closed, AC-19)
15
+
16
+ Before starting the pipeline, verify that every pipeline agent is installed and verified.
17
+
18
+ 1. **Derive the feature prefix** from the `<path-to-feature.md>` argument (e.g. path contains `FTR-017` → prefix = `FTR-017`). Derive the ledger directory as the directory containing the feature.md file.
19
+
20
+ 2. **Open the preflight ledger entry** (fail-closed — if this fails, do NOT proceed):
21
+ ```bash
22
+ ai-toolkit ledger open \
23
+ --prefix {PREFIX} \
24
+ --agent agent-preflight:implement-feature \
25
+ --phase phase3 \
26
+ --dir {LEDGER_DIR}
27
+ ```
28
+ If the command exits non-zero, **STOP IMMEDIATELY** — report the error and do not continue.
29
+
30
+ 3. **Run the preflight check:**
31
+ ```bash
32
+ ai-toolkit agents preflight --project . --pipeline implement-feature
33
+ ```
34
+
35
+ 4. **On success** (exit 0): close the ledger entry:
36
+ ```bash
37
+ ai-toolkit ledger close \
38
+ --prefix {PREFIX} \
39
+ --agent agent-preflight:implement-feature \
40
+ --dir {LEDGER_DIR}
41
+ ```
42
+ Then continue to Step 1.
43
+
44
+ 5. **On failure** (exit non-zero): mark the ledger entry failed and STOP:
45
+ ```bash
46
+ ai-toolkit ledger fail \
47
+ --prefix {PREFIX} \
48
+ --agent agent-preflight:implement-feature \
49
+ --error "agent preflight failed — one or more pipeline agents unverified" \
50
+ --dir {LEDGER_DIR}
51
+ ```
52
+ Report the preflight error to the user. Do NOT continue to Step 1.
14
53
 
15
54
  ---
16
55
 
17
56
  ## Step 1 — Invoke pm-phase1 (Documentation Phase)
18
57
 
19
- Invoke the `pm-phase1` workflow with the feature path:
58
+ Run directly via the shell tool:
20
59
 
21
- ```
22
- subagent_type: pm-phase1
23
- prompt: <path-to-feature.md>
60
+ ```bash
61
+ ai-toolkit workflow run pm-phase1 --project . --claude-path "{ABSOLUTE_CLAUDE_EXE}" -- "<path-to-feature.md>" [--force]
24
62
  ```
25
63
 
26
- Wait for the workflow to complete. Do NOT proceed until it returns.
64
+ The host verifies the installed workflow and each worker and owns all ledger transitions. Do not manually open/close its entries. Nonzero exit is a HARD STOP: do not present the next gate or report successful completion. Parse stdout as JSON only on exit 0. Never dispatch the workflow as a subagent.
27
65
 
28
66
  Extract from the result:
29
67
  - `prefix` — feature prefix (e.g. `FTR-009`)
@@ -93,14 +131,15 @@ If the file is missing or incomplete, write it again before proceeding.
93
131
 
94
132
  ## Step 3 — Invoke pm-phase2 (Work Breakdown Phase)
95
133
 
96
- Invoke the `pm-phase2` workflow:
134
+ Run directly via the shell tool:
97
135
 
98
- ```
99
- subagent_type: pm-phase2
100
- prompt: <path-to-feature.md>
136
+ ```bash
137
+ ai-toolkit workflow run pm-phase2 --project . --claude-path "{ABSOLUTE_CLAUDE_EXE}" -- "<path-to-feature.md>"
101
138
  ```
102
139
 
103
- Wait for the workflow to complete. Extract from the result:
140
+ The host verifies the installed workflow and each worker and owns all ledger transitions. Do not manually open/close its entries. Nonzero exit is a HARD STOP: do not present the next gate or report successful completion. Parse stdout as JSON only on exit 0. Never dispatch the workflow as a subagent.
141
+
142
+ Extract from the result:
104
143
  - `user_stories` — number of User Stories
105
144
  - `total_tasks` — total task count
106
145
  - `domain_breakdown` — tasks per domain
@@ -160,7 +199,7 @@ Read back `{PREFIX}-Approvals.md` and verify Gate 2 ✅ is present before contin
160
199
 
161
200
  ## Step 5 — Create feature branch
162
201
 
163
- Before invoking pm-phase3, create the feature branch:
202
+ Before launching the task executor, create the feature branch:
164
203
 
165
204
  ```bash
166
205
  git checkout -b feature/{PREFIX}-{short-slug}
@@ -174,40 +213,88 @@ git checkout feature/{PREFIX}-{short-slug}
174
213
 
175
214
  ---
176
215
 
177
- ## Step 6 — Invoke pm-phase3 (Implementation Phase)
216
+ ## Step 6 — Launch the task executor (Implementation Phase)
178
217
 
179
218
  Pre-condition check: read `{PREFIX}-Approvals.md` and verify BOTH Gate 1 ✅ and Gate 2 ✅.
180
219
  If either is missing, return to the missing gate.
181
220
 
182
- Invoke the `pm-phase3` workflow:
221
+ Implementation is no longer dispatched as a subagent from this skill. There is no
222
+ pm-phase3 workflow, no Tier-1 dispatch guard, and no `pm-phase3:dispatch` ledger entry for
223
+ this step — none of that applies once implementation runs as an external process instead of
224
+ an in-chat subagent. Once Gate 2 is approved, this skill's job is limited to presenting or
225
+ launching **one explicit `task-executor` start command**; the executor process itself then
226
+ owns the repo, plans, executes, checkpoints and resumes tasks deterministically, independent
227
+ of this chat.
183
228
 
229
+ **No subagent orchestrates the run, and no assistant or agent involvement is required for
230
+ each task transition once the run has started.** This is a deliberate behavioral change from
231
+ the retired pm-phase3 grouping model: previously an assistant-driven subagent had to be
232
+ present for the whole implementation phase; now a single durable command launch is enough,
233
+ and the run may keep going, checkpointing and resuming, even after this conversation ends.
234
+
235
+ ### Step 6a — Present or launch the executor start command
236
+
237
+ Build the start command:
238
+
239
+ ```bash
240
+ ai-toolkit executor start \
241
+ --project . \
242
+ --feature <path-to-feature.md> \
243
+ --max-concurrency 1 \
244
+ --claude-path <resolved-claude-cli-path> \
245
+ --task-timeout-ms <task-timeout-ms, e.g. 900000> \
246
+ --agent-budget-usd <per-agent budget in USD, e.g. 5.00>
184
247
  ```
185
- subagent_type: pm-phase3
186
- prompt: <path-to-feature.md> --branch feature/{PREFIX}-{short-slug}
187
- ```
188
248
 
189
- Wait for the workflow to complete. Capture its full result, including the `<usage>` block
190
- (format: `subagent_tokens: N`). Extract from the result:
191
- - `pr_url` — the created pull request URL
192
- - `token_ledger` — all per-agent token data from phase 3
193
- - `issues_summary` — escalation and issues counts
249
+ Placeholders:
250
+ - `<path-to-feature.md>` — the feature.md path passed to this skill
251
+ - `<resolved-claude-cli-path>` — the Claude CLI executable path on this host; ask the user if unknown
252
+ - `<task-timeout-ms>` and `<agent-budget-usd>` — must be supplied explicitly; there is no hidden default timeout or spend
253
+
254
+ **If the host's ordinary terminal capability can launch a durable external command**, launch
255
+ it directly through that capability so the process persists independently of this chat.
256
+
257
+ **If the host cannot launch a durable external command, show the exact command above for the
258
+ user to run themselves in a terminal.** Do not attempt to fake a durable launch by running it
259
+ as a blocking in-chat command — the run must be able to outlive this conversation.
260
+
261
+ In both cases, capture (or ask the user to report back) the `run-id` printed by `start` — it
262
+ is required for every subsequent `status`, `diagnose`, `stop`, `reconcile`, `resume`, and
263
+ `replan` call; there is no implicit last-run selection.
194
264
 
195
- If `issues_summary.escalations > 0`, report the escalation details to the user.
265
+ Tell the user that implementation has been launched and that progress and cost can be
266
+ checked at any time with:
267
+
268
+ ```bash
269
+ ai-toolkit executor status --run-id {run_id} --format json
270
+ ```
271
+
272
+ Do not block this skill on the run reaching a terminal state — proceed to Step 7 with
273
+ whatever the latest `status` reports at this point. No fallback to the retired pm-phase3
274
+ grouping model is permitted.
196
275
 
197
276
  ---
198
277
 
199
278
  ## Step 7 — Complete Token Estimate file
200
279
 
201
- From the `<usage>` block of the pm-phase3 result, read:
202
- - `subagent_tokens` — total tokens consumed by the pm-phase3 workflow
203
- - `duration_ms` — wall-clock duration of pm-phase3
280
+ Phases 1 and 2 return JSON token_ledger entries from measured worker subprocess usage. They do not return a workflow subagent usage block. Missing measurements stay unavailable. For phase 3 use the executor:
281
+
282
+ ```bash
283
+ ai-toolkit executor status --run-id {run_id} --format json
284
+ ```
285
+
286
+ Read the run's total actual tokens/cost and duration from that ledger-sourced summary. If the
287
+ run has not yet reached a terminal state (it may still be executing or may outlive this
288
+ chat), treat its actuals as **not yet available** for this pass — apply the same
289
+ null-compatibility rule below, and note in the file that the run is still in progress and the
290
+ row should be refreshed with a later `status` call.
204
291
 
205
- Read `{PREFIX}-Token-Estimate.md`. Append the orchestrator row and grand total:
292
+ Read `{PREFIX}-Token-Estimate.md`. Append the executor run row and grand total:
206
293
 
207
294
  > **Null-compatibility — actuals reading and cost calculation:** Treat a token value of `null`, `0`, or `not_available` as **data unavailable** — never as a real, observable zero consumption. Render unavailable values as `—` in the Actual tokens and Actual cost columns; exclude them from sums, averages, and grand totals. Preventing resume clobber and legacy misinterpretation requires that no unavailable measurement is coerced into a real zero.
208
295
 
209
296
  ```markdown
210
- | project-manager/pm-phase3 (orchestrator) | — | sonnet | 80,000 (estimated) | {subagent_tokens} (actual) | ±{delta} | {duration} |
297
+ | task-executor (run {run_id}) | — | — | 80,000 (estimated) | {ledger_actual_tokens} (actual) | ±{delta} | {ledger_duration} |
211
298
 
212
299
  ---
213
300
 
@@ -215,8 +302,8 @@ Read `{PREFIX}-Token-Estimate.md`. Append the orchestrator row and grand total:
215
302
 
216
303
  | Agent | Task / Scope | Model | Est. tokens | Actual tokens | Delta | Est. cost ($) | Actual cost ($) | Duration |
217
304
  |-------|-------------|-------|------------|---------------|-------|--------------|----------------|----------|
218
- {one row per entry in token_ledger — from phase 1, 2, and 3; for any entry where actual tokens is null, 0, or not_available show — in Actual tokens and Actual cost and exclude that row from totals}
219
- | project-manager/pm-phase3 (orchestrator) | — | sonnet | 80,000 | {subagent_tokens} | ±{delta} | $0.4320 | ${actual_cost} | {duration} |
305
+ {one row per entry in token_ledger from phase 1 and 2, plus per-task ledger entries recorded by the executor run for phase 3; for any entry where actual tokens is null, 0, or not_available show — in Actual tokens and Actual cost and exclude that row from totals}
306
+ | task-executor (run {run_id}) | — | — | 80,000 | {ledger_actual_tokens} | ±{delta} | $0.4320 | ${ledger_actual_cost} | {ledger_duration} |
220
307
 
221
308
  ## Estimation accuracy by agent type
222
309
 
@@ -234,9 +321,9 @@ Read `{PREFIX}-Token-Estimate.md`. Append the orchestrator row and grand total:
234
321
  ```
235
322
 
236
323
  > Per-agent values marked *(proportional)* are estimated distributions of the phase total.
237
- > Phase totals and grand total are exact measurements from workflow subagent_tokens.
324
+ > Phase 1/2 actuals come from worker usage in token_ledger; implementation actuals come from the task executor ledger. Missing measurements remain unavailable.
238
325
 
239
- If the Token Estimate file does not exist (pm-phase3 failed before writing it), create it
326
+ If the Token Estimate file does not exist (a prior phase failed before writing it), create it
240
327
  from scratch using the data available in the token_ledger.
241
328
 
242
329
  ---
@@ -246,8 +333,14 @@ from scratch using the data available in the token_ledger.
246
333
  After writing the token file, report:
247
334
 
248
335
  ```
249
- Feature pipeline complete.
336
+ Feature pipeline complete through implementation launch.
250
337
  Token estimate + actuals → {PREFIX}-Token-Estimate.md
251
338
  Effort estimate + actuals → {PREFIX}-Effort-Estimate.md
252
- Pull Request → {pr_url}
339
+ Implementation run → run-id {run_id} (check with `ai-toolkit executor status --run-id {run_id}`)
253
340
  ```
341
+
342
+ Unlike the retired pm-phase3 model, this skill does not itself produce a pull request: the
343
+ executor's scope is task execution, checkpointing and branch integration, not PR creation.
344
+ Once `executor status` reports the run has reached a terminal, fully-integrated state, open
345
+ the pull request the same way you would for any other finished branch (e.g. `gh pr create`,
346
+ or the toolkit's own `/pr-description` skill).
@@ -4,10 +4,10 @@ argument-hint: "[path-to-project-root]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- Spawn the `init-agents-md` agent with the arguments provided by the user:
7
+ Spawn the `gaia-init-agents-md` agent with the arguments provided by the user:
8
8
 
9
9
  ```
10
- subagent_type: init-agents-md
10
+ subagent_type: gaia-init-agents-md
11
11
  prompt: [path-to-project-root]
12
12
  ```
13
13
 
@@ -4,10 +4,10 @@ argument-hint: "[path-to-destination] [--force]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- Spawn the `install-toolkit` agent with the arguments provided by the user:
7
+ Spawn the `gaia-install-toolkit` agent with the arguments provided by the user:
8
8
 
9
9
  ```
10
- subagent_type: install-toolkit
10
+ subagent_type: gaia-install-toolkit
11
11
  prompt: <path-to-destination> [--force]
12
12
  ```
13
13