@babylonjs-toolkit/agent 1.2.0 → 1.2.2
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 +31 -21
- package/lib/claude-settings.js +146 -1
- package/lib/doctor.js +21 -4
- package/lib/install.js +67 -4
- package/package.json +1 -1
- package/scripts/hooks/block-sleep.js +138 -0
- package/skills/bt-atlas/SKILL.md +22 -5
- package/skills/bt-design/references/3d-hero-docs.md +10 -3
- package/skills/bt-design/references/3d-hero-scroll.md +30 -5
- package/skills/bt-execute/SKILL.md +89 -120
- package/skills/bt-execute/scripts/dashboard.mjs +279 -19
- package/skills/bt-execute/templates/dashboard/data-schema.md +36 -15
- package/skills/bt-gauntlet/SKILL.md +4 -4
- package/skills/bt-gauntlet/references/spec-composition.md +4 -2
- package/skills/bt-gauntlet/references/target-images.md +28 -4
- package/skills/bt-gauntlet/references/unity-pipeline.md +30 -8
- package/skills/bt-hero/SKILL.md +3 -3
- package/skills/bt-landing/SKILL.md +1 -1
- package/skills/bt-plan/SKILL.md +52 -62
- package/skills/bt-prototype/SKILL.md +3 -3
- package/skills/bt-unwrap/SKILL.md +396 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/bt_unwrap.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/image_utils.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/mesh_tools.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/model_io.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/previews.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/rasterizer.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/reference_views.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/reference_warp.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/texture_bake.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/texture_compose.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/uv_layout.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/bt_unwrap.py +678 -0
- package/skills/bt-unwrap/scripts/blender/image_utils.py +264 -0
- package/skills/bt-unwrap/scripts/blender/mesh_tools.py +508 -0
- package/skills/bt-unwrap/scripts/blender/model_io.py +135 -0
- package/skills/bt-unwrap/scripts/blender/previews.py +205 -0
- package/skills/bt-unwrap/scripts/blender/rasterizer.py +217 -0
- package/skills/bt-unwrap/scripts/blender/reference_views.py +945 -0
- package/skills/bt-unwrap/scripts/blender/reference_warp.py +571 -0
- package/skills/bt-unwrap/scripts/blender/texture_bake.py +390 -0
- package/skills/bt-unwrap/scripts/blender/texture_compose.py +596 -0
- package/skills/bt-unwrap/scripts/blender/uv_layout.py +605 -0
- package/skills/bt-unwrap/scripts/bt-unwrap.mjs +165 -0
|
@@ -216,17 +216,39 @@ return UnityEditor.AssetDatabase.AssetPathToGUID(p) + " rig=" + i.animationType
|
|
|
216
216
|
matching the Unity Avatar/Animator rig, and `add_leaf_bones=False` on FBX export.
|
|
217
217
|
|
|
218
218
|
**Textures are generated, not procedural.** Use `generate_image` for albedo, normals, roughness masks and
|
|
219
|
-
detail maps. It goes to the backend recorded in `pipeline.md`: the toolkit's `kie-image` MCP by default,
|
|
220
|
-
|
|
219
|
+
detail maps. It goes to the backend recorded in `pipeline.md`: the toolkit's `kie-image` MCP by default, the
|
|
220
|
+
Higgsfield API (`node "$HF_API" <model-path> … --out <dir>`, then move the saved file to
|
|
221
|
+
`Assets/Textures/<map>.png`), or the Higgsfield CLI (`node scripts/hf-generate.mjs <model> … --out Assets/Textures/<map>.png`),
|
|
222
|
+
per `target-images.md` §1a. Substituting
|
|
221
223
|
procedural noise or flat colours for maps the target needs is a gate failure, and the commonest reason an
|
|
222
224
|
asset reads as plastic.
|
|
223
225
|
|
|
224
|
-
**Image → starting mesh
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
**Image → starting mesh.** When a model part starts from nothing, an image-to-3D model can turn the locked
|
|
227
|
+
target's subject into a GLB blockout. Pick the generator in this order and record it in `pipeline.md`:
|
|
228
|
+
|
|
229
|
+
1. **Hi3D**, when the project's `.env` has `HI3D_ACCESS_KEY` + `HI3D_SECRET_KEY`. It is the preferred mesh generator
|
|
230
|
+
([Hi3D API](https://raw.githubusercontent.com/babylontoolkit/agent/main/references/web-hi3d-api.md)):
|
|
231
|
+
```
|
|
232
|
+
HI3D_API="https://raw.githubusercontent.com/babylontoolkit/agent/main/references/hi3d/hi3d-api.mjs"
|
|
233
|
+
node "$HI3D_API" image-to-3d --estimate --file images=<subject.png> --set face=100000
|
|
234
|
+
node "$HI3D_API" image-to-3d --out <round-dir> --name blockout --file images=<subject.png> --set face=100000
|
|
235
|
+
```
|
|
236
|
+
45 credits ($0.90) at the default `hi3dv3.0` / `2048quality`. For 2–4 views, use
|
|
237
|
+
`--view front=… --view back=… --view left=… --view right=…` in place of `--file images=…`. Hi3D's order differs
|
|
238
|
+
from Tripo's, and `--view` gets it right. For a cheap shape iteration, use
|
|
239
|
+
`--set model=hitem3dv2.1 --set resolution=1536fast` (25 credits). Never resubmit a task that timed out; resume it
|
|
240
|
+
with `--task <task_id>`.
|
|
241
|
+
2. **Higgsfield API**, when `.env` has `HIGGSFIELD_API_KEY` (`HF_API` is the installed wrapper, `target-images.md` §1a):
|
|
242
|
+
`node "$HF_API" tripo3d/h3.1/image-to-3d --out <round-dir> --file image_url=<subject.png>`, then move the saved
|
|
243
|
+
`.glb` to `<round-dir>/blockout.glb` (`tripo3d/h3.1/multiview-to-3d` with `--file image_urls[]=…` for 2–4 views,
|
|
244
|
+
in Tripo's order: front, left, back, right). Run `--estimate` first.
|
|
245
|
+
3. **Higgsfield CLI**, when it is signed in:
|
|
246
|
+
`node scripts/hf-generate.mjs tripo_h3_1_image_to_3d --image-references <subject.png> --out <round-dir>/blockout.glb`
|
|
247
|
+
(9 credits; `tripo_h3_1_multiview_to_3d` for 2–4 views). Run `--cost` first.
|
|
248
|
+
|
|
249
|
+
Log the cost of each one. Confirm the result with `file blockout.glb` (`glTF binary`). Then run `bt-unwrap` on it
|
|
250
|
+
with the same reference views, or import it into Blender, and refine it like any other source mesh: retopo, UVs,
|
|
251
|
+
LODs, weights under the gates above. It is a head start on the silhouette, never a finished asset. Its topology and UVs will not pass the
|
|
230
252
|
model rubric untouched.
|
|
231
253
|
|
|
232
254
|
---
|
package/skills/bt-hero/SKILL.md
CHANGED
|
@@ -37,7 +37,7 @@ Whatever is present is used verbatim; the intake resolves the rest (Step 1). **T
|
|
|
37
37
|
Every piece of a 3D hero scroll belongs to exactly one tier. This is the rule that keeps the intake small and the output deterministic:
|
|
38
38
|
|
|
39
39
|
- **Tier 1 — Invariants.** How the mechanic works. Owned by bt-design's reference and templates; never asked, never in the brief, never overridable: muted footage, the all-intra scrub encode, blob preload, veiled cuts, film-speed autoplay, cancel semantics, the `HS_CONFIG`/markup syntax, and the **verification protocol — which always runs, without being requested.**
|
|
40
|
-
- **Tier 2 — Defaults.** Sensible values supplied silently; the user may override any of them in their input (recorded in the brief's `Overrides` section): aspect ratio (default 16:9), clip duration (**backend-derived — probe the configured video model's real output; never assume a number**), the 4-beat REVEAL → MOTION → SHIFT → FINALE arc, `sweep: page`, controls all-on (`sweep: page`) / HUD+PLAY (`sweep: hero`), the scroll-length formula, poster = first film frame, generation backend (**KIE MCP by default;
|
|
40
|
+
- **Tier 2 — Defaults.** Sensible values supplied silently; the user may override any of them in their input (recorded in the brief's `Overrides` section): aspect ratio (default 16:9), clip duration (**backend-derived — probe the configured video model's real output; never assume a number**), the 4-beat REVEAL → MOTION → SHIFT → FINALE arc, `sweep: page`, controls all-on (`sweep: page`) / HUD+PLAY (`sweep: hero`), the scroll-length formula, poster = first film frame, generation backend (**KIE MCP by default; Higgsfield when that is what's set up or the user names it: the API when `.env` has `HIGGSFIELD_API_KEY`, else the CLI**; see bt-design `3d-hero-scroll.md` §2 for both Higgsfield mappings).
|
|
41
41
|
- **Tier 3 — Creative slots.** The only things intake deals in — the eight slots below.
|
|
42
42
|
|
|
43
43
|
If it's how the mechanic works → Tier 1. If it's a value that could legitimately differ per project → Tier 2. If it's a creative decision about *this* product → Tier 3.
|
|
@@ -62,7 +62,7 @@ Then resolve every unfilled slot by exactly one of two paths:
|
|
|
62
62
|
- **Enough to fly** — the input contains a usable star (an idea sentence, or an image/video whose subject is clear): fill every remaining slot from its default, ask **nothing**, and proceed. This is the one-shot path.
|
|
63
63
|
- **Not enough to fly** — empty input, or fragments with no discernible star: ask **only the unanswered questions** — inline, conversationally, as ONE compact numbered list (never one-at-a-time interrogation, never a structured question UI). Tell the user loose prose, partial answers, and "you pick" are all fine. What they answer is used; what they skip gets the default. Then proceed — do not re-confirm.
|
|
64
64
|
|
|
65
|
-
**Footage feasibility check:** if there is no provided footage AND no image/video generation backend configured (KIE MCP — the default, Higgsfield CLI, built-in generation, …), STOP — this pattern is wrong without footage; recommend a static hero instead (per the bt-design reference intake).
|
|
65
|
+
**Footage feasibility check:** if there is no provided footage AND no image/video generation backend configured (KIE MCP — the default, the Higgsfield API or CLI, built-in generation, …), STOP — this pattern is wrong without footage; recommend a static hero instead (per the bt-design reference intake).
|
|
66
66
|
|
|
67
67
|
## Step 2 — Write the hero brief (the save file)
|
|
68
68
|
|
|
@@ -82,7 +82,7 @@ status: draft
|
|
|
82
82
|
|
|
83
83
|
## 2. Footage Source
|
|
84
84
|
- Mode: generate | provided
|
|
85
|
-
- Backend: kie | higgsfield | <other> (generate mode only — recorded so a re-run uses the same one)
|
|
85
|
+
- Backend: kie | higgsfield-api | higgsfield-cli | <other> (generate mode only — recorded so a re-run uses the same one; `higgsfield` in an older brief means the CLI)
|
|
86
86
|
- Anchor: <image-generation prompt for the hero anchor> | <path/to/existing-image-or-video>
|
|
87
87
|
|
|
88
88
|
## 3. The Journey
|
|
@@ -124,7 +124,7 @@ The Layout law from Step 2 binds these surfaces too — full-bleed, responsive,
|
|
|
124
124
|
|
|
125
125
|
If the platform's `generate_image` / `generate_video` tools are available on this turn, use them to make the design beautiful: a hero background, a logo/wordmark, splash-adjacent accents (16:9 for wide heroes, 1:1 for badges/logos; png when alpha matters). Make ALL generate calls FIRST, in ONE parallel round, before writing any files; reference the returned `/assets/generated/…` paths exactly as returned (the one exception to never-invent-an-asset-path) — the renders land in the background, so every surface must look finished while they do (styled color/gradient fallback behind each image, never a blank box). At most ONE short looping hero video, and only if it truly elevates the design — video costs the user hundreds of credits. If the tools are absent, design with CSS + the images on disk instead.
|
|
126
126
|
|
|
127
|
-
**Backend mapping (Claude Code and other MCP hosts).** Where no platform-native `generate_*` is present, use the **KIE MCP** servers by default (`web-kie-servers.md`): pass `out_path` under the project's `assets/generated/` folder and reference that path. When the **Higgsfield CLI** is the set-up or requested backend (`web-higgsfield-cli.md`), generate through the reference's `scripts/hf-generate.mjs` wrapper, which saves each result to `--out` (for example `node scripts/hf-generate.mjs gpt_image_2_5 --prompt "…" --aspect_ratio 16:9 --resolution 2k --out assets/generated/hero-bg.png`). Launch all the calls in ONE parallel round in the background (shell `&`), write the files with their fallbacks in place, then `wait`. Image results are **PNG**, so reference `.png` paths (the wrapper saves `--out x.jpg` as `x.png` and reports it). Never reference a Higgsfield CDN URL. Run `--cost` first and state the total.
|
|
127
|
+
**Backend mapping (Claude Code and other MCP hosts).** Where no platform-native `generate_*` is present, use the **KIE MCP** servers by default (`web-kie-servers.md`): pass `out_path` under the project's `assets/generated/` folder and reference that path. When Higgsfield is the set-up or requested backend and the project's `.env` has **`HIGGSFIELD_API_KEY`**, use the **Higgsfield API** through the Reference's installed `hf-api.mjs` (`web-higgsfield-cli.md`, run in place; `HF_API="https://raw.githubusercontent.com/babylontoolkit/agent/main/references/higgsfield/hf-api.mjs"`): for example `node "$HF_API" xai/grok-imagine-image-2.0 --out assets/generated/gen --set prompt="…" --set aspect_ratio=16:9 --set resolution=2k`, then move the PNG it lists under `files` to `assets/generated/hero-bg.png`. Run `--estimate` first and state the total. Otherwise, when the **Higgsfield CLI** is the set-up or requested backend (`web-higgsfield-cli.md`), generate through the reference's `scripts/hf-generate.mjs` wrapper, which saves each result to `--out` (for example `node scripts/hf-generate.mjs gpt_image_2_5 --prompt "…" --aspect_ratio 16:9 --resolution 2k --out assets/generated/hero-bg.png`). Launch all the calls in ONE parallel round in the background (shell `&`), write the files with their fallbacks in place, then `wait`. Image results are **PNG**, so reference `.png` paths (the wrapper saves `--out x.jpg` as `x.png` and reports it). Never reference a Higgsfield CDN URL. Run `--cost` first and state the total.
|
|
128
128
|
|
|
129
129
|
Generated art goes on the LANDING PAGE — never on the splash/preloader (Step 3's lightweight rule). Art direction for every generate call comes from `DESIGN.md` — prompt the renders in its palette and atmosphere so the art belongs to the same design as the CSS around it.
|
|
130
130
|
|
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bt-plan
|
|
3
3
|
description: "The Babylon Toolkit Plan Skill creates the detailed technical plan for the specified feature spec file. Use when asked to plan or produce implementation tasks for an existing spec. Also supports a Quick Plan mode: when given only a brief (no spec file), it interviews the user to build a mini-spec and plans from that. Add `--heavy` for Heavy Plan mode: a decision-complete plan (numbered Decisions log, Design Reference with real interfaces and patterns, self-contained task blocks, cold-context audit) that keeps a long run of fresh-context tasks cohesive. Add `--parity` for numeric parity gates instead of the default functional proof. Always planning-only — it writes the plan file into the feature's folder (`.agents/specs/<slug>/`, which a Quick Plan creates) plus the feature's live dashboard in its planned state, and stops; execution is the separate bt-execute skill."
|
|
4
|
-
allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Agent, Task
|
|
4
|
+
allowed-tools: Read, Grep, Glob, Write, Bash(node:*), Bash(date:*), WebFetch(domain:raw.githubusercontent.com), Agent, Task
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ordered checklist of tasks that `bt-execute` runs — plus the feature's dashboard (`.agents/specs/<slug>/dashboard.html`) in its planned state, which bt-execute keeps current — live activity while a run is going, an After Action Report once it is over. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
|
|
@@ -22,10 +22,10 @@ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ord
|
|
|
22
22
|
## Ground rules
|
|
23
23
|
|
|
24
24
|
- **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — research only what the plan needs, keep subagents few and their questions narrow, and do not re-read what you already have. Begin every subagent prompt with `TIME MATTERS.` Print `⏱️ [bt-plan] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-plan] No time limit`, and do not add it). Speed never skips a required step, the Heavy Plan cold-context audit, or anything the plan needs to be complete.
|
|
25
|
-
- **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder, plus the one `.gitignore` line Step 4 names. Never implement a task, edit source, or run builds/tests — not even a trivial first task.
|
|
25
|
+
- **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder, plus the one `.gitignore` line Step 4 names; the only commands you run are the shell clock and Step 4's dashboard check. Never implement a task, edit source, or run builds/tests — not even a trivial first task. The passing check is the last action; the user runs `bt-execute` separately.
|
|
26
26
|
- **Babylon work:** if you have not read the Babylon Toolkit Agent Reference in this session, read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — the authority for conventions and API; read sub-documents only when relevant, and again only if a context compaction made you forget it. If it cannot be read, stop and tell the user — do not guess at the API.
|
|
27
27
|
- **Say what you are doing.** Before any step that takes more than a few seconds print one short line — `🔎 [bt-plan] <what> …` — and one when it returns; one line per subagent going out and coming back. A silent run looks like a hang and gets cancelled.
|
|
28
|
-
- **Subagents:** running this skill is the user's request to use them where it says so. Use whatever subagent tool your host provides (
|
|
28
|
+
- **Subagents:** running this skill is the user's request to use them where it says so. Use whatever subagent tool your host provides (e.g. `Agent` or `Task`); if there is none, work inline and say so. Tell exploration subagents they need not read the Agent Reference.
|
|
29
29
|
|
|
30
30
|
## Step 1. Analyze (required before writing)
|
|
31
31
|
|
|
@@ -44,15 +44,17 @@ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ord
|
|
|
44
44
|
Execution time is mostly *how the work is proven*, not the code. Keep proof strong and cheap:
|
|
45
45
|
|
|
46
46
|
1. **Tasks are real units of work** — something a developer would commit on its own, with its tests. Guide: `small` 1–3 tasks, `medium` 3–8, `large` as needed. Merge tasks that touch the same code for the same purpose; split only when a task would not fit in one sitting. Going well past the guide needs a one-line reason in Codebase Analysis.
|
|
47
|
-
2. **Phases.** Group tasks under `### Phase N — <name>`. bt-execute runs one independent verifier per phase. Small plan = one phase; otherwise 2–4 related tasks ending at a natural checkpoint.
|
|
48
|
-
3.
|
|
49
|
-
4.
|
|
50
|
-
5. **
|
|
51
|
-
6. **
|
|
52
|
-
7. **
|
|
53
|
-
8. **
|
|
54
|
-
9. **
|
|
55
|
-
10. **
|
|
47
|
+
2. **Phases.** Group tasks under `### Phase N — <name>`. bt-execute runs one independent verifier per phase, once all its tracks are built. Small plan = one phase; otherwise 2–4 related tasks ending at a natural checkpoint. **A plan of 3 tasks or fewer runs inline**, and says so (Step 3).
|
|
48
|
+
3. **Tracks — parallel builders that never conflict.** Every task has a `Track:` letter; bt-execute runs one builder per track at the same time, each owning its track's files (Step 3 lists them). Tasks whose files overlap share a track; tasks that depend on each other share a track or sit in different phases. Within a phase, tasks are numbered in track order. A file two tracks need — a route table, `package.json`, a lockfile, a shared stylesheet, a test list — belongs to exactly one track, or to a short closing integration step the orchestrator runs after the tracks. Dependency changes (`npm install`) go to one track, before the others start, or to the integration step. Unity (or Blender) work for one project stays on one track — Unity holds one editor per project.
|
|
49
|
+
4. **`Verify level`** per task: `standard` (build, named tests, diff review) or `live` (needs the dev server, a browser, Unity or Blender to observe). Mark `live` whenever correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity. If a live check may be impossible where the plan runs (needs credentials, data or hardware), say in the task what to report instead.
|
|
50
|
+
5. **Verification — complete, never duplicated.** Acceptance names **every** requirement a user of the feature would notice, each **once**, as a checkable statement — no line cap. No Acceptance line repeats a check another task already proves; a read-and-confirm check belongs to the task that made the change. bt-execute's builder never re-proves the Acceptance live — the phase verifier is the only live checker. Every task keeps its own checks for what it changed, in its own phase, never deferred to a later one. A check that needs a costly session (several browser pages, a long play-through, a Unity re-export, a second engine) is planned **once per phase**: one session proves every task in that phase that needs it, and the tracks section says which. Never schedule a capture or page session **per task** in the Steps — the most expensive mistake this skill can make. The last feature task keeps a `live` end-to-end check of the whole feature when it has anything on screen, in its Acceptance (not a separate task) — in addition to the per-task checks, never instead.
|
|
51
|
+
6. **Named tests** with expected outcomes for every task that has a testable surface, in test files under the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder). No probe suites, fuzzing or mutation testing unless the risk calls for it.
|
|
52
|
+
7. **Functional proof by default:** unit tests; for anything on screen, a look in the phase's shared session — the running result in the browser, judged against the spec and DESIGN.md, or beside a reference image when one exists (a mockup, the original site, the Unity view) — on one browser/engine at reduced resolution unless a requirement names another; cheap value fixtures sampled once from a reference implementation where there is one. **Numeric parity gates** (pixel thresholds, repeats, several engines) only under `--parity` / `proof: parity` or when the brief states a number — and then planned to run once per phase (iteration inside the phase uses the quick look), never loosened.
|
|
53
|
+
8. **Proportional safety.** When the spec requires a safety outcome (nothing unfinished reaches the user's folders, the app keeps working between tasks), pick the cheapest mechanism that achieves it — normally a build output the user's folders do not read, and one copy across at the end after the live check — never a branch or a commit (the user owns git). Add staged promotions, per-step archives or hash records only if the brief asks for them by name.
|
|
54
|
+
9. **Minimal exports.** A task's Steps re-export only the Unity project the task tests and only the scenes it works on, and only when the change alters that scene's export. Never write "re-export every scene" or "re-export all projects" for consistency — other scenes pick the change up at their next natural export. Name the scenes explicitly.
|
|
55
|
+
10. **No ceremony.** No standalone "verification sweep / open the review / final check" tasks, and no ledgers, md5 or environment records, archives, checked-in capture trees, standing evidence suites, doc-integrity registration or staged promotions — unless the brief asks.
|
|
56
|
+
11. **No brittle pins.** Never pin counts later tasks will change (tests passed, suite sizes, hashes). Say "the named tests pass, no new failures versus the baseline".
|
|
57
|
+
12. **Plan code follows the Agent Reference's Coding Practices — ENFORCED.** Every snippet, signature, interface, class, member, constant and file name the plan writes is clean, professional TypeScript or JavaScript in the project's language (never switched unasked), with meaningful full-word names (no one- or two-letter names, cryptic abbreviations or code-golf tricks), well structured, readable and maintainable by human developers, with meaningful JSDoc on every class, function, method, interface and public member. JSDoc is never a gate: no Acceptance item, Test or Verify step fails on missing JSDoc. The executor copies plan code word for word, so a badly named snippet ships badly named. Names that bind to exported data (component properties, serialized fields, Unity property names) keep the source's names. Plan UI code also follows **Game UI Performance — ENFORCED**: every HUD value is classified as *state* (React, set on events) or *telemetry* (refs and one frame loop, never React state or a per-frame EventBus message), and the snippets show telemetry that way. Every UI element gets the cheapest cadence in `ui-design-system.md` › **Per frame or not** — events for state, CSS for decorative motion, the frame loop only for telemetry, throttled readouts, nothing while hidden — and no snippet puts a frame loop on a menu, splash, preloader or landing page (a real-time hero excepted, paused off-screen and at rest). Code-quality checks are never a separate task; bt-execute's verifier enforces them on every task.
|
|
56
58
|
|
|
57
59
|
## Step 3. Write the plan
|
|
58
60
|
|
|
@@ -66,10 +68,11 @@ Print `✍️ [bt-plan] Writing .agents/specs/<slug>/documents/<slug>_plan.md
|
|
|
66
68
|
### Phase 1 — <name>
|
|
67
69
|
|
|
68
70
|
- [ ] **T1** — <short imperative title>
|
|
71
|
+
- Track: A
|
|
69
72
|
- Files: `path/one` (create), `path/two` (modify)
|
|
70
73
|
- Details: <what to do>
|
|
71
74
|
- Tests: `.agents/specs/<slug>/tests/<test file>` — `<case>` → <expected outcome>; … (or "no testable surface — <why>")
|
|
72
|
-
- Acceptance: <observable, checkable
|
|
75
|
+
- Acceptance: <every requirement this task delivers, each once, as an observable, checkable statement>
|
|
73
76
|
- Verify level: standard
|
|
74
77
|
```
|
|
75
78
|
|
|
@@ -77,59 +80,44 @@ Print `✍️ [bt-plan] Writing .agents/specs/<slug>/documents/<slug>_plan.md
|
|
|
77
80
|
|
|
78
81
|
```markdown
|
|
79
82
|
- [ ] **T<n>** — Update SPEC.md to match what was built
|
|
83
|
+
- Track: integration (after every track of its phase is built)
|
|
80
84
|
- Files: `SPEC.md`
|
|
81
85
|
- Details: Update the sections named in the spec's Project Spec Alignment, following SPEC.md's "How to update this spec" (replace/merge current-state sections; append Decisions). Record the product only — never verification procedure, tool lists, ledgers or gates.
|
|
82
86
|
- Acceptance: SPEC.md matches what the tasks above shipped; new dependencies listed; nothing contradicts the code.
|
|
83
87
|
- Verify level: standard
|
|
84
88
|
```
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
**`### Tracks and owned files`** — closes `## Tasks`. Per phase: each track's tasks and owned files; who owns each shared file (a track, or the integration step); which track installs dependencies or drives each Unity project; each shared costly session and the tasks it proves:
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
- Phase 1 — **A (T1, T2):** `path/one`, `path/two` · **B (T3):** `path/three` · integration (orchestrator, after the tracks): `package.json` · shared session: one browser session proves T2 and T3.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
A plan of 3 tasks or fewer writes instead: `Runs inline — bt-execute builds these tasks itself and runs one independent verifier at the end.`
|
|
97
|
+
|
|
98
|
+
**`## Estimated execution time`** — **agent time, from the calibration below — never developer-hours, and never by adding up activities.** Builds, exports, captures and browser looks are *not* separate line items: they happen inside a task's run and its rate. Counting them separately is how a 10-hour plan gets estimated at 45 hours.
|
|
87
99
|
|
|
88
100
|
Rate each task by the **kind of work it does** (classify tasks, not the plan — most plans mix kinds), sum, then give a range of **−35 % / +50 %**. Nothing else is added — no per-phase overhead (it did not show up in the measurements):
|
|
89
101
|
|
|
90
|
-
| Kind | min/task | What puts a task here |
|
|
102
|
+
| Kind | min/task (provisional) | What puts a task here |
|
|
91
103
|
| --- | --- | --- |
|
|
92
|
-
| **Code** |
|
|
93
|
-
| **Live** |
|
|
94
|
-
| **Game** |
|
|
95
|
-
| **Unity / parity / GPU** |
|
|
96
|
-
|
|
97
|
-
- **Live or Game?** Loading a scene and reading values from it is Live. Playing it until something happens is Game. Game work ran 1.2–2.8× its estimate when
|
|
98
|
-
- **Do not budget fix rounds.** They are inside the rates
|
|
99
|
-
- **Do not add a further margin.** The range is the margin. Do not discount for parallel phases either — the rates are wall-clock with bt-execute's usual parallelism.
|
|
100
|
-
- **Outsized work is 2× the task's own kind rate**, never a flat figure. A task that ports a whole engine subsystem rated as Code is
|
|
104
|
+
| **Code** | 5 | Code + tests, at most a quick browser look or one small scripted export. |
|
|
105
|
+
| **Live** | 10 | Proven by running it: live external APIs, a page or scene loaded and probed in a browser, live memory or perf runs in one engine, a visual match to a reference image. |
|
|
106
|
+
| **Game** | 25 | Proven by **playing the running game**: races, laps or levels driven through scenarios, a two-page network session, reproducing an intermittent in-game bug, tuning feel or sound by eye and ear. |
|
|
107
|
+
| **Unity / parity / GPU** | 25 | Authoring or re-exporting Unity content, measured parity against Unity Play mode, GPU shader backends, perf A/B across beds, exporter DLL + runtime changed together. |
|
|
108
|
+
|
|
109
|
+
- **Live or Game?** Loading a scene and reading values from it is Live. Playing it until something happens is Game. Game work ran 1.2–2.8× its estimate when rated Live: every scenario is a real-time play session, and a bug that shows on lap three costs three laps per check.
|
|
110
|
+
- **Do not budget fix rounds.** They are inside the rates (about one task in four needed a second attempt); budgeting rounds per phase was the largest source of over-estimation in the first calibration.
|
|
111
|
+
- **Do not add a further margin.** The range is the margin. Do not discount for parallel phases or tracks either — the rates are wall-clock with bt-execute's usual parallelism.
|
|
112
|
+
- **Outsized work is 2× the task's own kind rate**, never a flat figure. A task that ports a whole engine subsystem rated as Code is 10 min, not the Unity rate doubled. A task that builds a compiler or transpiler, or must prove coverage across many Unity sample projects, is 2× Unity (shadergraph-transpiler-complete-coverage ran 72 min/task on the earlier loop). Multiply by ~2 for `proof: parity` only if the plan really carries numeric gates, and by ~2–3 for `bt-execute --strict` (neither measured yet).
|
|
101
113
|
- **Unity frame-matching runs long.** A task proven by matching Unity frame by frame (animation feel, foot IK, landing poses) is where Unity tasks overran most (starter-assets-third-person: 2.4×). Name it as the biggest uncertainty.
|
|
102
|
-
- **The estimate covers the plan as written.** Tasks added mid-run cost far more than planned ones — unity-terrain-system-parity's 17 planned tasks took about 6 h, the 9 added during the run about 21 h
|
|
103
|
-
|
|
104
|
-
**Calibration (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
|
109
|
-
| draco-mesh-compression | code 3 · Unity 4 | 90 min | 0.57 |
|
|
110
|
-
| light-probe-network-toggle | code 5 · live 1 | 29 min | 0.63 |
|
|
111
|
-
| mario-kart-audio-parity | code 2 · game 4 | 112 min | 0.65 |
|
|
112
|
-
| navigation-areas-costs | code 9 · live 1 · Unity 2 | 92 min | 0.66 |
|
|
113
|
-
| lens-flares-all-pipelines | code 2 · live 3 · Unity 6 | 204 min | 0.76 |
|
|
114
|
-
| prewarm-behind-splash | code 3 · live 5 · GPU 1 | 103 min | 0.77 |
|
|
115
|
-
| unity-timeline-playback | code 5 · Unity 6 | 186 min | 0.78 |
|
|
116
|
-
| babylon-game-server | code 8 · live 8 | 157 min | 0.89 |
|
|
117
|
-
| mario-kart-leftover-particles | game 5 | 189 min | 0.94 |
|
|
118
|
-
| babylon-toolkit-networking | code 20 · Unity 8 | 385 min | 0.96 |
|
|
119
|
-
| mario-kart-drift-vfx-parity | Unity 2 · game 1 | 107 min | 0.97 |
|
|
120
|
-
| cinemachine-port | code 10 · Unity 14 | 560 min | 1.02 |
|
|
121
|
-
| vfx-graph-port | code 10 · Unity 7 | 310 min | 1.02 |
|
|
122
|
-
| unity-animator-port (run 1) | code 7 · live 3 · Unity 9 | 455 min | 1.12 |
|
|
123
|
-
| mario-kart-antigravity | Unity 2.3 · game 2 | 230 min | 1.43 |
|
|
124
|
-
| terminal-portals-fps-controller | code 5 · live 1 · Unity 6 | 375 min | 1.46 |
|
|
125
|
-
| prewarm-splash-status | code 1 · live 1 | 36 min | 1.64 |
|
|
126
|
-
| starter-assets-third-person | code 2 · live 1 · Unity 3 · game 1 | 411 min | 2.38 |
|
|
127
|
-
|
|
128
|
-
Across all 40 runs the median actual ÷ estimate is **1.00**; 30 of 40 land inside −35 % / +50 % and 34 of 40 within 0.6–1.6×. The previous rates (code 8 · live 18 · Unity 35, −30 % / +40 %) put only 11 of the 19 new runs inside their range: they ran about 2× high on engine-code plans and up to 2× low on plans that play the game. Excluded from the fit: mario-kart-port (scope grew 22 → 42 tasks mid-run), hdrp-complete-parity's run 2 (a reopened, deferred task), and the user-directed follow-up runs of draco-mesh-compression and unity-animator-port.
|
|
129
|
-
|
|
130
|
-
To recalibrate later, read the `⏱` lines bt-execute writes to each `documents/<slug>_autopilot.md` (older runs: `<plan>_autopilot.md` beside a flat plan) — they carry the plan's estimate, active minutes per phase and per run, and waits already separated out.
|
|
131
|
-
|
|
132
|
-
Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it slow | Estimate`, then one **Total** line in hours (days only if over ~16 h), the `--strict` multiplier, and the biggest uncertainty in one line. If the total averages above ~45 or below ~5 min per task, the estimate is wrong before the plan is: re-check it. An estimate, never a pin.
|
|
114
|
+
- **The estimate covers the plan as written.** Tasks added mid-run cost far more than planned ones — unity-terrain-system-parity's 17 planned tasks took about 6 h, the 9 added during the run about 21 h. Say so in the biggest-uncertainty line when the scope is still moving. Tasks added after a plan is complete get their own estimate at these rates.
|
|
115
|
+
|
|
116
|
+
**Calibration — provisional lean rates (2026-10-25).** Not yet measured, they replace the third calibration's Code 6 · Live 16 · Game 40 · Unity 35 (2026-10-19, 40 runs of the pre-lean loop). **Re-fit them from the `⏱` lines of the first five lean runs**, then drop "provisional".
|
|
117
|
+
|
|
118
|
+
To re-fit: read the `⏱` lines bt-execute writes to each `documents/<slug>_autopilot.md` — the plan's estimate, active minutes per phase and per run, waits already separated out. Take active time only; count each run's tasks by kind (outsized 2×) and fit a rate per kind on lean runs only, leaving out runs whose scope grew mid-run, reopened deferred tasks and user-directed follow-ups. Aim for a median actual ÷ estimate near 1.00 with most runs inside −35 % / +50 %; then update the table and this paragraph.
|
|
119
|
+
|
|
120
|
+
Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it slow | Estimate`, then one **Total** line in hours (days only if over ~16 h), the `--strict` multiplier, and the biggest uncertainty in one line. If the total averages above ~30 or below ~5 min per task, the estimate is wrong before the plan is: re-check it. An estimate, never a pin.
|
|
133
121
|
|
|
134
122
|
**`## How to execute this plan`** — this text verbatim:
|
|
135
123
|
|
|
@@ -139,21 +127,23 @@ Write a table `Phase | Tasks | Kind (code / live / game / Unity) | What makes it
|
|
|
139
127
|
Each task above is a checkbox. To implement:
|
|
140
128
|
- Run a single task with the bt-execute command (e.g. `bt-execute <this-file> T<n>`), run every remaining task in order with `bt-execute <this-file> ALL` (resumable — it skips tasks already checked), or implement the whole plan from a prompt like "implement the plan at <this-file>".
|
|
141
129
|
- bt-execute verifies each phase with an independent verifier; add `--strict` for an adversarial verifier on every task.
|
|
142
|
-
- Work the tasks top to bottom unless a task notes a different dependency order.
|
|
130
|
+
- Work the tasks top to bottom — bt-execute builds a phase's tracks in parallel — unless a task notes a different dependency order.
|
|
143
131
|
- When a task is fully implemented and its **Acceptance** criteria are met, mark it complete by editing this file and changing that task's `- [ ]` to `- [x]`.
|
|
144
132
|
- Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
|
|
145
133
|
```
|
|
146
134
|
|
|
147
|
-
## Step 4. Write the dashboard (planned state)
|
|
135
|
+
## Step 4. Write and check the dashboard (planned state)
|
|
148
136
|
|
|
149
137
|
Print `🗂️ [bt-plan] Writing the feature dashboard …`. **A spec from bt-spec already has a dashboard, in its `specified` state** (showing the bt-plan commands): read its `<slug>_dashboard.js` first and keep its `feature`, `decisions` and `activity`; everything below then fills it in and moves it to `planned`. A Quick Plan, or a spec with no dashboard, creates it here. From bt-execute's `templates/dashboard/` *(where skills load through a tool: `load_skill('bt-execute')` + `read_skill_resource`; where they are files: the sibling `bt-execute/` folder in the skills directory this skill was loaded from)*:
|
|
150
138
|
|
|
151
139
|
- copy `dashboard.html` to `.agents/specs/<slug>/dashboard.html`, replacing `{{slug}}` with the slug and changing nothing else (always — over a copy bt-spec wrote too, so the page is the current template);
|
|
152
140
|
- write `.agents/specs/<slug>/documents/<slug>_dashboard.js` from the starter `dashboard.template.js`, written whole as strict JSON behind its `window.FEATURE_DASHBOARD =` prefix — double-quoted keys, no comments, no trailing commas (`data-schema.md` documents every field): `feature` (title, slug, branch, `origin` `spec` or `quick-plan`, size, proof, a plain-language summary), `documents` (Spec — omitted for a Quick Plan — and Plan), `status: "planned"`, `updatedAt` from the shell clock (`date '+%Y-%m-%d %H:%M'`; with no shell, the current local time), `estimate` (the Total line), every phase and task from the plan as `pending` (id, title, kind from the estimate table, verify level), an empty `afterAction` and no snapshots, the plan’s Decisions as `decisions` (Heavy Plan; otherwise the spec’s), each an object `{ "id": "D1", "text": "…", "updates": [] }` (never a plain `"D1 — …"` string, which shows as an empty row), and one more `activity` line: `Plan written — <n> tasks in <k> phases, estimated <range>` (after bt-spec's `Spec written` line when there is one);
|
|
153
|
-
- write `.agents/specs/<slug>/documents/<slug>_live.js` from `live.template.js`, the same way (whole, strict JSON): no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute rewrites it
|
|
154
|
-
- in a git repository, make sure `.gitignore` (at the repository root) contains the line `.agents/*/*/documents/*_live.js` — append it once if missing. The live file is
|
|
141
|
+
- write `.agents/specs/<slug>/documents/<slug>_live.js` from `live.template.js`, the same way (whole, strict JSON): no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute's helper rewrites it with every task update).
|
|
142
|
+
- in a git repository, make sure `.gitignore` (at the repository root) contains the line `.agents/*/*/documents/*_live.js` — append it once if missing. The live file is not history worth keeping; `<slug>_dashboard.js` is, and stays tracked. A live file git already tracks is left alone.
|
|
143
|
+
|
|
144
|
+
Re-planning an existing feature rewrites the data file's phases and tasks from the new plan but keeps the results of tasks already done, its `afterAction` and its `activity` history, adding a `Plan revised` line; new tasks are `pending` with an `updates` note, and a `complete` status becomes `paused`. The dashboard is a deliverable: if the template cannot be found, say so and stop — the plan is not finished until the check below passes.
|
|
155
145
|
|
|
156
|
-
|
|
146
|
+
**Check, then stop.** Run `node <skills>/bt-execute/scripts/dashboard.mjs check .agents/specs/<slug>` (`<skills>`: the skills directory this skill was loaded from). It fails when a deliverable is missing — a dashboard file absent, or the dashboard's tasks out of step with the plan's checklist (ids and order) — or a data file is malformed. Fix what it names and re-run; **never finish while it fails**, whoever wrote the plan — this skill or an agent by hand. Where Node cannot run the helper, make the same checks by reading the files, and say so.
|
|
157
147
|
|
|
158
148
|
Then **stop**. Final message: a short summary, the estimated time, and:
|
|
159
149
|
|
|
@@ -174,5 +164,5 @@ Sections, in order: `## Codebase Analysis` (plus the test baseline) · **`## Dec
|
|
|
174
164
|
- **`## Decisions`** — numbered `D1, D2 …`, one per choice that binds more than one task or rejects a plausible alternative — architecture, file layout, naming, algorithms and constants, error policy, dependencies (exact packages and versions, or "no new dependencies"), sibling-skill option values, test strategy:
|
|
175
165
|
`- **D3 — <decision, stated as a fact>.** <why / precedent with file:line> Rejected: <alternative> (<why not>). Binds: T4, T7.`
|
|
176
166
|
- **`## Design Reference`** — the shared blueprint, written as code wherever the code *is* the decision: File map (path · create/modify/delete · responsibility · tasks) · Module boundaries · Interfaces & contracts (full signatures, in the project's language) · Data shapes & state · Control flow · Algorithms & formulas with their constants · Error & edge-case policy (`when X → Y`) · Conventions to mirror (verbatim, with `file:line`) · API usage · Test strategy. Omit a heading only if it truly does not apply. **All of it is written to the Agent Reference's Coding Practices — ENFORCED**: every interface, signature, data shape, constant and snippet uses meaningful full-word names, strict types (JSDoc type tags in JavaScript) and meaningful JSDoc, and reads cleanly to a developer new to the project. Mirror the structure of existing conventions, but never copy one- or two-letter names or obfuscated code into a new name.
|
|
177
|
-
- **Heavy task block** — adds to the standard block: `Depends on:` · `Applies:` (the D-numbers and Design Reference entries it must match) · `Steps:` numbered instructions, each naming the file, a real anchor (prefer quoted code over bare line numbers) and the change · `Code:` when the code is the decision, written to the Coding Practices exactly as it must ship · `Do not:` the tempting wrong turns · `Verify:` commands with expected output. `Depends on`, `Files`, `Applies`, `Steps`, `Tests`, `Acceptance`, `Verify` and `Verify level` are required on every heavy task. A task never says "like T3" — it cites the Design Reference; a name, signature or value a step introduces is added to the Design Reference first, so task 40 types what task 3 typed. Say what keeps the app working between tasks (shim, flag) and which task removes it. The `Update SPEC.md` task carries the exact text to write.
|
|
178
|
-
- **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, write the dashboard (Step 4) from the finished plan, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.
|
|
167
|
+
- **Heavy task block** — adds to the standard block: `Depends on:` (same track, or an earlier phase) · `Applies:` (the D-numbers and Design Reference entries it must match) · `Steps:` numbered instructions, each naming the file, a real anchor (prefer quoted code over bare line numbers) and the change · `Code:` when the code is the decision, written to the Coding Practices exactly as it must ship · `Do not:` the tempting wrong turns · `Verify:` commands with expected output. `Depends on`, `Files`, `Applies`, `Steps`, `Tests`, `Acceptance`, `Verify` and `Verify level` are required on every heavy task. A task never says "like T3" — it cites the Design Reference; a name, signature or value a step introduces is added to the Design Reference first, so task 40 types what task 3 typed. Say what keeps the app working between tasks (shim, flag) and which task removes it. The `Update SPEC.md` task carries the exact text to write.
|
|
168
|
+
- **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag two tracks in one phase that edit the same file, micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, write and check the dashboard (Step 4) from the finished plan, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.
|
|
@@ -53,7 +53,7 @@ Use the user's message after the skill name as the `arguments`.
|
|
|
53
53
|
|
|
54
54
|
## ⚠️ Required reading before any build
|
|
55
55
|
|
|
56
|
-
For any Babylon / BabylonJS / Babylon Toolkit work, ensure the **Agent Reference** is already read in this session/context (read `https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md` first if not; and its `web-kie-servers.md` sub-document if using the KIE MCP servers, or its `web-higgsfield-cli.md` sub-document if using the Higgsfield CLI). If a required document cannot be read, STOP and tell the user. Do not re-read what you already remember.
|
|
56
|
+
For any Babylon / BabylonJS / Babylon Toolkit work, ensure the **Agent Reference** is already read in this session/context (read `https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md` first if not; and its `web-kie-servers.md` sub-document if using the KIE MCP servers, or its `web-higgsfield-cli.md` sub-document if using the Higgsfield API or CLI). If a required document cannot be read, STOP and tell the user. Do not re-read what you already remember.
|
|
57
57
|
|
|
58
58
|
If the project keeps a root **SPEC.md**, read it first and conform to its architecture/conventions; record the shipped prototypes per the project's working agreement when the batch lands.
|
|
59
59
|
|
|
@@ -74,7 +74,7 @@ The **difference** between prototypes is in the *design language* — layout, mo
|
|
|
74
74
|
1. Read the flags (`--type`, `--count`, `--motionsites`, `--awwwards[:forensic]`, `--3d-hero-scroll`) and the `<theme>`. Apply defaults (`html`, `10`).
|
|
75
75
|
2. **Theme gate:** if no theme is discernible, ask **once** — one short inline question — then proceed. This is the only interactive stop; once the batch starts, it runs autonomously.
|
|
76
76
|
3. Ingest attached screenshots into a world anchor (above). Note the host: React (Vite/TS) vs plain HTML, per `--type` and any existing project.
|
|
77
|
-
4. **Asset-backend check:** the Fable-grade bar assumes asset generation is available. Confirm what's configured — KIE MCP (image/video/Kling — the **default**), the Higgsfield CLI (`node_modules/.bin/higgsfield account status --json` succeeds), GPT Image 2 keys, Pinterest source. Pass the chosen backend to every subagent so the batch is consistent. **If Higgsfield is the backend,
|
|
77
|
+
4. **Asset-backend check:** the Fable-grade bar assumes asset generation is available. Confirm what's configured — KIE MCP (image/video/Kling — the **default**), the Higgsfield API (the project's `.env` has `HIGGSFIELD_API_KEY`, checked by shape only; it comes before the CLI), the Higgsfield CLI (`node_modules/.bin/higgsfield account status --json` succeeds), GPT Image 2 keys, Pinterest source. Pass the chosen backend to every subagent so the batch is consistent. **If Higgsfield is the backend, run one image and one video through `--estimate` (API: the installed `hf-api.mjs`) or `--cost` (CLI: `scripts/hf-generate.mjs`, after checking `account status`), then tell the user the estimated batch cost before fanning out**: N prototypes × video is where credits disappear. If none is available, say so and proceed with hand-authored CSS/SVG/WebGL craft rather than silently producing flat pages.
|
|
78
78
|
|
|
79
79
|
## Step 2 — Compose the direction spread (N genuinely-different lenses)
|
|
80
80
|
|
|
@@ -130,7 +130,7 @@ Each prototype subagent gets: its **direction**, the **theme**, the **world anch
|
|
|
130
130
|
|
|
131
131
|
1. **Own its folder.** Create `.agents/prototypes/<NN-slug>/` and put **everything self-contained inside it** — markup, styles, scripts, and all generated/downloaded assets. No shared globals; a prototype is copy-out-able on its own.
|
|
132
132
|
2. **Build to the Fable bar for its lens** — advanced 3D tactics, otherworldly animation, exceptional palette, novel type. Not a template with the colors swapped; a distinct, *mind-blowing* execution of that direction for this game. **Full-bleed console UI by default** (bt-design's *Layout Philosophy*): fill the whole viewport edge-to-edge like a console dashboard / game menu, not a centered fixed-width website — unless this direction is the noted contained exception.
|
|
133
|
-
3. **Produce assets** via any mix of the available workflows: Pinterest pulls for reference, **GPT Image 2** for stills, **KIE MCP servers (default) /
|
|
133
|
+
3. **Produce assets** via any mix of the available workflows: Pinterest pulls for reference, **GPT Image 2** for stills, **KIE MCP servers (default) / Higgsfield, API or CLI (Kling, Seedance, etc.)** for motion/video, hand-authored WebGL/SVG/CSS. All assets stay faithful to the world anchor and live in the prototype's folder. **On the Higgsfield API, every generation goes through the Reference's installed `hf-api.mjs`** (run in place, `web-higgsfield-cli.md` has the kie → API model table) with `--out .agents/prototypes/<NN-slug>/gen`, then the saved file is moved to its name in the prototype's folder; local references go in as `--file image_urls[]=…` (first / last video frames as `--file image_url=…` and `--file last_image_url=…` on Kling 3, `end_image_url` on Seedance 2.5). **On the Higgsfield CLI, every generation goes through the reference's `scripts/hf-generate.mjs` wrapper** with `--out .agents/prototypes/<NN-slug>/<file>`: the CLI alone only returns a CDN URL, and a prototype must never hot-link one. Local reference images are passed as file paths (`--image-references`, `--start-image`, `--end-image`) and uploaded automatically.
|
|
134
134
|
4. **3D-hero-scroll directions:** follow *The 3D-hero-scroll batch rule* below.
|
|
135
135
|
5. Run its own **iteration passes** (Step 4) before returning.
|
|
136
136
|
6. **Write clean, readable code.** Every file follows the Coding Practices: 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). The chosen prototype becomes the user's real front end, so its code must be maintainable. Every HUD follows the Agent Reference's **Game UI Performance — ENFORCED**: per-frame values (speed, timers, bars, needles) reach the screen through refs and one frame loop, never React state or a per-frame EventBus message. And nothing runs per frame that does not need to: the "otherworldly animation" is CSS `@keyframes` / `transition` on `transform` and `opacity` wherever CSS can do it; a WebGL / canvas / scroll-scrubbed scene pauses off-screen (`IntersectionObserver`) and in a background tab, writes nothing while the scroll is at rest, and honors `prefers-reduced-motion`; nothing animates `width` / `height` / `top` / `left` or reads layout per frame (`ui-design-system.md` › **Per frame or not**). Spectacle that costs frames when nothing is moving is not finished.
|