@babylonjs-toolkit/agent 1.2.1 → 1.2.3

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.
@@ -5,7 +5,7 @@
5
5
  | File | Holds | Written |
6
6
  |---|---|---|
7
7
  | `<slug>_dashboard.js` | the feature's record — status, phases, tasks and their results, decisions, snapshots, the After Action Report | bt-spec creates it from `dashboard.template.js` (`specified`), bt-plan fills in the plan (`planned`), bt-execute writes it at every task boundary; a Quick Plan creates it at bt-plan |
8
- | `<slug>_live.js` | what is happening this minute — the current task, one sentence, its step log | at every meaningful step of a run (from `live.template.js`) |
8
+ | `<slug>_live.js` | what is happening this minute — the current task, one sentence, its step log | by bt-execute's helper, never by an agent: every `dashboard.mjs task` write that changes a task's status, and every `status` write (bt-plan creates it from `live.template.js`) |
9
9
 
10
10
  They are **data, not code.** Each file is exactly one line of prefix and one strict-JSON value:
11
11
 
@@ -21,9 +21,11 @@ The status of the plan itself lives in the plan file's checkboxes; the dashboard
21
21
 
22
22
  ## Updating a data file
23
23
 
24
- Use bt-execute's helper — `node <skills>/bt-execute/scripts/dashboard.mjs live|task|activity|status|check|watch <feature-folder> …`
25
- (every option is in its header). It parses, checks field shapes and writes atomically. Its `watch` command is the
26
- watchdog that writes a heartbeat into the live file when an agent has been quiet for 10 minutes.
24
+ Use bt-execute's helper — `node <skills>/bt-execute/scripts/dashboard.mjs task|snapshot|activity|status|check <feature-folder> …`
25
+ (every option is in its header). It parses, checks field shapes and writes atomically. Its `task` and `status`
26
+ commands also rewrite the live file, so agents never write it. `live` remains for a hand write, and `watch` is an
27
+ optional watchdog for manual use (a heartbeat into the live file when nothing has been written for 10 minutes) —
28
+ no skill launches it.
27
29
 
28
30
  ### Fallback — parse, change, write back
29
31
 
@@ -79,9 +81,13 @@ instead of a blank page if something still cannot render — it keeps checking a
79
81
  - The status picks the page's top slot: `specified` shows *Plan this feature* (the `bt-plan` commands to copy, and a builder for its options and a brief); `planned` shows *Start this plan* (the `bt-execute` commands, and a builder for any task range and its options); `in-progress` shows *Current run activity* (the live file and the
80
82
  milestones); `paused`, `complete` and `incomplete` show *Execution debrief* (the After Action Report card, marked
81
83
  *Interim* while paused), with *Continue this plan* — the commands that pick up where it stopped — above it.
82
- - **Cadence is per task.** A task's entry changes the moment it starts (`in-progress`), the moment it is built
83
- (`built` — summary, files, tests and snapshots filled in right then), while the verifier checks it
84
- (`verifying`) and when it passes (`done` — verifier, done time).
84
+ - **Cadence is per task — three writes**, each with `dashboard.mjs task`: when it starts (`in-progress`), the moment
85
+ it is built (`built` — summary, files and tests filled in right then, after its frames were added with
86
+ `dashboard.mjs snapshot`) and when it passes (`done` — verifier, attempts, done time, `checkedLive`). The verifier
87
+ adds `verifying` while it checks; a FAIL sends the task back to `in-progress` with `attempts` + 1. Each status write
88
+ also updates the live file. A move to `built`, `verifying` or `done` is refused while a `snapshots/T<n>-…` frame of
89
+ that task is on no dashboard entry, and a visual task's move to `built` is refused with no snapshot at all unless
90
+ `--no-frame "<why>"` says it has nothing to show yet.
85
91
 
86
92
  ## `<slug>_dashboard.js` fields
87
93
 
@@ -112,7 +118,7 @@ Top level:
112
118
  | `headline` | one sentence: what the plan delivered |
113
119
  | `body` | 2–4 paragraphs: what was built, how it was proven, what surprised |
114
120
  | `highlights` | the results worth remembering |
115
- | `comparison` | ONE before/after for the plan as a whole — "before" captured before T1 started, "after" at the end, from the same camera or viewport: `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" } }`; `null` when the plan has nothing to see |
121
+ | `comparison` | ONE before/after for the plan as a whole — "before" captured before T1 started, "after" at the end, from the same camera or viewport: `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" } }`, written with `dashboard.mjs snapshot <feature-folder> comparison --before snapshots/plan-before.png --after snapshots/plan-after.png --caption "…"`; `null` when the plan has nothing to see |
116
122
  | `snapshots` | optional: the plan's key progression, or the end-to-end proof |
117
123
  | `testing` | how the plan was tested — every run, not only `--verbose` (below) |
118
124
  | `sections` | `--verbose` only: `[{ "title", "body": [paragraphs], "items": [bullets] }]`, in this order where they apply — Architecture · Phase by phase · Problems and resolutions · Deviations from the plan · Known limitations · Lessons learned · Estimate vs actual · Recommended next steps |
@@ -178,7 +184,7 @@ Each task:
178
184
 
179
185
  ## Snapshot shapes
180
186
 
181
- **Add snapshots with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T3|P1|plan> --src snapshots/… --caption "…"`** (`--before`/`--after` for a comparison, `--frame "src|stage|caption"` repeated for a progression) — never by writing the JSON yourself. The image key is **`src`**, relative to the feature folder; an entry with `path` (or `file`, `image`, `url`, `href`) instead would render as "No snapshot", so every helper write repairs it to `src` (and an unknown `source` to `"browser"`), `check` repairs any already in the file, the watchdog repairs one written around the helper within a minute, and the page reads those keys too. An image that is not on disk is refused — `check` fails on it. **The snapshots are the chronicle of the build: `check` passing is part of every phase boundary and of run end.**
187
+ **Add snapshots with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T3|P1|plan> --src snapshots/… --caption "…"`** (`--before`/`--after` for a comparison, `--frame "src|stage|caption"` repeated for a progression) — never by writing the JSON yourself. The image key is **`src`**, relative to the feature folder; an entry with `path` (or `file`, `image`, `url`, `href`) instead would render as "No snapshot", so every helper write repairs it to `src` (and an unknown `source` to `"browser"`), `check` repairs any already in the file, and the page reads those keys too. An image that is not on disk is refused — `check` fails on it. **The snapshots are the chronicle of the build — they tell the story of how the plan came together: `check` passing is part of every phase boundary and of run end.** Every visual task (`kind` `live`, `game` or `unity`) leaves a progression from one camera as it is built — a before frame, a frame per meaningful layer, the built frame (the builder, added before its `built` write) and the verified frames (the verifier), usually 3–8 in all — plus any comparison or angle that proves the point; a task with nothing to see needs none. The plan as a whole gets `snapshots/plan-before.png` before T1 and one plan-wide before/after (target `comparison`) at run end. Frames come from the sessions and exports the work already runs, never an extra page session or re-export just for a picture; inside an open session a capture costs seconds, so take it. Who takes which frame: bt-execute's *Snapshots tell the story*.
182
188
 
183
189
  Any list of snapshots may mix them. `source` names where the image came from: `"browser"`, `"unity"`,
184
190
  `"blender"`, `"reference"`.
@@ -191,11 +197,13 @@ Any list of snapshots may mix them. `source` names where the image came from: `"
191
197
 
192
198
  ## `<slug>_live.js` fields
193
199
 
194
- "What are you doing right now?" — answered on the page without asking. Whoever is doing the work rewrites
195
- this file whole: the implementer while it builds, the verifier while it checks, the orchestrator between them —
196
- at every meaningful step (starting a task, each milestone inside it, before a build / export / bake / capture /
197
- test run, a fix attempt, the hand-over to the verifier, the phase closing). A 20-minute silence shows as a warning.
198
- The page shows it only while `status` is `in-progress`.
200
+ "What are you doing right now?" — answered on the page without asking. bt-execute's helper rewrites this file
201
+ whole from each change it makes: a `task` write that sets a status names the task, its phase, the role the status
202
+ implies (`in-progress` / `built` → implementer, `verifying` → verifier, otherwise orchestrator), one sentence on the
203
+ new state plus the first sentence of the summary written with it, and appends that sentence to the task's step log;
204
+ a `status` write records the run starting or ending. A `task` write without a status leaves it untouched, and
205
+ agents never write it. A 20-minute silence shows as a warning. The page shows it only while `status` is
206
+ `in-progress`.
199
207
 
200
208
  | Field | Meaning |
201
209
  |---|---|
@@ -205,5 +213,24 @@ The page shows it only while `status` is `in-progress`.
205
213
  | `title` | only when there is no task: `"Verifying phase 1"`, `"Closing phase 1"` |
206
214
  | `role` | `implementer` · `verifier` · `orchestrator` |
207
215
  | `activity` | one plain-language sentence on what is happening this minute |
208
- | `source` | `agent` (an agent wrote it) or `watchdog` (a heartbeat written because the agent was quiet — the page tags it) |
209
- | `steps` | `[{ "at": "HH:MM", "text" }]` — the current task's log, oldest first; start fresh for each task, keep the last 12. Plain language a non-developer follows: "Painting the road mask from the spline", not "edit RoadNetwork.ts L120" |
216
+ | `source` | `agent` (the helper, from an agent's write) or `watchdog` (a heartbeat from the manual watchdog — the page tags it) |
217
+ | `steps` | `[{ "at": "HH:MM", "text" }]` — the current task's log, oldest first; fresh for each task, the last 12 kept. Plain language a non-developer follows, which is why a task's `summary` leads with a plain first sentence |
218
+
219
+ ## `check` — the gate
220
+
221
+ `node <skills>/bt-execute/scripts/dashboard.mjs check <feature-folder>` runs at every phase boundary, at run end and
222
+ as bt-plan's last step. It repairs the slips it can (snapshot image keys, plain-text decisions), then fails — listing
223
+ every problem in one message — when a snapshot cannot show its image or a deliverable was skipped:
224
+
225
+ - `documents/<slug>_plan.md` exists without `dashboard.html`, `documents/<slug>_dashboard.js` or `documents/<slug>_live.js`;
226
+ - the dashboard's task ids differ from the plan's checklist (`- [ ]` / `- [x]` lines that start with a task id) in
227
+ membership or order;
228
+ - `status` is `complete` while the plan has an unticked box, or without `documents/<slug>_summary.html`;
229
+ - a visual task (`kind` `live`, `game` or `unity`) is `done` with no snapshot of its own and no phase or After Action
230
+ Report progression frame whose `task` is its id;
231
+ - frames were left behind in `snapshots/`: a `T<n>-…` image of a `built`, `verifying` or `done` task, a `P<N>-…` image
232
+ of a closed phase (`done`, `partial`, `deferred`) or — once the run has ended (`paused`, `complete`, `incomplete`) —
233
+ a `plan-before` image, that no dashboard entry shows. Fix it by adding the frames, never by moving or deleting them;
234
+ - a task ticked in the plan has no `verifier` result.
235
+
236
+ With no plan in the folder (a legacy flat plan) the plan checks are skipped.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: bt-plan
3
3
  description: "The Babylon Toolkit Plan Skill creates the detailed technical plan for the specified feature spec file. Use when asked to plan or produce implementation tasks for an existing spec. Also supports a Quick Plan mode: when given only a brief (no spec file), it interviews the user to build a mini-spec and plans from that. Add `--heavy` for Heavy Plan mode: a decision-complete plan (numbered Decisions log, Design Reference with real interfaces and patterns, self-contained task blocks, cold-context audit) that keeps a long run of fresh-context tasks cohesive. Add `--parity` for numeric parity gates instead of the default functional proof. Always planning-only — it writes the plan file into the feature's folder (`.agents/specs/<slug>/`, which a Quick Plan creates) plus the feature's live dashboard in its planned state, and stops; execution is the separate bt-execute skill."
4
- allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Agent, Task
4
+ allowed-tools: Read, Grep, Glob, Write, Bash(node:*), Bash(date:*), WebFetch(domain:raw.githubusercontent.com), Agent, Task
5
5
  ---
6
6
 
7
7
  Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ordered checklist of tasks that `bt-execute` runs — plus the feature's dashboard (`.agents/specs/<slug>/dashboard.html`) in its planned state, which bt-execute keeps current — live activity while a run is going, an After Action Report once it is over. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
@@ -22,10 +22,10 @@ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ord
22
22
  ## Ground rules
23
23
 
24
24
  - **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — research only what the plan needs, keep subagents few and their questions narrow, and do not re-read what you already have. Begin every subagent prompt with `TIME MATTERS.` Print `⏱️ [bt-plan] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-plan] No time limit`, and do not add it). Speed never skips a required step, the Heavy Plan cold-context audit, or anything the plan needs to be complete.
25
- - **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder, plus the one `.gitignore` line Step 4 names. Never implement a task, edit source, or run builds/tests — not even a trivial first task. Writing the plan is the last action; the user runs `bt-execute` separately.
25
+ - **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder, plus the one `.gitignore` line Step 4 names; the only commands you run are the shell clock and Step 4's dashboard check. Never implement a task, edit source, or run builds/tests — not even a trivial first task. The passing check is the last action; the user runs `bt-execute` separately.
26
26
  - **Babylon work:** if you have not read the Babylon Toolkit Agent Reference in this session, read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — the authority for conventions and API; read sub-documents only when relevant, and again only if a context compaction made you forget it. If it cannot be read, stop and tell the user — do not guess at the API.
27
27
  - **Say what you are doing.** Before any step that takes more than a few seconds print one short line — `🔎 [bt-plan] <what> …` — and one when it returns; one line per subagent going out and coming back. A silent run looks like a hang and gets cancelled.
28
- - **Subagents:** running this skill is the user's request to use them where it says so. Use whatever subagent tool your host provides (its name varies by host — e.g. `Agent` or `Task`); if there is none, work inline and say so. Tell exploration subagents they need not read the Agent Reference.
28
+ - **Subagents:** running this skill is the user's request to use them where it says so. Use whatever subagent tool your host provides (e.g. `Agent` or `Task`); if there is none, work inline and say so. Tell exploration subagents they need not read the Agent Reference.
29
29
 
30
30
  ## Step 1. Analyze (required before writing)
31
31
 
@@ -44,15 +44,17 @@ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ord
44
44
  Execution time is mostly *how the work is proven*, not the code. Keep proof strong and cheap:
45
45
 
46
46
  1. **Tasks are real units of work** — something a developer would commit on its own, with its tests. Guide: `small` 1–3 tasks, `medium` 3–8, `large` as needed. Merge tasks that touch the same code for the same purpose; split only when a task would not fit in one sitting. Going well past the guide needs a one-line reason in Codebase Analysis.
47
- 2. **Phases.** Group tasks under `### Phase N — <name>`. bt-execute runs one independent verifier per phase. Small plan = one phase; otherwise 2–4 related tasks ending at a natural checkpoint.
48
- 3. **`Verify level`** per task: `standard` (build, named tests, diff review) or `live` (needs the dev server, a browser, Unity or Blender to observe). Mark `live` whenever correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity. The last feature task carries one `live` end-to-end check of the whole feature when it has anything on screen — write it into that task's Acceptance, not as a separate task; a read-and-confirm check likewise belongs in the Acceptance of the task that made the change. bt-execute's verifier performs the live checks, and does all of a phase's live tasks in **one** session. So mark as many tasks `live` as truly need it, but never schedule a capture, screenshot or page session **per task** in the Steps — the phase gets one session covering all of them, and any second engine or full-resolution pass happens once, in the final end-to-end task. A plan with more planned looks than phases is the single most expensive mistake this skill can make. If a live check may be impossible where the plan runs (needs credentials, data or hardware), say in the task what to report instead.
49
- 4. **Named tests** with expected outcomes for every task that has a testable surface, in test files under the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder). No probe suites, fuzzing or mutation testing unless the risk calls for it.
50
- 5. **Functional proof by default:** unit tests; for anything on screen, one look per visual phase — the running result in the browser, judged against the spec and DESIGN.md, or beside a reference image when one exists (a mockup, the original site, the Unity view) — on one browser/engine at reduced resolution, with any second engine checked once in the final end-to-end task; cheap value fixtures sampled once from a reference implementation where there is one. Keep Acceptance to what a user of the feature would notice. **Numeric parity gates** (pixel thresholds, repeats, several engines) only under `--parity` / `proof: parity` or when the brief states a number — and then planned to run once per phase (iteration inside the phase uses the quick look), never loosened.
51
- 6. **Proportional safety.** When the spec requires a safety outcome (nothing unfinished reaches the user's folders, the app keeps working between tasks), pick the cheapest mechanism that achieves it — normally a build output the user's folders do not read, and one copy across at the end after the live check — never a branch or a commit (the user owns git; they create branches and commit when they choose). Add staged promotions, per-step archives or hash records only if the brief asks for them by name.
52
- 7. **Minimal exports.** A task's Steps re-export only the Unity project the task tests and only the scenes it works on, and only when the change alters that scene's export. Never write "re-export every scene" or "re-export all projects" for consistency — other scenes pick the change up at their next natural export. Name the scenes explicitly.
53
- 8. **No ceremony.** No standalone "verification sweep / open the review / final check" tasks, and no ledgers, md5 or environment records, archives, checked-in capture trees, standing evidence suites, doc-integrity registration or staged promotions — unless the brief asks.
54
- 9. **No brittle pins.** Never pin counts later tasks will change (tests passed, suite sizes, hashes). Say "the named tests pass, no new failures versus the baseline".
55
- 10. **Plan code follows the Agent Reference's Coding Practices — ENFORCED.** Every snippet, signature, interface, class, method, property, variable, constant and file name the plan writes or decides is clean, professional TypeScript or JavaScript in the language the project uses (never switched unasked), with meaningful full-word names (never one- or two-letter names, cryptic abbreviations or code-golf tricks), well structured, readable and maintainable by human developers, and carries meaningful JSDoc on every class, function, method, interface and public member it defines. JSDoc is always written but never a gate: never write an Acceptance item, Test or Verify step that fails on missing JSDoc. The executor copies plan code word for word, so a badly named snippet ships badly named. Names that bind to exported data (component properties, serialized fields, Unity property names) keep the source's names. Plan UI code also follows **Game UI Performance — ENFORCED**: every HUD value the plan introduces is classified as *state* (React, set on events) or *telemetry* (refs and one frame loop, never React state or a per-frame EventBus message), and the plan's snippets show telemetry that way. Every UI element also gets the cheapest cadence in `ui-design-system.md` › **Per frame or not** — events for state, CSS for decorative motion, the frame loop only for telemetry, throttled readouts, nothing while hidden — and no plan snippet puts a frame loop on a menu, splash, preloader or landing page (a real-time hero excepted, paused off-screen and at rest). Code-quality checks are never a separate task; bt-execute's verifier enforces them on every task.
47
+ 2. **Phases.** Group tasks under `### Phase N — <name>`. bt-execute runs one independent verifier per phase, once all its tracks are built. Small plan = one phase; otherwise 2–4 related tasks ending at a natural checkpoint. **A plan of 3 tasks or fewer runs inline**, and says so (Step 3).
48
+ 3. **Tracks — parallel builders that never conflict.** Every task has a `Track:` letter; bt-execute runs one builder per track at the same time, each owning its track's files (Step 3 lists them). Tasks whose files overlap share a track; tasks that depend on each other share a track or sit in different phases. Within a phase, tasks are numbered in track order. A file two tracks need — a route table, `package.json`, a lockfile, a shared stylesheet, a test list — belongs to exactly one track, or to a short closing integration step the orchestrator runs after the tracks. Dependency changes (`npm install`) go to one track, before the others start, or to the integration step. Unity (or Blender) work for one project stays on one track — Unity holds one editor per project.
49
+ 4. **`Verify level`** per task: `standard` (build, named tests, diff review) or `live` (needs the dev server, a browser, Unity or Blender to observe). Mark `live` whenever correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity. If a live check may be impossible where the plan runs (needs credentials, data or hardware), say in the task what to report instead.
50
+ 5. **Verification — complete, never duplicated.** Acceptance names **every** requirement a user of the feature would notice, each **once**, as a checkable statement — no line cap. No Acceptance line repeats a check another task already proves; a read-and-confirm check belongs to the task that made the change. bt-execute's builder never re-proves the Acceptance live — the phase verifier is the only live checker. Every task keeps its own checks for what it changed, in its own phase, never deferred to a later one. A check that needs a costly session (several browser pages, a long play-through, a Unity re-export, a second engine) is planned **once per phase**: one session proves every task in that phase that needs it, and the tracks section says which. Never schedule a capture or page session **per task** in the Steps — the most expensive mistake this skill can make. The last feature task keeps a `live` end-to-end check of the whole feature when it has anything on screen, in its Acceptance (not a separate task) — in addition to the per-task checks, never instead.
51
+ 6. **Named tests** with expected outcomes for every task that has a testable surface, in test files under the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder). No probe suites, fuzzing or mutation testing unless the risk calls for it.
52
+ 7. **Functional proof by default:** unit tests; for anything on screen, a look in the phase's shared session — the running result in the browser, judged against the spec and DESIGN.md, or beside a reference image when one exists (a mockup, the original site, the Unity view) — on one browser/engine at reduced resolution unless a requirement names another; cheap value fixtures sampled once from a reference implementation where there is one. **Numeric parity gates** (pixel thresholds, repeats, several engines) only under `--parity` / `proof: parity` or when the brief states a number — and then planned to run once per phase (iteration inside the phase uses the quick look), never loosened.
53
+ 8. **Proportional safety.** When the spec requires a safety outcome (nothing unfinished reaches the user's folders, the app keeps working between tasks), pick the cheapest mechanism that achieves it — normally a build output the user's folders do not read, and one copy across at the end after the live check — never a branch or a commit (the user owns git). Add staged promotions, per-step archives or hash records only if the brief asks for them by name.
54
+ 9. **Minimal exports.** A task's Steps re-export only the Unity project the task tests and only the scenes it works on, and only when the change alters that scene's export. Never write "re-export every scene" or "re-export all projects" for consistency — other scenes pick the change up at their next natural export. Name the scenes explicitly.
55
+ 10. **No ceremony.** No standalone "verification sweep / open the review / final check" tasks, and no ledgers, md5 or environment records, archives, checked-in capture trees, standing evidence suites, doc-integrity registration or staged promotions — unless the brief asks.
56
+ 11. **No brittle pins.** Never pin counts later tasks will change (tests passed, suite sizes, hashes). Say "the named tests pass, no new failures versus the baseline".
57
+ 12. **Plan code follows the Agent Reference's Coding Practices — ENFORCED.** Every snippet, signature, interface, class, member, constant and file name the plan writes is clean, professional TypeScript or JavaScript in the project's language (never switched unasked), with meaningful full-word names (no one- or two-letter names, cryptic abbreviations or code-golf tricks), well structured, readable and maintainable by human developers, with meaningful JSDoc on every class, function, method, interface and public member. JSDoc is never a gate: no Acceptance item, Test or Verify step fails on missing JSDoc. The executor copies plan code word for word, so a badly named snippet ships badly named. Names that bind to exported data (component properties, serialized fields, Unity property names) keep the source's names. Plan UI code also follows **Game UI Performance — ENFORCED**: every HUD value is classified as *state* (React, set on events) or *telemetry* (refs and one frame loop, never React state or a per-frame EventBus message), and the snippets show telemetry that way. Every UI element gets the cheapest cadence in `ui-design-system.md` › **Per frame or not** — events for state, CSS for decorative motion, the frame loop only for telemetry, throttled readouts, nothing while hidden — and no snippet puts a frame loop on a menu, splash, preloader or landing page (a real-time hero excepted, paused off-screen and at rest). Code-quality checks are never a separate task; bt-execute's verifier enforces them on every task.
56
58
 
57
59
  ## Step 3. Write the plan
58
60
 
@@ -66,10 +68,11 @@ Print `✍️ [bt-plan] Writing .agents/specs/<slug>/documents/<slug>_plan.md
66
68
  ### Phase 1 — <name>
67
69
 
68
70
  - [ ] **T1** — <short imperative title>
71
+ - Track: A
69
72
  - Files: `path/one` (create), `path/two` (modify)
70
73
  - Details: <what to do>
71
74
  - Tests: `.agents/specs/<slug>/tests/<test file>` — `<case>` → <expected outcome>; … (or "no testable surface — <why>")
72
- - Acceptance: <observable, checkable statements>
75
+ - Acceptance: <every requirement this task delivers, each once, as an observable, checkable statement>
73
76
  - Verify level: standard
74
77
  ```
75
78
 
@@ -77,59 +80,44 @@ Print `✍️ [bt-plan] Writing .agents/specs/<slug>/documents/<slug>_plan.md
77
80
 
78
81
  ```markdown
79
82
  - [ ] **T<n>** — Update SPEC.md to match what was built
83
+ - Track: integration (after every track of its phase is built)
80
84
  - Files: `SPEC.md`
81
85
  - Details: Update the sections named in the spec's Project Spec Alignment, following SPEC.md's "How to update this spec" (replace/merge current-state sections; append Decisions). Record the product only — never verification procedure, tool lists, ledgers or gates.
82
86
  - Acceptance: SPEC.md matches what the tasks above shipped; new dependencies listed; nothing contradicts the code.
83
87
  - Verify level: standard
84
88
  ```
85
89
 
86
- **`## Estimated execution time`** — **agent time, from the calibration below — never developer-hours, and never by adding up activities.** Builds, exports, captures and browser looks are *not* separate line items: they happen inside a task's own run and are already inside the per-task rate. Counting them separately is how a 10-hour plan gets estimated at 45 hours.
90
+ **`### Tracks and owned files`** — closes `## Tasks`. Per phase: each track's tasks and owned files; who owns each shared file (a track, or the integration step); which track installs dependencies or drives each Unity project; each shared costly session and the tasks it proves:
91
+
92
+ ```markdown
93
+ - Phase 1 — **A (T1, T2):** `path/one`, `path/two` · **B (T3):** `path/three` · integration (orchestrator, after the tracks): `package.json` · shared session: one browser session proves T2 and T3.
94
+ ```
95
+
96
+ A plan of 3 tasks or fewer writes instead: `Runs inline — bt-execute builds these tasks itself and runs one independent verifier at the end.`
97
+
98
+ **`## Estimated execution time`** — **agent time, from the calibration below — never developer-hours, and never by adding up activities.** Builds, exports, captures and browser looks are *not* separate line items: they happen inside a task's run and its rate. Counting them separately is how a 10-hour plan gets estimated at 45 hours.
87
99
 
88
100
  Rate each task by the **kind of work it does** (classify tasks, not the plan — most plans mix kinds), sum, then give a range of **−35 % / +50 %**. Nothing else is added — no per-phase overhead (it did not show up in the measurements):
89
101
 
90
- | Kind | min/task | What puts a task here |
102
+ | Kind | min/task (provisional) | What puts a task here |
91
103
  | --- | --- | --- |
92
- | **Code** | 6 | Code + tests, at most a quick browser look or one small scripted export. |
93
- | **Live** | 16 | Proven by running it: live external APIs, a page or scene loaded and probed in a browser, live memory or perf runs in one engine, a visual match to a reference image. |
94
- | **Game** | 40 | Proven by **playing the running game**: races, laps or levels driven through scenarios, a two-page network session, reproducing an intermittent in-game bug, tuning feel or sound by eye and ear. |
95
- | **Unity / parity / GPU** | 35 | Authoring or re-exporting Unity content, measured parity against Unity Play mode, GPU shader backends, perf A/B across beds, exporter DLL + runtime changed together. |
96
-
97
- - **Live or Game?** Loading a scene and reading values from it is Live. Playing it until something happens is Game. Game work ran 1.2–2.8× its estimate when it was rated Live, because every scenario is a real-time play session and a bug that only shows on lap three costs three laps each time it is checked.
98
- - **Do not budget fix rounds.** They are inside the rates: about one task in four needed a second attempt in both calibrations, and every one of those is already in the numbers. Defensively budgeting rounds per phase was the single largest source of over-estimation in the first calibration.
99
- - **Do not add a further margin.** The range is the margin. Do not discount for parallel phases either — the rates are wall-clock with bt-execute's usual parallelism.
100
- - **Outsized work is 2× the task's own kind rate**, never a flat figure. A task that ports a whole engine subsystem rated as Code is 12 min, not the Unity rate doubled (babylon-toolkit-networking rated its nine engine-scale code tasks at a flat 72 min each, estimated 15.7 h and ran 6.4 h). A task that builds a compiler or transpiler, or must prove coverage across many Unity sample projects, is 2× Unity (shadergraph-transpiler-complete-coverage: 72 min/task). Multiply by ~2 for `proof: parity` only if the plan really carries numeric gates, and by ~2–3 for `bt-execute --strict` (neither measured yet).
104
+ | **Code** | 5 | Code + tests, at most a quick browser look or one small scripted export. |
105
+ | **Live** | 10 | Proven by running it: live external APIs, a page or scene loaded and probed in a browser, live memory or perf runs in one engine, a visual match to a reference image. |
106
+ | **Game** | 25 | Proven by **playing the running game**: races, laps or levels driven through scenarios, a two-page network session, reproducing an intermittent in-game bug, tuning feel or sound by eye and ear. |
107
+ | **Unity / parity / GPU** | 25 | Authoring or re-exporting Unity content, measured parity against Unity Play mode, GPU shader backends, perf A/B across beds, exporter DLL + runtime changed together. |
108
+
109
+ - **Live or Game?** Loading a scene and reading values from it is Live. Playing it until something happens is Game. Game work ran 1.2–2.8× its estimate when rated Live: every scenario is a real-time play session, and a bug that shows on lap three costs three laps per check.
110
+ - **Do not budget fix rounds.** They are inside the rates (about one task in four needed a second attempt); budgeting rounds per phase was the largest source of over-estimation in the first calibration.
111
+ - **Do not add a further margin.** The range is the margin. Do not discount for parallel phases or tracks either — the rates are wall-clock with bt-execute's usual parallelism.
112
+ - **Outsized work is 2× the task's own kind rate**, never a flat figure. A task that ports a whole engine subsystem rated as Code is 10 min, not the Unity rate doubled. A task that builds a compiler or transpiler, or must prove coverage across many Unity sample projects, is 2× Unity (shadergraph-transpiler-complete-coverage ran 72 min/task on the earlier loop). Multiply by ~2 for `proof: parity` only if the plan really carries numeric gates, and by ~2–3 for `bt-execute --strict` (neither measured yet).
101
113
  - **Unity frame-matching runs long.** A task proven by matching Unity frame by frame (animation feel, foot IK, landing poses) is where Unity tasks overran most (starter-assets-third-person: 2.4×). Name it as the biggest uncertainty.
102
- - **The estimate covers the plan as written.** Tasks added mid-run cost far more than planned ones — unity-terrain-system-parity's 17 planned tasks took about 6 h, the 9 added during the run about 21 h; mario-kart-port grew from 22 to 42 tasks. Say so in the biggest-uncertainty line when the scope is still moving. Tasks added after a plan is complete get their own estimate at these rates.
103
-
104
- **Calibration (third, 2026-10-19; 40 runs).** 19 new bt-execute runs (Runtime, 2026-10-07 → 10-19, 190 tasks) measured from their `⏱` lines, active time only, with waits on the user excluded, fitted per task kind together with the 21 runs of the 2026-10-07 calibration. Each new run's actual ÷ estimate at these rates:
105
-
106
- | Run | Mix (tasks by kind, outsized counted 2×) | Active | ÷ estimate |
107
- | --- | --- | --- | --- |
108
- | ugui-animation-parity | code 4 · Unity 5 | 80 min | 0.40 |
109
- | draco-mesh-compression | code 3 · Unity 4 | 90 min | 0.57 |
110
- | light-probe-network-toggle | code 5 · live 1 | 29 min | 0.63 |
111
- | mario-kart-audio-parity | code 2 · game 4 | 112 min | 0.65 |
112
- | navigation-areas-costs | code 9 · live 1 · Unity 2 | 92 min | 0.66 |
113
- | lens-flares-all-pipelines | code 2 · live 3 · Unity 6 | 204 min | 0.76 |
114
- | prewarm-behind-splash | code 3 · live 5 · GPU 1 | 103 min | 0.77 |
115
- | unity-timeline-playback | code 5 · Unity 6 | 186 min | 0.78 |
116
- | babylon-game-server | code 8 · live 8 | 157 min | 0.89 |
117
- | mario-kart-leftover-particles | game 5 | 189 min | 0.94 |
118
- | babylon-toolkit-networking | code 20 · Unity 8 | 385 min | 0.96 |
119
- | mario-kart-drift-vfx-parity | Unity 2 · game 1 | 107 min | 0.97 |
120
- | cinemachine-port | code 10 · Unity 14 | 560 min | 1.02 |
121
- | vfx-graph-port | code 10 · Unity 7 | 310 min | 1.02 |
122
- | unity-animator-port (run 1) | code 7 · live 3 · Unity 9 | 455 min | 1.12 |
123
- | mario-kart-antigravity | Unity 2.3 · game 2 | 230 min | 1.43 |
124
- | terminal-portals-fps-controller | code 5 · live 1 · Unity 6 | 375 min | 1.46 |
125
- | prewarm-splash-status | code 1 · live 1 | 36 min | 1.64 |
126
- | starter-assets-third-person | code 2 · live 1 · Unity 3 · game 1 | 411 min | 2.38 |
127
-
128
- Across all 40 runs the median actual ÷ estimate is **1.00**; 30 of 40 land inside −35 % / +50 % and 34 of 40 within 0.6–1.6×. The previous rates (code 8 · live 18 · Unity 35, −30 % / +40 %) put only 11 of the 19 new runs inside their range: they ran about 2× high on engine-code plans and up to 2× low on plans that play the game. Excluded from the fit: mario-kart-port (scope grew 22 → 42 tasks mid-run), hdrp-complete-parity's run 2 (a reopened, deferred task), and the user-directed follow-up runs of draco-mesh-compression and unity-animator-port.
129
-
130
- To recalibrate later, read the `⏱` lines bt-execute writes to each `documents/<slug>_autopilot.md` (older runs: `<plan>_autopilot.md` beside a flat plan) — they carry the plan's estimate, active minutes per phase and per run, and waits already separated out.
131
-
132
- Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it slow | Estimate`, then one **Total** line in hours (days only if over ~16 h), the `--strict` multiplier, and the biggest uncertainty in one line. If the total averages above ~45 or below ~5 min per task, the estimate is wrong before the plan is: re-check it. An estimate, never a pin.
114
+ - **The estimate covers the plan as written.** Tasks added mid-run cost far more than planned ones — unity-terrain-system-parity's 17 planned tasks took about 6 h, the 9 added during the run about 21 h. Say so in the biggest-uncertainty line when the scope is still moving. Tasks added after a plan is complete get their own estimate at these rates.
115
+
116
+ **Calibration — provisional lean rates (2026-10-25).** Not yet measured, they replace the third calibration's Code 6 · Live 16 · Game 40 · Unity 35 (2026-10-19, 40 runs of the pre-lean loop). **Re-fit them from the `⏱` lines of the first five lean runs**, then drop "provisional".
117
+
118
+ To re-fit: read the `⏱` lines bt-execute writes to each `documents/<slug>_autopilot.md` — the plan's estimate, active minutes per phase and per run, waits already separated out. Take active time only; count each run's tasks by kind (outsized 2×) and fit a rate per kind on lean runs only, leaving out runs whose scope grew mid-run, reopened deferred tasks and user-directed follow-ups. Aim for a median actual ÷ estimate near 1.00 with most runs inside −35 % / +50 %; then update the table and this paragraph.
119
+
120
+ Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it slow | Estimate`, then one **Total** line in hours (days only if over ~16 h), the `--strict` multiplier, and the biggest uncertainty in one line. If the total averages above ~30 or below ~5 min per task, the estimate is wrong before the plan is: re-check it. An estimate, never a pin.
133
121
 
134
122
  **`## How to execute this plan`** — this text verbatim:
135
123
 
@@ -139,21 +127,23 @@ Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it
139
127
  Each task above is a checkbox. To implement:
140
128
  - Run a single task with the bt-execute command (e.g. `bt-execute <this-file> T<n>`), run every remaining task in order with `bt-execute <this-file> ALL` (resumable — it skips tasks already checked), or implement the whole plan from a prompt like "implement the plan at <this-file>".
141
129
  - bt-execute verifies each phase with an independent verifier; add `--strict` for an adversarial verifier on every task.
142
- - Work the tasks top to bottom unless a task notes a different dependency order.
130
+ - Work the tasks top to bottom — bt-execute builds a phase's tracks in parallel — unless a task notes a different dependency order.
143
131
  - When a task is fully implemented and its **Acceptance** criteria are met, mark it complete by editing this file and changing that task's `- [ ]` to `- [x]`.
144
132
  - Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
145
133
  ```
146
134
 
147
- ## Step 4. Write the dashboard (planned state)
135
+ ## Step 4. Write and check the dashboard (planned state)
148
136
 
149
137
  Print `🗂️ [bt-plan] Writing the feature dashboard …`. **A spec from bt-spec already has a dashboard, in its `specified` state** (showing the bt-plan commands): read its `<slug>_dashboard.js` first and keep its `feature`, `decisions` and `activity`; everything below then fills it in and moves it to `planned`. A Quick Plan, or a spec with no dashboard, creates it here. From bt-execute's `templates/dashboard/` *(where skills load through a tool: `load_skill('bt-execute')` + `read_skill_resource`; where they are files: the sibling `bt-execute/` folder in the skills directory this skill was loaded from)*:
150
138
 
151
139
  - copy `dashboard.html` to `.agents/specs/<slug>/dashboard.html`, replacing `{{slug}}` with the slug and changing nothing else (always — over a copy bt-spec wrote too, so the page is the current template);
152
140
  - write `.agents/specs/<slug>/documents/<slug>_dashboard.js` from the starter `dashboard.template.js`, written whole as strict JSON behind its `window.FEATURE_DASHBOARD =` prefix — double-quoted keys, no comments, no trailing commas (`data-schema.md` documents every field): `feature` (title, slug, branch, `origin` `spec` or `quick-plan`, size, proof, a plain-language summary), `documents` (Spec — omitted for a Quick Plan — and Plan), `status: "planned"`, `updatedAt` from the shell clock (`date '+%Y-%m-%d %H:%M'`; with no shell, the current local time), `estimate` (the Total line), every phase and task from the plan as `pending` (id, title, kind from the estimate table, verify level), an empty `afterAction` and no snapshots, the plan’s Decisions as `decisions` (Heavy Plan; otherwise the spec’s), each an object `{ "id": "D1", "text": "…", "updates": [] }` (never a plain `"D1 — …"` string, which shows as an empty row), and one more `activity` line: `Plan written — <n> tasks in <k> phases, estimated <range>` (after bt-spec's `Spec written` line when there is one);
153
- - write `.agents/specs/<slug>/documents/<slug>_live.js` from `live.template.js`, the same way (whole, strict JSON): no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute rewrites it at every step of a run).
154
- - in a git repository, make sure `.gitignore` (at the repository root) contains the line `.agents/*/*/documents/*_live.js` — append it once if missing. The live file is rewritten at every step of a run and is not history worth keeping; `<slug>_dashboard.js` is, and stays tracked. A live file git already tracks is left as it is.
141
+ - write `.agents/specs/<slug>/documents/<slug>_live.js` from `live.template.js`, the same way (whole, strict JSON): no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute's helper rewrites it with every task update).
142
+ - in a git repository, make sure `.gitignore` (at the repository root) contains the line `.agents/*/*/documents/*_live.js` — append it once if missing. The live file is not history worth keeping; `<slug>_dashboard.js` is, and stays tracked. A live file git already tracks is left alone.
143
+
144
+ Re-planning an existing feature rewrites the data file's phases and tasks from the new plan but keeps the results of tasks already done, its `afterAction` and its `activity` history, adding a `Plan revised` line; new tasks are `pending` with an `updates` note, and a `complete` status becomes `paused`. The dashboard is a deliverable: if the template cannot be found, say so and stop — the plan is not finished until the check below passes.
155
145
 
156
- Re-planning an existing feature rewrites the data file's phases and tasks from the new plan but keeps the results of tasks already done, its `afterAction` and its `activity` history, adding a `Plan revised` line; new tasks are `pending` with an `updates` note, and a `complete` status becomes `paused`. If the template cannot be found, skip the dashboard and say so — bt-execute creates it on its first run.
146
+ **Check, then stop.** Run `node <skills>/bt-execute/scripts/dashboard.mjs check .agents/specs/<slug>` (`<skills>`: the skills directory this skill was loaded from). It fails when a deliverable is missing — a dashboard file absent, or the dashboard's tasks out of step with the plan's checklist (ids and order) — or a data file is malformed. Fix what it names and re-run; **never finish while it fails**, whoever wrote the plan — this skill or an agent by hand. Where Node cannot run the helper, make the same checks by reading the files, and say so.
157
147
 
158
148
  Then **stop**. Final message: a short summary, the estimated time, and:
159
149
 
@@ -174,5 +164,5 @@ Sections, in order: `## Codebase Analysis` (plus the test baseline) · **`## Dec
174
164
  - **`## Decisions`** — numbered `D1, D2 …`, one per choice that binds more than one task or rejects a plausible alternative — architecture, file layout, naming, algorithms and constants, error policy, dependencies (exact packages and versions, or "no new dependencies"), sibling-skill option values, test strategy:
175
165
  `- **D3 — <decision, stated as a fact>.** <why / precedent with file:line> Rejected: <alternative> (<why not>). Binds: T4, T7.`
176
166
  - **`## Design Reference`** — the shared blueprint, written as code wherever the code *is* the decision: File map (path · create/modify/delete · responsibility · tasks) · Module boundaries · Interfaces & contracts (full signatures, in the project's language) · Data shapes & state · Control flow · Algorithms & formulas with their constants · Error & edge-case policy (`when X → Y`) · Conventions to mirror (verbatim, with `file:line`) · API usage · Test strategy. Omit a heading only if it truly does not apply. **All of it is written to the Agent Reference's Coding Practices — ENFORCED**: every interface, signature, data shape, constant and snippet uses meaningful full-word names, strict types (JSDoc type tags in JavaScript) and meaningful JSDoc, and reads cleanly to a developer new to the project. Mirror the structure of existing conventions, but never copy one- or two-letter names or obfuscated code into a new name.
177
- - **Heavy task block** — adds to the standard block: `Depends on:` · `Applies:` (the D-numbers and Design Reference entries it must match) · `Steps:` numbered instructions, each naming the file, a real anchor (prefer quoted code over bare line numbers) and the change · `Code:` when the code is the decision, written to the Coding Practices exactly as it must ship · `Do not:` the tempting wrong turns · `Verify:` commands with expected output. `Depends on`, `Files`, `Applies`, `Steps`, `Tests`, `Acceptance`, `Verify` and `Verify level` are required on every heavy task. A task never says "like T3" — it cites the Design Reference; a name, signature or value a step introduces is added to the Design Reference first, so task 40 types what task 3 typed. Say what keeps the app working between tasks (shim, flag) and which task removes it. The `Update SPEC.md` task carries the exact text to write.
178
- - **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, write the dashboard (Step 4) from the finished plan, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.
167
+ - **Heavy task block** — adds to the standard block: `Depends on:` (same track, or an earlier phase) · `Applies:` (the D-numbers and Design Reference entries it must match) · `Steps:` numbered instructions, each naming the file, a real anchor (prefer quoted code over bare line numbers) and the change · `Code:` when the code is the decision, written to the Coding Practices exactly as it must ship · `Do not:` the tempting wrong turns · `Verify:` commands with expected output. `Depends on`, `Files`, `Applies`, `Steps`, `Tests`, `Acceptance`, `Verify` and `Verify level` are required on every heavy task. A task never says "like T3" — it cites the Design Reference; a name, signature or value a step introduces is added to the Design Reference first, so task 40 types what task 3 typed. Say what keeps the app working between tasks (shim, flag) and which task removes it. The `Update SPEC.md` task carries the exact text to write.
168
+ - **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag two tracks in one phase that edit the same file, micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, write and check the dashboard (Step 4) from the finished plan, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.