@babylonjs-toolkit/agent 1.1.54 → 1.1.55

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.
@@ -4,16 +4,16 @@ description: "The Babylon Toolkit Plan Skill creates the detailed technical plan
4
4
  allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Agent, Task
5
5
  ---
6
6
 
7
- Turn a feature spec into `_specs/<feature-name>_plan.md`: an ordered checklist of tasks that `bt-execute` runs. 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`.
7
+ Turn a feature spec into `.agents/specs/<feature-name>_plan.md`: an ordered checklist of tasks that `bt-execute` runs. 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`.
8
8
 
9
9
  ```
10
10
  /bt-plan [--heavy] [--parity] [--no-time-limit] <feature-spec> <optional-brief>
11
11
 
12
- /bt-plan @_specs/mute-game-audio_spec.md
12
+ /bt-plan @.agents/specs/mute-game-audio_spec.md
13
13
  /bt-plan "add a settings toggle to mute all game audio" # no spec file → Quick Plan: short interview, then plan
14
- /bt-plan --heavy @_specs/feature_spec.md # decision-complete plan for a long or cheaper-model run
15
- /bt-plan --heavy --parity @_specs/feature_spec.md # numeric parity gates against the reference (slow)
16
- /bt-plan --no-time-limit @_specs/feature_spec.md # turn off the default TIME MATTERS mode
14
+ /bt-plan --heavy @.agents/specs/feature_spec.md # decision-complete plan for a long or cheaper-model run
15
+ /bt-plan --heavy --parity @.agents/specs/feature_spec.md # numeric parity gates against the reference (slow)
16
+ /bt-plan --no-time-limit @.agents/specs/feature_spec.md # turn off the default TIME MATTERS mode
17
17
  ```
18
18
 
19
19
  - `--heavy` — Heavy Plan mode (below). `--parity` — plan numeric parity proof; also on when the spec says `proof: parity`. `--no-time-limit` — turn off TIME MATTERS mode (Ground rules). Strip flags, and any literal `TIME MATTERS`, first; they are never part of the brief.
@@ -30,7 +30,7 @@ Turn a feature spec into `_specs/<feature-name>_plan.md`: an ordered checklist o
30
30
  ## Step 1. Analyze (required before writing)
31
31
 
32
32
  1. Read the feature spec in full, and `SPEC.md`'s headings, Architecture, Conventions and the systems the feature touches. The plan must conform to SPEC.md — **if it would conflict, stop and tell the user.** Verification procedures described in SPEC.md are tooling you may reuse, not a bar the plan must meet. Note the spec's `spec_impact`, `size` and `proof`.
33
- 2. **Start from the spec's `## Research Notes`, and any bt-recon doc (`_specs/*_recon.md`) it cites or whose scope covers the systems the feature touches** — its Extension Points and End-to-End Flows usually name the integration points directly. Spot-check that the paths exist, then research only what a plan needs beyond them: how the app is built and tested, the real conventions and the closest feature to mirror, the concrete files and integration points, available dependencies, constraints from the agent instructions.
33
+ 2. **Start from the spec's `## Research Notes`, and any bt-recon doc (`.agents/recon/*_recon.md`) it cites or whose scope covers the systems the feature touches** — its Extension Points and End-to-End Flows usually name the integration points directly. Spot-check that the paths exist, then research only what a plan needs beyond them: how the app is built and tested, the real conventions and the closest feature to mirror, the concrete files and integration points, available dependencies, constraints from the agent instructions.
34
34
  3. Size the research: `small` → inline; `medium` / `large` (or no Research Notes) → up to 3 **read-only** subagents returning findings and paths, not file dumps. Tell each one verbatim: *"Read-only: you may read, search and report. Do not edit or create files, and do not run builds, tests or any command that writes — not even into a build folder. If a fact needs a build or a test run to establish, report it as unknown and say which command would settle it."*
35
35
  4. Sibling-skill pattern (e.g. bt-design's 3D-Hero-Scroll): read that skill's reference **and templates** *(where skills load through a tool: `load_skill` + `read_skill_resource`, never a guessed path; where they are files: the skills directory this skill was loaded from, e.g. `~/.claude/skills/`, `~/.agents/skills/` or the project's equivalent)*. The plan **copies and configures the template engine — never re-implements it**; each behavioral option the spec records (e.g. `sweep: page`) becomes an Acceptance item stated in observable terms. Prefer copying and wiring the template as the first task, so later tasks only configure it.
36
36
  5. Too ambiguous to plan responsibly → ask the user. **Already built?** If the research shows some or all of the feature already exists, say so first and plan only what is missing (often just tests and the live check).
@@ -54,7 +54,7 @@ Execution time is mostly *how the work is proven*, not the code. Keep proof stro
54
54
 
55
55
  ## Step 3. Write the plan
56
56
 
57
- Print `✍️ [bt-plan] Writing _specs/<feature-name>_plan.md …`. The file has, in order:
57
+ Print `✍️ [bt-plan] Writing .agents/specs/<feature-name>_plan.md …`. The file has, in order:
58
58
 
59
59
  **`## Codebase Analysis`** — what Step 1 found, citing real files; the SPEC.md sections the plan conforms to; `spec_impact`, `size`, `proof` (say which were inferred); Quick Plan assumptions.
60
60
 
@@ -126,8 +126,8 @@ Each task above is a checkbox. To implement:
126
126
  Then **stop**. Final message: a short summary, the estimated time, and:
127
127
 
128
128
  ```
129
- Plan written to _specs/<feature-name>_plan.md — <n> tasks, estimated <total range> of agent time
130
- Run a single task with `bt-execute _specs/<feature-name>_plan.md T1`, or every task with `bt-execute _specs/<feature-name>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
129
+ Plan written to .agents/specs/<feature-name>_plan.md — <n> tasks, estimated <total range> of agent time
130
+ Run a single task with `bt-execute .agents/specs/<feature-name>_plan.md T1`, or every task with `bt-execute .agents/specs/<feature-name>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
131
131
  ```
132
132
 
133
133
  ## Heavy Plan mode (`--heavy`)
@@ -88,7 +88,7 @@ Before building anything, decide the **N distinct directions** so the batch does
88
88
 
89
89
  **Full-bleed does not mean a single locked screen — these are landing pages, so scroll stays first-class** (bt-design's *scroll is the transport, not the enemy* rule). Full-viewport views scroll between and through each other, and any **3D-hero-scroll direction plays its cinematic scroll, then settles into the full-bleed console home view at the end** (the sweep-into-console handoff) rather than dead-ending or dropping into a stock template. Compose each view full-bleed; let scroll carry the user between them.
90
90
 
91
- Write the plan to `_prototypes/_directions.md` (id, name, one-line design language, inspiration source + attribution if any, whether it's a 3D-hero-scroll direction). This is the batch's manifest.
91
+ Write the plan to `.agents/prototypes/_directions.md` (id, name, one-line design language, inspiration source + attribution if any, whether it's a 3D-hero-scroll direction). This is the batch's manifest.
92
92
 
93
93
  ## Sourcing directions from awwwards
94
94
 
@@ -128,16 +128,16 @@ Build the N prototypes **in parallel via subagents** — if a subagent-spawning/
128
128
 
129
129
  Each prototype subagent gets: its **direction**, the **theme**, the **world anchor** (screenshots + extracted palette/mood/silhouettes), the **`--type`**, and the **asset workflows** available, plus the full text of the Agent Reference's **Coding Practices — ENFORCED**. It must:
130
130
 
131
- 1. **Own its folder.** Create `_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.
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) / the Higgsfield 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 Higgsfield, every generation goes through the reference's `scripts/hf-generate.mjs` wrapper** with `--out _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.
133
+ 3. **Produce assets** via any mix of the available workflows: Pinterest pulls for reference, **GPT Image 2** for stills, **KIE MCP servers (default) / the Higgsfield 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 Higgsfield, 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.
137
137
 
138
138
  ## The 3D-hero-scroll batch rule
139
139
 
140
- When `--3d-hero-scroll` is set (or a direction inherently calls for the cinematic hero), that prototype is built via **bt-hero → bt-design's 3D-Hero-Scroll protocol** — copy the templates, run the footage pipeline, calibrate, verify. **But this is a batch: bt-hero must never prompt.** So all of bt-hero's creative slots must be **pre-resolved before the subagent starts** — the star, look/anchor, journey/beats, HUD, controls, sweep, brand/overlays, and below-the-journey are derived from the theme + world anchor + direction and written into a hero brief (`_prototypes/<NN-slug>/_hero-brief.md`) up front. The subagent runs bt-hero's build against that brief with **zero questions** ("enough to fly," always). If a slot genuinely can't be resolved without the user, resolve it with a sensible default and note it — do **not** pause the batch.
140
+ When `--3d-hero-scroll` is set (or a direction inherently calls for the cinematic hero), that prototype is built via **bt-hero → bt-design's 3D-Hero-Scroll protocol** — copy the templates, run the footage pipeline, calibrate, verify. **But this is a batch: bt-hero must never prompt.** So all of bt-hero's creative slots must be **pre-resolved before the subagent starts** — the star, look/anchor, journey/beats, HUD, controls, sweep, brand/overlays, and below-the-journey are derived from the theme + world anchor + direction and written into a hero brief (`.agents/prototypes/<NN-slug>/_hero-brief.md`) up front. The subagent runs bt-hero's build against that brief with **zero questions** ("enough to fly," always). If a slot genuinely can't be resolved without the user, resolve it with a sensible default and note it — do **not** pause the batch.
141
141
 
142
142
  ## Step 4 — Iteration passes (the quality gate)
143
143
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bt-recon
3
- description: "The Babylon Toolkit Recon Skill deep-dives existing code — a subsystem named in a brief, or the whole codebase — and writes a comprehensive, evidence-cited technical grounding spec (`_specs/<slug>_recon.md`) plus, when the scope has UI, a plain-language user guide (`_specs/<slug>_guide.md`), for maintaining inherited or undocumented code and grounding future bt-spec features. Use when asked to document, reverse-engineer, explain, map or take over existing code (e.g. `bt-recon the &session=camera system`, `bt-recon the whole codebase`). Not a diff or bug review."
3
+ description: "The Babylon Toolkit Recon Skill deep-dives existing code — a subsystem named in a brief, or the whole codebase — and writes a comprehensive, evidence-cited technical grounding spec (`.agents/recon/<slug>_recon.md`) plus, when the scope has UI, a plain-language user guide (`.agents/recon/<slug>_guide.md`), for maintaining inherited or undocumented code and grounding future bt-spec features. Use when asked to document, reverse-engineer, explain, map or take over existing code (e.g. `bt-recon the &session=camera system`, `bt-recon the whole codebase`). Not a diff or bug review."
4
4
  allowed-tools: Read, Grep, Glob, Write, Bash(git log:*), Bash(git show:*), Bash(git blame:*), Bash(git rev-parse:*), Bash(git ls-files:*), Bash(git diff:*), WebFetch(domain:raw.githubusercontent.com), AskUserQuestion, Agent, Task
5
5
  ---
6
6
 
@@ -8,26 +8,26 @@ Run reconnaissance on existing code nobody has documented — one subsystem or t
8
8
 
9
9
  ```
10
10
  /bt-recon [--guide|--no-guide] [--no-live] [--quick] [--out <dir>] <brief>
11
- /bt-recon --refresh @_specs/<slug>_recon.md
11
+ /bt-recon --refresh @.agents/recon/<slug>_recon.md
12
12
 
13
13
  /bt-recon "the default camera system"
14
14
  /bt-recon "the save/load pipeline"
15
15
  /bt-recon "the whole codebase"
16
16
  /bt-recon --no-guide "the physics layer helpers in src/physics"
17
- /bt-recon --refresh @_specs/session-camera_recon.md # update an existing recon after code changes
17
+ /bt-recon --refresh @.agents/recon/session-camera_recon.md # update an existing recon after code changes
18
18
  ```
19
19
 
20
20
  - `--guide` — always write the user guide. `--no-guide` — never write it. Neither → write it when the scope has UI — anything a person operates (Step 8).
21
21
  - `--no-live` — skip the live pass (Step 5) even when the brief gives a URL.
22
22
  - `--quick` — a lighter recon: one reader per slice, no coverage audit (Step 6). The output keeps the same sections.
23
- - `--out <dir>` — write the outputs to `<dir>` instead of `_specs/`.
23
+ - `--out <dir>` — write the outputs to `<dir>` instead of `.agents/recon/`.
24
24
  - `--refresh @<recon file>` — update an existing recon against what changed since it was written (Refresh mode, at the end).
25
25
  - Strip the flags first; they are never part of the brief or the file name. No brief → ask for one. Never guess a path or URL.
26
26
 
27
27
  ## Ground rules
28
28
 
29
29
  - **Thorough by default.** Unlike the other bt-* skills, recon has no TIME MATTERS default: the whole point is that nothing is missed. Print `🔬 [bt-recon] Deep recon` at the start (`--quick`: `⚡ [bt-recon] Quick recon`). Still do not re-read what you already have.
30
- - **Read-only on the project.** Research only. The files you write are the recon doc, the guide, and screenshots under `_specs/<slug>_recon/` — nothing else. No source edits, no builds, no installs, no tests, no shell commands beyond the read-only `git` commands above.
30
+ - **Read-only on the project.** Research only. The files you write are the recon doc, the guide, and screenshots under `.agents/recon/<slug>_recon/` — nothing else. No source edits, no builds, no installs, no tests, no shell commands beyond the read-only `git` commands above.
31
31
  - **Evidence or it is unknown.** Every factual claim cites `path:line` (or `path:start-end`) and carries one confidence tag: `[code]` read in the source · `[live]` seen in the running app · `[history]` from git history · `[inferred]` deduced, with the reason in the same line. Anything you cannot establish goes in `## Unknowns` with what would settle it. Never fill a gap with a plausible guess — an inherited system is exactly where a confident wrong guess does the most damage.
32
32
  - **Write the system, not the review process.** The recon describes what the code does and why. It never records how the recon was carried out (subagent counts, tool lists, audit logs).
33
33
  - **Babylon work:** if the scope uses BabylonJS or the Babylon Toolkit and you have not read the Babylon Toolkit Agent Reference in this session, fetch and read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — it is the authority for the API and conventions the code is built on, so it tells you what is toolkit behavior and what is project code. Fetch its sub-documents only when relevant. If the fetch fails, stop and tell the user.
@@ -43,7 +43,7 @@ From the flag-stripped brief derive `recon_title` (Title Case, e.g. `Session Cam
43
43
 
44
44
  Note any URL (it enables the live pass), and any audience or emphasis hints ("focus on the CMS endpoints") — emphasis deepens a section, it never drops one. If you cannot infer a sensible title, ask.
45
45
 
46
- If `_specs/<recon_slug>_recon.md` already exists, ask whether to refresh it (Refresh mode) or replace it. Never overwrite it silently.
46
+ If `.agents/recon/<recon_slug>_recon.md` already exists, ask whether to refresh it (Refresh mode) or replace it. Never overwrite it silently.
47
47
 
48
48
  ## Step 2. Locate and map the scope
49
49
 
@@ -91,7 +91,7 @@ Runs when the brief gives a URL and your host has a browser tool (e.g. the Chrom
91
91
  **Observe-only, without exception.** Never click Save, Delete, Publish, Submit, Upload or anything whose handler (from Step 3) writes data. Never send, replay or let the page send a request that changes data on a real backend (POST / PUT / PATCH / DELETE) through an action of yours. Open, tab, hover, toggle a panel's visibility, pan or orbit the view — fine. Requests the page makes on its own while loading are observed, never triggered. A write path stays documented from the code and tagged `[code]`.
92
92
 
93
93
  1. Open the URL, wait for the app to settle, and screenshot the initial state.
94
- 2. Open each panel, dialog and mode that safe navigation reaches (the Step 3 UI inventory is your checklist) and screenshot each one to `_specs/<slug>_recon/<nn>-<panel-slug>.png`.
94
+ 2. Open each panel, dialog and mode that safe navigation reaches (the Step 3 UI inventory is your checklist) and screenshot each one to `.agents/recon/<slug>_recon/<nn>-<panel-slug>.png`.
95
95
  3. Record the network requests the page makes: real endpoint URLs, status codes, and the response shapes of the reads (field names and types — never copy secrets, tokens or personal data into the docs).
96
96
  4. Record console errors and warnings.
97
97
  5. Reconcile: upgrade each claim the run confirmed to `[live]`; flag every contradiction between code and runtime in the doc — a contradiction usually means a stale code path or a different deployed build, and is worth recording either way.
@@ -108,16 +108,16 @@ Fix every gap — re-read the source rather than trusting the auditor's summary
108
108
 
109
109
  ## Step 7. Write the recon doc
110
110
 
111
- Print `✍️ [bt-recon] Writing _specs/<slug>_recon.md …` and write it to `_specs/<slug>_recon.md` (or `--out`). Get the header `commit` from `git rev-parse --short HEAD` (no git → `commit: n/a`).
111
+ Print `✍️ [bt-recon] Writing .agents/recon/<slug>_recon.md …` and write it to `.agents/recon/<slug>_recon.md` (or `--out`). Get the header `commit` from `git rev-parse --short HEAD` (no git → `commit: n/a`).
112
112
 
113
- Include every section. A section that genuinely does not apply says so in one line (`No network I/O in this scope [code].`) — never delete the heading, so the next reader knows it was checked. For a codebase recon with more than about 6 major systems, make this file the index (header, Summary, Architecture, End-to-End Flows, Known Issues, Extension Points, History, Unknowns, Files Reviewed) and give each system its own chapter at `_specs/<slug>_recon/<system-slug>.md` using the same template.
113
+ Include every section. A section that genuinely does not apply says so in one line (`No network I/O in this scope [code].`) — never delete the heading, so the next reader knows it was checked. For a codebase recon with more than about 6 major systems, make this file the index (header, Summary, Architecture, End-to-End Flows, Known Issues, Extension Points, History, Unknowns, Files Reviewed) and give each system its own chapter at `.agents/recon/<slug>_recon/<system-slug>.md` using the same template.
114
114
 
115
115
  ```markdown
116
116
  # Recon: <recon_title>
117
117
 
118
118
  scope: <the brief, one line> · kind: <subsystem|codebase>
119
119
  commit: <short sha> · date: <YYYY-MM-DD> · files: <n> (<total> lines)
120
- guide: <_specs/<slug>_guide.md | none> · live: <yes | no (<reason>)>
120
+ guide: <.agents/recon/<slug>_guide.md | none> · live: <yes | no (<reason>)>
121
121
  confidence tags: [code] read in source · [live] seen running · [history] from git · [inferred] deduced
122
122
 
123
123
  ## Summary
@@ -182,9 +182,9 @@ confidence tags: [code] read in source · [live] seen running · [history] from
182
182
 
183
183
  ## Step 8. Write the user guide (when the scope has UI)
184
184
 
185
- Write `_specs/<slug>_guide.md` when the scope has anything a person operates — panels, controls, modes, gestures, outputs they use — or with `--guide`; skip it under `--no-guide` or when there is no UI (and set `guide: none` in the recon header). Print `✍️ [bt-recon] Writing _specs/<slug>_guide.md …`.
185
+ Write `.agents/recon/<slug>_guide.md` when the scope has anything a person operates — panels, controls, modes, gestures, outputs they use — or with `--guide`; skip it under `--no-guide` or when there is no UI (and set `guide: none` in the recon header). Print `✍️ [bt-recon] Writing .agents/recon/<slug>_guide.md …`.
186
186
 
187
- The reader has never seen the feature and does not read code: plain language, no code, no `path:line`, every term explained on first use. It must agree with the recon doc — it is the same facts told as tasks. Use the live screenshots wherever they exist (relative links into `_specs/<slug>_recon/`). Anything the recon could not confirm is stated with a short caveat rather than presented as certain.
187
+ The reader has never seen the feature and does not read code: plain language, no code, no `path:line`, every term explained on first use. It must agree with the recon doc — it is the same facts told as tasks. Use the live screenshots wherever they exist (relative links into `.agents/recon/<slug>_recon/`). Anything the recon could not confirm is stated with a short caveat rather than presented as certain.
188
188
 
189
189
  ```markdown
190
190
  # <recon_title> — User Guide
@@ -221,8 +221,8 @@ The reader has never seen the feature and does not read code: plain language, no
221
221
  ## Step 9. Report
222
222
 
223
223
  ```
224
- Recon: _specs/<slug>_recon.md
225
- Guide: _specs/<slug>_guide.md | none (<why>)
224
+ Recon: .agents/recon/<slug>_recon.md
225
+ Guide: .agents/recon/<slug>_guide.md | none (<why>)
226
226
  Scope: <n> files, <total> lines · live: <yes|no>
227
227
  Claims: <n> [code] · <n> [live] · <n> [history] · <n> [inferred] · <n> unknowns
228
228
  Top risks: <three one-liners from Known Issues>
@@ -39,7 +39,7 @@ Git is optional. **Where git is available:** stop now if the working tree has un
39
39
  - **`SPEC.md`** (repository root) is the project's source of truth for architecture, systems, conventions and decisions. Read its headings, Architecture, Conventions, and the systems this feature touches. The feature must fit it. **If the idea conflicts with SPEC.md, stop and tell the user before writing.** Verification procedures described in SPEC.md are tooling the feature may reuse, not requirements it inherits.
40
40
  - **If `SPEC.md` is missing or an empty stub, ask the user first** whether to create it from the scaffold at the end of this file. Yes → write it, then continue against it. No → continue, and note in the spec: `"No project SPEC.md content yet — following existing codebase conventions."`
41
41
  - **`DESIGN.md`** (only if the feature has UI): it is the single source of truth for design — never Figma or invented values. Cite the tokens and shared components the feature uses in 3–8 bullets. Missing → note `"No DESIGN.md design system found — follow the existing UI conventions already in the codebase."` No UI → say no design tokens apply.
42
- - **Recon docs (`_specs/*_recon.md`, written by bt-recon):** if any recon's `scope` covers a system this feature touches, read its Summary, Architecture, the relevant Feature Inventory / UI Reference / External Interfaces sections, Known Issues and Extension Points — it is the grounding for code nobody else documented, so build on it instead of re-deriving it. Cite it in `## Research Notes`. If its `commit:` is well behind HEAD for the files this feature touches, note the drift there and suggest `bt-recon --refresh`.
42
+ - **Recon docs (`.agents/recon/*_recon.md`, written by bt-recon):** if any recon's `scope` covers a system this feature touches, read its Summary, Architecture, the relevant Feature Inventory / UI Reference / External Interfaces sections, Known Issues and Extension Points — it is the grounding for code nobody else documented, so build on it instead of re-deriving it. Cite it in `## Research Notes`. If its `commit:` is well behind HEAD for the files this feature touches, note the drift there and suggest `bt-recon --refresh`.
43
43
  - **Research the codebase, sized to the feature.** Find the closest existing feature to mirror, the real conventions, and the integration points. For a `small` feature do this inline; fan out to up to 3 **read-only** subagents only for `medium` / `large` (they report findings and file paths, never draft the spec; if a finding contradicts SPEC.md, raise it with the user rather than resolving it silently). Record the result in the spec's `## Research Notes` so bt-plan starts from it.
44
44
 
45
45
  ## Step 3. Sibling-skill patterns
@@ -67,7 +67,7 @@ Interview the user until the design is decided, after Steps 2–3 so questions a
67
67
  - **`size`** — `small` ≈ 1–2 hours by hand, one system; `medium` ≈ a day, a few systems; `large` ≈ multi-day, multi-system, or Unity/Blender/export pipeline work. Classify by the real work.
68
68
  - **`proof`** — `functional` (default) or `parity` (only with `--parity`, or when the brief itself states a numeric bar). Under `functional`, Acceptance Criteria are what a user would notice — it works, it looks and feels right (against DESIGN.md, or next to a reference when there is one), the console is clean — proven by tests and a look at the running result. Never invent numeric pixel thresholds, repeat counts, per-engine matrices or evidence archives: how a feature is proven is most of what it costs to build.
69
69
 
70
- Print `✍️ [bt-spec] Drafting _specs/<feature_slug>_spec.md …`, then write the spec to `_specs/<feature_slug>_spec.md` using the project's `FEATURE.md` template if it exists (add any header field or section below that it lacks), otherwise this structure. No implementation detail or code examples.
70
+ Print `✍️ [bt-spec] Drafting .agents/specs/<feature_slug>_spec.md …`, then write the spec to `.agents/specs/<feature_slug>_spec.md` using the project's `FEATURE.md` template if it exists (add any header field or section below that it lacks), otherwise this structure. No implementation detail or code examples.
71
71
 
72
72
  ```markdown
73
73
  # Spec for <feature-name>
@@ -120,7 +120,7 @@ Create test file(s) in ./tests for these named cases, without going heavy:
120
120
 
121
121
  ```
122
122
  Branch: <branch_name>
123
- Spec file: _specs/<feature_slug>_spec.md
123
+ Spec file: .agents/specs/<feature_slug>_spec.md
124
124
  Title: <feature_title>
125
125
  ```
126
126
 
@@ -132,7 +132,7 @@ Do not print the spec unless asked.
132
132
  # Project Spec
133
133
 
134
134
  > The source of truth for this project: its durable architecture, systems, conventions and decisions.
135
- > Feature specs in `_specs/` are derived from and constrained by this file. It describes the **product** —
135
+ > Feature specs in `.agents/specs/` are derived from and constrained by this file. It describes the **product** —
136
136
  > what exists and why — never how a feature was verified (capture protocols, tool lists, ledgers).
137
137
 
138
138
  ## Architecture & Module Layout _(current-state — replace/merge)_
@@ -156,7 +156,7 @@ Do not print the spec unless asked.
156
156
 
157
157
  ## How to update this spec
158
158
  - `(current-state — replace/merge)` sections say what is true now: replace seed placeholders with real content, then keep them matching the shipped code.
159
- - `Decisions` holds only what still binds the current design, briefly. A decision's full rationale, its rejected alternatives and its history live in that feature's spec in `_specs/`, not here — this file must stay short enough to read before every feature.
159
+ - `Decisions` holds only what still binds the current design, briefly. A decision's full rationale, its rejected alternatives and its history live in that feature's spec in `.agents/specs/`, not here — this file must stay short enough to read before every feature.
160
160
  - Add each new Game System as its own subsection; record every new dependency (version + why) in the task that introduces it.
161
161
  - bt-spec reads this file and aligns the feature to it; bt-plan conforms to it and adds an `Update SPEC.md` task for spec-impacting features; bt-execute runs that task through the same verifier as every other task.
162
162
  ```
@@ -1,262 +0,0 @@
1
- ---
2
- name: bt-combine
3
- description: "The Babylon Toolkit Combine Skill analyses a Unity scene and merges the static meshes and LOD groups that can safely be merged — fewer meshes, fewer draw calls, faster export and load — without changing how the scene looks in Unity or in BabylonJS. It works on a copy of the scene, explains every keep/merge decision in a report, merges with the Babylon Toolkit MeshCombiner (packed source lightmap UVs, no vertex bloat), clusters LOD groups level by level with corrected switch distances, re-bakes, exports, and verifies the result against the original in Unity and in the browser. Use when the user wants to combine, merge, batch or optimize static meshes or LOD groups in a scene (e.g. `/bt-combine Assets/Scenes/Garden/GardenScene.unity`)."
4
- allowed-tools: Read, Grep, Glob, Edit, Write, Bash, WebFetch(domain:raw.githubusercontent.com)
5
- ---
6
-
7
- You are an EXPERT Babylon Toolkit and Unity technical artist. Always adhere to any rules or requirements set out in the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md).
8
-
9
- Use the user's message after the skill name as the `arguments`.
10
-
11
- ---
12
-
13
- # Invocation
14
-
15
- ```
16
- /bt-combine [<scene asset path>] [--out:<asset path>] [--analyze] [--reset] [--cell:15] [--spread:3] [--atlas-share:0.45]
17
- [--include-shadergraphs] [--no-lods] [--exclude:Name1,Prefix*] [--only:Path/A,Path/B] [--shaders:Name1,Name2]
18
- [--no-bake] [--no-export] [--no-browser] [--times:10,15,20,30]
19
- ```
20
-
21
- - **`<scene asset path>`** — the scene to optimize. Default: the Editor's active scene.
22
- - **`--out:`** — the working copy. Default: `<scene folder>/<SceneName>_Combined.unity`. **The source scene is never edited.**
23
- - **`--analyze`** — report only: analyse the source scene, write the report, change nothing, stop.
24
- - **`--reset`** — start again from the source (re-copies it over the working copy and deletes the previous merged meshes).
25
- - **`--cell:`** — area "patch" size in meters that merged meshes must stay inside (default 15).
26
- - **`--spread:`** — meters a merge may extend past its largest piece (default 3). Keeps merges to pieces that touch.
27
- - **`--atlas-share:`** — largest share of one lightmap atlas a merged lightmapped mesh may use (default 0.45).
28
- - **`--include-shadergraphs`** — also merge Shader Graph materials that pass the object-space / vertex-animation scan.
29
- - **`--no-lods`** — leave every LOD group alone.
30
- - **`--exclude:`** — object names (or prefixes ending in `*`) whose subtrees are never merged.
31
- - **`--only:`** — limit merging to these hierarchy paths.
32
- - **`--shaders:`** — extra shader names to treat as safe (custom shaders that do not use the pivot or object space).
33
- - **`--no-bake` / `--no-export` / `--no-browser`** — skip those phases (each skip is stated in the final report as unverified).
34
- - **`--times:`** — seconds after page load at which the browser comparison captures frames.
35
-
36
- ---
37
-
38
- # What this skill guarantees
39
-
40
- 1. **The source scene — and any scene the user has open — is untouched.** All work happens in the working copy, which only `PrepareCopy` can create (it leaves a `working-copy.txt` marker; `Apply` and `RemoveCopy` refuse any scene without it). Nothing switches scenes while an open scene has unsaved changes. A bad result is undone with `--reset`.
41
- 2. **Every decision has a written reason.** `_combine/<Scene>_Combined/analysis.md` lists every merge (pieces, vertices, draw calls before → after, reflection probe, lights, lightmap share, spread) and every object kept separate, grouped by reason.
42
- 3. **No vertex bloat.** Merges use the toolkit's `UnityMeshSimplifier.MeshCombiner` in *Pack Source Lightmap UVs* mode: each source keeps its own lightmap UVs, packed side by side at its original texel density. Apply refuses to run on a toolkit build without that mode.
43
- 4. **It looks the same.** The result is re-baked and compared with the original — numerically (lightmap slots, UV range, texel density, LOD transitions) and visually (Unity captures and browser frames at the same moments).
44
-
45
- # Talk to the user while you work
46
-
47
- Long runs lose people. At every phase change, post one short plain-language update: **Done** (what changed, with numbers) · **Doing now** · **Next**. Say plainly that the merging itself is done by their toolkit's MeshCombiner. If you change the plan (exclude a group, reset, re-bake), say why in one line.
48
-
49
- ---
50
-
51
- # The merge rules — and why each exists
52
-
53
- These rules are enforced by `scripts/BtCombine.cs`; know them so you can explain the report. Each one comes from a real regression.
54
-
55
- **A piece can merge only if it is:**
56
-
57
- | Rule | Why |
58
- |---|---|
59
- | Marked static (Contribute GI or Batching Static) | Anything else may move at runtime |
60
- | Not scripted, animated, a particle system, a Rigidbody, or under one | Merged geometry cannot move or toggle on its own |
61
- | Not referenced by any component (scripts, timeline bindings, cameras, signals…) | A script that toggles or moves it would lose its target |
62
- | Opaque or alpha-tested (not transparent) | Transparent meshes are sorted per mesh; merging breaks draw order |
63
- | A safe shader: URP/HDRP/Built-in Lit/Simple Lit/Unlit/Standard, `--shaders`, or a Shader Graph that passes the scan (`--include-shadergraphs`) | Graphs that read object space, use the Object node / model matrix, or move vertices (wind) change look when many objects share one pivot |
64
- | Not mirrored (negative scale), not vertex-painted, not on toolkit layers 28–31 | The combiner does not flip winding; vertex streams and reserved layers are lost |
65
- | **Lightmapped** (Contribute GI + Receive GI: Lightmaps) when the scene has light probes | A merged light-probe-lit mesh gets **one** probe sample at its centre — metal rails merged across a room turned black |
66
-
67
- **A group of pieces merges only if they:**
68
-
69
- | Rule | Why |
70
- |---|---|
71
- | Share a container (highest ancestor with no scripts, animation or references) | Toggling or moving anything above still applies to the merged mesh |
72
- | Share every renderer setting (shadows, GI, probes, Scale In Lightmap, lightmap parameters, layer, tag, static flags) | One mesh has one set |
73
- | Share their dominant **reflection probe**, and the merged centre stays inside that probe's box | Probes are chosen from a mesh's bounds centre; merging two corridors moved the centre into a different probe zone and darkened both |
74
- | Stay inside one area cell, and extend at most `--spread` past their largest piece | Keeps merges physically adjacent: culling, probes and light choice stay local |
75
- | Fit the lightmap atlas budget, and stay under 200k vertices | One mesh must fit one lightmap; huge meshes cull badly |
76
- | Are not reached by more runtime lights than BabylonJS applies per mesh (scene `maximumLights`, default 4), beyond what their most-lit piece already had | Merging must never cost a piece one of its lights |
77
-
78
- **LOD groups** are merged as **LOD clusters**: nearby groups with the same level count, the same transition heights (typically instances of one prefab), the same fade mode and the same per-level settings. Level *i* of every member becomes one merged mesh, held by a new LOD group with exactly one renderer per level (BabylonJS's fast native LOD path). Because a bigger group switches later, the new transition heights are the old ones × (cluster size ÷ member size), and a cluster is split when a member would sit more than 20% of its LOD0→LOD1 switch distance from the cluster centre, or when the rescaled LOD0 height would reach 0.95. LOD levels above 0 may be probe-lit (seen only at distance).
79
-
80
- **Lower LODs borrow LOD0's lightmap.** In Unity, a LOD1/LOD2 renderer that receives lightmaps but does not Contribute GI gets **LOD0's lightmap region** (same index and scale/offset), so its UV2 is authored to line up with LOD0's. The engine therefore records where each member's LOD0 UV2 was packed and applies that exact scale and offset to the member's lower levels; packing them independently turned merged rocks black at LOD1. Such clusters need exactly one LOD0 renderer per member and UV2 on every sharing level, otherwise the group is kept separate. Billboard / SpeedTree / skinned LODs, empty levels, and renderers shared between levels are left alone too.
81
-
82
- ---
83
-
84
- # Pipeline
85
-
86
- Read the Babylon Toolkit Agent Reference router and its `unity-exporter-cli.md`, `unity-editor-commands.md` and `unity-authoring-recipes.md` (§4 lightmaps, §5–6 probes, §17 LOD, §19 static flags, §21 verification) before the first run in a session — unless your prompt already carries those excerpts.
87
-
88
- Set these once:
89
-
90
- ```bash
91
- PROJ=<absolute Unity project path> # folder holding Assets/
92
- SKILL_DIR=<absolute path of this skill's folder>
93
- SOURCE=Assets/.../Scene.unity # from the arguments, or the active scene (bt_status → scene)
94
- OUT=Assets/.../Scene_Combined.unity # --out, or <source folder>/<SceneName>_Combined.unity
95
- NAME=$(basename "$OUT" .unity) # reports live in $PROJ/_combine/$NAME/
96
- OPTIONS='{"cellSize":15,"maxSpread":3,"maxAtlasShare":0.45,"includeShaderGraphs":false,"combineLods":true,"exclude":[],"only":[],"extraShaders":[]}'
97
-
98
- bt_run() { # bt_run <Method> '<json args array>'
99
- unity command run_script --file AgentScripts/bt-combine/BtCombine.cs --entry "BtCombine.$1" --args "$2" \
100
- --timeout_ms 1800000 --timeout 1900 --project-path "$PROJ" --format json \
101
- | python3 -c "import json,sys; d=json.load(sys.stdin); r=d['data']['result']; print(r.get('result') if r.get('success') else 'FAILED: '+json.dumps(r.get('diagnostics') or r.get('errorDetails') or r)[:4000])"
102
- }
103
- OPTS_ARG=$(python3 -c "import json,sys; print(json.dumps([sys.argv[1]]))" "$OPTIONS") # options JSON wrapped as a one-string args array
104
- ```
105
-
106
- Map flags into `OPTIONS` (`--exclude:A,B*` → `"exclude":["A","B*"]`, `--include-shadergraphs` → `true`, `--no-lods` → `"combineLods":false`, …).
107
-
108
- ## Phase 0 — Preflight
109
-
110
- ```bash
111
- unity pipeline list # Editor running, Pipeline reachable, not in Safe Mode
112
- unity command editor_status --project-path "$PROJ" # ready, not in Play mode (editor_stop if it is)
113
- mkdir -p "$PROJ/AgentScripts/bt-combine" && cp "$SKILL_DIR/scripts/BtCombine.cs" "$PROJ/AgentScripts/bt-combine/"
114
- bt_run Preflight "[\"$SOURCE\"]"
115
- ```
116
-
117
- Stop and report if: no Editor is reachable (say how to start one — `unity-exporter-cli.md` §6), the source does not exist, **any open scene has unsaved changes** (`activeScene=… dirty=True`, or a `PrepareCopy` error naming the scene — ask the user to save or discard; never save or discard their scene for them, and never open another scene over it), or `packSourceLightmapUVs=False` (their `CanvasTools.dll` predates the packing combiner — merging would split vertices; tell them to update the toolkit, or proceed only if they explicitly accept with `allowUnityUnwrap`).
118
-
119
- ## Phase 1 — Analyse
120
-
121
- - `--analyze`: `unity command open_scene --path "$SOURCE"`, then `bt_run Analyze "$OPTS_ARG"`, summarise `_combine/<SourceName>/analysis.md`, stop.
122
- - Otherwise: `bt_run PrepareCopy "[\"$SOURCE\",\"$OUT\",<true if --reset else false>]"`, then `bt_run Analyze "$OPTS_ARG"`.
123
-
124
- If the working copy already holds merges (Apply refuses: "already combined"), either continue from Phase 3 with the existing result or rerun with `--reset` — ask only if the user's intent is unclear.
125
-
126
- Tell the user, in a few lines: meshes and estimated draw calls before → after, number of static merges and LOD clusters, the top three "kept separate" reasons, and anything they could change to merge more (for example: "142 rocks are skipped only because they are not marked Static"). Then continue — do not wait for approval; the source is safe.
127
-
128
- ## Phase 2 — Apply
129
-
130
- ```bash
131
- bt_run Apply "$OPTS_ARG"
132
- ```
133
-
134
- Read the output: every group's `verts a -> b` must be equal (a mismatch or a `WARNING … re-unwrapped` line means bloat — stop and report). `needsBake=True` means Phase 3 is required.
135
-
136
- ## Phase 3 — Bake (skip only with --no-bake)
137
-
138
- The working copy needs its own lightmaps: merged meshes have new lightmap UVs, and a copied scene still points at the source's LightingData.
139
-
140
- ```bash
141
- unity command bake_lighting --dry_run true --project-path "$PROJ"
142
- unity command bake_lighting --confirm true --project-path "$PROJ"
143
- deadline=$((SECONDS+5400)); seen=""
144
- while :; do
145
- s=$(unity command lighting_bake_status --project-path "$PROJ" --result-only 2>/dev/null)
146
- case "$s" in
147
- *completed*) break;;
148
- *failed*) echo "bake failed: $s"; break;;
149
- *baking*|*running*|*in_progress*) seen=1;;
150
- *idle*) [ -n "$seen" ] && { echo "bake stopped without completing"; break; };;
151
- esac
152
- [ $SECONDS -ge $deadline ] && { echo "bake timed out"; break; }
153
- sleep 15
154
- done
155
- unity command save_all --project-path "$PROJ" # the bake assigns new LightingData; exports refuse a dirty scene
156
- bt_run CorrectDensity '[]'
157
- ```
158
-
159
- **Density correction (one extra bake).** Unity sizes a merged mesh in the lightmap slightly smaller than the sum of its parts — measured on a 900-piece garden: median 84–89% of the sources' texel density, down to 73% for clusters of many small pieces. `CorrectDensity` measures every merged lightmapped mesh against its sources and raises its Scale In Lightmap by exactly the shortfall (target 95%, at most ×2). When it reports `corrected=N` with N > 0, run the bake loop above **once more**, `save_all`, then:
160
-
161
- ```bash
162
- bt_run Verify '[]'
163
- ```
164
-
165
- `Verify` must end with `problems=0` (it flags density below 80% of the sources, missing lightmap slots, UV2 outside 0..1, malformed LOD clusters, and LightingData that is not this scene's). Typical fixes: no lightmap slot → bake again; density still low → lower `--atlas-share` and `--reset`; LightingData not this scene's → the bake did not finish or was not saved.
166
-
167
- ## Phase 4 — Unity side-by-side (LOD0 **and** LOD1)
168
-
169
- The spawn view alone is not enough: a merge can look right up close and wrong at distance (lower LOD levels), or right in the open and wrong in a corridor. Capture the spawn view, then the three largest merges at LOD0 and forced LOD1, in both scenes (GPU Resident Drawer must be off in batch Editors — `unity-editor-commands.md` §8.1):
170
-
171
- ```bash
172
- CAPS="$PROJ/_combine/$NAME/captures"; mkdir -p "$CAPS"
173
- CAM=$(unity command eval 'return UnityEngine.Camera.main != null ? UnityEngine.Camera.main.name : "";' --project-path "$PROJ" --result-only | python3 -c "import json,sys; print(json.load(sys.stdin)['result'])")
174
- cap() { unity command capture_game_view --camera "$CAM" --width 1280 --height 720 --project-path "$PROJ" --result-only --timeout 300 \
175
- | python3 -c "import json,sys,base64; d=json.load(sys.stdin); d=json.loads(d) if isinstance(d,str) else d; open(sys.argv[1],'wb').write(base64.b64decode(d['base64']))" "$1"; }
176
-
177
- cap "$CAPS/unity_spawn_combined.png"
178
- unity command open_scene --path "$SOURCE" --project-path "$PROJ"; cap "$CAPS/unity_spawn_source.png"
179
- unity command open_scene --path "$OUT" --project-path "$PROJ"
180
-
181
- bt_run QaPoints '[3]' > "$CAPS/points.txt" # name|x|y|z|size of the largest merges (LOD clusters first)
182
- while IFS='|' read -r name x y z size; do
183
- [ -z "$name" ] && continue
184
- dist=$(python3 -c "print(max(4.0, float('$size') * 1.5))")
185
- for lod in 0 1; do
186
- for which in source combined; do
187
- scene=$([ "$which" = source ] && echo "$SOURCE" || echo "$OUT")
188
- bt_run QaView "[\"$scene\",$x,$y,$z,$dist,$lod]" >/dev/null && cap "$CAPS/unity_${name}_lod${lod}_${which}.png"
189
- done
190
- done
191
- done < "$CAPS/points.txt"
192
- unity command open_scene --path "$OUT" --project-path "$PROJ" # QaView never saves; reopening discards the QA camera
193
- ```
194
-
195
- Open every source/combined pair and compare: material, moss/detail, baked shadows and brightness must match. A merged object that is darker, black or blotchy **only at LOD1** is a lower-LOD lightmap problem; one that is wrong at LOD0 is a probe or lightmap problem — exclude that merge (Phase 6 loop) and report it.
196
-
197
- ## Phase 5 — Export and numbers (skip only with --no-export)
198
-
199
- ```bash
200
- unity command bt_export_level --scene "$OUT" --project-path "$PROJ" --timeout 3600
201
- ```
202
-
203
- The source's export must exist for comparison: find `<exportRoot>/scenes/<source name>.gltf` (`bt_status` → `exportRoot`; the project may lower-case file names). If it is missing or older than the source scene file, export the source too (`bt_export_level --scene "$SOURCE"`). Record both export durations.
204
-
205
- ```bash
206
- mkdir -p "$PROJ/_combine/.qa-tools" && cp "$SKILL_DIR"/scripts/qa/* "$PROJ/_combine/.qa-tools/"
207
- (cd "$PROJ/_combine/.qa-tools" && npm install --silent) # puppeteer-core, kept out of the Unity project's package.json
208
- node "$PROJ/_combine/.qa-tools/gltf-stats.mjs" <source.gltf> <combined.gltf>
209
- ```
210
-
211
- ## Phase 6 — Browser comparison (skip only with --no-browser)
212
-
213
- ```bash
214
- unity command bt_devserver_start --project-path "$PROJ" # rerun after any domain reload — it stops the server
215
- node "$PROJ/_combine/.qa-tools/compare-browser.mjs" --base http://localhost:<port> \
216
- --scenes <source>.gltf,<combined>.gltf --times 10,15,20,30 --out "$PROJ/_combine/$NAME/captures"
217
- ```
218
-
219
- Use the harness's own browser tool instead when it has one and it works. The script prints `{ sheet, results }`: open **`sheet.png`** first — one row per moment, one column per scene — then the full-size frames you need. Load time and console errors are in `results` (both scenes must be error-free).
220
-
221
- Flythroughs start when the scene is ready, so **the two runs are usually offset by a few seconds** (on a 900-piece garden the combined scene ran 5–10 s ahead of the original — it finished loading sooner). Pair frames by matching view, not by timestamp: find the same view in both columns, note the offset, and compare those pairs at full size. Report the offset as a load-time observation (headless, single run). Capture enough moments (`--times 20,25,…,90`) to cover the offset.
222
-
223
- **Regression loop (at most 3 rounds).** If a region looks different (darker, flatter, wrong reflections, LOD popping):
224
-
225
- 1. Identify the merge: match the region against `manifest.json` (`combinedPaths`, `sources`, `containers`, probe names).
226
- 2. Add its sources' container or names to `exclude`, say why in one line, then `PrepareCopy … true` (reset), Analyze, Apply, Bake, Verify, export, compare again.
227
- 3. If it is still different without that merge, the cause is not merging — compare against a re-baked **uncombined** copy (PrepareCopy to `<Scene>_Control.unity`, bake, export, capture; delete it afterwards with `RemoveCopy`). A difference that the control also shows is the re-bake (often a stale source bake), not this skill — report it as such.
228
-
229
- ## Phase 7 — Report
230
-
231
- Reply in plain language, with images. Put this structure in the reply and in `_combine/$NAME/report.md`:
232
-
233
- - **Result:** working copy path; meshes, drawn mesh nodes, primitives, drawn vertices and export size before → after (`gltf-stats`); export time before → after; draw calls estimated before → after.
234
- - **What merged:** static merges and LOD clusters, the biggest ones by name.
235
- - **What stayed separate and why:** the top reasons with counts, and which ones the user can unlock (mark static, opt into Shader Graphs, fix mirrored prefabs…).
236
- - **Checks:** Verify result, Unity captures, browser frames with load time and console errors; anything skipped or unverified, stated as such.
237
- - **How to undo or redo:** `--reset`, or delete the working copy and `<SceneName>_CombinedMeshes/`.
238
-
239
- ---
240
-
241
- # Files this skill writes
242
-
243
- | Path | What |
244
- |---|---|
245
- | `<out scene>` | the working copy (combined) |
246
- | `<out scene folder>/<OutName>_CombinedMeshes/*.asset` | merged meshes |
247
- | `<out scene folder>/<OutName>/` | the copy's baked lighting |
248
- | `_combine/<OutName>/analysis.md`, `analysis.json` | the plan and every reason |
249
- | `_combine/<OutName>/manifest.json`, `verify.md`, `report.md`, `captures/` | what was done and how it was checked |
250
- | `AgentScripts/bt-combine/BtCombine.cs`, `_combine/.qa-tools/` | the engine and the QA tools (outside `Assets/`, no recompiles) |
251
-
252
- # Troubleshooting
253
-
254
- | Symptom | Fix |
255
- |---|---|
256
- | `FAILED: … Compilation Failed` from `bt_run` | Read the diagnostics; the toolkit DLL may be older than this skill (`UnityMeshSimplifier.MeshCombiner`, `UnityTools.GetMaxSimultaneousLights` must exist) |
257
- | Apply: "no Pack Source Lightmap UVs mode" | Update the Babylon Toolkit (`CanvasTools.dll`); never accept bloat silently |
258
- | Apply: "already combined" | `--reset`, or continue from Phase 3 |
259
- | Bake never completes | Check `console --level error`; GPU lightmapper may fall back to CPU and take much longer — raise the deadline |
260
- | Export refuses: unsaved changes | `unity command save_all` after the bake |
261
- | Browser: connection refused | The dev server stops on every domain reload — `bt_devserver_start` again |
262
- | Merged area darker in the browser only | Probe or light choice: lower `--spread` / `--cell`, or `--exclude` that container; then the control test above |
@@ -1,9 +0,0 @@
1
- {
2
- "name": "bt-combine-qa",
3
- "private": true,
4
- "type": "module",
5
- "description": "Browser and glTF checks for the bt-combine skill. Installed into <project>/_combine/.qa-tools, never into the Unity project's own package.json.",
6
- "dependencies": {
7
- "puppeteer-core": "23.11.1"
8
- }
9
- }