@babylonjs-toolkit/agent 1.1.85 → 1.1.88

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Babylon Toolkit Desktop Agent (1.1.85)
1
+ # Babylon Toolkit Desktop Agent (1.1.88)
2
2
 
3
3
  The desktop agent owns the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs-toolkit/agent",
3
- "version": "1.1.85",
3
+ "version": "1.1.88",
4
4
  "description": "Installs the Babylon Toolkit Desktop Agent for Claude Code, Codex, GitHub Copilot, Gemini CLI and Antigravity.",
5
5
  "keywords": [
6
6
  "babylonjs",
@@ -10,7 +10,8 @@ Your goal is to convert source code to Babylon Toolkit based TypeScript or JavaS
10
10
  * If an interface is only referenced (not defined in the source code being converted), do **not** generate the interface, just reference it
11
11
  * Follow the Agent Reference's **Coding Practices — ENFORCED** in every converted file: clean, professional TypeScript or JavaScript in the project's own language; meaningful full-word names, never one- or two-letter names or obfuscation; well-structured, readable, maintainable code for human developers; meaningful JSDoc on every class, function, method and public member (always written, but never a reason to fail a test or verification). Carry the source's doc comments (C# `///` XML docs and the like) across as JSDoc, and write meaningful JSDoc where the source has none
12
12
  * Keep the source's public and serialized names (classes, methods, properties, fields) in camelCase, because exported Unity metadata binds to them by name. Give meaningful names to every local, parameter and helper the conversion introduces, and rename obfuscated or minified locals in the source to meaningful names
13
- * Before finishing, re-read every converted file against the Coding Practices and fix every violation
13
+ * Follow the Agent Reference's **Game UI Performance — ENFORCED** when the source updates UI. Unity scripts routinely write `Text.text`, `TMP_Text.text`, `Slider.value`, `Image.fillAmount` or a needle's rotation in `Update()` every frame, and other engines do the same in their render loop. Do not convert that cadence as-is: telemetry (speed, timers, bars, needles) is written only when its quantized shown value changes — through refs and one frame loop in a DOM HUD, or a changed-value check on a `@babylonjs/gui` control / `TOOLKIT.UserInterface.SetText` / `SetValue`; discrete values (score, ammo, lap) are set from the event that changed them; readouts nobody reads at 60 Hz are throttled; nothing is updated while hidden. Converted HUD code never pushes per-frame values through React state or posts them on the `EventBus` every frame (`ui-design-system.md` › **Live HUD Values — ENFORCED** and **Per frame or not**)
14
+ * Before finishing, re-read every converted file against the Coding Practices and Game UI Performance rules and fix every violation
14
15
 
15
16
  ---
16
17
 
@@ -148,7 +148,7 @@ Instruct bt-design to:
148
148
 
149
149
  - Match the blueprint's mechanics and timing **exactly** — this is a fidelity job, not a fresh design. Where bt-design would normally improvise, here it executes the blueprint.
150
150
  - Generate the re-imagined video/image/3D assets (image & video generation) to fill the asset manifest under the new theme — as beautiful and cinematic as the original's.
151
- - Reproduce the load choreography, scroll behavior, and micro-interactions from the motion table.
151
+ - Reproduce the load choreography, scroll behavior, and micro-interactions from the motion table — **with the Agent Reference's Game UI Performance — ENFORCED cadence, even where the original wastes frames.** Load reveals, staggers, hovers, pulses and enter / exit motion are CSS `@keyframes` / `transition` on `transform` and `opacity`, never a JavaScript frame loop. Only genuinely scroll- or time-driven motion (a scrub hero, a WebGL scene, scroll-linked parallax) runs per frame, and it writes nothing while the scroll is at rest, pauses off-screen (`IntersectionObserver`) and in a background tab, never animates `width` / `height` / `top` / `left`, and never reads layout in the loop. Copy the original's *feel*, not its per-frame cost (`ui-design-system.md` › **Per frame or not**).
152
152
  - **Reproduce the audio model from the blueprint** — if the original has sound, rebuild the equivalent behavior (ambient bed, interaction/scroll SFX, mute toggle, autoplay-gating on first user gesture per browser policy) and generate re-imagined audio assets that match the new theme. If the original is silent, do not add audio unless the brief asks for it.
153
153
 
154
154
  **Enforced build mandate (always apply):**
@@ -168,7 +168,7 @@ A copycat that "feels off" has failed. Before declaring done, verify the rebuild
168
168
 
169
169
  - Open the rebuilt site in the browser and capture the **same scroll-depth storyboard** you captured in Phase 1. Compare side by side against the blueprint — does each beat land at the same scroll position with the same motion?
170
170
  - Check the load sequence, easings, and stagger match the motion table.
171
- - Confirm nothing is janky: smooth scrubbing, no layout shift, motion holds 60fps where the original does.
171
+ - Confirm nothing is janky: smooth scrubbing, no layout shift, motion holds 60fps where the original does. Record a short performance trace with the page at rest after load: with nothing scrolling and nothing hovered, the main thread is idle — no frame loop doing work, no style or layout recalculation each frame.
172
172
  - Confirm the audio behavior matches the blueprint: if the original had sound, ours has the equivalent ambient bed / SFX, a working mute toggle, and correct autoplay-gating; if the original was silent, ours is too (unless the brief asked otherwise).
173
173
  - Confirm the *skin* fully reads as the new brief, not a recolor of the original's content.
174
174
 
@@ -32,7 +32,7 @@ Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
32
32
  Focus on:
33
33
  - **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
34
34
  - **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
35
- - **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
35
+ - **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions — `@keyframes` and `transition` on `transform` and `opacity`, which run on the compositor and stay smooth while the game loads or plays. Use Motion library for React when available, for enter / exit and layout transitions, never as a per-frame driver of game values. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
36
36
  - **Spatial Composition**: Default to **full-bleed, full-viewport layouts that stay fully responsive down to mobile** — edge-to-edge like a console dashboard, with UI anchored to the viewport edges rather than trapped in a centered fixed-width column (see *Layout Philosophy* below). Within that full canvas: unexpected layouts, asymmetry, overlap, diagonal flow, grid-breaking elements, generous negative space OR controlled density.
37
37
  - **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
38
38
 
@@ -47,7 +47,10 @@ Interpret creatively and make unexpected choices that feel genuinely designed fo
47
47
  - **Render once, then write through refs.** Static furniture (ticks, numerals, bezels, frames, labels) is memoized or static SVG / CSS. One `useFrameLoop` per HUD reads the game (`GameManager.GlobalState`, component getters) and writes only what changed: `textContent` for numbers, `transform` for needles and markers, `scaleX` for bars, `stroke-dashoffset` on a full arc drawn once for rings and sweeps, `opacity` for fades, `classList.toggle` for state styles.
48
48
  - **Never per frame:** `width` / `height` / `top` / `left`, `innerHTML`, SVG geometry (`d`, `points`), layout reads, allocations.
49
49
  - **Design for it.** Prefer looks that animate with transforms, opacity and dash offsets (rotating needles, scaling fills, sweeping dashes) over looks that need geometry rebuilt every frame.
50
- - **Before finishing**, search the HUD files for state setters, `dispatch(`, store updates and `EventBus.PostMessage(` inside `requestAnimationFrame`, `useFrameLoop`, render observables and `update()`; any hit is a violation to fix.
50
+ - **Per frame only when it must be — pick the cheapest cadence for every element** (`ui-design-system.md` › **Per frame or not**): *events* for state (set only when the value changed); *CSS* for decorative motion and fixed transitions (pulses, glows, particles, scanlines, hover, modal / toast enter and exit, a bar easing after a hit); *the frame loop* only for telemetry the player watches track the game; *throttled* (a few hertz in the same loop) for FPS, distance, standings and distant minimap markers; *nothing* for what is not on screen — a HUD behind a modal, a paused game, an off-screen canvas.
51
+ - **No frame loop on menus, pause / settings / results screens, the splash, the preloader or the landing page.** Their motion is CSS. The one exception is a real-time 3D, canvas or scroll-scrubbed hero, which pauses off-screen (`IntersectionObserver`, `visibilitychange`), writes nothing while the scroll is at rest, and honors `prefers-reduced-motion`.
52
+ - **A property the frame loop writes has no CSS `transition`** — it restarts every frame and lags the game. Smooth in the loop.
53
+ - **Before finishing**, search the HUD files for state setters, `dispatch(`, store updates and unguarded `EventBus.PostMessage(` inside `requestAnimationFrame`, `useFrameLoop`, render observables and `update()` / `late()` / `after()`, and search every menu, splash, preloader and landing-page file for `requestAnimationFrame`, `useFrameLoop`, `setInterval` and animation-library ticks; any hit is a violation to fix.
51
54
 
52
55
  **IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
53
56
 
@@ -62,6 +65,7 @@ The most common failure in generated game chrome: the splash / loading screen is
62
65
  Treat every loading surface (preloader, splash, initial overlay) as a **designed scene in the game's world**, not a utility screen:
63
66
 
64
67
  - **Invent a progress metaphor native to THIS game.** A racer: track start-lights counting down, a fuel gauge filling, a speedometer needle sweeping to redline. A platformer: the level assembling tile by tile. A space game: a warp drive charging, a star map resolving. A dungeon crawler: torches igniting one by one down a corridor. The progress percentage should *drive the scene* — not sit under it as a bare bar.
68
+ - **Animate the splash on the compositor, not the main thread (ENFORCED).** Every bit of splash and preloader atmosphere — particles, parallax, scanlines, pulses, a needle sweeping, tiles assembling — is CSS `@keyframes` / `transition` on `transform` and `opacity`, never a `requestAnimationFrame` loop, a `useFrameLoop` or React state ticking per frame. The scene build holds the main thread in slices; compositor animations keep playing through them, JavaScript-driven ones stutter exactly when the load is heaviest and slow the load down. Progress is an event: keep it in state as the whole percent shown (so React skips identical updates) and draw bars with `scaleX`, never `width`. If the design truly needs a canvas effect, keep it small, draw it in a worker with `OffscreenCanvas` where the browser supports it, and stop it the moment the splash hides.
65
69
  - **Bring the full aesthetic direction with you.** The splash uses the same typography, palette, motion language, and atmosphere as the landing page and HUD — it is the first screen of the experience, often seen for several seconds, and it sets the tone. Full-bleed, edge-to-edge, like everything else (see *Layout Philosophy*).
66
70
  - **Design the wait itself.** Staggered reveals, ambient motion (drifting particles, scanlines, parallax layers, animated environment art), rotating flavor text/lore/tips in the game's voice, a bold wordmark treatment for the game's own title. The player should *want* to watch it load.
67
71
  - **The default's anatomy is a placeholder, not a seed.** Centered-logo-plus-spinner, a thin bar at the bottom, a percentage in a corner — if the result still reads as "the stock loader, restyled," start over from the game's fantasy instead. NO stock spinner, NO engine/toolkit branding, nothing carried over from the default splash except the wiring the host platform requires (progress subscription, mount points, re-exports — keep the MECHANICS, replace ALL of the look, layout, and behavior of the visuals).
@@ -294,3 +294,12 @@ overlays, and the fixed chrome. Apply the handoff rule (§3) at the seam.
294
294
  re-entry in either scroll direction.
295
295
  - The HUD hides itself when the journey hands off to normal-flow sections;
296
296
  jump-nav buttons dim at the end they're already at.
297
+ - The frame loop writes nothing at rest: while the scroll offset and the
298
+ smoothed scrub are unchanged it skips every DOM write (overlays, HUD, video
299
+ seek, blur), so a page left open costs one scroll read per frame. Layout is
300
+ read only on load and resize, never in the loop. Keep both when you extend
301
+ the engine — a per-frame write that does not check for a change is a
302
+ violation of the Agent Reference's *Game UI Performance — ENFORCED*.
303
+ - The loader bar is a full-width fill scaled with `scaleX`, written only when
304
+ its whole percent changes — never `width` (a download fires many chunks a
305
+ second).
@@ -113,11 +113,13 @@ body[data-hs-state="ready"] #hs-loader { opacity: 0; visibility: hidden; }
113
113
  overflow: hidden;
114
114
  }
115
115
 
116
+ /* The fill is full width and scaled, never resized: progress writes a transform (no layout). */
116
117
  #hs-loader-fill {
117
- display: block; height: 100%; width: 0%;
118
+ display: block; height: 100%; width: 100%;
119
+ transform: scaleX(0); transform-origin: left;
118
120
  background: var(--hs-accent);
119
121
  box-shadow: 0 0 12px var(--hs-accent), 0 0 32px var(--hs-accent-soft);
120
- transition: width 0.25s ease;
122
+ transition: transform 0.25s ease;
121
123
  }
122
124
 
123
125
  /* ── telemetry HUD (optional) ───────────────────────────────────── */
@@ -156,9 +156,14 @@ export function initHeroScroll(root = document, userConfig = {}) {
156
156
  let objectUrl = null;
157
157
  let alive = true;
158
158
 
159
+ let shownLoaderPct = -1;
160
+
161
+ /** Shows download progress; writes only when the whole percent shown changes (a stream fires many chunks). */
159
162
  function setLoader(p) {
160
163
  const pct = Math.round(clamp(p, 0, 1) * 100);
161
- if (loaderFill) loaderFill.style.width = pct + "%";
164
+ if (pct === shownLoaderPct) return;
165
+ shownLoaderPct = pct;
166
+ if (loaderFill) loaderFill.style.transform = `scaleX(${pct / 100})`;
162
167
  if (loaderPct) loaderPct.textContent = String(pct).padStart(3, "0");
163
168
  }
164
169
 
@@ -189,6 +194,7 @@ export function initHeroScroll(root = document, userConfig = {}) {
189
194
  duration = video.duration;
190
195
  video.currentTime = 0;
191
196
  videoReady = true;
197
+ invalidateFrame(); // seek to wherever the viewer already scrolled while it loaded
192
198
  } catch (e) {
193
199
  document.body.classList.add(CFG.fallbackClass); // poster still shows
194
200
  setLoader(1);
@@ -306,6 +312,16 @@ export function initHeroScroll(root = document, userConfig = {}) {
306
312
  if (element && element.textContent !== text) element.textContent = text;
307
313
  }
308
314
  let frameRaf = null;
315
+ // The scrub position and scroll offset the chrome was last drawn at. While both are unchanged the frame
316
+ // loop writes nothing: a page at rest costs one scroll read per frame, not a full redraw of the chrome.
317
+ let drawnP = Number.NaN;
318
+ let drawnY = Number.NaN;
319
+
320
+ /** Forces the next frame to redraw everything (after a re-measure or when the video becomes seekable). */
321
+ function invalidateFrame() {
322
+ drawnP = Number.NaN;
323
+ drawnY = Number.NaN;
324
+ }
309
325
 
310
326
  function measure() {
311
327
  const sTop = isDocScroller ? 0 : scroller.getBoundingClientRect().top;
@@ -314,6 +330,7 @@ export function initHeroScroll(root = document, userConfig = {}) {
314
330
  viewportHeight = viewportH();
315
331
  journeyScroll = Math.max(1, journeyHeight - viewportHeight);
316
332
  frameEndY = endY();
333
+ invalidateFrame();
317
334
  }
318
335
 
319
336
  // where PLAY/END consider "the end": journey end (sweep:"hero") or
@@ -324,12 +341,21 @@ export function initHeroScroll(root = document, userConfig = {}) {
324
341
  : maxY();
325
342
 
326
343
  function frame() {
327
- const y = clamp(getY() - journeyTop, 0, journeyScroll);
344
+ const scrollY = getY();
345
+ const y = clamp(scrollY - journeyTop, 0, journeyScroll);
328
346
  const p = y / journeyScroll;
329
347
 
330
348
  smoothP += (p - smoothP) * (reduced ? 1 : CFG.smoothing);
331
349
  if (Math.abs(p - smoothP) < 0.0004) smoothP = p;
332
350
 
351
+ // At rest — same scroll, scrub settled, nothing invalidated: every value below is already on screen.
352
+ if (smoothP === drawnP && scrollY === drawnY) {
353
+ if (alive) frameRaf = requestAnimationFrame(frame);
354
+ return;
355
+ }
356
+ drawnP = smoothP;
357
+ drawnY = scrollY;
358
+
333
359
  if (videoReady && duration) {
334
360
  const t = smoothP * Math.max(0, duration - 0.05);
335
361
  if (Math.abs(t - video.currentTime) > 0.02) video.currentTime = t;
@@ -338,6 +364,7 @@ export function initHeroScroll(root = document, userConfig = {}) {
338
364
  if (CFG.motionBlur && !reduced && videoReady) {
339
365
  const blur = Math.min(5, Math.abs(smoothP - lastP) * 620);
340
366
  video.style.filter = blur > 0.35 ? `blur(${blur.toFixed(2)}px)` : "none";
367
+ if (blur > 0.35) drawnP = Number.NaN; // still blurred: draw the next frame too, so the blur clears at rest
341
368
  }
342
369
  lastP = smoothP;
343
370
 
@@ -353,12 +380,12 @@ export function initHeroScroll(root = document, userConfig = {}) {
353
380
  }
354
381
  hud.classList.toggle(
355
382
  "hs-hud-off",
356
- getY() > journeyTop + journeyHeight - viewportHeight * 0.55
383
+ scrollY > journeyTop + journeyHeight - viewportHeight * 0.55
357
384
  );
358
385
  }
359
386
 
360
- if (gotoTop) gotoTop.classList.toggle("hs-nav-dim", getY() < 4);
361
- if (gotoEnd) gotoEnd.classList.toggle("hs-nav-dim", getY() >= frameEndY - 4);
387
+ if (gotoTop) gotoTop.classList.toggle("hs-nav-dim", scrollY < 4);
388
+ if (gotoEnd) gotoEnd.classList.toggle("hs-nav-dim", scrollY >= frameEndY - 4);
362
389
 
363
390
  for (const o of overlays) styleOverlay(o, smoothP);
364
391
 
@@ -32,6 +32,7 @@ Run tasks from a plan: build each one with its tests, have an independent verifi
32
32
  ## Ground rules
33
33
 
34
34
  - **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 — follow the *Work fast* rules below to the letter, take the direct route to each task's Acceptance, and do not re-read what you already have. Begin every implementer and verifier prompt with `TIME MATTERS.` Print `⏱️ [bt-execute] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-execute] No time limit`, and do not add it). Speed never relaxes tests, the independent verifier, live checks, or "tick only on PASS".
35
+ - **Snapshots — ENFORCED.** The dashboard's snapshots are the chronicle of how the feature was built; a row of "No snapshot" loses that record for good. Every snapshot reaches the dashboard **only** through `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T<n>|P<N>|plan> --src snapshots/… --caption "…"` (`--before … --after …` for a comparison, `--frame "src|stage|caption"` repeated for a progression). Never write or brief a snapshot JSON shape — every brief carries that exact command line with the paths filled in, and a subagent that cannot run it returns paths and captions for you to add. `dashboard.mjs check <feature-folder>` is a gate, not a courtesy: run it before every phase commit and at run end, and never commit or end the run while it fails. Then open `dashboard.html` headless and look: every snapshot slot shows its image.
35
36
  - **Scope.** Implement only the selected task(s). No "while I'm here" work on other tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide and log it)*.
36
37
  - **Open the run before anything else.** The first actions of every run — before reading docs, reading code, checking the repo or any other pre-flight work — are, in order: take the clock; append the `⏱ Run <n> start` line to the run log; sync the dashboard with the plan and set `status: "in-progress"` (*Run start* under *Feature folder and dashboard*); write the live file (`role: "orchestrator"`, `title: "Starting run <n> — <what you are checking first>"`); and launch the watchdog in the background (*Never let the dashboard go stale*). From then on the pre-flight work is narrated in the live file like any other step. Until the run is opened the dashboard still shows the last run's end state — a user who restarts a run and refreshes must see it running within a minute, not after the pre-flight is over.
37
38
  - **Read the docs once.** For Babylon work, if you have not read the Agent Reference this session, read it once — https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — plus only the sub-documents the plan's tasks need, searching a large one for the part you need rather than reading it whole. It is the authority for conventions and API. Cannot be read → stop and tell the user *(auto-pilot: retry 3×, then continue on what you know and log it)*. Read the plan's checklist and the parts of `SPEC.md` the tasks touch; re-read after a context compaction.
@@ -54,13 +55,13 @@ Work in **phases**: a `### Phase N` group in the plan, or — if the plan has no
54
55
  4. **Fix loop** for a task that failed: fix the code in the context that wrote it; re-run its tests; re-verify with a **fresh** verifier given only the failed items and the evidence (`--strict`: the whole task). A records-only slip (a stale number or note) is fixed directly and re-checked by you. 3 attempts (`--strict`: 5), each changing something material; stop early if two attempts fail the same way with no new idea. Still failing → leave it unticked, stop and report *(auto-pilot: defer and continue)*.
55
56
  5. **Report:** tasks done (for `ALL` / ranges: the range asked for, completed/total, and whether the plan is now finished; if fewer than `n` tasks remained for `NEXT:<n>`, say so), files changed, tests run (`tests: 4 passed (implementer) · verifier-checked`), verifier result (`verified (independent subagent)` or `verified (self)`), the dashboard path (`.agents/specs/<slug>/dashboard.html` — open it in a browser), the plan summary path when this run wrote it (`.agents/specs/<slug>/documents/<slug>_summary.html`), and the next task id — for reference only.
56
57
 
57
- **The verifier is told:** *"Confirm each task's Acceptance is genuinely met and run its `Verify` commands against the stated expected output. Re-run the tests and the relevant suite once; check they really cover the Acceptance and named edge cases and could fail — missing or vacuous tests are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled edge cases the plan names, a documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. Check every code file the task created or changed against the Agent Reference's Coding Practices — ENFORCED: clean, professional TypeScript or JavaScript in the language the project already uses (never converted to the other unasked); strict types with no needless `any` in TypeScript; meaningful full-word names for every class, method, property, variable and parameter (one- or two-letter names, cryptic abbreviations and code-golf tricks are violations, except the allowed loop counters, axis/`uv` names and toolkit aliases, and names that bind to exported data); no dead code, unused imports or leftover `console.log`; well-structured code a developer new to the project can read and maintain. Any violation is a FAIL for that task — quote the offending lines. Check every HUD, overlay or GUI file the task created or changed against the Agent Reference's Game UI Performance — ENFORCED: a value that changes every frame (speed, RPM, needles, timers, bars, markers) set through React state, props, context or a store, or posted on the EventBus per frame; a state setter, `dispatch(`, store update or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or a component's `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written per frame, or layout read in the loop; a Babylon GUI control assigned every frame without a changed-value check. Any of these is a FAIL for that task — quote the offending lines. JSDoc is never a FAIL: missing, thin or stale JSDoc (including JavaScript type tags) never fails a test, a verification or an Acceptance item — list it under a separate non-blocking `JSDoc notes` heading. For any task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — check it live in the browser (and Unity where relevant) whether or not the plan marks it `live`, and do the plan's final end-to-end check live: look at the running result, beside the reference image when there is one, and judge it as a user would; passing unit tests never substitute. Do all of a phase's live checks in one session on the already-running dev server, and re-export from Unity only if the phase changed that scene's export — then only the project and the scenes the phase works on. Save the frames from your live session that show each visual task's verified result to `[SNAPSHOTS]` as `T<n>-<NN>-<stage>.png` — the same camera or viewport as the implementer's progression frames, plus any angle or comparison (Unity beside browser, before beside after) that proves the Acceptance — and return each path with a one-line caption saying what it shows. Snapshots never add a page session or an export of their own. Keep the dashboard current as you go: set each task `verifying` when you start checking it, and rewrite the live file at each check (what you are checking, on what) — never 15 minutes without a write. Treat an absolute count in the plan as 'named tests pass, no new failures'. [SCOPE] Return PASS/FAIL per task with evidence and one line on what you ran live and where (or `none — tests only`), listing records-only slips separately."*
58
+ **The verifier is told:** *"Confirm each task's Acceptance is genuinely met and run its `Verify` commands against the stated expected output. Re-run the tests and the relevant suite once; check they really cover the Acceptance and named edge cases and could fail — missing or vacuous tests are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled edge cases the plan names, a documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. Check every code file the task created or changed against the Agent Reference's Coding Practices — ENFORCED: clean, professional TypeScript or JavaScript in the language the project already uses (never converted to the other unasked); strict types with no needless `any` in TypeScript; meaningful full-word names for every class, method, property, variable and parameter (one- or two-letter names, cryptic abbreviations and code-golf tricks are violations, except the allowed loop counters, axis/`uv` names and toolkit aliases, and names that bind to exported data); no dead code, unused imports or leftover `console.log`; well-structured code a developer new to the project can read and maintain. Any violation is a FAIL for that task — quote the offending lines. Check every HUD, overlay or GUI file the task created or changed against the Agent Reference's Game UI Performance — ENFORCED: a value that changes every frame (speed, RPM, needles, timers, bars, markers) set through React state, props, context or a store, or posted on the EventBus per frame; a state setter, `dispatch(`, store update or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or a component's `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written per frame, or layout read in the loop; a Babylon GUI control assigned every frame without a changed-value check; a frame loop (`requestAnimationFrame`, `useFrameLoop`, `setInterval`, an animation-library tick) on a menu, pause / settings / results screen, splash, preloader or landing page, or driving motion CSS could do (a real-time 3D / canvas / scroll-scrubbed hero is allowed when it pauses off-screen and writes nothing at rest); a HUD loop that keeps writing while its HUD is hidden, behind a modal or the game is paused; a CSS `transition` on a property the frame loop writes. Any of these is a FAIL for that task — quote the offending lines. JSDoc is never a FAIL: missing, thin or stale JSDoc (including JavaScript type tags) never fails a test, a verification or an Acceptance item — list it under a separate non-blocking `JSDoc notes` heading. For any task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — check it live in the browser (and Unity where relevant) whether or not the plan marks it `live`, and do the plan's final end-to-end check live: look at the running result, beside the reference image when there is one, and judge it as a user would; passing unit tests never substitute. Do all of a phase's live checks in one session on the already-running dev server, and re-export from Unity only if the phase changed that scene's export — then only the project and the scenes the phase works on. Save the frames from your live session that show each visual task's verified result to `[SNAPSHOTS]` as `T<n>-<NN>-<stage>.png` — the same camera or viewport as the implementer's progression frames, plus any angle or comparison (Unity beside browser, before beside after) that proves the Acceptance — and add each one to its task with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> T<n> --src snapshots/… --caption "…"` (never snapshot JSON), returning each path with its one-line caption. Snapshots never add a page session or an export of their own. Keep the dashboard current as you go: set each task `verifying` when you start checking it, and rewrite the live file at each check (what you are checking, on what) — never 15 minutes without a write. Treat an absolute count in the plan as 'named tests pass, no new failures'. [SCOPE] Return PASS/FAIL per task with evidence and one line on what you ran live and where (or `none — tests only`), listing records-only slips separately."*
58
59
 
59
60
  `[SNAPSHOTS]` is the feature folder's `snapshots/` path (`.agents/specs/<slug>/snapshots/`). `[SCOPE]` is one of two sentences. **Standard:** *"Do not add mutation testing, fuzzing, restarts or audits of untouched files unless something you found points there; aim for about 25 tool calls and report rather than expand."* **`--strict`:** *"Be adversarial: actively look for any reason the Acceptance is NOT met, using whatever you judge worthwhile — mutation checks against the tests, randomized inputs, re-deriving values from the plan's Decisions and Design Reference, live QA of every rendered or exported surface."*
60
61
 
61
62
  For a task built on a sibling skill (e.g. bt-design's 3D-Hero-Scroll), give the verifier the relevant part of that skill *(where skills load through a tool: `load_skill` + `read_skill_resource`; where they are files: the skills directory this skill was loaded from, e.g. `~/.claude/skills/`, `~/.agents/skills/` or the project's equivalent)* — its documented options (e.g. `sweep: page` really reaches the document bottom) are part of Acceptance.
62
63
 
63
- **Every subagent gets a brief, not homework:** the task block(s), the plan Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Agent Reference excerpts needed (with their links) — **always including the full `Coding Practices — ENFORCED` section**, since implementers write to it and verifiers fail work that breaks it — the test command and the feature folder's `tests/` path, the `snapshots/` path and *Snapshots tell the story* (for any phase with visible output), the dashboard and live file paths with the per-task update rules from *Feature folder and dashboard* (with `--verbose`, the `details` fields that role writes), the project's agent instructions, the *Work fast* rules below, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it for the API, never the whole file) only if you hit an API this brief does not cover, and say which."*
64
+ **Every subagent gets a brief, not homework:** the task block(s), the plan Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Agent Reference excerpts needed (with their links) — **always including the full `Coding Practices — ENFORCED` section**, since implementers write to it and verifiers fail work that breaks it — the test command and the feature folder's `tests/` path, the `snapshots/` path and *Snapshots tell the story* (for any phase with visible output), the dashboard and live file paths with the per-task update rules from *Feature folder and dashboard* (with `--verbose`, the `details` fields that role writes) and **the exact `dashboard.mjs snapshot` command line with the feature folder filled in** — never a snapshot JSON shape of your own (a hand-written `{path, caption}` entry has twice reached a dashboard as a row of "No snapshot"), the project's agent instructions, the *Work fast* rules below, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it for the API, never the whole file) only if you hit an API this brief does not cover, and say which."*
64
65
 
65
66
  ## Feature folder and dashboard
66
67
 
@@ -95,12 +96,12 @@ Every feature lives in one folder, created by bt-spec (or by bt-plan for a Quick
95
96
 
96
97
  - **The live file — at every meaningful step.** Rewrite `documents/<slug>_live.js` whole (it is small) when a task starts, at each milestone inside it, before anything slow (a build, an export, a bake, a capture, a test run), at each fix attempt, at the hand-over to the verifier and while it checks each task, and at the commit: the phase, the task, the role, one plain-language sentence on what is happening now, and the task's step log. Never let it go 15 minutes without a write during active work — the page flags a 20-minute silence. Between tasks, `task: ""` and a `title` (`Verifying phase 2`, `Committing phase 2`).
97
98
  - **The dashboard data — at every task boundary:** a task becomes `in-progress` when it starts; `built` the moment it is built and its tests are green — with its summary of what was actually done (and anything surprising), files, tests and snapshots filled in **right then**, not at the phase end; `verifying` while the verifier checks it; `done` when it passes (verifier result, attempts, commit, done time, its `DECISION` lines, and `checkedLive` — one line on what the verifier ran live and where, for every task it checked in the browser or Unity whatever the plan's verify level, `""` when tests alone proved it); back to `in-progress` with `attempts` + 1 on a FAIL. Each change also adds an `activity` line and refreshes `updatedAt`.
98
- - **Every write goes through this skill's `scripts/dashboard.mjs` — never hand-edited.** Each data file is one `window.… =` prefix and one strict-JSON value (the prefix only lets a page opened from disk load it); the helper parses it, changes it, checks the shapes and writes it back atomically, so the page never sees a half-written or malformed file. Use it, not a one-off script of your own: `node <skills>/bt-execute/scripts/dashboard.mjs live <feature-folder> --task T7 --role implementer --activity "…" --step "…"` · `task <feature-folder> T7 --set '{"status":"built","summary":"…"}'` · `activity <feature-folder> "…"` · `status <feature-folder> in-progress` · `check <feature-folder>` (all options in the script's header). Only where Node cannot run, fall back to the parse-and-write-back recipe in `data-schema.md`. Keep each field its documented shape too — a list stays a list (`updates`, `snapshots`, `files`, `decisions`, `notes` …: append, never assign a string); a helper script you give subagents checks the shapes before it writes.
99
+ - **Every write goes through this skill's `scripts/dashboard.mjs` — never hand-edited.** Each data file is one `window.… =` prefix and one strict-JSON value (the prefix only lets a page opened from disk load it); the helper parses it, changes it, checks the shapes and writes it back atomically, so the page never sees a half-written or malformed file. Use it, not a one-off script of your own: `node <skills>/bt-execute/scripts/dashboard.mjs live <feature-folder> --task T7 --role implementer --activity "…" --step "…"` · `task <feature-folder> T7 --set '{"status":"built","summary":"…"}'` · `snapshot <feature-folder> T7 --src snapshots/T7-01-stage.png --caption "…"` (or `--before … --after …`, or `--frame "src|stage|caption"` repeated) · `activity <feature-folder> "…"` · `status <feature-folder> in-progress` · `check <feature-folder>` (all options in the script's header). **Snapshots go in only through `snapshot`** — it builds the shape the page renders and refuses an image that is not on disk. As a backstop, every helper write repairs an entry the page could not show (an image under `path`, `file`, `image`, `url` or `href` moves to `src`; an unknown `source` becomes `browser`), `check` repairs any already in the file, and the watchdog repairs one written around the helper within a minute; an image that is not on disk is still refused. Run `check` at every phase boundary and at run end; a failure there is fixed before the commit. Only where Node cannot run, fall back to the parse-and-write-back recipe in `data-schema.md`. Keep each field its documented shape too — a list stays a list (`updates`, `snapshots`, `files`, `decisions`, `notes` …: append, never assign a string); a helper script you give subagents checks the shapes before it writes.
99
100
 
100
101
  On top of the per-task updates:
101
102
 
102
103
  - **Run start — the first thing the run does** (*Open the run before anything else*): make sure the default `.agents` folders exist — `.agents/specs/`, `.agents/complete/`, `.agents/archived/`, `.agents/profile/` and `.agents/recon/`, each with an empty `.gitkeep` (write only the ones missing); **refresh `dashboard.html`** — copy it again from the template with `{{slug}}` replaced (it is never edited, so this is always safe, and it is how layout fixes reach dashboards created by older versions), and `documents/<slug>_summary.html` the same way from `templates/summary/summary.html` when the feature already has one; then **sync the dashboard with the plan file** — re-read its checklist and add any phase or task (including sub-tasks like `T3.1`) the dashboard lacks, in plan order, as `pending`, with an `updates` note on it (`Added to the plan after <the plan was complete / phase 2 ran> — <why, if the plan says>`); a task the plan no longer has is removed with an `activity` line saying so. Then `status: "in-progress"`, `runs` + 1, the run-log document link, an `activity` line, the first live-file write, and the watchdog launched in the background. In a git repository, check `.gitignore` has `.agents/*/*/documents/*_live.js` and append it once if not — the live file is never staged or committed; `<slug>_dashboard.js` and `snapshots/` are.
103
- - **Each phase, after its ticks and before its commit:** the phase's status, times and minutes (from its `⏱` line), its verifier result and a two-or-three-sentence summary of what it delivered; the phase-level snapshots (a progression spanning several tasks — below); `decisions`; `activeTime` — the plan's total across **every run so far** (each finished run's `active` from its `⏱ Run <n> end` line, plus this run's so far), never this run alone; an `activity` line; and a current "so far" `outcome` headline.
104
+ - **Each phase, after its ticks and before its commit:** the phase's status, times and minutes (from its `⏱` line), its verifier result and a two-or-three-sentence summary of what it delivered; the phase-level snapshots (a progression spanning several tasks — below), each added with `dashboard.mjs snapshot`, and `dashboard.mjs check` passing; `decisions`; `activeTime` — the plan's total across **every run so far** (each finished run's `active` from its `⏱ Run <n> end` line, plus this run's so far), never this run alone; an `activity` line; and a current "so far" `outcome` headline.
104
105
  - **A deferral:** the task's `status: "deferred"` and `deferredReason`, an `activity` line.
105
106
  - **Run end — the After Action Report.** **decide the status by re-reading the plan file's checkboxes, never from memory:** `complete` when every task in the plan is `- [x]`; `incomplete` when every task is either ticked or marked ⏭️ DEFERRED; otherwise `paused` (the run covered only a slice, or tasks were added). The page refuses a `complete` it can see is false — it shows the plan as paused with a warning — but the plan file is the authority; never leave `in-progress` behind, because the status picks the page's top slot: `in-progress` shows *Current run activity* (the live file and the milestones), any other run-ended status shows the After Action Report in its place. Write `followUps` for a human, and `afterAction` — the whole plan's execution, start to finish: a one-sentence headline of what the plan delivered; two to four paragraphs on what was built, how it was proven and what surprised; highlights; and **one before/after for the plan as a whole** (`comparison`) — the plan-wide "before" frame beside a final "after" taken now from the same camera or viewport (the end-to-end check's session supplies it). Add the plan's key progression to `afterAction.snapshots` if one tells the story better than any single phase. Write `afterAction.testing` on every run, not only `--verbose`: run every test suite the plan touched **once more, in full, at run end** and record each as a `suites` entry (name, command, passed, failed, how many tests this plan added, and a `note` for any failure that pre-dates the plan) — never add up the tasks' counts, which re-count the same suite once per task; a `summary` of how the plan was tested (unit tests, the verifier's re-runs, what was checked live and on what, the end-to-end check); and `gaps` — what no test or live check covers. The page builds the task-by-task table and the list of test cases from the tasks. The figures (tasks, tests, retries, time) are computed by the page — never type them in. A run that ends before the plan is finished writes it too; the page marks it *Interim* while `paused`, and the next run revises it with an `updates` entry. **A reopened plan** (tasks added after it was complete) works the same way: the run that finishes the added tasks rewrites the After Action Report to cover them, notes the change in its `updates` (`Revised — T7 added after completion: <why>`), and retakes the plan-wide "after" from the same camera so the comparison shows the plan as it now stands.
106
107
  - **Run end — the plan summary, only when the plan is `complete`.** Write the feature's plan summary, a formatted page that opens straight from disk. It is the plan told to people who never see the code: what it delivered, what it means for existing users and content, what was wrong, what changed, what did not, and how it was checked. Use on-screen names in **bold** and real values. Leave out file names, task IDs and test counts. Like the dashboard, the page is a fixed template and the content is data, both from this skill's `templates/summary/`. Copy `summary.html` to `documents/<slug>_summary.html` with `{{slug}}` replaced and nothing else edited; only `dashboard.html` sits at the feature root. Write `documents/<slug>_summary.js` beside it, whole as strict JSON behind `window.PLAN_SUMMARY =`. **`summary-guide.md` has the audience, the fields and the section order, and `summary.template.js` is a worked example. Read both.** **Leave out any section that does not apply to this plan**, and adapt a heading's wording where the default does not fit (a feature has *Why it was needed* in place of *What was wrong*). Then set `afterAction.planSummary: "documents/<slug>_summary.html"` so the After Action Report links to the page. A `paused` or `incomplete` run writes no summary. **A reopened plan** keeps its existing summary while the added tasks run. The run that completes them rewrites the data to cover the plan as it now stands, adds the new date to `stamp` (`Fixed on 2026-10-19; updated on 2026-11-02`) and says in the lead what the update added. Commit both files with the dashboard data.
@@ -121,7 +122,7 @@ The snapshots are how a human sees what was built, so choose them for meaning, n
121
122
  - **Then whatever proves the point.** A comparison when a change is best seen side by side (a fix, the state before the phase, Unity beside the browser for parity); a second angle when one view hides it (overview, ground level, close detail); a still when one image proves one thing.
122
123
  - **As many frames as the build has meaningful stages** — usually 3–8 for a visual task, none for a task with nothing to see. No near-duplicates, no frame per iteration, and a failed attempt only when it explains a decision (say so in the caption).
123
124
  - **Who takes them.** At the start of the first run, before T1 changes anything, take the **plan-wide "before"** (`snapshots/plan-before.png`) from the camera or viewport that will best show the finished feature — the starting state, even if that is an empty scene or the old page; skip it only when the plan has nothing to see. The implementer saves a "before" frame before the first change of a visual phase, and saves milestone frames while it builds — it is already capturing to iterate, so it keeps the meaningful ones instead of discarding them. The verifier adds the verified final frames from its live session. You pick and order them into the dashboard. Frames come from sessions and exports the work already runs — never an extra page session or re-export just for a picture.
124
- - **Files.** `snapshots/T<n>-<NN>-<stage>.png` (phase-level: `P<N>-<NN>-<stage>.png`), at most about 1600 px wide; prefer JPEG or WebP for large scenes. Unity frames come through the bridge's camera capture, browser frames through the browser tool.
125
+ - **Files.** `snapshots/T<n>-<NN>-<stage>.png` (phase-level: `P<N>-<NN>-<stage>.png`), at most about 1600 px wide; prefer JPEG or WebP for large scenes. Unity frames come through the bridge's camera capture, browser frames through the browser tool. Each frame reaches the dashboard through `dashboard.mjs snapshot` (task `T<n>`, phase `P<N>` or `plan`); a subagent without the helper returns its paths and captions and you add them.
125
126
 
126
127
  ## Work fast
127
128