@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.
Files changed (44) hide show
  1. package/README.md +31 -21
  2. package/lib/claude-settings.js +146 -1
  3. package/lib/doctor.js +21 -4
  4. package/lib/install.js +67 -4
  5. package/package.json +1 -1
  6. package/scripts/hooks/block-sleep.js +138 -0
  7. package/skills/bt-atlas/SKILL.md +22 -5
  8. package/skills/bt-design/references/3d-hero-docs.md +10 -3
  9. package/skills/bt-design/references/3d-hero-scroll.md +30 -5
  10. package/skills/bt-execute/SKILL.md +89 -120
  11. package/skills/bt-execute/scripts/dashboard.mjs +279 -19
  12. package/skills/bt-execute/templates/dashboard/data-schema.md +36 -15
  13. package/skills/bt-gauntlet/SKILL.md +4 -4
  14. package/skills/bt-gauntlet/references/spec-composition.md +4 -2
  15. package/skills/bt-gauntlet/references/target-images.md +28 -4
  16. package/skills/bt-gauntlet/references/unity-pipeline.md +30 -8
  17. package/skills/bt-hero/SKILL.md +3 -3
  18. package/skills/bt-landing/SKILL.md +1 -1
  19. package/skills/bt-plan/SKILL.md +52 -62
  20. package/skills/bt-prototype/SKILL.md +3 -3
  21. package/skills/bt-unwrap/SKILL.md +396 -0
  22. package/skills/bt-unwrap/scripts/blender/__pycache__/bt_unwrap.cpython-313.pyc +0 -0
  23. package/skills/bt-unwrap/scripts/blender/__pycache__/image_utils.cpython-313.pyc +0 -0
  24. package/skills/bt-unwrap/scripts/blender/__pycache__/mesh_tools.cpython-313.pyc +0 -0
  25. package/skills/bt-unwrap/scripts/blender/__pycache__/model_io.cpython-313.pyc +0 -0
  26. package/skills/bt-unwrap/scripts/blender/__pycache__/previews.cpython-313.pyc +0 -0
  27. package/skills/bt-unwrap/scripts/blender/__pycache__/rasterizer.cpython-313.pyc +0 -0
  28. package/skills/bt-unwrap/scripts/blender/__pycache__/reference_views.cpython-313.pyc +0 -0
  29. package/skills/bt-unwrap/scripts/blender/__pycache__/reference_warp.cpython-313.pyc +0 -0
  30. package/skills/bt-unwrap/scripts/blender/__pycache__/texture_bake.cpython-313.pyc +0 -0
  31. package/skills/bt-unwrap/scripts/blender/__pycache__/texture_compose.cpython-313.pyc +0 -0
  32. package/skills/bt-unwrap/scripts/blender/__pycache__/uv_layout.cpython-313.pyc +0 -0
  33. package/skills/bt-unwrap/scripts/blender/bt_unwrap.py +678 -0
  34. package/skills/bt-unwrap/scripts/blender/image_utils.py +264 -0
  35. package/skills/bt-unwrap/scripts/blender/mesh_tools.py +508 -0
  36. package/skills/bt-unwrap/scripts/blender/model_io.py +135 -0
  37. package/skills/bt-unwrap/scripts/blender/previews.py +205 -0
  38. package/skills/bt-unwrap/scripts/blender/rasterizer.py +217 -0
  39. package/skills/bt-unwrap/scripts/blender/reference_views.py +945 -0
  40. package/skills/bt-unwrap/scripts/blender/reference_warp.py +571 -0
  41. package/skills/bt-unwrap/scripts/blender/texture_bake.py +390 -0
  42. package/skills/bt-unwrap/scripts/blender/texture_compose.py +596 -0
  43. package/skills/bt-unwrap/scripts/blender/uv_layout.py +605 -0
  44. package/skills/bt-unwrap/scripts/bt-unwrap.mjs +165 -0
@@ -64,10 +64,17 @@ all beats ffmpeg concat → journey.mp4
64
64
  **Which tool backs `generate_image` / `generate_video`?** These are generic
65
65
  calls, not a specific vendor. The skill routes them to whatever image/video
66
66
  generation is configured in your environment — KIE MCP servers (e.g.
67
- `kie-image-mcp` and `kie-video-mcp`, the default), the Higgsfield CLI, the
68
- model's own built-in image/video generation, or any other configured image/video
69
- tool. The prompt just says "generate the footage"; the wiring picks the backend.
67
+ `kie-image-mcp` and `kie-video-mcp`, the default), the Higgsfield API (when `.env`
68
+ has `HIGGSFIELD_API_KEY`), the Higgsfield CLI, the model's own built-in
69
+ image/video generation, or any other configured image/video tool. The prompt
70
+ just says "generate the footage"; the wiring picks the backend.
70
71
  `image_paths` / `reference_paths` / `out_path` are the KIE/Kling parameter names.
72
+ On the **Higgsfield API** every call goes through the Reference's installed
73
+ `hf-api.mjs`: `image_paths[0]` / `[1]` become `--file image_url=…` and
74
+ `--file last_image_url=…` on `kling-video/v3.0/pro/image-to-video` (or
75
+ `end_image_url` on `bytedance/seedance-2.5/image-to-video`), reference images
76
+ become `--file image_urls[]=<file>`, and each result is moved from the `--out`
77
+ folder to its `out_path`.
71
78
  On the **Higgsfield CLI** every call goes through the reference's
72
79
  `scripts/hf-generate.mjs` wrapper: `image_paths[0]` / `[1]` become
73
80
  `--start-image` / `--end-image` on `kling3_0` or `seedance_2_5`, reference images
@@ -40,8 +40,9 @@ memory in any framework; copy it and configure it.
40
40
  - **(a) Provided video** — skip to §3 (still needs the scrub re-encode).
41
41
  - **(b) Generate the footage** with whatever image/video generation is
42
42
  configured — KIE MCP servers (`kie-image-mcp` / `kie-video-mcp`, the
43
- **default**), the Higgsfield CLI, the model's own built-in image/video
44
- generation, or any other configured image/video tool — §2.
43
+ **default**), the Higgsfield API (`HIGGSFIELD_API_KEY` in `.env`), the
44
+ Higgsfield CLI, the model's own built-in image/video generation, or any
45
+ other configured image/video tool — §2.
45
46
  - **(c) No footage possible** — this pattern is wrong; use a static hero.
46
47
  2. **Brand tokens** — map `--hs-bg / --hs-ink / --hs-dim / --hs-accent /
47
48
  --hs-display / --hs-mono` to the host site's design system (DESIGN.md or
@@ -76,16 +77,40 @@ memory in any framework; copy it and configure it.
76
77
  The generation backend is pluggable — the pipeline below is the same whatever
77
78
  produces the frames. Choose the backend in this order: the one the user named →
78
79
  **KIE MCP servers** (`kie-image-mcp` / `kie-video-mcp`, the default) → the **Higgsfield
79
- CLI** → the model's own built-in image/video generation → any other configured
80
+ API** when the project's `.env` has `HIGGSFIELD_API_KEY` → the **Higgsfield CLI** →
81
+ the model's own built-in image/video generation → any other configured
80
82
  image/video tool. The parameter names below (`reference_paths`, `image_paths`,
81
- `out_path`) are KIE/Kling's; map them to your backend (Higgsfield mapping below).
83
+ `out_path`) are KIE/Kling's; map them to your backend (Higgsfield mappings below).
82
84
 
83
85
  > **If using the KIE MCP servers** (Babylon Toolkit projects): read the
84
86
  > Babylon Toolkit Agent Reference and its `web-kie-servers.md` sub-document
85
87
  > first (per CLAUDE.md). Those servers read the key from `.env` — a file named
86
88
  > `env` is ignored.
87
89
 
88
- > **If using the Higgsfield CLI** (`@higgsfield/cli`): read the Agent
90
+ > **If using the Higgsfield API** (`HIGGSFIELD_API_KEY` in `.env`, checked by
91
+ > shape only): read the Agent Reference's `web-higgsfield-cli.md` sub-document
92
+ > first. Run the Reference's installed wrapper in place, never a copy:
93
+ > `HF_API="https://raw.githubusercontent.com/babylontoolkit/agent/main/references/higgsfield/hf-api.mjs"`.
94
+ > It uploads local files, waits, and saves every result as
95
+ > `<request_id>_<field>.<ext>` under `--out <dir>`, listing them under `files`
96
+ > on stdout. Move each one to the path the step names. KIE-shaped calls map like this:
97
+ >
98
+ > | KIE shape | Higgsfield API |
99
+ > |---|---|
100
+ > | `generate_image({ prompt, out_path })` | `node "$HF_API" xai/grok-imagine-image-2.0 --out media/gen --set prompt="…" --set aspect_ratio=16:9 --set resolution=2k`, then move the PNG to `media/hero.png` |
101
+ > | `reference_paths: [hero.png]` | `--file image_urls[]=media/hero.png` (repeat for several, up to 10) |
102
+ > | `image_paths[0]` = first frame | `--file image_url=media/clip1-last.jpg` |
103
+ > | `image_paths[1]` = last frame | `--file last_image_url=media/hero.png` (Kling) · `--file end_image_url=media/hero.png` (Seedance) |
104
+ > | Kling 3 `std`/`pro` | `node "$HF_API" kling-video/v3.0/pro/image-to-video --set prompt="…" --set duration=<3–15> --set sound=off …` (`v3.0/standard/…`, `v3.0/4k/…`) |
105
+ > | general video | `node "$HF_API" bytedance/seedance-2.5/image-to-video --set duration=<4–30> --set resolution=1080p --set generate_audio=false …` |
106
+ > | `out_path: "clipN.mp4"` | `--out media/gen`, then move the saved `.mp4` to `media/clipN.mp4` (`--timeout` is in minutes, default 30) |
107
+ >
108
+ > Turn sound **off** (the scrub encode strips audio) and run every clip once
109
+ > with `--estimate` in place of `--out <dir>`. Tell the user the film's total
110
+ > before submitting it. There is no sign-in step. The API image models stop at
111
+ > 2K, so the anchor is 2K.
112
+
113
+ > **If using the Higgsfield CLI** (`@higgsfield/cli`, no API key): read the Agent
89
114
  > Reference's `web-higgsfield-cli.md` sub-document first. Install the CLI
90
115
  > locally (`npm i -D @higgsfield/cli`) and the reference's download wrapper as
91
116
  > `scripts/hf-generate.mjs`. The CLI only returns CDN URLs; the wrapper saves
@@ -1,170 +1,139 @@
1
1
  ---
2
2
  name: bt-execute
3
- description: "The Babylon Toolkit Execute Skill runs one task — or all remaining tasks — from a feature plan or spec file. Use when asked to run a task (e.g. `bt-execute @plan T1`), all tasks (e.g. `bt-execute @plan ALL`), or a range (e.g. `bt-execute @plan T3-T7`, `T12-`, `NEXT:3`); with no task id it runs the next unchecked task. Add `--auto-pilot` for an unattended run (e.g. `bt-execute --auto-pilot @plan ALL`): the agent owns the whole pipeline (code, UI, shaders, generated assets, Blender, Unity, export, build, dev server, visual QA), every decision is made autonomously from the plan, spec, Babylon Toolkit Agent Reference and codebase, it never asks the user a question, failing tasks are retried then deferred, and the run never stops until the requested range (or every task) is done. Every task is tested, checked by an independent verifier, and checked live in the browser when its result is visual; add `--strict` for an adversarial verifier on every task, and `--verbose` for a fully written-up dashboard — each task and the After Action Report documented in depth. Every run keeps the feature's live dashboard (`.agents/specs/<slug>/dashboard.html`) current task by task — what is being worked on right now, each task's result the moment it is built, verifier results, and meaningful snapshots of the build as it progresses — and, once the run is over, puts an After Action Report in place of the live activity: the whole plan's execution summarized, with one before/after for the plan as a whole. When the plan is complete it also writes `.agents/specs/<slug>/documents/<slug>_summary.html`, a formatted plain-language summary of the plan for non-technical readers, linked from the After Action Report."
3
+ description: "The Babylon Toolkit Execute Skill runs one task — or all remaining tasks — from a feature plan or spec file. Use when asked to run a task (e.g. `bt-execute @plan T1`), all tasks (`@plan ALL`) or a range (`T3-T7`, `T12-`, `NEXT:3`); with no task id it runs the next unchecked task. `--auto-pilot` runs unattended: the agent owns the whole pipeline (code, UI, assets, Blender, Unity, export, build, visual QA), never asks a question, defers what keeps failing, and never stops until the range is done. Each task is built with its tests and checked once by an independent verifier, live when visual; plan tracks build in parallel. `--strict` adds an adversarial verifier per task; `--verbose` an in-depth dashboard. The feature's dashboard (`.agents/specs/<slug>/dashboard.html`) stays current task by task with snapshots of the build, then shows an After Action Report with a plan-wide before/after; a complete plan also gets a plain-language `documents/<slug>_summary.html`."
4
4
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash, WebFetch(domain:raw.githubusercontent.com), Agent, Task
5
5
  ---
6
6
 
7
- Run tasks from a plan: build each one with its tests, have an independent verifier check it, and only then tick its box — and keep the feature's dashboard current as you go (see *Feature folder and dashboard*). 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
+ Run tasks from a plan: build each with its tests, have an independent verifier check it once, tick only on PASS, keep the feature's dashboard current. 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-execute [--auto-pilot] [--strict] [--verbose] [--no-time-limit] <plan> [task] [brief]
11
11
 
12
- /bt-execute @.agents/specs/<slug>/documents/<slug>_plan.md ALL
13
-
14
- /bt-execute @plan.md # NEXT: the next unchecked task
15
- /bt-execute @plan.md T4 # one task
16
- /bt-execute @plan.md T3-T7 # a range, in plan order (T12- = through the end)
17
- /bt-execute @plan.md NEXT:3 # the next three unchecked tasks
18
- /bt-execute @plan.md ALL # every remaining task (resumable)
19
- /bt-execute @plan.md "mind the physics layer" # a brief shapes HOW, never WHICH task
20
- /bt-execute --strict @plan.md ALL # adversarial verifier on every task
21
- /bt-execute --auto-pilot @plan.md ALL # unattended; combine with --strict if wanted
22
- /bt-execute --no-time-limit @plan.md ALL # turn off the default TIME MATTERS mode
23
- /bt-execute --verbose @plan.md ALL # a fully written-up dashboard: every task and the After Action Report in depth
12
+ /bt-execute @.agents/specs/<slug>/documents/<slug>_plan.md ALL # every remaining task (resumable)
13
+ /bt-execute @plan.md # NEXT: the next unchecked task
14
+ /bt-execute @plan.md T4 # one task · T3-T7 a range · T12- to the end · NEXT:3
15
+ /bt-execute @plan.md "mind the physics layer" # a brief shapes HOW, never WHICH task
24
16
  ```
25
17
 
26
- - Strip `--auto-pilot` / `--strict` / `--verbose` / `--no-time-limit`, and any literal `TIME MATTERS`, first (anywhere in the arguments, never part of the brief). `<plan>` is required — if missing, ask (auto-pilot: say so and end). Never guess a path.
27
- - `[task]` is the token right after the plan, only if it is `T<id>`, `T<a>-T<b>`, `T<a>-`, `NEXT`, `NEXT:<n>` or `ALL` (case-insensitive). Otherwise it is part of the brief, and the task defaults to `NEXT` (`ALL` under auto-pilot). Never ask which task to run.
28
- - A range is a slice of the checklist **in file order** (sub-tasks like `T3.1` between the endpoints included). An unknown id → list the available ids and stop. A reversed range → error; never swap it. Tasks outside the slice are never touched.
29
- - Tasks already `- [x]` are skipped — that is what makes every mode resumable. Nothing left to do → say so and stop. Except in `ALL` / range / `NEXT:<n>` runs, do one task and do not continue to the next.
30
- - **`--auto-pilot` overrides every stop in this skill.** Wherever a rule below says *stop*, *ask* or *tell the user*, an auto-pilot run follows the **Auto-pilot** section instead — read it before the first task.
18
+ - `--auto-pilot`: unattended. `--strict`: an adversarial verifier on every task. `--verbose`: an in-depth dashboard. `--no-time-limit`: TIME MATTERS off. Strip these and any literal `TIME MATTERS` first. `<plan>` is required — missing → ask *(auto-pilot: say so, end)*; never guess a path.
19
+ - `[task]` is the token after the plan only if it is `T<id>`, `T<a>-T<b>`, `T<a>-`, `NEXT`, `NEXT:<n>` or `ALL` (any case); otherwise it is brief, and the task is `NEXT` (`ALL` under auto-pilot). Never ask which.
20
+ - A range is a checklist slice in file order, sub-tasks (`T3.1`) included. Unknown id → list the ids, stop; reversed → error, never swap. Nothing outside it is touched.
21
+ - `- [x]` tasks are skipped, so every mode resumes; nothing left → say so, stop. Only `ALL`, ranges and `NEXT:<n>` run past one task.
22
+ - **`--auto-pilot` overrides every *stop*, *ask* and *tell the user* below** — read **Auto-pilot** first.
31
23
 
32
24
  ## Ground rules
33
25
 
34
- - **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — follow the *Work fast* rules below to the letter, take the direct route to each task's Acceptance, and do not re-read what you already have. Begin every implementer and verifier prompt with `TIME MATTERS.` Print `⏱️ [bt-execute] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-execute] No time limit`, and do not add it). Speed never relaxes tests, the independent verifier, live checks, or "tick only on PASS".
35
- - **Snapshots — ENFORCED.** The dashboard's snapshots are the chronicle of how the feature was built; a row of "No snapshot" loses that record for good. Every snapshot reaches the dashboard **only** through `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> <T<n>|P<N>|plan> --src snapshots/… --caption "…"` (`--before … --after …` for a comparison, `--frame "src|stage|caption"` repeated for a progression). Never write or brief a snapshot JSON shape — every brief carries that exact command line with the paths filled in, and a subagent that cannot run it returns paths and captions for you to add. `dashboard.mjs check <feature-folder>` is a gate, not a courtesy: run it at every phase boundary and at run end, and never close a phase or end the run while it fails. Then open `dashboard.html` headless and look: every snapshot slot shows its image.
36
- - **Never commit.** No git commit, stage, stash, push or branch switch, in any mode (`--auto-pilot` included); it works on whatever branch is checked out. The user commits when they choose; every change this skill makes stays in the working tree.
37
- - **Scope.** Implement only the selected task(s). No "while I'm here" work on other tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide and log it)*.
38
- - **Open the run before anything else.** The first actions of every run — before reading docs, reading code, checking the repo or any other pre-flight work — are, in order: take the clock; append the `⏱ Run <n> start` line to the run log; sync the dashboard with the plan and set `status: "in-progress"` (*Run start* under *Feature folder and dashboard*); write the live file (`role: "orchestrator"`, `title: "Starting run <n> — <what you are checking first>"`); and launch the watchdog in the background (*Never let the dashboard go stale*). From then on the pre-flight work is narrated in the live file like any other step. Until the run is opened the dashboard still shows the last run's end state — a user who restarts a run and refreshes must see it running within a minute, not after the pre-flight is over.
39
- - **Read the docs once.** For Babylon work, if you have not read the Agent Reference this session, read it once — https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — plus only the sub-documents the plan's tasks need, searching a large one for the part you need rather than reading it whole. It is the authority for conventions and API. Cannot be read → stop and tell the user *(auto-pilot: retry 3×, then continue on what you know and log it)*. Read the plan's checklist and the parts of `SPEC.md` the tasks touch; re-read after a context compaction.
40
- - **SPEC.md** constrains how you build. If the code and SPEC.md disagree, stop and tell the user *(auto-pilot: decide which is right, fix SPEC.md in the same task, log it)*. When a task changes architecture, a system, a convention or a dependency, SPEC.md must end up matching — normally the plan's final `Update SPEC.md` task; if the plan has none, do it anyway; a new dependency is recorded in SPEC.md by the task that introduces it. Follow SPEC.md's "How to update this spec". **Write the product, never the procedure** — no capture protocols, tool lists, ledgers or gates: recorded there, they become a bar every later feature must clear.
41
- - **Say what you are doing** — one short line at each task and phase boundary, and before anything slow.
42
- - **Clock every run** — auto-pilot or not, so bt-plan's time estimates can be recalibrated from real runs. Take every time from the shell (`date '+%Y-%m-%d %H:%M %Z'`, local time), never from memory, the conversation or a tool result's UTC timestamp. Append to the run log `documents/<slug>_autopilot.md` beside the plan (a legacy plan keeps its existing `<plan-basename>_autopilot.md`; an interactive run writes only these lines and its task lines):
43
- - Run start: `⏱ Run <n> start <date time> · queue T<a>–T<b> (<k> tasks) · plan estimate <the plan's Total line, or none> · flags <auto-pilot / strict / interactive>`
44
- - Each phase — read the clock when the implementer launches, when each verifier launches, and at the tick — once its tasks are ticked or deferred: `⏱ Phase <N> (T<a>–T<b>): <HH:MM>→<HH:MM> · <m> min · build <m> · verify <m> · fix <m> (<rounds> rounds)`. Time spent waiting on the user (a question, a permission prompt) is logged as `· waited <m>` and left out of `<m> min`.
45
- - Each task line ends `· done <HH:MM>`.
46
- - Run end: `⏱ Run <n> end <date time> · <done>/<k> tasks · active <h m> · <min> min/task · waited <m>`.
47
- - **Subagents:** running this skill is the user's request to use them. Use whatever subagent tool your host provides (its name varies by host — e.g. `Agent` or `Task`); if there is none, work inline, self-verify with the same checklist, and say so.
26
+ - **TIME MATTERS** (default): follow *Work fast*, take the direct route, never re-read. Print `⏱️ [bt-execute] TIME MATTERS` (or `⏱️ [bt-execute] No time limit`) and start every subagent prompt with `TIME MATTERS.` unless it is off. Speed never relaxes tests, the verifier, live checks or "tick only on PASS".
27
+ - **Never commit** — no git commit, stage, stash, reset, checkout, push or branch switch, in any mode. Changes stay in the working tree.
28
+ - **Scope:** only the selected tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide, log it)*.
29
+ - **Open the run first** — before docs, code or pre-flight: take the clock, append `⏱ Run <n> start`, do *Run start*, so a refreshed dashboard shows the run within a minute.
30
+ - **Read the docs once:** for Babylon work, the Agent Reference (https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md) once per session plus only the sub-documents the tasks need, searched — the authority on conventions and API. Unreadable → stop and tell the user *(auto-pilot: retry 3×, carry on, log it)*. Read the checklist and the `SPEC.md` parts the tasks touch; re-read after a compaction.
31
+ - **SPEC.md** constrains the build. It disagrees with the code → stop and tell the user *(auto-pilot: decide, fix SPEC.md in that task, log it)*. Changes to architecture, systems, conventions or dependencies leave SPEC.md matching (the plan's `Update SPEC.md` task, or anyway), per its "How to update this spec". **Write the product, never the procedure** — no capture protocols, tool lists, ledgers or gates, which would bind every later feature.
32
+ - **Say what you are doing** in one line at each boundary.
33
+ - **Clock every run**, any mode — bt-plan re-fits its estimates from it. Shell times only (`date '+%Y-%m-%d %H:%M %Z'`), appended to `documents/<slug>_autopilot.md` (legacy plans: `<plan-basename>_autopilot.md`; interactive runs write only these and task lines):
34
+ - `⏱ Run <n> start <date time> · queue T<a>–T<b> (<k> tasks) · plan estimate <the plan's Total line, or none> · flags <auto-pilot / strict / interactive>`
35
+ - per phase, after its ticks (clock read at build start, verifier launch, tick): `⏱ Phase <N> (T<a>–T<b>): <HH:MM>→<HH:MM> · <m> min · build <m> · verify <m> · fix <m> (<rounds> rounds)`, plus `· waited <m>` for time waiting on the user, not counted in `<m> min`
36
+ - task lines end `· done <HH:MM>`
37
+ - `⏱ Run <n> end <date time> · <done>/<k> tasks · active <h m> · <min> min/task · waited <m>`
38
+ - **Subagents:** this skill is the request to use them (`Agent`, `Task`, …). None → work inline, self-verify with the charter, say so.
48
39
 
49
40
  ## The loop
50
41
 
51
- Work in **phases**: a `### Phase N` group in the plan, or — if the plan has none — up to 3 consecutive tasks (a `live` task, the `Update SPEC.md` task and the last task each close a group). A single task or `NEXT` is a phase of one. Under `--strict` every task is its own phase.
42
+ Work in **phases**: the plan's `### Phase N` groups, else up to 3 consecutive tasks (a `live` task, `Update SPEC.md` and the last task close a group). `--strict` makes every task a phase.
52
43
 
53
- 1. **Build** each task in the phase, in order, **following the Agent Reference's Coding Practices — ENFORCED** (clean, professional TypeScript or JavaScript in the project's own language; meaningful full-word names, never one- or two-letter names or obfuscation; well-structured, readable, maintainable code for human developers; meaningful JSDoc on every class, function, method and public member — always written, never a reason to fail a task), and every HUD or overlay **following Game UI Performance — ENFORCED** (per-frame values reach the screen through refs and one frame loop, never React state, props, a store or a per-frame EventBus message; only changed values written, with cheap properties), **with its tests**: the cases the plan's `Tests:` names (or, with none, meaningful cases for its Acceptance and edge cases), in the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder), using the repo's test runner and style. Get them green — fix the code, not the test, unless the test is wrong. No testable surface (config, docs, assets) → say so. A task with visible output also **saves its progression snapshots** as it builds (*Snapshots tell the story*, below). The implementer keeps the **dashboard current task by task** — the live file at every step, the task's entry at start and the moment it is built — so the user never waits for the phase to end to see progress. Boxes stay unticked.
54
- 2. **Verify** the phase with a fresh **independent verifier** subagent (charter below), giving it the list of files changed. It returns PASS/FAIL per task, with evidence, and marks each task `verifying` on the dashboard (and the live file) as it checks it.
55
- 3. **Tick** `- [ ]` → `- [x]` for every task that passed, immediately — except a task that depends on one that failed in the same phase, which waits for it. Never tick partial, skipped or unverified work. Mark each ticked task `done` on the dashboard as you tick it, then write the phase's dashboard entry.
56
- 4. **Fix loop** for a task that failed: fix the code in the context that wrote it; re-run its tests; re-verify with a **fresh** verifier given only the failed items and the evidence (`--strict`: the whole task). A records-only slip (a stale number or note) is fixed directly and re-checked by you. 3 attempts (`--strict`: 5), each changing something material; stop early if two attempts fail the same way with no new idea. Still failing → leave it unticked, stop and report *(auto-pilot: defer and continue)*.
57
- 5. **Report:** tasks done (for `ALL` / ranges: the range asked for, completed/total, and whether the plan is now finished; if fewer than `n` tasks remained for `NEXT:<n>`, say so), files changed, tests run (`tests: 4 passed (implementer) · verifier-checked`), verifier result (`verified (independent subagent)` or `verified (self)`), the dashboard path (`.agents/specs/<slug>/dashboard.html` — open it in a browser), the plan summary path when this run wrote it (`.agents/specs/<slug>/documents/<slug>_summary.html`), and the next task id — for reference only.
44
+ **Who builds:**
58
45
 
59
- **The verifier is told:** *"Confirm each task's Acceptance is genuinely met and run its `Verify` commands against the stated expected output. Re-run the tests and the relevant suite once; check they really cover the Acceptance and named edge cases and could fail — missing or vacuous tests are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled edge cases the plan names, a documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. Check every code file the task created or changed against the Agent Reference's Coding Practices — ENFORCED: clean, professional TypeScript or JavaScript in the language the project already uses (never converted to the other unasked); strict types with no needless `any` in TypeScript; meaningful full-word names for every class, method, property, variable and parameter (one- or two-letter names, cryptic abbreviations and code-golf tricks are violations, except the allowed loop counters, axis/`uv` names and toolkit aliases, and names that bind to exported data); no dead code, unused imports or leftover `console.log`; well-structured code a developer new to the project can read and maintain. Any violation is a FAIL for that task — quote the offending lines. Check every HUD, overlay or GUI file the task created or changed against the Agent Reference's Game UI Performance — ENFORCED: a value that changes every frame (speed, RPM, needles, timers, bars, markers) set through React state, props, context or a store, or posted on the EventBus per frame; a state setter, `dispatch(`, store update or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or a component's `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written per frame, or layout read in the loop; a Babylon GUI control assigned every frame without a changed-value check; a frame loop (`requestAnimationFrame`, `useFrameLoop`, `setInterval`, an animation-library tick) on a menu, pause / settings / results screen, splash, preloader or landing page, or driving motion CSS could do (a real-time 3D / canvas / scroll-scrubbed hero is allowed when it pauses off-screen and writes nothing at rest); a HUD loop that keeps writing while its HUD is hidden, behind a modal or the game is paused; a CSS `transition` on a property the frame loop writes. Any of these is a FAIL for that task — quote the offending lines. JSDoc is never a FAIL: missing, thin or stale JSDoc (including JavaScript type tags) never fails a test, a verification or an Acceptance item — list it under a separate non-blocking `JSDoc notes` heading. For any task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — check it live in the browser (and Unity where relevant) whether or not the plan marks it `live`, and do the plan's final end-to-end check live: look at the running result, beside the reference image when there is one, and judge it as a user would; passing unit tests never substitute. Do all of a phase's live checks in one session on the already-running dev server, and re-export from Unity only if the phase changed that scene's export — then only the project and the scenes the phase works on. Save the frames from your live session that show each visual task's verified result to `[SNAPSHOTS]` as `T<n>-<NN>-<stage>.png` — the same camera or viewport as the implementer's progression frames, plus any angle or comparison (Unity beside browser, before beside after) that proves the Acceptance — and add each one to its task with `node <skills>/bt-execute/scripts/dashboard.mjs snapshot <feature-folder> T<n> --src snapshots/… --caption "…"` (never snapshot JSON), returning each path with its one-line caption. Snapshots never add a page session or an export of their own. Keep the dashboard current as you go: set each task `verifying` when you start checking it, and rewrite the live file at each check (what you are checking, on what) — never 15 minutes without a write. Treat an absolute count in the plan as 'named tests pass, no new failures'. [SCOPE] Return PASS/FAIL per task with evidence and one line on what you ran live and where (or `none — tests only`), listing records-only slips separately."*
46
+ - **A queue of 3 tasks or fewer** (a small plan says *Runs inline*): you build them, then one independent verifier checks them all.
47
+ - **Tracks** (`Track: <letter>`): one builder subagent per track, all at once, each given its owned files from the plan's *Tracks and owned files* and the *Parallel rules*. A `Track: integration` task is the closing step you run once the phase's tracks are built. The phase verifier starts when all of it is built; the next phase may build meanwhile unless it depends on this one.
48
+ - **No tracks:** one builder subagent per phase, tasks in order, kept for its fix loop.
60
49
 
61
- `[SNAPSHOTS]` is the feature folder's `snapshots/` path (`.agents/specs/<slug>/snapshots/`). `[SCOPE]` is one of two sentences. **Standard:** *"Do not add mutation testing, fuzzing, restarts or audits of untouched files unless something you found points there; aim for about 25 tool calls and report rather than expand."* **`--strict`:** *"Be adversarial: actively look for any reason the Acceptance is NOT met, using whatever you judge worthwhile — mutation checks against the tests, randomized inputs, re-deriving values from the plan's Decisions and Design Reference, live QA of every rendered or exported surface."*
50
+ 1. **Build** to the Agent Reference's **Coding Practices — ENFORCED** (clean code in the project's language, full-word names, maintainable structure; JSDoc always, never a fail reason) and, for HUDs and overlays, **Game UI Performance — ENFORCED** (per-frame values through refs and one frame loop, never React state, props, a store or per-frame EventBus messages). Write the tests `Tests:` names (else meaningful Acceptance and edge cases) in the feature folder's `tests/`, in the repo's runner and style; get them green — fix the code, not the test, unless the test is wrong; nothing testable → say so. Then take **one quick look** — one capture at one viewport, or one scripted probe — and stop: the builder never runs the Acceptance's live proof.
51
+ 2. **Verify** with an **independent verifier** subagent (charter below) given the changed files — one per phase (`--strict`: per task), the only live checker, returning PASS/FAIL per task with evidence.
52
+ 3. **Tick** each passed task `- [x]` at once, unless it depends on one that failed this phase. Never tick partial, skipped or unverified work.
53
+ 4. **Fix loop:** the task's builder fixes it and re-runs its tests; then **resume the same verifier** (`SendMessage` or equivalent) with only the failed items and the fix — never a fresh verifier (`--strict`: a fresh adversarial verifier re-checks the whole task). Records-only slips (a stale number or note) you fix and re-check. 3 attempts (`--strict`: 5), each changing something material; stop early when two fail alike with no new idea. Still failing → unticked; stop and report *(auto-pilot: defer, continue)*.
54
+ 5. **Report:** tasks done (range, completed/total, plan finished?), files changed, tests (`tests: 4 passed (builder) · verifier-checked`), `verified (independent subagent)` or `verified (self)`, the dashboard path, the plan summary path if written, the next task id.
62
55
 
63
- For a task built on a sibling skill (e.g. bt-design's 3D-Hero-Scroll), give the verifier the relevant part of that skill *(where skills load through a tool: `load_skill` + `read_skill_resource`; where they are files: the skills directory this skill was loaded from, e.g. `~/.claude/skills/`, `~/.agents/skills/` or the project's equivalent)* — its documented options (e.g. `sweep: page` really reaches the document bottom) are part of Acceptance.
56
+ ### Parallel rules — in every track builder's brief
64
57
 
65
- **Every subagent gets a brief, not homework:** the task block(s), the plan Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Agent Reference excerpts needed (with their links) — **always including the full `Coding Practices — ENFORCED` section**, since implementers write to it and verifiers fail work that breaks it — the test command and the feature folder's `tests/` path, the `snapshots/` path and *Snapshots tell the story* (for any phase with visible output), the dashboard and live file paths with the per-task update rules from *Feature folder and dashboard* (with `--verbose`, the `details` fields that role writes) and **the exact `dashboard.mjs snapshot` command line with the feature folder filled in** — never a snapshot JSON shape of your own (a hand-written `{path, caption}` entry has twice reached a dashboard as a row of "No snapshot"), the project's agent instructions, the *Work fast* rules below, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it for the API, never the whole file) only if you hit an API this brief does not cover, and say which."*
58
+ - **Files:** edit only your track's files. A file two tracks need (route table, `package.json`, lockfile, shared stylesheet, test list) belongs to one track or to integration. Need another track's file → stop that item and report it; never edit it.
59
+ - **Shared processes:** never restart, stop or re-launch a shared dev server, game server or proxy. Use your own DevTools port and scratch folder. Unity or Blender work on one project stays on one track.
60
+ - **Builds and installs:** no `npm install` or dependency change while tracks run (one track does it first, or integration). Run only your own type-check and tests; the full build that writes shared output (`dist/`, `*.tsbuildinfo`, kit bundles) runs once, by the orchestrator, after the tracks. A type error in a file you do not own is noted, never fixed.
61
+ - **Tests and records:** your tests write only to their own `mkdtemp` folders; write only your own tasks' dashboard entries; no git command that changes the working tree or index.
66
62
 
67
- ## Feature folder and dashboard
63
+ ### The verifier's charter
64
+
65
+ *"Confirm each task's Acceptance is met and run its `Verify` commands against their expected output. Re-run the tests and the relevant suite once; tests that miss the Acceptance or named edge cases, or could not fail, are a FAIL. Read the diff for real defects: logic errors, broken callers, unhandled named edge cases, documented behavior dropped or inverted, a sibling-skill template re-implemented instead of copied. FAIL a touched code file that breaks Coding Practices — ENFORCED: not in the project's language; needless `any`; one- or two-letter names, cryptic abbreviations or code-golf tricks (loop counters, axis/`uv` names, toolkit aliases and exported-data names excepted); dead code, unused imports, leftover `console.log`; structure a newcomer cannot maintain. FAIL a HUD, overlay or GUI file that breaks Game UI Performance — ENFORCED: a per-frame value (speed, needles, timers, bars) through React state, props, context, a store or a per-frame EventBus post; a setter, `dispatch(` or `EventBus.PostMessage(` inside `requestAnimationFrame`, a frame-loop hook, a render observable or `update()`; `width` / `height` / `top` / `left` / `innerHTML` / SVG geometry written, or layout read, per frame; a Babylon GUI control assigned every frame without a changed-value check; a frame loop on a menu, pause or results screen, splash, preloader or landing page, or doing what CSS could (a 3D or scroll-scrubbed hero that pauses off-screen is fine); a HUD loop writing while hidden or paused; a CSS `transition` on a property the loop writes. Quote the lines. JSDoc is never a FAIL — list gaps under non-blocking `JSDoc notes`. You are the only live checker: check live (browser through `bt-cdp.mjs`, Unity where relevant) every task whose correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity — and the plan's final end-to-end check, judging the running result as a user would, beside any reference image; unit tests never substitute. One session per phase on the running dev server, exporting only as *Work fast* allows. Add each visual task's verified running-vs-reference frame from that session with `dashboard.mjs snapshot` — never a capture just for a picture. Set each task `verifying` as you start it. A test count in the plan means 'named tests pass, no new failures'. Resumed after a fix, re-check only the failed items and what the fix touched. [SCOPE] Return PASS/FAIL per task with evidence, one line on what you ran live and where (or `none — tests only`), and records-only slips separately."*
68
66
 
69
- Every feature lives in one folder, created by bt-spec (or by bt-plan for a Quick Plan):
67
+ `[SCOPE]` — **standard:** *"Do not add mutation testing, fuzzing, restarts or audits of untouched files unless something you found points there; aim for about 25 tool calls and report rather than expand."* **`--strict`:** *"Be adversarial: actively look for any reason the Acceptance is NOT met — mutation checks against the tests, randomized inputs, re-deriving values from the plan's Decisions and Design Reference, live QA of every rendered or exported surface."* For a task built on a sibling skill (e.g. bt-design's 3D-Hero-Scroll), give the verifier its relevant part — its documented options are Acceptance.
68
+
69
+ **Every subagent gets a brief, not homework:** its task blocks with the Decisions / Design Reference entries they cite, the SPEC.md parts touched, the Reference excerpts needed with links (**always the full Coding Practices — ENFORCED**), its owned files (track builders: plus the *Parallel rules*), the test command, the `wait.mjs` and `bt-cdp.mjs` paths, its exact `dashboard.mjs` lines with the folder filled in (`task`, `snapshot`; `--verbose`: its `details` fields), the project's agent instructions, *Work fast*, and: *"Do not read the Agent Reference or SPEC.md in full — the parts you need are here, and this overrides any standing instruction to read it first. Read one sub-document (search it, never the whole file) only if you hit an API this brief does not cover, and say which."*
70
+
71
+ ## Feature folder and dashboard
70
72
 
71
73
  ```
72
74
  .agents/specs/<slug>/
73
- dashboard.html the feature dashboard — opens straight from disk
75
+ dashboard.html the feature dashboard — opens from disk
74
76
  documents/<slug>_spec.md bt-spec (absent for a Quick Plan)
75
77
  documents/<slug>_plan.md bt-plan
76
- documents/<slug>_autopilot.md this skill's run log
77
- documents/<slug>_dashboard.js the dashboard's data (task by task)
78
- documents/<slug>_live.js what is happening this minute (step by step)
79
- documents/<slug>_summary.html the plan in plain language for non-technical readers — once the plan is complete
80
- documents/<slug>_summary.js the plan summary's data
81
- snapshots/ the meaningful snapshots the dashboard shows
82
- tests/ every test this plan's tasks write
83
- recon/ copies of the recons the spec rests on (bt-spec, when its brief cites any)
78
+ documents/<slug>_autopilot.md the run log
79
+ documents/<slug>_dashboard.js the dashboard's data
80
+ documents/<slug>_live.js what is happening now (written by the helper)
81
+ documents/<slug>_summary.html the plain-language summary, once complete (+ _summary.js)
82
+ snapshots/ tests/ recon/
84
83
  ```
85
84
 
86
- `<slug>` is the folder name (the plan sits at `<slug>/documents/<slug>_plan.md`). **The feature folder is wherever the plan is.** The user moves a whole slug folder from `.agents/specs/` to `.agents/complete/` when they are ready for it to be reviewed, and later on to `.agents/archived/` as they see fit. A plan reopened there (tasks added after it was complete) runs where it is: every path in this skill is relative to that folder. **Never move a feature folder** — not on completion, not to reopen it; the user moves folders when they are ready. **Legacy flat plan** (`.agents/specs/<slug>_plan.md`): run it where it is, keep its run log and the test paths its `Tests:` lines name, and still create `.agents/specs/<slug>/` for `dashboard.html`, `documents/<slug>_dashboard.js`, `documents/<slug>_live.js` and `snapshots/` — move nothing unless the user asks.
87
-
88
- **The dashboard.** `dashboard.html` is a fixed template; `documents/<slug>_dashboard.js` holds everything it shows. Both come from this skill's `templates/dashboard/` *(where skills load through a tool: `load_skill` + `read_skill_resource`; where they are files: the skills directory this skill was loaded from)*: `dashboard.html` copied with `{{slug}}` replaced — never otherwise edited — and the starter data `dashboard.template.js`. A third file, `documents/<slug>_live.js` (from `live.template.js`), carries what is happening this minute. **`data-schema.md` documents every field and the update recipe — read it once per run and put the parts a role writes into its brief.** bt-plan writes all three in the `planned` state; if any is missing, create it now from the plan.
89
-
90
- **Update per task, not per phase — the user watches this page instead of asking "what are you doing?"** Whoever is doing the work writes: the implementer while it builds, the verifier while it checks, you (the orchestrator) between them. Only one agent works at a time in this loop, so writes never collide; if you ever run subagents in parallel, they report back and you write. Every implementer and verifier brief carries the helper's exact command lines with the paths filled in, and these rules. Every timestamp comes from the local clock (the helper takes it for you).
85
+ **The feature folder is wherever the plan is** (`<slug>` is its name); paths are relative to it. The user moves folders between `.agents/specs/`, `complete/` and `archived/`; a reopened plan runs where it is. **Never move a feature folder.** A legacy flat plan (`.agents/specs/<slug>_plan.md`) runs in place and gets `.agents/specs/<slug>/` for the dashboard files and `snapshots/`.
91
86
 
92
- **Never let the dashboard go stale — three guards, because an agent deep in a long task forgets to write:**
87
+ The page, starter data and live file come from `templates/dashboard/` *(skills loaded through a tool: `load_skill` + `read_skill_resource`; as files: this skill's folder)*; `dashboard.html` is copied with `{{slug}}` replaced, never edited. **`data-schema.md` documents every field, status and snapshot shape — read it once per run; brief each role on its parts.** bt-plan writes all three; create any that is missing. **Every write goes through `scripts/dashboard.mjs`** (atomic, shape-checked; options in its header; no Node → `data-schema.md`'s fallback).
93
88
 
94
- 1. **The watchdog.** At run start, launch `node <skills>/bt-execute/scripts/dashboard.mjs watch <feature-folder> --watch <your scratch folder>` in the background (add `--watch` for any other folder where the work leaves files — exports, logs, captures). Every minute it checks the live file: after 10 quiet minutes it writes a heartbeat naming the latest file that changed ("still working — latest activity: t19/gp3.log at 21:48"); after 30 minutes with no file change either it says the run may be stalled; and if the live file still names a finished task while another is in progress, it points it at the active task. It exits by itself when the status leaves `in-progress`. A heartbeat is a safety net, not a substitute — the agents' own writes say what is actually happening.
95
- 2. **Hand-off writes.** Before you launch any implementer or verifier, set its task(s) `in-progress` (implementer) or `verifying` (verifier) and point the live file at it (`--task T19 --role implementer --activity "Implementer started on T19 — <its first step>" --reset`); when it returns, write what it reported. The live file must never still name the previous task while a new one is being worked on.
96
- 3. **Long commands are narrated.** Before any command that may run more than a few minutes (a full test chain, an export or bake, a multi-race or multi-scene browser run), write a step saying what it is and roughly how long it takes; run it in the background where the host allows, and write a step at each milestone its output shows ("race 2 of 4 reached results"). A long run is exactly when the user is watching.
89
+ - **Three writes per task** (`task <feature-folder> T7 --set '{…}'`): `in-progress` at start (you, launching its builder, or a builder starting its next task); `built` by the builder once green, with `summary` (what was done, anything surprising), `files`, `tests`; `done` by you at the tick, with `verifier`, `attempts`, `doneAt`, `DECISION` lines and `checkedLive` (what ran live and where, or `""`). The verifier adds `verifying`; a FAIL is `in-progress` with `attempts` + 1; a deferral `deferred` with `deferredReason`.
90
+ - **The helper writes the live file** on every `task` status change and `status` write, keeping *Current run activity* current. Agents never write it; no watchdog is launched.
91
+ - **Snapshots are the chronicle — ENFORCED**, added only with `snapshot <feature-folder> <T<n>|P<N>|plan> --src snapshots/… --caption "…"` (`--before … --after …`: comparison; `--frame "src|stage|caption"` repeated: progression), never snapshot JSON; a subagent that cannot run it returns paths and captions. Frames come only from captures the work already takes — never an extra page session, export or capture just for a picture. Each visual task records at least the builder's quick-look (built) frame and the verifier's running-vs-reference comparison, plus milestone frames the builder took anyway, as a same-camera progression; nothing to see → none. Name them `snapshots/T<n>-<NN>-<stage>.png` (`P<N>-…` per phase), ≤ ~1600 px wide.
92
+ - **`check <feature-folder>` is the gate** at every phase boundary and run end; nothing closes while it fails. It catches snapshots that cannot show and skipped deliverables: a missing page or data file, tasks unlike the plan's checklist, a false or summary-less `complete`, a visual task `done` without a snapshot, a ticked task without a verifier result.
93
+ - **A record, never a gate on a task.** Never silently rewrite an earlier result: change it and add `{ at, by: "T<n>", note }` to its `updates` (`--note "…" --by T<n>`), badged **Updated**; superseded snapshots stay.
97
94
 
98
- - **The live file — at every meaningful step.** Rewrite `documents/<slug>_live.js` whole (it is small) when a task starts, at each milestone inside it, before anything slow (a build, an export, a bake, a capture, a test run), at each fix attempt, at the hand-over to the verifier and while it checks each task, and when the phase closes: the phase, the task, the role, one plain-language sentence on what is happening now, and the task's step log. Never let it go 15 minutes without a write during active work — the page flags a 20-minute silence. Between tasks, `task: ""` and a `title` (`Verifying phase 2`, `Closing phase 2`).
99
- - **The dashboard data — at every task boundary:** a task becomes `in-progress` when it starts; `built` the moment it is built and its tests are green — with its summary of what was actually done (and anything surprising), files, tests and snapshots filled in **right then**, not at the phase end; `verifying` while the verifier checks it; `done` when it passes (verifier result, attempts, done time, its `DECISION` lines, and `checkedLive` — one line on what the verifier ran live and where, for every task it checked in the browser or Unity whatever the plan's verify level, `""` when tests alone proved it); back to `in-progress` with `attempts` + 1 on a FAIL. Each change also adds an `activity` line and refreshes `updatedAt`.
100
- - **Every write goes through this skill's `scripts/dashboard.mjs` — never hand-edited.** Each data file is one `window.… =` prefix and one strict-JSON value (the prefix only lets a page opened from disk load it); the helper parses it, changes it, checks the shapes and writes it back atomically, so the page never sees a half-written or malformed file. Use it, not a one-off script of your own: `node <skills>/bt-execute/scripts/dashboard.mjs live <feature-folder> --task T7 --role implementer --activity "…" --step "…"` · `task <feature-folder> T7 --set '{"status":"built","summary":"…"}'` · `snapshot <feature-folder> T7 --src snapshots/T7-01-stage.png --caption "…"` (or `--before … --after …`, or `--frame "src|stage|caption"` repeated) · `activity <feature-folder> "…"` · `status <feature-folder> in-progress` · `check <feature-folder>` (all options in the script's header). **Snapshots go in only through `snapshot`** — it builds the shape the page renders and refuses an image that is not on disk. As a backstop, every helper write repairs an entry the page could not show (an image under `path`, `file`, `image`, `url` or `href` moves to `src`; an unknown `source` becomes `browser`), `check` repairs any already in the file, and the watchdog repairs one written around the helper within a minute; an image that is not on disk is still refused. Run `check` at every phase boundary and at run end; a failure there is fixed before the phase closes. Only where Node cannot run, fall back to the parse-and-write-back recipe in `data-schema.md`. Keep each field its documented shape too — a list stays a list (`updates`, `snapshots`, `files`, `decisions`, `notes` …: append, never assign a string); a helper script you give subagents checks the shapes before it writes.
95
+ ### Run start, phases, run end
101
96
 
102
- On top of the per-task updates:
103
-
104
- - **Run start — the first thing the run does** (*Open the run before anything else*): make sure the default `.agents` folders exist — `.agents/specs/`, `.agents/complete/`, `.agents/archived/`, `.agents/profile/` and `.agents/recon/`, each with an empty `.gitkeep` (write only the ones missing); **refresh `dashboard.html`** — copy it again from the template with `{{slug}}` replaced (it is never edited, so this is always safe, and it is how layout fixes reach dashboards created by older versions), and `documents/<slug>_summary.html` the same way from `templates/summary/summary.html` when the feature already has one; then **sync the dashboard with the plan file** — re-read its checklist and add any phase or task (including sub-tasks like `T3.1`) the dashboard lacks, in plan order, as `pending`, with an `updates` note on it (`Added to the plan after <the plan was complete / phase 2 ran> — <why, if the plan says>`); a task the plan no longer has is removed with an `activity` line saying so. Then `status: "in-progress"`, `runs` + 1, the run-log document link, an `activity` line, the first live-file write, and the watchdog launched in the background. In a git repository, check `.gitignore` has `.agents/*/*/documents/*_live.js` and append it once if not — the live file is never worth committing; `<slug>_dashboard.js` and `snapshots/` are, when the user commits.
105
- - **Each phase, after its ticks:** the phase's status, times and minutes (from its `⏱` line), its verifier result and a two-or-three-sentence summary of what it delivered; the phase-level snapshots (a progression spanning several tasks — below), each added with `dashboard.mjs snapshot`, and `dashboard.mjs check` passing; `decisions`; `activeTime` — the plan's total across **every run so far** (each finished run's `active` from its `⏱ Run <n> end` line, plus this run's so far), never this run alone; an `activity` line; and a current "so far" `outcome` headline.
106
- - **A deferral:** the task's `status: "deferred"` and `deferredReason`, an `activity` line.
107
- - **Run end — the After Action Report.** **decide the status by re-reading the plan file's checkboxes, never from memory:** `complete` when every task in the plan is `- [x]`; `incomplete` when every task is either ticked or marked ⏭️ DEFERRED; otherwise `paused` (the run covered only a slice, or tasks were added). The page refuses a `complete` it can see is false — it shows the plan as paused with a warning — but the plan file is the authority; never leave `in-progress` behind, because the status picks the page's top slot: `in-progress` shows *Current run activity* (the live file and the milestones), any other run-ended status shows the After Action Report in its place. Write `followUps` for a human, and `afterAction` — the whole plan's execution, start to finish: a one-sentence headline of what the plan delivered; two to four paragraphs on what was built, how it was proven and what surprised; highlights; and **one before/after for the plan as a whole** (`comparison`) — the plan-wide "before" frame beside a final "after" taken now from the same camera or viewport (the end-to-end check's session supplies it). Add the plan's key progression to `afterAction.snapshots` if one tells the story better than any single phase. Write `afterAction.testing` on every run, not only `--verbose`: run every test suite the plan touched **once more, in full, at run end** and record each as a `suites` entry (name, command, passed, failed, how many tests this plan added, and a `note` for any failure that pre-dates the plan) — never add up the tasks' counts, which re-count the same suite once per task; a `summary` of how the plan was tested (unit tests, the verifier's re-runs, what was checked live and on what, the end-to-end check); and `gaps` — what no test or live check covers. The page builds the task-by-task table and the list of test cases from the tasks. The figures (tasks, tests, retries, time) are computed by the page — never type them in. A run that ends before the plan is finished writes it too; the page marks it *Interim* while `paused`, and the next run revises it with an `updates` entry. **A reopened plan** (tasks added after it was complete) works the same way: the run that finishes the added tasks rewrites the After Action Report to cover them, notes the change in its `updates` (`Revised — T7 added after completion: <why>`), and retakes the plan-wide "after" from the same camera so the comparison shows the plan as it now stands.
108
- - **Run end — the plan summary, only when the plan is `complete`.** Write the feature's plan summary, a formatted page that opens straight from disk. It is the plan told to people who never see the code: what it delivered, what it means for existing users and content, what was wrong, what changed, what did not, and how it was checked. Use on-screen names in **bold** and real values. Leave out file names, task IDs and test counts. Like the dashboard, the page is a fixed template and the content is data, both from this skill's `templates/summary/`. Copy `summary.html` to `documents/<slug>_summary.html` with `{{slug}}` replaced and nothing else edited; only `dashboard.html` sits at the feature root. Write `documents/<slug>_summary.js` beside it, whole as strict JSON behind `window.PLAN_SUMMARY =`. **`summary-guide.md` has the audience, the fields and the section order, and `summary.template.js` is a worked example. Read both.** **Leave out any section that does not apply to this plan**, and adapt a heading's wording where the default does not fit (a feature has *Why it was needed* in place of *What was wrong*). Then set `afterAction.planSummary: "documents/<slug>_summary.html"` so the After Action Report links to the page. A `paused` or `incomplete` run writes no summary. **A reopened plan** keeps its existing summary while the added tasks run. The run that completes them rewrites the data to cover the plan as it now stands, adds the new date to `stamp` (`Fixed on 2026-10-19; updated on 2026-11-02`) and says in the lead what the update added.
109
- - **`--verbose` — the same work, written up in depth.** It changes what is written, never what is done: tests, the verifier, live checks and snapshot captures are exactly as without it, and TIME MATTERS still holds (the extra cost is writing, not checking). Set `detail: "verbose"` at run start. Each task gets a `details` write-up (fields in `data-schema.md`), filled in by whoever has the facts, at the same per-task moments as everything else:
110
- - **the implementer, when the task is built:** `approach` (how it was built, how the pieces fit together, why this way and not the alternatives it weighed); `changes` — every file touched, with what changed in it and why; `testCases` — every named case with its expected and actual result, the result leading with `PASS` or `FAIL` (`"PASS — 0→74 km/h on held W"`); `problems` — each failed attempt or dead end, with what failed, the root cause and the fix; `notes` for a future maintainer; `timing.build`;
111
- - **the verifier, while it checks:** `acceptance` — every Acceptance item with its verdict and the evidence it rests on (command output, the screenshot, the line read); `liveCheck` — what it looked at, on which engine, at what resolution, and how it judged it; `timing.verify`;
112
- - **you, at the tick and in the fix loop:** each fix round added to `problems`, `timing.fix`, and snapshot captions that say what to notice, not just what is shown.
113
-
114
- At run end the After Action Report adds `sections`, one card each where it applies: **Architecture** (what now exists and how it connects), **Phase by phase**, **Problems and resolutions**, **Deviations from the plan** (and why), **Known limitations**, **Lessons learned**, **Estimate vs actual** (per phase, from the `⏱` lines), **Recommended next steps**. Plain language a new developer can follow, concrete over vague — name the files, classes, numbers and screenshots. A later run without `--verbose` keeps everything a verbose run wrote and never thins it; `detail` stays `verbose`.
115
- - **Updated notifications.** Never silently rewrite an earlier part of the dashboard. When later work changes an earlier result — a figure corrected, a decision reversed, a reopened task, a snapshot superseded by a better one — change it and append `{ at, by: "T<n>", note }` to that entry's `updates`. The page badges it **Updated** and lists it under *Updates and revisions*. A superseded snapshot stays; add the new one beside it.
116
- - The dashboard is a record, never a gate: a dashboard slip never fails or blocks a task. At run end, leave the live file's last entry saying the run finished (the page hides it once the status is no longer `in-progress`).
117
-
118
- ### Snapshots tell the story
119
-
120
- The snapshots are how a human sees what was built, so choose them for meaning, not coverage. Never just one before and one after per task: show **how the work came together**.
121
-
122
- - **Progressions first.** For a task with visible output, capture a frame each time a meaningful layer of the work lands, from the **same camera or viewport** every time so the frames line up, and caption each with what that stage added. A terrain: heightmap → splat textures → road network → trees → foliage → baked lighting. A UI: layout → styling → states → motion. A shader: base colour → each lighting term → final. A level: blockout → props → lighting → post. A progression can span several tasks; record it on the phase, with each frame's `task`.
123
- - **Then whatever proves the point.** A comparison when a change is best seen side by side (a fix, the state before the phase, Unity beside the browser for parity); a second angle when one view hides it (overview, ground level, close detail); a still when one image proves one thing.
124
- - **As many frames as the build has meaningful stages** — usually 3–8 for a visual task, none for a task with nothing to see. No near-duplicates, no frame per iteration, and a failed attempt only when it explains a decision (say so in the caption).
125
- - **Who takes them.** At the start of the first run, before T1 changes anything, take the **plan-wide "before"** (`snapshots/plan-before.png`) from the camera or viewport that will best show the finished feature — the starting state, even if that is an empty scene or the old page; skip it only when the plan has nothing to see. The implementer saves a "before" frame before the first change of a visual phase, and saves milestone frames while it builds — it is already capturing to iterate, so it keeps the meaningful ones instead of discarding them. The verifier adds the verified final frames from its live session. You pick and order them into the dashboard. Frames come from sessions and exports the work already runs — never an extra page session or re-export just for a picture.
126
- - **Files.** `snapshots/T<n>-<NN>-<stage>.png` (phase-level: `P<N>-<NN>-<stage>.png`), at most about 1600 px wide; prefer JPEG or WebP for large scenes. Unity frames come through the bridge's camera capture, browser frames through the browser tool. Each frame reaches the dashboard through `dashboard.mjs snapshot` (task `T<n>`, phase `P<N>` or `plan`); a subagent without the helper returns its paths and captions and you add them.
97
+ - **Run start:** create any missing `.agents/specs/`, `complete/`, `archived/`, `profile/`, `recon/` (each with an empty `.gitkeep`); re-copy `dashboard.html` and an existing `documents/<slug>_summary.html` from their templates; **sync the dashboard with the plan** — add missing phases and tasks in plan order as `pending` with an `updates` note (`Added to the plan after <phase 2 ran / it was complete> — <why>`), remove dropped ones with an `activity` line. Then `status <feature-folder> in-progress`, `runs` + 1, the run-log link, an `activity` line; in git, add `.agents/*/*/documents/*_live.js` to `.gitignore` once. Before T1 of the first run, save `snapshots/plan-before.png` from the view that will best show the finished feature, in a session the work opens anyway (none if nothing to see).
98
+ - **Each phase, after its ticks:** status, times and minutes (its `⏱` line), verifier result, a 2–3 sentence summary, any phase progression, `decisions`, `activeTime` (all runs: each `⏱ Run <n> end` line's `active` plus this run's), an `activity` line, a "so far" `outcome`, and `check` passing.
99
+ - **Run end — the After Action Report.** Status from **re-reading the checkboxes**: all `- [x]` → `complete`; all ticked or ⏭️ DEFERRED → `incomplete`; else `paused` — never `in-progress`. Write `followUps` and `afterAction` (fields in `data-schema.md`): headline, body, highlights, **one plan-wide before/after** (`comparison`), the "after" from the same camera in the final end-to-end session; the key progression in `afterAction.snapshots` if it tells the story best; and every run `afterAction.testing` — each suite the plan touched re-run **once in full** (one `suites` entry each, never summed from tasks), a `summary` and `gaps`. An early end writes it too (*Interim* while `paused`; revised next run with an `updates` entry); finishing a reopened plan rewrites it, notes the change and retakes the "after". Then open `dashboard.html` headless once: every snapshot shows.
100
+ - **Plan summary, only when `complete`:** copy `templates/summary/summary.html` to `documents/<slug>_summary.html` (`{{slug}}` replaced) and write `documents/<slug>_summary.js` per **`summary-guide.md`** and its worked example `summary.template.js` — the plan for people who never see the code, on-screen names in **bold**, real values, no file names, task IDs or test counts. Set `afterAction.planSummary`. A reopened plan keeps its summary until it completes again; then rewrite it, add the date to `stamp` (`Fixed on 2026-10-19; updated on 2026-11-02`) and say in the lead what changed.
101
+ - **`--verbose`** changes what is written, never what is done: `detail: "verbose"`, each task's `details` from whoever has the facts (the builder at `built`, the verifier as it checks, you in fix rounds), and at run end `afterAction.sections` — fields and card order in `data-schema.md`. Later runs never thin it.
127
102
 
128
103
  ## Work fast
129
104
 
130
- Writing the code is about a tenth of a run; keep the loop around it short.
131
-
132
- - **Iterate narrow, confirm wide.** While getting something to work, run only that task's tests, the fastest build the repo has, and one low-resolution capture on one engine. The full test chain, full build and any wider check (second engine, full resolution, numeric parity gates) run **once**, when the phase is ready to verify. A parity gate is never loosened to pass.
133
- - **Export minimally.** Re-export only the Unity project being tested, only the scenes the task works on, and only when the change actually alters that scene's export. Never re-export other scenes or projects "for consistency" — they pick the change up at their next natural export. Exports are the slowest step of a run; brief every implementer and verifier with this rule, and never widen a plan's export step in a brief.
134
- - **Never sleep-poll.** No `until …; do sleep N; done`. Run long commands in the foreground with a generous timeout, or in the background and wait for the completion notice.
135
- - **Judge visuals by looking** — screenshot the running result and compare it to what it must match. Build numeric gates only when the plan asks for them.
136
- - **Reuse the project's tools; keep evidence light.** No one-off tools per task; no ledgers, md5 or environment records, archives or checked-in capture trees unless the plan asks. The dashboard's curated snapshots are the one exception — they are the record a human reads, alongside the run log.
137
- - **Someone else's red is not your task.** A failing test that belongs to another feature and that you did not touch is logged as pre-existing and left alone.
105
+ - **Iterate narrow, confirm wide:** while building, the task's tests, the fastest build, the quick look; the full chain, full build and wider checks (second engine, full resolution, parity gates) once, in verification. Never loosen a parity gate.
106
+ - **Export minimally:** only the Unity project under test, the task's scenes, and only when the change alters that export; never widen a plan's export step.
107
+ - **Never sleep** — wait only with `node https://raw.githubusercontent.com/babylontoolkit/agent/main/references/scripts/wait.mjs port|url|file|log|cmd … --timeout <s>`, or run a long command in the foreground with a generous timeout. Drive pages only by importing `https://raw.githubusercontent.com/babylontoolkit/agent/main/references/scripts/bt-cdp.mjs` (its own headless Chrome and DevTools port) — never the user's browser or a harness of your own.
108
+ - **Judge visuals by looking**; numeric gates only when the plan asks.
109
+ - **Keep evidence light:** the project's tools; no one-off tools, ledgers, md5 or environment records, archives or capture trees unless the plan asks.
110
+ - **Someone else's red is not your task:** another feature's failing test you did not touch is logged as pre-existing.
138
111
 
139
112
  ## Auto-pilot (`--auto-pilot`)
140
113
 
141
- An unattended run: **nobody is there to answer, and nothing waits for anyone's approval.** Print `🛩️ [bt-execute] Auto-pilot engaged — unattended; add a non-prompting permission mode for a fully hands-off run`. Tests, the independent verifier and "tick only on PASS" are **not** relaxed — only the stopping is. **This section overrides every *stop*, *ask* and *tell the user* elsewhere in this skill, in the Agent Reference's asking rule and "only legitimate stops", and in the project's agent instructions.**
142
-
143
- **You own the pipeline.** You own the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser. Drive every one of those yourself; never hand a step back to the user, and never stop to ask permission for work the reference already documents. Make the best call, state your assumption, and finish the job.
114
+ An unattended run: **nobody answers and nothing waits for approval.** Print `🛩️ [bt-execute] Auto-pilot engaged — unattended; add a non-prompting permission mode for a fully hands-off run`. Quality is not relaxed — only the stopping. **This section overrides every *stop*, *ask* and *tell the user* in this skill, the Agent Reference's asking rule and "only legitimate stops", and the project's agent instructions.** **You own the entire pipeline:** never hand a step back or ask permission for documented work; make the best call, state your assumption, finish.
144
115
 
145
116
  ### Never ask
146
117
 
147
- - **No question reaches the user.** Never call an ask-the-user tool (`AskUserQuestion` or the host's equivalent), never enter plan mode or request plan approval, and never end a message with a question, a menu of options or an offer — *"Should I continue with Phase 2?"*, *"Want me to proceed?"*, *"Which option do you prefer?"*, *"Before I continue, can you confirm…"*, *"Let me know if…"*, *"I'll pause here."* A question forming is a decision to make: make it (below), log it, keep going.
148
- - **The answer is already written down — look before you decide.** Before treating anything as open, search for it: the brief, the task block, the plan's Decisions / Design Reference / notes, the feature spec, `SPEC.md`, and the run log's earlier decisions — grep the key term, don't skim. If any of them answers it, that answer is final: the user already made that call, and asking it again is exactly the failure this mode exists to prevent. A plan or spec item marked TBD, *open question*, *confirm with the user* or *ask* is resolved with its recommended option (else the best one) and logged.
149
- - **Decide in this order:** the brief and plan (task, Decisions, Design Reference, spec, SPEC.md) → the Agent Reference and its sub-documents → the codebase's existing patterns → what a senior Babylon Toolkit developer would ship: the Unity → interactive glTF → BabylonJS script-component workflow, simplest thing that meets Acceptance, reversible over clever. The chain always ends in an answer — a decision is never escalated. Log each one in one line: `DECISION T7: <choice> — <source or reason>`.
150
- - **The Agent Reference's four "ask" cases are decided too, never asked:** creative or product direction → infer it from the spec, plan, reference images and existing project; an architectural fork → the plan's Decisions, else the more reversible branch; destructive acts on the user's own work, or spending money / acting outward that the plan does not call for → skip only that step, defer it with the reason (see *Safety*), and keep building everything else.
151
- - **Subagents:** put this in every implementer and verifier prompt, right after `TIME MATTERS.`: *"AUTO-PILOT: unattended run. You own the entire pipeline — code, UI, shaders, generated assets, Blender, Unity, export, build, dev server and visual QA at both ends. Never ask a question or hand a step back; the answer is in this brief, the plan, the Agent Reference or the codebase. Decide, state each assumption in one line, and always return a result."* A subagent that returns a question, "needs input" or a half-finished result anyway: answer it from the plan yourself and send it back (or relaunch it) — never relay it to the user.
118
+ - **No question reaches the user** — no `AskUserQuestion` (or equivalent), no plan mode or approval request, no message ending in a question, menu or offer (*"Should I continue with Phase 2?"*, *"Which option do you prefer?"*, *"Let me know if…"*, *"I'll pause here."*). A forming question is a decision: make it, log it, go on.
119
+ - **Look before deciding:** grep the brief, task block, plan Decisions / Design Reference / notes, spec, `SPEC.md` and the run log's decisions; an answer there is final. TBD, *open question*, *confirm with the user* or *ask* items take their recommended option (else the best), logged.
120
+ - **Decide in order:** brief and plan → Agent Reference → codebase patterns → what a senior Babylon Toolkit developer would ship (Unity → interactive glTF → BabylonJS script components; the simplest thing meeting Acceptance; reversible over clever). Never escalate. Log `DECISION T7: <choice> — <source or reason>`.
121
+ - **The Reference's four "ask" cases:** creative direction → inferred from spec, plan, references and project; architectural fork → the plan's Decisions, else the more reversible branch; destructive acts on the user's work, or spending money / acting outward unasked → defer only that step (*Safety*), build the rest.
122
+ - **Subagents:** every builder and verifier prompt carries, after `TIME MATTERS.`: *"AUTO-PILOT: unattended run. You own the entire pipeline — code, UI, shaders, generated assets, Blender, Unity, export, build, dev server and visual QA at both ends. Never ask a question or hand a step back; the answer is in this brief, the plan, the Agent Reference or the codebase. Decide, state each assumption in one line, and always return a result."* One that returns a question or half a result: answer from the plan and send it back; never relay it.
152
123
 
153
124
  ### Never stop
154
125
 
155
- - **The run ends only when the work queue is empty** — every task in it `- [x]` or deferred. The queue is the range asked for (`T3-T7`, `T12-`, `NEXT:<n>`), or every remaining task for `ALL` or no task id. Before ending, re-read the plan: an unticked, undeferred task in the queue means you are not done.
156
- - **Ending your turn is stopping.** A finished task or phase, a milestone worth reporting, a long session, many tasks done, a compaction, a tool error, an ambiguity, a hard external blocker — none of these ends the turn. Narrate the boundary in one console line and start the next phase in the same turn. The only mid-queue turn end is waiting on a background job or subagent that will notify you, and that message is one status line (`waiting on T9 verifier`), never a question or a summary inviting a reply.
157
- - **The only early exits — exactly four:** the plan file is missing; a range endpoint does not exist or is reversed (a typo the user must fix — say so and end); the brief names a stop point (`stop after T5`, `stop before the Unity tasks`) — stop there; the user tells you to stop during the run. Nothing else. An Agent Reference that cannot be read → retry 3×, then continue on what you know and log it. A missing Pro license, an account, a credential or a sign-in only the user has → defer the tasks that need it and keep running every task that does not.
158
- - After a compaction, re-read the plan and the run log and continue from the first unticked, undeferred task.
126
+ - **The run ends only when the queue is empty** — each task in it `- [x]` or deferred (the range, or every remaining task for `ALL` / no id); re-read the plan before ending.
127
+ - **Ending your turn is stopping.** No boundary, milestone, compaction, error, ambiguity or blocker ends it: one console line, then the next phase. The only mid-queue turn end is waiting on a background job or subagent that will notify you — one status line (`waiting on the phase 2 verifier`), never a question.
128
+ - **Exactly four early exits:** the plan file is missing; a range endpoint is unknown or reversed (say so, end); the brief names a stop point (`stop after T5`); the user says stop. An unreadable Reference → retry 3×, carry on, log it. A license, account, credential or sign-in only the user has → defer the tasks that need it, run the rest.
129
+ - After a compaction, re-read the plan and run log — the only state — and continue at the first unticked, undeferred task.
159
130
 
160
131
  ### Keep moving
161
132
 
162
- - **Blocked by an unfinished task:** if it was deferred this run and the fix is now apparent, re-attempt it; otherwise do the minimum of it needed to unblock, log the scope expansion; never tick a task outside the work queue.
163
- - **Errors:** read the error, fix the cause, retry; transient ones (network, port in use, lock file, editor still compiling) → wait and retry up to 3×. **Tools down** (Unity, Blender, dev server, browser): restart or install them through their CLI and retry; genuinely unavailable → defer the task.
164
- - **Permission denied:** a tool call the host's permission mode refuses is respected, never worked around — log it, defer only that step with `permission denied: <action>`, and continue with everything else. The README's non-prompting permission mode is how the user avoids these.
165
- - **Defer, don't stall.** A task that cannot pass keeps `- [ ]` and gets ` ⏭️ DEFERRED (auto-pilot): <reason>` appended to its line; continue. A dependent that cannot proceed is deferred `blocked by T<n>`. When the queue is done, make one more pass over the deferred tasks; one that now passes loses the marker and gets its tick.
166
- - **Safety.** Never push, force-push, deploy, publish, spend money, or delete/overwrite anything outside the plan's scope unless the plan explicitly says so — defer that step instead. Asset generation the plan or spec explicitly calls for (images, textures, audio, video, 3D through the documented generation tools) is in scope: do it. Never `git init`.
167
- - **No commits.** Never commit, stage, stash, switch branches or push — not per task, not per phase, not at run end. Every change stays in the working tree for the user, who commits when they choose. Uncommitted changes that are not yours → leave them untouched; never ask about them.
168
- - **Context.** Implement each phase in a fresh implementer subagent (it builds and tests; keep it for that phase's fix loop), so you only orchestrate: read plan → implementer → verifier → tick → log → next phase. The plan's checkboxes and the run log are the only state — re-read them at each phase boundary and after a compaction.
169
- - **Run log** — `documents/<slug>_autopilot.md` beside the plan, appended per run: the `⏱` lines from *Clock every run* and completed/total; one line per task (outcome, attempts, tests, verifier, files, done time); one line per decision; deferred tasks with what a human should look at first. Narrate the same boundaries to the console: `▶ [auto-pilot] T12/50 — <title>`, `✅ … verified`, `⏭️ … deferred — <reason>`.
170
- - **Exit report** — only once the queue is empty: tasks completed, completed/total, deferred tasks with reasons, decisions logged and the run-log path, the dashboard path, that every change is left uncommitted for the user, whether the plan is done. It states results; it asks nothing. Re-running the same command resumes and re-attempts deferred tasks.
133
+ - **Blocked by an unfinished task:** re-attempt it if deferred this run and the fix is now clear; else do the minimum to unblock, log it; never tick outside the queue.
134
+ - **Errors:** fix the cause, retry; transient ones (network, port in use, lock file, editor compiling) → `wait.mjs`, retry up to 3×. **Tools down** (Unity, Blender, dev server, browser) → restart or install via their CLI; truly unavailable → defer.
135
+ - **Permission denied** is respected, never worked around: log it, defer that step (`permission denied: <action>`), continue.
136
+ - **Defer, don't stall:** keep `- [ ]` and append ` ⏭️ DEFERRED (auto-pilot): <reason>`; dependents are deferred `blocked by T<n>`. After the queue, one more pass: a deferred task that now passes loses the marker and is ticked.
137
+ - **Safety:** never push, deploy, publish, spend money, or delete/overwrite outside the plan's scope unless it says so — defer instead. Asset generation the plan or spec calls for is in scope. Never `git init`; leave others' uncommitted changes alone, unasked.
138
+ - **Run log** per run: the `⏱` lines, completed/total, a line per task (outcome, attempts, tests, verifier, files, done time) and per decision, deferred tasks with where to look first. Console: `▶ [auto-pilot] T12/50 — <title>`, `✅ … verified`, `⏭️ … deferred — <reason>`.
139
+ - **Exit report** once the queue is empty: completed/total, deferrals with reasons, decisions and the run-log path, the dashboard path, that all changes are uncommitted, whether the plan is done. It asks nothing; re-running resumes and retries deferrals.