@babylonjs-toolkit/agent 1.1.58 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Babylon Toolkit Desktop Agent (1.1.58)
1
+ # Babylon Toolkit Desktop Agent (1.1.60)
2
2
 
3
3
  The desktop agent owns the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser.
4
4
 
@@ -270,7 +270,7 @@ start without a spec:
270
270
  documents/<slug>_plan.md the plan (bt-plan)
271
271
  documents/<slug>_autopilot.md the run log (bt-execute)
272
272
  documents/<slug>_dashboard.js the dashboard's data, updated task by task
273
- documents/<slug>_live.js what is happening this minute, updated step by step
273
+ documents/<slug>_live.js what is happening this minute, updated step by step (git-ignored)
274
274
  snapshots/ meaningful snapshots of the build
275
275
  tests/ every test the plan's tasks write
276
276
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs-toolkit/agent",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "description": "Installs the Babylon Toolkit Desktop Agent for Claude Code, Codex, GitHub Copilot, Gemini CLI and Antigravity.",
5
5
  "keywords": [
6
6
  "babylonjs",
@@ -33,6 +33,7 @@ Run tasks from a plan: build each one with its tests, have an independent verifi
33
33
 
34
34
  - **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — follow the *Work fast* rules below to the letter, take the direct route to each task's Acceptance, and do not re-read what you already have. Begin every implementer and verifier prompt with `TIME MATTERS.` Print `⏱️ [bt-execute] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-execute] No time limit`, and do not add it). Speed never relaxes tests, the independent verifier, live checks, or "tick only on PASS".
35
35
  - **Scope.** Implement only the selected task(s). No "while I'm here" work on other tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide and log it)*.
36
+ - **Open the run before anything else.** The first actions of every run — before fetching 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*); and write the live file (`role: "orchestrator"`, `title: "Starting run <n> — <what you are checking first>"`). 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.
36
37
  - **Read the docs once.** For Babylon work, if you have not read the Agent Reference this session, fetch it once — https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — plus only the sub-documents the plan's tasks need. It is the authority for conventions and API. Fetch fails → 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.
37
38
  - **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.
38
39
  - **Say what you are doing** — one short line at each task and phase boundary, and before anything slow.
@@ -79,21 +80,21 @@ Every feature lives in one folder, created by bt-spec (or by bt-plan for a Quick
79
80
 
80
81
  `<slug>` is the folder name (the plan sits at `<slug>/documents/<slug>_plan.md`). **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.
81
82
 
82
- **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 `dashboard.template.js`, whose header comment is the data schema. bt-plan writes both in the `planned` state; if either is missing, create it now from the plan. A third file, `documents/<slug>_live.js` (from `live.template.js`), carries what is happening this minute.
83
+ **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.
83
84
 
84
85
  **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 three paths and these rules. Every timestamp comes from the shell clock.
85
86
 
86
87
  - **The live file — at every meaningful step.** Rewrite `documents/<slug>_live.js` whole (it is small) when a task starts, at each milestone inside it, before anything slow (a build, an export, a bake, a capture, a test run), at each fix attempt, at the hand-over to the verifier and while it checks each task, and at the commit: the phase, the task, the role, one plain-language sentence on what is happening now, and the task's step log. Never let it go 15 minutes without a write during active work — the page flags a 20-minute silence. Between tasks, `task: ""` and a `title` (`Verifying phase 2`, `Committing phase 2`).
87
88
  - **The dashboard data — at every task boundary:** a task becomes `in-progress` when it starts; `built` the moment it is built and its tests are green — with its summary of what was actually done (and anything surprising), files, tests and snapshots filled in **right then**, not at the phase end; `verifying` while the verifier checks it; `done` when it passes (verifier result, attempts, commit, done time, its `DECISION` lines); back to `in-progress` with `attempts` + 1 on a FAIL. Each change also adds an `activity` line and refreshes `updatedAt`.
88
- - **Valid JavaScript, always.** Both files are loaded as scripts — one bad comma blanks the page. After every write, run `node --check <file>` where Node is available and fix it at once.
89
+ - **Data, written through a parser — 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). Every update reads the file, parses the JSON, changes the fields and writes the whole file back — the Python recipe in `data-schema.md`, or Node's `JSON.parse` / `JSON.stringify`. One stray comma written by hand would blank the page; a parser cannot write one.
89
90
 
90
91
  On top of the per-task updates:
91
92
 
92
- - **Run start:** first **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, and the first live-file write.
93
+ - **Run start — the first thing the run does** (*Open the run before anything else*): **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, and the first live-file write. In a git repository, check `.gitignore` has `.agents/specs/*/documents/*_live.js` and append it once if not — the live file is never staged or committed; `<slug>_dashboard.js` and `snapshots/` are.
93
94
  - **Each phase, after its ticks and before its commit:** the phase's status, times and minutes (from its `⏱` line), its verifier result and a two-or-three-sentence summary of what it delivered; the phase-level snapshots (a progression spanning several tasks — below); `decisions`; `activeTime`; an `activity` line; and a current "so far" `outcome` headline.
94
95
  - **A deferral:** the task's `status: "deferred"` and `deferredReason`, an `activity` line.
95
96
  - **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. 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.
96
- - **`--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 (schema in `dashboard.template.js`), filled in by whoever has the facts, at the same per-task moments as everything else:
97
+ - **`--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:
97
98
  - **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; `problems` — each failed attempt or dead end, with what failed, the root cause and the fix; `notes` for a future maintainer; `timing.build`;
98
99
  - **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`;
99
100
  - **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.
@@ -10,8 +10,8 @@
10
10
 
11
11
  This page is a fixed template: copy it to .agents/specs/<slug>/dashboard.html, replace {{slug}} below with the
12
12
  feature slug, and never hand-edit anything else. Everything shown comes from the data file
13
- documents/<slug>_dashboard.js (schema: bt-execute/templates/dashboard/dashboard.template.js) and, while a run
14
- is going, the live status in documents/<slug>_live.js (schema: live.template.js).
13
+ documents/<slug>_dashboard.js and, while a run is going, the live status in documents/<slug>_live.js —
14
+ both strict JSON behind a one-line `window.… =` prefix (fields and update recipe: data-schema.md).
15
15
  It opens straight from disk (file://) — no server, no build, no network.
16
16
  -->
17
17
  <style>
@@ -1,134 +1,81 @@
1
- /*
2
- * Feature Dashboard data — .agents/specs/<slug>/documents/<slug>_dashboard.js
3
- *
4
- * dashboard.html (copied from this template folder) renders everything from this one object. It is plain
5
- * JavaScript loaded with <script src>, so the page works opened straight from disk. Rules:
6
- * - Keep it valid JavaScript: one `window.FEATURE_DASHBOARD = { … };` assignment, JSON-style values.
7
- * - Paths (documents, snapshots) are relative to the feature folder: "snapshots/…", "documents/…".
8
- * - Every timestamp is local time from the shell, formatted "YYYY-MM-DD HH:MM" (the page orders and
9
- * flags "new since your last visit" by plain string comparison).
10
- * - Text fields may use `code` and **bold**; everything else is shown as plain text.
11
- * - Never silently rewrite an earlier phase, task, snapshot, decision or the After Action Report. Change it and append
12
- * an entry to its `updates` list: { at, by, note } — the page shows an "Updated" badge on it and lists
13
- * it under "Updates and revisions".
14
- *
15
- * Status values — report: planned | in-progress (a run is executing right now) | paused (a run ended, plan not
16
- * finished) | complete | incomplete (plan finished with deferrals)
17
- * Decide it from the plan file's checkboxes. The page only believes "complete" when every task here is done;
18
- * otherwise it shows the plan as paused with a warning. A task added to the plan after it was complete is
19
- * added here as "pending" (with an `updates` note) and the status becomes "paused".
20
- * The status picks the page's top slot: in-progress shows Current run activity (the live file + milestones);
21
- * paused / complete / incomplete show the After Action Report instead (paused marks it Interim).
22
- * phase: pending | in-progress | done | partial | deferred
23
- * task: pending | in-progress | built (awaiting the verifier) | verifying | done | deferred | failed
24
- *
25
- * Update cadence: per TASK, not per phase. A task's entry changes the moment it starts (in-progress), the moment
26
- * it is built (built — with its summary, files, tests and snapshots filled in right then), while the verifier
27
- * checks it (verifying) and when it passes (done — verifier, commit, done time). The minute-by-minute "what is
28
- * happening now" lives in the separate live file, documents/<slug>_live.js (schema: live.template.js).
29
- *
30
- * Snapshot shapes (any list of snapshots may mix them):
31
- * progression — the build told stage by stage, from the same camera, in the order it happened:
32
- * { title, caption, source, frames: [ { src, stage, caption, task, at }, … ], updates }
33
- * comparison — one change, side by side (drag slider):
34
- * { title, caption, source, before: { src, caption }, after: { src, caption }, updates }
35
- * still — one image that proves one thing:
36
- * { title, caption, source, src, updates }
37
- * `source` names where the image came from: "browser", "unity", "blender", "reference".
38
- */
39
1
  window.FEATURE_DASHBOARD = {
40
- schema: 1,
41
-
42
- feature: {
43
- title: "Feature Title",
44
- slug: "feature-slug",
45
- branch: "project/feature/feature-slug",
46
- origin: "spec", // "spec" (bt-spec) or "quick-plan" (bt-plan Quick Plan)
47
- size: "medium",
48
- proof: "functional",
49
- summary: "One paragraph: what this feature is and why it exists, in plain language."
2
+ "schema": 1,
3
+ "feature": {
4
+ "title": "Feature Title",
5
+ "slug": "feature-slug",
6
+ "branch": "project/feature/feature-slug",
7
+ "origin": "spec",
8
+ "size": "medium",
9
+ "proof": "functional",
10
+ "summary": "One paragraph: what this feature is and why it exists, in plain language."
50
11
  },
51
-
52
- documents: [
53
- { label: "Spec", path: "documents/feature-slug_spec.md" }, // omit for a Quick Plan
54
- { label: "Plan", path: "documents/feature-slug_plan.md" },
55
- { label: "Run log", path: "documents/feature-slug_autopilot.md" } // add once bt-execute has run
12
+ "documents": [
13
+ {
14
+ "label": "Spec",
15
+ "path": "documents/feature-slug_spec.md"
16
+ },
17
+ {
18
+ "label": "Plan",
19
+ "path": "documents/feature-slug_plan.md"
20
+ }
56
21
  ],
57
-
58
- status: "planned",
59
- detail: "normal", // "verbose" once any run used bt-execute --verbose (never set back)
60
- updatedAt: "2026-01-01 09:00",
61
- estimate: "3–6 h", // the plan's Total line
62
- activeTime: "", // from the run log's ⏱ lines, e.g. "2 h 10 min"
63
- runs: 0,
64
-
65
- // The After Action Report — the whole plan's execution, start to finish. Empty while planned; written by
66
- // bt-execute at the end of every run, and shown in the top slot once no run is executing ("Interim" while paused).
67
- afterAction: {
68
- writtenAt: "", // "YYYY-MM-DD HH:MM"
69
- headline: "", // one sentence: what the plan delivered
70
- body: [], // 2–4 paragraphs: what was built, how it was proven, what surprised
71
- highlights: [], // the results worth remembering
72
- // ONE before/after for the plan as a whole: "before" captured before T1 started, "after" at the end,
73
- // from the same camera or viewport. null when the plan has nothing to see.
74
- comparison: null, // { title, caption, source, before: { src, caption }, after: { src, caption } }
75
- snapshots: [], // optional: the plan's key progression, or the end-to-end proof
76
- // --verbose only: the full debrief, one card per section, in this order where they apply —
77
- // Architecture · Phase by phase · Problems and resolutions · Deviations from the plan · Known limitations ·
78
- // Lessons learned · Estimate vs actual · Recommended next steps
79
- sections: [], // { title, body: [paragraphs], items: [bullets] }
80
- updates: []
22
+ "status": "planned",
23
+ "detail": "normal",
24
+ "updatedAt": "2026-01-01 09:00",
25
+ "estimate": "3–6 h",
26
+ "activeTime": "",
27
+ "runs": 0,
28
+ "afterAction": {
29
+ "writtenAt": "",
30
+ "headline": "",
31
+ "body": [],
32
+ "highlights": [],
33
+ "comparison": null,
34
+ "snapshots": [],
35
+ "sections": [],
36
+ "updates": []
81
37
  },
82
-
83
- phases: [
38
+ "phases": [
84
39
  {
85
- number: 1,
86
- name: "Phase name from the plan",
87
- status: "pending",
88
- started: "", // "HH:MM" — from the ⏱ phase line
89
- finished: "",
90
- minutes: 0,
91
- summary: "", // what this phase delivered, in two or three sentences
92
- verifier: null, // { result: "PASS" | "FAIL → PASS on attempt 2", note: "…" }
93
- snapshots: [], // phase-level story: progressions spanning several tasks
94
- updates: [],
95
- tasks: [
40
+ "number": 1,
41
+ "name": "Phase name from the plan",
42
+ "status": "pending",
43
+ "started": "",
44
+ "finished": "",
45
+ "minutes": 0,
46
+ "summary": "",
47
+ "verifier": null,
48
+ "snapshots": [],
49
+ "updates": [],
50
+ "tasks": [
96
51
  {
97
- id: "T1",
98
- title: "Task title from the plan",
99
- kind: "code", // code | live | unity — the plan's estimate kind
100
- verifyLevel: "standard", // standard | live
101
- status: "pending",
102
- summary: "", // what was actually done, and anything surprising
103
- files: [],
104
- tests: null, // { passed: 4, failed: 0, files: [".agents/specs/<slug>/tests/…"], note: "" }
105
- verifier: "", // "PASS — independent subagent; live check in Chrome"
106
- attempts: 0,
107
- commit: "",
108
- doneAt: "",
109
- deferredReason: "",
110
- decisions: [], // "DECISION T1: … — source"
111
- snapshots: [], // this task's progression / comparisons / stills
112
- // --verbose only: the task's full write-up. Every field optional; the page shows what is present.
113
- details: null, // {
114
- // approach: ["how it was built, how the pieces fit, why this way and not the alternatives"],
115
- // changes: [{ file, change: "what changed in it and why" }],
116
- // testCases: [{ name, expected, result: "PASS" | "FAIL …" }],
117
- // acceptance: [{ criterion, result: "PASS" | "FAIL", evidence }],
118
- // problems: [{ attempt: "1", failed, cause, fix }],
119
- // liveCheck: "what was looked at, where, at what resolution, what was judged",
120
- // notes: ["anything a maintainer should know"],
121
- // timing: { build: 12, verify: 6, fix: 4 } // minutes
122
- // }
123
- updates: []
52
+ "id": "T1",
53
+ "title": "Task title from the plan",
54
+ "kind": "code",
55
+ "verifyLevel": "standard",
56
+ "status": "pending",
57
+ "summary": "",
58
+ "files": [],
59
+ "tests": null,
60
+ "verifier": "",
61
+ "attempts": 0,
62
+ "commit": "",
63
+ "doneAt": "",
64
+ "deferredReason": "",
65
+ "decisions": [],
66
+ "snapshots": [],
67
+ "details": null,
68
+ "updates": []
124
69
  }
125
70
  ]
126
71
  }
127
72
  ],
128
-
129
- decisions: [], // { id: "D1" | "T7", text, source, updates }
130
- followUps: [], // plain strings: what a human should look at next
131
- activity: [ // oldest first; the page shows newest first
132
- { at: "2026-01-01 09:00", text: "Plan written — 1 task in 1 phase, estimated 3–6 h." }
73
+ "decisions": [],
74
+ "followUps": [],
75
+ "activity": [
76
+ {
77
+ "at": "2026-01-01 09:00",
78
+ "text": "Plan written — 1 task in 1 phase, estimated 3–6 h."
79
+ }
133
80
  ]
134
81
  };
@@ -0,0 +1,177 @@
1
+ # Feature Dashboard data
2
+
3
+ `dashboard.html` renders everything from two data files in the feature folder's `documents/`:
4
+
5
+ | File | Holds | Written |
6
+ |---|---|---|
7
+ | `<slug>_dashboard.js` | the feature's record — status, phases, tasks and their results, decisions, snapshots, the After Action Report | at every task boundary (bt-plan creates it from `dashboard.template.js`) |
8
+ | `<slug>_live.js` | what is happening this minute — the current task, one sentence, its step log | at every meaningful step of a run (from `live.template.js`) |
9
+
10
+ They are **data, not code.** Each file is exactly one line of prefix and one strict-JSON value:
11
+
12
+ ```js
13
+ window.FEATURE_DASHBOARD = { "schema": 1, "status": "planned", … };
14
+ window.FEATURE_LIVE = { "updatedAt": "2026-01-01 09:00", … };
15
+ ```
16
+
17
+ The `window.… =` prefix exists only because a page opened from disk (`file://`) may load a neighbouring
18
+ `<script src>` but may not fetch a `.json` file. Everything after `=` and before the final `;` is strict
19
+ JSON — double-quoted keys and strings, no comments, no trailing commas — so any JSON parser can read it.
20
+ The status of the plan itself lives in the plan file's checkboxes; the dashboard mirrors it (see *Status*).
21
+
22
+ ## Updating a data file — parse, change, write back
23
+
24
+ Never edit the text by hand: one stray comma blanks the page. Read the file, parse the JSON, change the
25
+ fields, and write the whole file back. Every write then produces valid data by construction.
26
+
27
+ ```bash
28
+ python3 - "$DATA" <<'PY'
29
+ import json, pathlib, sys
30
+ path = pathlib.Path(sys.argv[1])
31
+ text = path.read_text(encoding="utf-8")
32
+ prefix, body = text.split("=", 1)
33
+ data = json.loads(body.strip().rstrip(";"))
34
+ # … change `data` here, e.g. data["status"] = "in-progress" …
35
+ path.write_text(prefix.strip() + " = " + json.dumps(data, indent=2, ensure_ascii=False) + ";\n", encoding="utf-8")
36
+ PY
37
+ ```
38
+
39
+ Node works the same way (`JSON.parse` / `JSON.stringify(data, null, 2)`). Where neither runs, write the
40
+ whole file from a complete JSON value, never a partial patch. `<slug>_live.js` is small — always write it whole.
41
+
42
+ ## Conventions
43
+
44
+ - **Paths** (documents, snapshots) are relative to the feature folder: `"snapshots/…"`, `"documents/…"`.
45
+ - **Timestamps** are local time from the shell, `"YYYY-MM-DD HH:MM"` (`date '+%Y-%m-%d %H:%M'`). The page
46
+ orders entries and flags "new since your last visit" by plain string comparison.
47
+ - **Text** may use `` `code` `` and `**bold**`; everything else is shown as plain text.
48
+ - **Updated notifications.** Never silently rewrite an earlier phase, task, snapshot, decision or the After
49
+ Action Report. Change it and append `{ "at", "by", "note" }` to its `updates` list — the page shows an
50
+ **Updated** badge on it and lists it under *Updates and revisions*.
51
+
52
+ ## Status
53
+
54
+ | Field | Values |
55
+ |---|---|
56
+ | `status` | `planned` · `in-progress` (a run is executing right now) · `paused` (a run ended, the plan is not finished) · `complete` · `incomplete` (finished with deferrals) |
57
+ | phase `status` | `pending` · `in-progress` · `done` · `partial` · `deferred` |
58
+ | task `status` | `pending` · `in-progress` · `built` (awaiting the verifier) · `verifying` · `done` · `deferred` · `failed` |
59
+
60
+ - Decide `status` from the plan file's checkboxes, never from memory. The page only believes `complete` when
61
+ every task here is `done`; otherwise it shows the plan as paused with a warning.
62
+ - A task added to the plan after it was complete is added here as `pending`, in plan order, with an `updates`
63
+ note saying why — and `complete` becomes `paused`.
64
+ - The status picks the page's top slot: `in-progress` shows *Current run activity* (the live file and the
65
+ milestones); `paused`, `complete` and `incomplete` show *The plan summary* (the After Action Report, marked
66
+ *Interim* while paused).
67
+ - **Cadence is per task.** A task's entry changes the moment it starts (`in-progress`), the moment it is built
68
+ (`built` — summary, files, tests and snapshots filled in right then), while the verifier checks it
69
+ (`verifying`) and when it passes (`done` — verifier, commit, done time).
70
+
71
+ ## `<slug>_dashboard.js` fields
72
+
73
+ Top level:
74
+
75
+ | Field | Meaning |
76
+ |---|---|
77
+ | `schema` | `1` |
78
+ | `feature` | `{ "title", "slug", "branch", "origin": "spec" \| "quick-plan", "size", "proof", "summary" }` — `summary` is one plain-language paragraph |
79
+ | `documents` | `[{ "label", "path" }]` — Spec (omitted for a Quick Plan), Plan, and Run log once bt-execute has run |
80
+ | `status` | see *Status* |
81
+ | `detail` | `"normal"`, or `"verbose"` once any run used `bt-execute --verbose` (never set back) |
82
+ | `updatedAt` | last write, `"YYYY-MM-DD HH:MM"` |
83
+ | `estimate` | the plan's Total line, e.g. `"3–6 h"` |
84
+ | `activeTime` | from the run log's `⏱` lines, e.g. `"2 h 10 min"` |
85
+ | `runs` | number of bt-execute runs so far |
86
+ | `afterAction` | the After Action Report (below) |
87
+ | `phases` | the plan's phases, each with its tasks (below) |
88
+ | `decisions` | `[{ "id": "D1" \| "T7", "text", "source", "updates" }]` |
89
+ | `followUps` | plain strings — what a human should look at next |
90
+ | `activity` | `[{ "at", "text" }]`, oldest first — the milestones (the page shows newest first) |
91
+
92
+ `afterAction` — empty while planned; written by bt-execute at the end of every run:
93
+
94
+ | Field | Meaning |
95
+ |---|---|
96
+ | `writtenAt` | `"YYYY-MM-DD HH:MM"` |
97
+ | `headline` | one sentence: what the plan delivered |
98
+ | `body` | 2–4 paragraphs: what was built, how it was proven, what surprised |
99
+ | `highlights` | the results worth remembering |
100
+ | `comparison` | ONE before/after for the plan as a whole — "before" captured before T1 started, "after" at the end, from the same camera or viewport: `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" } }`; `null` when the plan has nothing to see |
101
+ | `snapshots` | optional: the plan's key progression, or the end-to-end proof |
102
+ | `sections` | `--verbose` only: `[{ "title", "body": [paragraphs], "items": [bullets] }]`, in this order where they apply — Architecture · Phase by phase · Problems and resolutions · Deviations from the plan · Known limitations · Lessons learned · Estimate vs actual · Recommended next steps |
103
+ | `updates` | see *Updated notifications* |
104
+
105
+ Each phase:
106
+
107
+ | Field | Meaning |
108
+ |---|---|
109
+ | `number`, `name` | from the plan |
110
+ | `status` | see *Status* |
111
+ | `started`, `finished`, `minutes` | `"HH:MM"` and minutes, from the phase's `⏱` line |
112
+ | `summary` | what the phase delivered, in two or three sentences |
113
+ | `verifier` | `{ "result": "PASS" \| "FAIL → PASS on attempt 2", "note" }` or `null` |
114
+ | `snapshots` | phase-level story — progressions spanning several tasks |
115
+ | `tasks` | below |
116
+ | `updates` | see *Updated notifications* |
117
+
118
+ Each task:
119
+
120
+ | Field | Meaning |
121
+ |---|---|
122
+ | `id`, `title` | from the plan (`T1`, `T3.1` …) |
123
+ | `kind` | `code` · `live` · `unity` — the plan's estimate kind |
124
+ | `verifyLevel` | `standard` · `live` |
125
+ | `status` | see *Status* |
126
+ | `summary` | what was actually done, and anything surprising |
127
+ | `files` | paths changed |
128
+ | `tests` | `{ "passed", "failed", "files": [".agents/specs/<slug>/tests/…"], "note" }` or `null` |
129
+ | `verifier` | `"PASS — independent subagent; live check in Chrome"` |
130
+ | `attempts`, `commit`, `doneAt` | as recorded |
131
+ | `deferredReason` | why it was deferred, if it was |
132
+ | `decisions` | `"DECISION T1: … — source"` lines |
133
+ | `snapshots` | this task's progression, comparisons and stills |
134
+ | `details` | `--verbose` only, else `null` — see below |
135
+ | `updates` | see *Updated notifications* |
136
+
137
+ `details` (`--verbose`) — every field optional; the page shows what is present:
138
+
139
+ | Field | Meaning |
140
+ |---|---|
141
+ | `approach` | paragraphs: how it was built, how the pieces fit, why this way and not the alternatives |
142
+ | `changes` | `[{ "file", "change": "what changed in it and why" }]` |
143
+ | `testCases` | `[{ "name", "expected", "result": "PASS" \| "FAIL …" }]` |
144
+ | `acceptance` | `[{ "criterion", "result": "PASS" \| "FAIL", "evidence" }]` |
145
+ | `problems` | `[{ "attempt": "1", "failed", "cause", "fix" }]` |
146
+ | `liveCheck` | what was looked at, where, at what resolution, how it was judged |
147
+ | `notes` | anything a maintainer should know |
148
+ | `timing` | `{ "build": 12, "verify": 6, "fix": 4 }` — minutes |
149
+
150
+ ## Snapshot shapes
151
+
152
+ Any list of snapshots may mix them. `source` names where the image came from: `"browser"`, `"unity"`,
153
+ `"blender"`, `"reference"`.
154
+
155
+ | Shape | Use | Fields |
156
+ |---|---|---|
157
+ | progression | the build told stage by stage, from the same camera, in the order it happened | `{ "title", "caption", "source", "frames": [{ "src", "stage", "caption", "task", "at" }], "updates" }` |
158
+ | comparison | one change, side by side (drag slider) | `{ "title", "caption", "source", "before": { "src", "caption" }, "after": { "src", "caption" }, "updates" }` |
159
+ | still | one image that proves one thing | `{ "title", "caption", "source", "src", "updates" }` |
160
+
161
+ ## `<slug>_live.js` fields
162
+
163
+ "What are you doing right now?" — answered on the page without asking. Whoever is doing the work rewrites
164
+ this file whole: the implementer while it builds, the verifier while it checks, the orchestrator between them —
165
+ at every meaningful step (starting a task, each milestone inside it, before a build / export / bake / capture /
166
+ test run, a fix attempt, the hand-over to the verifier, the commit). A 20-minute silence shows as a warning.
167
+ The page shows it only while `status` is `in-progress`.
168
+
169
+ | Field | Meaning |
170
+ |---|---|
171
+ | `updatedAt` | `"YYYY-MM-DD HH:MM"` from the shell clock |
172
+ | `phase` | the current phase number |
173
+ | `task` | the task being worked on; `""` between tasks |
174
+ | `title` | only when there is no task: `"Verifying phase 1"`, `"Committing phase 1"` |
175
+ | `role` | `implementer` · `verifier` · `orchestrator` |
176
+ | `activity` | one plain-language sentence on what is happening this minute |
177
+ | `steps` | `[{ "at": "HH:MM", "text" }]` — the current task's log, oldest first; start fresh for each task, keep the last 12. Plain language a non-developer follows: "Painting the road mask from the spline", not "edit RoadNetwork.ts L120" |
@@ -1,25 +1,9 @@
1
- /*
2
- * Feature Dashboard live status — .agents/specs/<slug>/documents/<slug>_live.js
3
- *
4
- * "What are you doing right now?" — answered on the page without asking. Whoever is doing the work writes
5
- * this file: the implementer while it builds, the verifier while it checks, the orchestrator between them.
6
- * Rewrite the WHOLE file each time (it is small; never patch it in place) at every meaningful step:
7
- * starting a task, each milestone inside it, starting a build / export / capture / test run, a fix attempt,
8
- * handing over to the verifier, committing. A quiet gap of 20 minutes shows as a warning on the page.
9
- *
10
- * Rules: valid JavaScript, one assignment. `updatedAt` is the shell clock, "YYYY-MM-DD HH:MM".
11
- * `steps` is the current task's log, oldest first — start a fresh list when a new task starts; keep the
12
- * last 12. Plain language a non-developer understands: "Painting the road mask from the spline", not
13
- * "edit RoadNetwork.ts L120". The page shows it only while the dashboard's status is "in-progress".
14
- */
15
1
  window.FEATURE_LIVE = {
16
- updatedAt: "2026-01-01 09:00",
17
- phase: 1,
18
- task: "T1", // the task being worked on; "" between tasks
19
- title: "", // only when no task: e.g. "Verifying phase 1", "Committing phase 1"
20
- role: "implementer", // implementer | verifier | orchestrator
21
- activity: "One sentence: what is happening this minute.",
22
- steps: [
23
- { at: "09:00", text: "Started T1 — read the plan's task block and the files it touches." }
24
- ]
2
+ "updatedAt": "2026-01-01 09:00",
3
+ "phase": 1,
4
+ "task": "",
5
+ "title": "Plan written — waiting for bt-execute",
6
+ "role": "orchestrator",
7
+ "activity": "",
8
+ "steps": []
25
9
  };
@@ -22,7 +22,7 @@ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ord
22
22
  ## Ground rules
23
23
 
24
24
  - **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — research only what the plan needs, keep subagents few and their questions narrow, and do not re-read what you already have. Begin every subagent prompt with `TIME MATTERS.` Print `⏱️ [bt-plan] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-plan] No time limit`, and do not add it). Speed never skips a required step, the Heavy Plan cold-context audit, or anything the plan needs to be complete.
25
- - **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder. Never implement a task, edit source, or run builds/tests — not even a trivial first task. Writing the plan is the last action; the user runs `bt-execute` separately.
25
+ - **Planning only — in every mode.** Research read-only; the only files you write are the plan and the dashboard (`dashboard.html` and its data files) in the feature folder, plus the one `.gitignore` line Step 4 names. Never implement a task, edit source, or run builds/tests — not even a trivial first task. Writing the plan is the last action; the user runs `bt-execute` separately.
26
26
  - **Babylon work:** if you have not read the Babylon Toolkit Agent Reference in this session, fetch and read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — the authority for conventions and API; fetch sub-documents only when relevant, and again only if a context compaction made you forget it. If the fetch fails, stop and tell the user — do not guess at the API.
27
27
  - **Say what you are doing.** Before any step that takes more than a few seconds print one short line — `🔎 [bt-plan] <what> …` — and one when it returns; one line per subagent going out and coming back. A silent run looks like a hang and gets cancelled.
28
28
  - **Subagents:** running this skill is the user's request to use them where it says so. Use whatever subagent tool your host provides (its name varies by host — e.g. `Agent` or `Task`); if there is none, work inline and say so. Tell exploration subagents they need not fetch the Agent Reference.
@@ -130,8 +130,9 @@ Each task above is a checkbox. To implement:
130
130
  Print `🗂️ [bt-plan] Writing the feature dashboard …`. From bt-execute's `templates/dashboard/` *(where skills load through a tool: `load_skill('bt-execute')` + `read_skill_resource`; where they are files: the sibling `bt-execute/` folder in the skills directory this skill was loaded from)*:
131
131
 
132
132
  - copy `dashboard.html` to `.agents/specs/<slug>/dashboard.html`, replacing `{{slug}}` with the slug and changing nothing else;
133
- - write `.agents/specs/<slug>/documents/<slug>_dashboard.js` following `dashboard.template.js` (its header comment is the schema): `feature` (title, slug, branch, `origin` `spec` or `quick-plan`, size, proof, a plain-language summary), `documents` (Spec — omitted for a Quick Plan — and Plan), `status: "planned"`, `updatedAt` from the shell clock (`date '+%Y-%m-%d %H:%M'`; with no shell, the current local time), `estimate` (the Total line), every phase and task from the plan as `pending` (id, title, kind from the estimate table, verify level), an empty `afterAction` and no snapshots, the plan's Decisions as `decisions` (Heavy Plan; otherwise the spec's), and one `activity` line: `Plan written — <n> tasks in <k> phases, estimated <range>`;
134
- - write `.agents/specs/<slug>/documents/<slug>_live.js` following `live.template.js`: no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute rewrites it at every step of a run).
133
+ - write `.agents/specs/<slug>/documents/<slug>_dashboard.js` from the starter `dashboard.template.js`, written whole as strict JSON behind its `window.FEATURE_DASHBOARD =` prefix — double-quoted keys, no comments, no trailing commas (`data-schema.md` documents every field): `feature` (title, slug, branch, `origin` `spec` or `quick-plan`, size, proof, a plain-language summary), `documents` (Spec — omitted for a Quick Plan — and Plan), `status: "planned"`, `updatedAt` from the shell clock (`date '+%Y-%m-%d %H:%M'`; with no shell, the current local time), `estimate` (the Total line), every phase and task from the plan as `pending` (id, title, kind from the estimate table, verify level), an empty `afterAction` and no snapshots, the plan's Decisions as `decisions` (Heavy Plan; otherwise the spec's), and one `activity` line: `Plan written — <n> tasks in <k> phases, estimated <range>`;
134
+ - write `.agents/specs/<slug>/documents/<slug>_live.js` from `live.template.js`, the same way (whole, strict JSON): no task, `role: "orchestrator"`, `title: "Plan written — waiting for bt-execute"`, no steps (bt-execute rewrites it at every step of a run).
135
+ - in a git repository, make sure `.gitignore` (at the repository root) contains the line `.agents/specs/*/documents/*_live.js` — append it once if missing. The live file is rewritten at every step of a run and is not history worth keeping; `<slug>_dashboard.js` is, and stays tracked. A live file git already tracks is left as it is.
135
136
 
136
137
  Re-planning an existing feature rewrites the data file's phases and tasks from the new plan but keeps the results of tasks already done, its `afterAction` and its `activity` history, adding a `Plan revised` line; new tasks are `pending` with an `updates` note, and a `complete` status becomes `paused`. If the template cannot be found, skip the dashboard and say so — bt-execute creates it on its first run.
137
138