@babylonjs-toolkit/agent 1.1.68 → 1.1.76
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 +3 -3
- package/package.json +1 -1
- package/skills/bt-design/SKILL.md +7 -0
- package/skills/bt-design/templates/3d-hero-scroll/hero-scroll.js +27 -9
- package/skills/bt-execute/SKILL.md +2 -2
- package/skills/bt-execute/templates/dashboard/dashboard.html +177 -0
- package/skills/bt-gauntlet/references/critic-rubrics.md +1 -0
- package/skills/bt-plan/SKILL.md +1 -1
- package/skills/bt-profile/SKILL.md +77 -34
- package/skills/bt-profile/scripts/analyze.mjs +67 -15
- package/skills/bt-profile/scripts/lib/chrome.mjs +22 -0
- package/skills/bt-profile/scripts/lib/probe.mjs +117 -2
- package/skills/bt-profile/scripts/lib/progress-panel.mjs +103 -7
- package/skills/bt-profile/scripts/profile.mjs +89 -40
- package/skills/bt-profile/scripts/progress.mjs +141 -10
- package/skills/bt-profile/scripts/report.mjs +203 -11
- package/skills/bt-profile/templates/scenario.template.mjs +28 -19
- package/skills/bt-prototype/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Babylon Toolkit Desktop Agent (1.1.
|
|
1
|
+
# Babylon Toolkit Desktop Agent (1.1.76)
|
|
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
|
|
|
@@ -281,7 +281,7 @@ pair or schedule the bridge.
|
|
|
281
281
|
| [`bt-hero`](skills/bt-hero/SKILL.md) | `/bt-hero` | Create smooth cinematic 3D scrolling hero sections. |
|
|
282
282
|
| [`bt-atlas`](skills/bt-atlas/SKILL.md) | `/bt-atlas` | Generate texture atlas skin variations. |
|
|
283
283
|
| [`bt-optimize`](skills/bt-optimize/SKILL.md) | `/bt-optimize` | Make an exported Unity scene run fast in the browser: profile the BabylonJS frame (draw calls per pass, lights, shadows, post-processing, resolution, materials, textures), fix the causes on a copy of the scene — runtime lights, shadows, post, exporter settings, static / lightmap / mirrored unlocks — and merge static meshes and LOD groups (packed lightmap UVs, LOD clusters); then re-bake, export and verify frame rate and look against the original. `--no-combine`, `--combine-only`. |
|
|
284
|
-
| [`bt-profile`](skills/bt-profile/SKILL.md) | `/bt-profile` | Find and fix
|
|
284
|
+
| [`bt-profile`](skills/bt-profile/SKILL.md) | `/bt-profile` | Find what makes a web app slow and list the fixes (spec them with `/bt-spec`, or apply them with `--auto-fix`) — built for BabylonJS / Babylon Toolkit games, usable on any front end (give it a URL and the project folder): drive the running game in Chrome through a repeatable scenario (a cold load, a level start, a countdown), record the CPU profile, allocations, every frame and every GPU pipeline compile (with `--gpu-cold`, as on a first visit), map each millisecond to its source line and owner (your code, the toolkit runtime, BabylonJS, Havok, React), then list the fixes, or with `--auto-fix` apply them one at a time and re-measure each. Writes `.agents/profile/<slug>/dashboard.html` (live progress, Print / Download PDF) and a spec-ready `findings.md`. `--auto-fix`, `--snapshots`, `--watch`, `--gpu-cold`, `--stop`, `--resume`, `--restart`, `--project`, `--slug`. |
|
|
285
285
|
|
|
286
286
|
Every tool derives the slash-command from the **folder name** (`bt-spec/` → `/bt-spec`) and reads
|
|
287
287
|
the frontmatter `name` + `description` to decide when the skill applies. The `allowed-tools`
|
|
@@ -324,7 +324,7 @@ storyboard, plus before/after sliders and stills where those prove the point. Wh
|
|
|
324
324
|
revises an earlier result, the earlier entry is marked **Updated** with who changed it and why —
|
|
325
325
|
nothing is rewritten silently.
|
|
326
326
|
|
|
327
|
-
The top of the page follows the run. While a run is going it shows **Current run activity** — the *Now*
|
|
327
|
+
The top of the page follows the run. Before the first run it shows **Start this plan** — ready-made `bt-execute` commands with copy buttons (every task unattended, every task with you on hand, one phase, the first task, fully written up) and a builder for any task range with `--auto-pilot`, `--strict`, `--verbose` or `--no-time-limit`; a paused plan shows the same as **Continue this plan**. While a run is going it shows **Current run activity** — the *Now*
|
|
328
328
|
banner and the milestones so far. Once the run is over, that slot becomes the **After Action Report**
|
|
329
329
|
(marked *Interim* if the plan is not finished yet), and the milestone history folds into the Milestone
|
|
330
330
|
activity logs at the bottom. The After Action Report is the whole plan's execution summarized — what
|
package/package.json
CHANGED
|
@@ -42,6 +42,13 @@ Interpret creatively and make unexpected choices that feel genuinely designed fo
|
|
|
42
42
|
|
|
43
43
|
**CODE QUALITY is not traded for visual ambition.** Every component, style and script follows the Agent Reference's **Coding Practices — ENFORCED**: clean, professional TypeScript or JavaScript in the project's own language; meaningful full-word names for components, props, state, variables, functions and CSS classes (never one- or two-letter names or obfuscation); well-structured code a human developer can read and maintain; and meaningful JSDoc on every component, hook, function and exported member (always written, but never a reason to fail a test or verification). Elaborate effects are split into well-named components and hooks, not packed into one dense file. Before finishing, re-read every file you created or changed against those rules and fix every violation.
|
|
44
44
|
|
|
45
|
+
**LIVE HUD VALUES are ENFORCED — a beautiful HUD that re-renders every frame is not finished.** Follow the Agent Reference's **Game UI Performance — ENFORCED** and `ui-design-system.md` › **Live HUD Values — ENFORCED** in every HUD, gauge, timer, bar and overlay you design or build:
|
|
46
|
+
- **Classify every HUD value.** *State* changes on discrete events (screens, pause, gear, lap, position, score, health after a hit) and lives in React. *Telemetry* changes every frame (speed, RPM, needles, arcs, timers, boost / health / charge bars, minimap markers) and **never touches React state, props, context, a store or a per-frame EventBus message**.
|
|
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
|
+
- **Never per frame:** `width` / `height` / `top` / `left`, `innerHTML`, SVG geometry (`d`, `points`), layout reads, allocations.
|
|
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.
|
|
51
|
+
|
|
45
52
|
**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.
|
|
46
53
|
|
|
47
54
|
Remember: You are capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
|
|
@@ -295,19 +295,32 @@ export function initHeroScroll(root = document, userConfig = {}) {
|
|
|
295
295
|
let lastP = 0;
|
|
296
296
|
let journeyTop = 0;
|
|
297
297
|
let journeyScroll = 1;
|
|
298
|
+
// Layout is read here, on load and resize — never in the frame loop, where a read after a style write
|
|
299
|
+
// forces a synchronous layout every frame (Agent Reference › Live HUD Values — ENFORCED).
|
|
300
|
+
let journeyHeight = 0;
|
|
301
|
+
let viewportHeight = 0;
|
|
302
|
+
let frameEndY = 0;
|
|
303
|
+
|
|
304
|
+
/** Writes text into an element only when it differs from what is shown. */
|
|
305
|
+
function writeText(element, text) {
|
|
306
|
+
if (element && element.textContent !== text) element.textContent = text;
|
|
307
|
+
}
|
|
298
308
|
let frameRaf = null;
|
|
299
309
|
|
|
300
310
|
function measure() {
|
|
301
311
|
const sTop = isDocScroller ? 0 : scroller.getBoundingClientRect().top;
|
|
302
312
|
journeyTop = journey.getBoundingClientRect().top - sTop + getY();
|
|
303
|
-
|
|
313
|
+
journeyHeight = journey.offsetHeight;
|
|
314
|
+
viewportHeight = viewportH();
|
|
315
|
+
journeyScroll = Math.max(1, journeyHeight - viewportHeight);
|
|
316
|
+
frameEndY = endY();
|
|
304
317
|
}
|
|
305
318
|
|
|
306
319
|
// where PLAY/END consider "the end": journey end (sweep:"hero") or
|
|
307
320
|
// document bottom (sweep:"page")
|
|
308
321
|
const endY = () =>
|
|
309
322
|
CFG.sweep === "hero"
|
|
310
|
-
? journeyTop +
|
|
323
|
+
? journeyTop + journeyHeight - viewportHeight
|
|
311
324
|
: maxY();
|
|
312
325
|
|
|
313
326
|
function frame() {
|
|
@@ -329,25 +342,23 @@ export function initHeroScroll(root = document, userConfig = {}) {
|
|
|
329
342
|
lastP = smoothP;
|
|
330
343
|
|
|
331
344
|
if (hud) {
|
|
332
|
-
|
|
345
|
+
writeText(hudValue, String(Math.round(valueAt(smoothP))));
|
|
333
346
|
if (hudProgress)
|
|
334
347
|
hudProgress.style.transform = `scaleX(${smoothP.toFixed(4)})`;
|
|
335
|
-
|
|
336
|
-
hudPct.textContent =
|
|
337
|
-
String(Math.round(smoothP * 100)).padStart(3, "0") + "%";
|
|
348
|
+
writeText(hudPct, String(Math.round(smoothP * 100)).padStart(3, "0") + "%");
|
|
338
349
|
if (hudSeg && TEL && TEL.segments) {
|
|
339
350
|
let seg = TEL.segments[0][1];
|
|
340
351
|
for (const [at, label] of TEL.segments) if (smoothP >= at) seg = label;
|
|
341
|
-
hudSeg
|
|
352
|
+
writeText(hudSeg, seg);
|
|
342
353
|
}
|
|
343
354
|
hud.classList.toggle(
|
|
344
355
|
"hs-hud-off",
|
|
345
|
-
getY() > journeyTop +
|
|
356
|
+
getY() > journeyTop + journeyHeight - viewportHeight * 0.55
|
|
346
357
|
);
|
|
347
358
|
}
|
|
348
359
|
|
|
349
360
|
if (gotoTop) gotoTop.classList.toggle("hs-nav-dim", getY() < 4);
|
|
350
|
-
if (gotoEnd) gotoEnd.classList.toggle("hs-nav-dim", getY() >=
|
|
361
|
+
if (gotoEnd) gotoEnd.classList.toggle("hs-nav-dim", getY() >= frameEndY - 4);
|
|
351
362
|
|
|
352
363
|
for (const o of overlays) styleOverlay(o, smoothP);
|
|
353
364
|
|
|
@@ -509,6 +520,12 @@ export function initHeroScroll(root = document, userConfig = {}) {
|
|
|
509
520
|
// (element scroll doesn't bubble to window; capture on document catches it).
|
|
510
521
|
const onResize = () => measure();
|
|
511
522
|
on(window, "resize", onResize);
|
|
523
|
+
// Content that grows after load (images, fonts) changes the page height without a window resize.
|
|
524
|
+
const sizeWatcher = typeof ResizeObserver === "function" ? new ResizeObserver(onResize) : null;
|
|
525
|
+
if (sizeWatcher) {
|
|
526
|
+
sizeWatcher.observe(journey);
|
|
527
|
+
for (const child of (isDocScroller ? document.body : scroller).children) sizeWatcher.observe(child);
|
|
528
|
+
}
|
|
512
529
|
|
|
513
530
|
/* ── go ────────────────────────────────────────────────────────── */
|
|
514
531
|
|
|
@@ -527,6 +544,7 @@ export function initHeroScroll(root = document, userConfig = {}) {
|
|
|
527
544
|
timers.clear();
|
|
528
545
|
for (const [target, ev, fn, opts] of bound)
|
|
529
546
|
target.removeEventListener(ev, fn, opts);
|
|
547
|
+
if (sizeWatcher) sizeWatcher.disconnect();
|
|
530
548
|
if (veil.parentNode) veil.parentNode.removeChild(veil);
|
|
531
549
|
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
532
550
|
delete document.body.dataset.hsState;
|
|
@@ -48,13 +48,13 @@ Run tasks from a plan: build each one with its tests, have an independent verifi
|
|
|
48
48
|
|
|
49
49
|
Work in **phases**: a `### Phase N` group in the plan, or — if the plan has none — up to 3 consecutive tasks (a `live` task, the `Update SPEC.md` task and the last task each close a group). A single task or `NEXT` is a phase of one. Under `--strict` every task is its own phase.
|
|
50
50
|
|
|
51
|
-
1. **Build** each task in the phase, in order, **following the Agent Reference's Coding Practices — ENFORCED** (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, never a reason to fail a task), **with its tests**: the cases the plan's `Tests:` names (or, with none, meaningful cases for its Acceptance and edge cases), in the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder), using the repo's test runner and style. Get them green — fix the code, not the test, unless the test is wrong. No testable surface (config, docs, assets) → say so. A task with visible output also **saves its progression snapshots** as it builds (*Snapshots tell the story*, below). The implementer keeps the **dashboard current task by task** — the live file at every step, the task's entry at start and the moment it is built — so the user never waits for the phase to end to see progress. Boxes stay unticked.
|
|
51
|
+
1. **Build** each task in the phase, in order, **following the Agent Reference's Coding Practices — ENFORCED** (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, never a reason to fail a task), and every HUD or overlay **following Game UI Performance — ENFORCED** (per-frame values reach the screen through refs and one frame loop, never React state, props, a store or a per-frame EventBus message; only changed values written, with cheap properties), **with its tests**: the cases the plan's `Tests:` names (or, with none, meaningful cases for its Acceptance and edge cases), in the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder), using the repo's test runner and style. Get them green — fix the code, not the test, unless the test is wrong. No testable surface (config, docs, assets) → say so. A task with visible output also **saves its progression snapshots** as it builds (*Snapshots tell the story*, below). The implementer keeps the **dashboard current task by task** — the live file at every step, the task's entry at start and the moment it is built — so the user never waits for the phase to end to see progress. Boxes stay unticked.
|
|
52
52
|
2. **Verify** the phase with a fresh **independent verifier** subagent (charter below), giving it the list of files changed. It returns PASS/FAIL per task, with evidence, and marks each task `verifying` on the dashboard (and the live file) as it checks it.
|
|
53
53
|
3. **Tick** `- [ ]` → `- [x]` for every task that passed, immediately — except a task that depends on one that failed in the same phase, which waits for it. Never tick partial, skipped or unverified work. Mark each ticked task `done` on the dashboard as you tick it, then write the phase's dashboard entry before its commit.
|
|
54
54
|
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
55
|
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), and the next task id — for reference only.
|
|
56
56
|
|
|
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. 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."*
|
|
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
58
|
|
|
59
59
|
`[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
60
|
|
|
@@ -651,6 +651,35 @@
|
|
|
651
651
|
font-size: 13.5px;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
+
/* ---------- Run commands ---------- */
|
|
655
|
+
.run-card { padding: 6px 22px 20px; }
|
|
656
|
+
.run-list { display: grid; grid-template-columns: minmax(0, 1fr); }
|
|
657
|
+
.run-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
|
|
658
|
+
.run-what { display: grid; gap: 2px; min-width: 0; }
|
|
659
|
+
.run-what strong { font-size: 14.5px; }
|
|
660
|
+
.run-what span { color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
|
|
661
|
+
.run-copy { display: flex; gap: 8px; align-items: center; min-width: 0; }
|
|
662
|
+
.run-command { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--bg-sunken); font: 600 12.5px/1.45 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
|
|
663
|
+
.copy-command { flex: none; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-muted); font: 600 11.5px/1 var(--font-mono); cursor: pointer; }
|
|
664
|
+
.copy-command:hover { color: var(--text); border-color: var(--accent); }
|
|
665
|
+
.copy-command.is-copied { color: var(--done); border-color: var(--done); }
|
|
666
|
+
.run-builder { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
|
|
667
|
+
.run-builder-title { font: 700 11px/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
|
|
668
|
+
/* The task picker and the options share one line, the options centred in the room beside it. A select is as
|
|
669
|
+
wide as its longest option (a long task title), so it gets a set width instead and can never push them down. */
|
|
670
|
+
.run-controls { display: flex; flex-wrap: nowrap; gap: 12px 20px; align-items: center; }
|
|
671
|
+
.run-field { flex: 0 1 auto; display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 13px; color: var(--text-muted); }
|
|
672
|
+
.run-field select { flex: 0 1 460px; width: 460px; min-width: 140px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--bg-sunken); color: var(--text); font: 13px/1.3 var(--font-sans, inherit); text-overflow: ellipsis; }
|
|
673
|
+
.run-flags { flex: none; margin: 0 auto; display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 8px 16px; white-space: nowrap; }
|
|
674
|
+
.run-flag { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
|
|
675
|
+
.run-flag input { accent-color: var(--accent); }
|
|
676
|
+
@media (max-width: 760px) {
|
|
677
|
+
.run-row { grid-template-columns: minmax(0, 1fr); }
|
|
678
|
+
.run-controls { flex-wrap: wrap; }
|
|
679
|
+
.run-field { flex-basis: 100%; }
|
|
680
|
+
.run-flags { flex: 1 1 100%; min-width: 0; margin: 0; flex-wrap: wrap; justify-content: flex-start; white-space: normal; }
|
|
681
|
+
}
|
|
682
|
+
|
|
654
683
|
/* ---------- Verbose task details and After Action Report sections ---------- */
|
|
655
684
|
.task-details { display: grid; gap: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
|
|
656
685
|
.detail-block h4, .aar-section h4 { margin: 0 0 8px; }
|
|
@@ -823,6 +852,15 @@
|
|
|
823
852
|
const VERDICT_BADGE_MAX_LENGTH = 16;
|
|
824
853
|
// The report's task-by-task testing table starts open for a short plan and folded for a long one.
|
|
825
854
|
const TESTING_TABLE_OPEN_ROWS = 12;
|
|
855
|
+
/** The bt-execute options the page offers, in the order the command line takes them. */
|
|
856
|
+
const RUN_OPTIONS = [
|
|
857
|
+
{ key: 'autoPilot', flag: '--auto-pilot', label: 'Auto-pilot', hint: 'Unattended: never stops to ask; retries, then defers a task that keeps failing' },
|
|
858
|
+
{ key: 'strict', flag: '--strict', label: 'Strict', hint: 'An adversarial verifier on every task' },
|
|
859
|
+
{ key: 'verbose', flag: '--verbose', label: 'Verbose', hint: 'Every task and the After Action Report written up in depth' },
|
|
860
|
+
{ key: 'noTimeLimit', flag: '--no-time-limit', label: 'No time limit', hint: 'Turns off the default TIME MATTERS mode' },
|
|
861
|
+
];
|
|
862
|
+
// "Build your own" keeps its choices when the page refreshes its data.
|
|
863
|
+
const runChoice = { tasks: 'ALL', autoPilot: true, strict: false, verbose: false, noTimeLimit: false };
|
|
826
864
|
// A verifier result that names a live check: "live two-tab race in headless Chrome", "end-to-end on WebGPU".
|
|
827
865
|
const LIVE_CHECK_WORDS = /\blive\b|chrome|browser|webgl|webgpu|unity editor|play ?mode/i;
|
|
828
866
|
/** Where the Babylon Toolkit Desktop Agent, whose skills generate this dashboard, is published. */
|
|
@@ -865,6 +903,7 @@
|
|
|
865
903
|
try {
|
|
866
904
|
render();
|
|
867
905
|
wireLightbox();
|
|
906
|
+
wireRunCommands();
|
|
868
907
|
} catch (error) {
|
|
869
908
|
// A malformed field must never leave a blank page: say what broke, and keep checking for a repaired file.
|
|
870
909
|
console.error('Dashboard render failed', error);
|
|
@@ -893,6 +932,7 @@
|
|
|
893
932
|
'<main class="page">',
|
|
894
933
|
renderStats(allTasks, doneCount),
|
|
895
934
|
view === 'running' ? renderCurrentActivity(allTasks) : '',
|
|
935
|
+
showsRunCommands(view) ? renderRunCommands(allTasks, view) : '',
|
|
896
936
|
view === 'finished' ? renderAfterAction(allTasks, doneCount) : '',
|
|
897
937
|
renderPhases(),
|
|
898
938
|
renderDecisions(),
|
|
@@ -946,6 +986,7 @@
|
|
|
946
986
|
function renderNav(updateCount, view) {
|
|
947
987
|
const links = [
|
|
948
988
|
view === 'running' ? ['current-activity', 'Current run'] : null,
|
|
989
|
+
showsRunCommands(view) ? ['run-commands', view === 'planned' ? 'Start' : 'Continue'] : null,
|
|
949
990
|
view === 'finished' ? ['after-action', 'Summary'] : null,
|
|
950
991
|
['phases', 'Phases'],
|
|
951
992
|
['decisions', 'Decisions'],
|
|
@@ -1735,6 +1776,142 @@
|
|
|
1735
1776
|
|
|
1736
1777
|
/* ===================== Data helpers ===================== */
|
|
1737
1778
|
|
|
1779
|
+
/* ===================== Run commands ===================== */
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
/** The commands show while there is work to start: a plan not yet run, or one paused part way. */
|
|
1783
|
+
function showsRunCommands(view) {
|
|
1784
|
+
return view === 'planned' || effectiveStatus() === 'paused';
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
/** The plan as bt-execute takes it, from the project root: `@.agents/specs/<slug>/documents/<slug>_plan.md`. */
|
|
1788
|
+
function planReference() {
|
|
1789
|
+
const slug = (report.feature && report.feature.slug) || '';
|
|
1790
|
+
const plan = (report.documents || []).find((document) => /plan/i.test(document.label || '') && document.path);
|
|
1791
|
+
const relativePath = plan ? String(plan.path).replace(/^\.?\//, '') : `documents/${slug}_plan.md`;
|
|
1792
|
+
return `@.agents/specs/${slug}/${relativePath}`;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
function runCommand(flags, tasks) {
|
|
1796
|
+
return ['/bt-execute', ...flags, planReference(), tasks].filter(Boolean).join(' ');
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/** A phase as a task range in plan order (`T4-T7`, or `T4` alone); ticked tasks inside it are skipped by bt-execute. */
|
|
1800
|
+
function phaseRange(phase) {
|
|
1801
|
+
const ids = (phase.tasks || []).map((task) => task.id).filter(Boolean);
|
|
1802
|
+
if (!ids.length) return '';
|
|
1803
|
+
return ids.length === 1 ? ids[0] : `${ids[0]}-${ids[ids.length - 1]}`;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
function renderRunCommands(allTasks, view) {
|
|
1807
|
+
const starting = view === 'planned';
|
|
1808
|
+
const phases = (report.phases || []).filter((phase) => phaseRange(phase));
|
|
1809
|
+
const remaining = allTasks.filter((task) => task.status !== 'done' && task.status !== 'deferred');
|
|
1810
|
+
const nextTask = remaining[0];
|
|
1811
|
+
const nextPhase = phases.find((phase) => (phase.tasks || []).some((task) => task.status !== 'done' && task.status !== 'deferred'));
|
|
1812
|
+
const firstTask = allTasks[0];
|
|
1813
|
+
const phaseLabel = (phase) => `Phase ${phase.number} — ${phase.name || ''}`;
|
|
1814
|
+
|
|
1815
|
+
const presets = starting
|
|
1816
|
+
? [
|
|
1817
|
+
['Every task, unattended', 'Auto-pilot builds, verifies and commits each task in turn without stopping to ask', runCommand(['--auto-pilot'], 'ALL')],
|
|
1818
|
+
['Every task, with you on hand', 'Runs them all, and stops when it needs your decision', runCommand([], 'ALL')],
|
|
1819
|
+
nextPhase ? [`${phaseLabel(nextPhase)} only`, `Tasks ${phaseRange(nextPhase)}`, runCommand([], phaseRange(nextPhase))] : null,
|
|
1820
|
+
firstTask ? [`The first task only — ${firstTask.id}`, firstTask.title || '', runCommand([], firstTask.id)] : null,
|
|
1821
|
+
['Every task, fully written up', 'Auto-pilot with --verbose: every task and the After Action Report documented in depth', runCommand(['--auto-pilot', '--verbose'], 'ALL')],
|
|
1822
|
+
]
|
|
1823
|
+
: [
|
|
1824
|
+
['Every remaining task, unattended', `${remaining.length} task${remaining.length === 1 ? '' : 's'} left, finished without stopping to ask`, runCommand(['--auto-pilot'], 'ALL')],
|
|
1825
|
+
nextTask ? [`The next task only — ${nextTask.id}`, nextTask.title || '', runCommand([], 'NEXT')] : null,
|
|
1826
|
+
remaining.length > 2 ? ['The next three tasks', remaining.slice(0, 3).map((task) => task.id).join(', '), runCommand([], 'NEXT:3')] : null,
|
|
1827
|
+
nextPhase ? [`Finish ${phaseLabel(nextPhase)}`, `Tasks ${phaseRange(nextPhase)}; the ticked ones are skipped`, runCommand([], phaseRange(nextPhase))] : null,
|
|
1828
|
+
];
|
|
1829
|
+
|
|
1830
|
+
const taskChoices = [
|
|
1831
|
+
['ALL', 'All remaining tasks'],
|
|
1832
|
+
['NEXT', 'The next unchecked task'],
|
|
1833
|
+
['NEXT:3', 'The next three tasks'],
|
|
1834
|
+
...phases.map((phase) => [phaseRange(phase), `${phaseLabel(phase)} (${phaseRange(phase)})`]),
|
|
1835
|
+
...(starting ? allTasks : remaining).filter((task) => task.id).map((task) => [task.id, `${task.id} — ${task.title || ''}`]),
|
|
1836
|
+
];
|
|
1837
|
+
if (!taskChoices.some(([value]) => value === runChoice.tasks)) runChoice.tasks = 'ALL';
|
|
1838
|
+
|
|
1839
|
+
const rows = presets.filter(Boolean).map(([what, detail, command]) => `
|
|
1840
|
+
<div class="run-row">
|
|
1841
|
+
<div class="run-what"><strong>${escapeHtml(what)}</strong>${detail ? `<span>${formatInline(detail)}</span>` : ''}</div>
|
|
1842
|
+
${copyableCommand(command)}
|
|
1843
|
+
</div>`).join('');
|
|
1844
|
+
|
|
1845
|
+
return `
|
|
1846
|
+
<section id="run-commands">
|
|
1847
|
+
<div class="section-head"><h2>${starting ? 'Start this plan' : 'Continue this plan'}</h2><span class="section-note">Copy a command into your agent — ticked tasks are always skipped, so any of these is safe to run again</span></div>
|
|
1848
|
+
<div class="card run-card">
|
|
1849
|
+
<div class="run-list">${rows}</div>
|
|
1850
|
+
<div class="run-builder">
|
|
1851
|
+
<div class="run-builder-title">Build your own</div>
|
|
1852
|
+
<div class="run-controls">
|
|
1853
|
+
<label class="run-field"><span>Tasks</span>
|
|
1854
|
+
<select data-run-choice="tasks">${taskChoices.map(([value, label]) => `<option value="${escapeAttribute(value)}"${value === runChoice.tasks ? ' selected' : ''}>${escapeHtml(label)}</option>`).join('')}</select>
|
|
1855
|
+
</label>
|
|
1856
|
+
<div class="run-flags">${RUN_OPTIONS.map((option) => `
|
|
1857
|
+
<label class="run-flag" title="${escapeAttribute(option.hint)}"><input type="checkbox" data-run-choice="${option.key}"${runChoice[option.key] ? ' checked' : ''}> ${escapeHtml(option.label)}</label>`).join('')}
|
|
1858
|
+
</div>
|
|
1859
|
+
</div>
|
|
1860
|
+
<div class="run-built">${copyableCommand(builtCommand(), 'built-command')}</div>
|
|
1861
|
+
</div>
|
|
1862
|
+
</div>
|
|
1863
|
+
</section>`;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
function builtCommand() {
|
|
1867
|
+
return runCommand(RUN_OPTIONS.filter((option) => runChoice[option.key]).map((option) => option.flag), runChoice.tasks);
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
function copyableCommand(command, id = '') {
|
|
1871
|
+
return `<div class="run-copy"><code class="run-command"${id ? ` id="${id}"` : ''}>${escapeHtml(command)}</code><button type="button" class="copy-command" data-copy="${escapeAttribute(command)}">Copy</button></div>`;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/** Copy buttons and the command builder; delegated, so they keep working after the page redraws. */
|
|
1875
|
+
function wireRunCommands() {
|
|
1876
|
+
document.addEventListener('click', (event) => {
|
|
1877
|
+
const button = event.target.closest('.copy-command');
|
|
1878
|
+
if (!button) return;
|
|
1879
|
+
const text = button.getAttribute('data-copy') || '';
|
|
1880
|
+
const copied = () => {
|
|
1881
|
+
button.textContent = 'Copied';
|
|
1882
|
+
button.classList.add('is-copied');
|
|
1883
|
+
setTimeout(() => { button.textContent = 'Copy'; button.classList.remove('is-copied'); }, 1500);
|
|
1884
|
+
};
|
|
1885
|
+
if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).then(copied, () => { copyWithSelection(text); copied(); });
|
|
1886
|
+
else { copyWithSelection(text); copied(); }
|
|
1887
|
+
});
|
|
1888
|
+
document.addEventListener('change', (event) => {
|
|
1889
|
+
const control = event.target.closest('[data-run-choice]');
|
|
1890
|
+
if (!control) return;
|
|
1891
|
+
const key = control.getAttribute('data-run-choice');
|
|
1892
|
+
runChoice[key] = control.type === 'checkbox' ? control.checked : control.value;
|
|
1893
|
+
const command = builtCommand();
|
|
1894
|
+
const output = document.getElementById('built-command');
|
|
1895
|
+
if (output) {
|
|
1896
|
+
output.textContent = command;
|
|
1897
|
+
output.nextElementSibling.setAttribute('data-copy', command);
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
/** Where the clipboard API is unavailable, copy through a hidden selection; the command also stays visible to copy by hand. */
|
|
1903
|
+
function copyWithSelection(text) {
|
|
1904
|
+
const area = document.createElement('textarea');
|
|
1905
|
+
area.value = text;
|
|
1906
|
+
area.setAttribute('readonly', '');
|
|
1907
|
+
area.style.position = 'fixed';
|
|
1908
|
+
area.style.opacity = '0';
|
|
1909
|
+
document.body.appendChild(area);
|
|
1910
|
+
area.select();
|
|
1911
|
+
try { document.execCommand('copy'); } catch (error) { /* left for the user to copy by hand */ }
|
|
1912
|
+
area.remove();
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1738
1915
|
function collectTasks() {
|
|
1739
1916
|
return (report.phases || []).flatMap((phase) => phase.tasks || []);
|
|
1740
1917
|
}
|
|
@@ -101,6 +101,7 @@ threshold AND every gate passes.**
|
|
|
101
101
|
| **Console** | any error in the browser console (warnings are reported, not fatal, unless the card says otherwise) |
|
|
102
102
|
| **Component authority** | a protected `TOOLKIT.*` component was reimplemented, bypassed or deleted without the full replacement-evidence checklist in the round journal |
|
|
103
103
|
| **Coding practices** | any code the round created or changed breaks the Agent Reference's **Coding Practices — ENFORCED**: TypeScript or JavaScript that is not clean and professional (needless `any` or loose typing, code converted to the other language unasked), one- or two-letter or obfuscated names (outside the allowed loop counters, axis/`uv` names, toolkit aliases and names that bind to exported data), dead code or leftover `console.log`, or code a developer new to the project could not read and maintain. **JSDoc never fails this gate**: list missing or thin JSDoc as a low-priority entry in the gap list. Quote the offending lines |
|
|
104
|
+
| **Game UI performance** | any HUD, overlay or GUI the round created or changed breaks the Agent Reference's **Game UI Performance — ENFORCED**: a per-frame value (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(` or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or `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. Quote the offending lines |
|
|
104
105
|
| **Camera lock** | the evidence was not captured from the transform recorded in `cameras.md` |
|
|
105
106
|
| **Pipeline gate** | whatever the deliverable kind's pipeline reference declares (export-boundary integrity, GUID survival, licence tier …) |
|
|
106
107
|
|
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -52,7 +52,7 @@ Execution time is mostly *how the work is proven*, not the code. Keep proof stro
|
|
|
52
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
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
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. Code-quality checks are never a separate task; bt-execute's verifier enforces them on every task.
|
|
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. Code-quality checks are never a separate task; bt-execute's verifier enforces them on every task.
|
|
56
56
|
|
|
57
57
|
## Step 3. Write the plan
|
|
58
58
|
|