@babylonjs-toolkit/agent 1.1.55 → 1.1.58

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.
@@ -0,0 +1,134 @@
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
+ 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."
50
+ },
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
56
+ ],
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: []
81
+ },
82
+
83
+ phases: [
84
+ {
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: [
96
+ {
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: []
124
+ }
125
+ ]
126
+ }
127
+ ],
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." }
133
+ ]
134
+ };
@@ -0,0 +1,25 @@
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
+ 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
+ ]
25
+ };
@@ -7,8 +7,8 @@ skills:
7
7
 
8
8
  | Spec workflow | Gauntlet equivalent |
9
9
  | --- | --- |
10
- | `.agents/specs/<feature>_spec.md` (bt-spec) | `.agents/gauntlet/<name>/loop-card.md` — objective, benchmark, rubric, success condition, boundaries |
11
- | `.agents/specs/<feature>_plan.md` (bt-plan) | the part checklist in `.agents/gauntlet/<name>/progress.md` — the lead agent's round-1 decomposition |
10
+ | `.agents/specs/<feature>/documents/<feature>_spec.md` (bt-spec) | `.agents/gauntlet/<name>/loop-card.md` — objective, benchmark, rubric, success condition, boundaries |
11
+ | `.agents/specs/<feature>/documents/<feature>_plan.md` (bt-plan) | the part checklist in `.agents/gauntlet/<name>/progress.md` — the lead agent's round-1 decomposition |
12
12
  | bt-execute `ALL` (checkbox resume) | the round protocol + `--resume <name>` |
13
13
 
14
14
  The difference is when a box may flip. A **bt-plan task** is feed-forward: known work, visited once, `- [x]`
@@ -40,9 +40,9 @@ idiom bt-prototype uses with bt-hero — **pre-resolve everything at spec time s
40
40
  - **bt-spec:** the interview happens HERE, at spec time — the spec answers every loop-card slot (including
41
41
  `<NAME>`, `<DELIVERABLE KIND>`, the reference media or target-generation prompt, the locked cameras, the
42
42
  `OUT OF REACH` list and the boundaries) and writes the **pre-filled loop card** as a spec artifact
43
- (e.g. `.agents/specs/<feature>_gauntlet-card.md`).
43
+ (e.g. `.agents/specs/<feature>/documents/<feature>_gauntlet-card.md`).
44
44
  - **bt-plan:** the gauntlet becomes one task (usually the last), whose Details invoke
45
- `/bt-gauntlet --card:.agents/specs/<feature>_gauntlet-card.md --rounds:N`. Its **Acceptance** is observable:
45
+ `/bt-gauntlet --card:.agents/specs/<feature>/documents/<feature>_gauntlet-card.md --rounds:N`. Its **Acceptance** is observable:
46
46
  "gauntlet job `<name>` reports DONE — success condition met and the integration critic passed — as
47
47
  evidenced by `.agents/gauntlet/<name>/progress.md` and the final round journal."
48
48
  - **bt-execute:** runs the task by invoking the gauntlet non-interactively. Because a gauntlet may outlast
@@ -50,7 +50,8 @@ idiom bt-prototype uses with bt-hero — **pre-resolve everything at spec time s
50
50
  `bt-execute <plan> NEXT` run re-enters via `/bt-gauntlet --resume <name>` and the box flips only when the
51
51
  job genuinely reports DONE (or a loop-card boundary fires and the user accepts the parked result — record
52
52
  which). The gauntlet's own critic evidence IS the acceptance evidence; the bt-execute verifier reads
53
- `progress.md` + the last round journal rather than re-judging the art.
53
+ `progress.md` + the last round journal rather than re-judging the art. bt-execute copies the gauntlet's best
54
+ evidence frames, round by round, into the feature's `snapshots/` as a progression for the feature dashboard.
54
55
 
55
56
  bt-gauntlet never orchestrates bt-spec itself — composition is always initiated from the spec side.
56
57
 
@@ -23,7 +23,7 @@ Use the user's message after the skill name as the `arguments`.
23
23
  - **an idea sentence** — `create a Mustang GT Shelby decked out for racing, with a race driver — desert dawn to red-rock canyon to night dunes, NFS-style game site`
24
24
  - **a path to an existing hero image or video** — `@my-hero.jpg`, `@footage/run.mp4`
25
25
  - **explicit slot answers** — `HUD 0→220 MPH`, `sweep: hero`, `no jump nav`, `call it SIDEWINDER`
26
- - **a previously written brief file** — `@.agents/specs/<name>_hero-brief.md` (rebuilds it exactly, asking nothing)
26
+ - **a previously written brief file** — `@.agents/specs/<name>/documents/<name>_hero-brief.md` (rebuilds it exactly, asking nothing; a legacy flat `.agents/specs/<name>_hero-brief.md` works too)
27
27
  - **nothing at all** — full interview
28
28
 
29
29
  Whatever is present is used verbatim; the intake resolves the rest (Step 1). **There are no route keywords and no confirmation gates: `/bt-hero` builds, one shot.** The only permitted stop is the safety stop in Step 3.
@@ -66,7 +66,7 @@ Then resolve every unfilled slot by exactly one of two paths:
66
66
 
67
67
  ## Step 2 — Write the hero brief (the save file)
68
68
 
69
- Write the resolved slots to `.agents/specs/<feature-name>_hero-brief.md` (create `.agents/specs/` if needed). The brief is the **record**, not a gate: the user never has to touch it, but `/bt-hero @<brief-file>` later must rebuild the same hero with zero questions — that is what makes a hero repeatable, shareable, and tweakable (edit a line, re-run). Record **only Tier 3 answers and explicit Tier 2 overrides** — never Tier 1 mechanics; the brief describes the film, not the engine.
69
+ Write the resolved slots to `.agents/specs/<feature-name>/documents/<feature-name>_hero-brief.md` — the feature's folder (create it if needed; inside a bt-spec run it is the spec's own folder). The brief is the **record**, not a gate: the user never has to touch it, but `/bt-hero @<brief-file>` later must rebuild the same hero with zero questions — that is what makes a hero repeatable, shareable, and tweakable (edit a line, re-run). Record **only Tier 3 answers and explicit Tier 2 overrides** — never Tier 1 mechanics; the brief describes the film, not the engine.
70
70
 
71
71
  ```markdown
72
72
  ---
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  name: bt-plan
3
- description: "The Babylon Toolkit Plan Skill creates the detailed technical plan for the specified feature spec file. Use when asked to plan or produce implementation tasks for an existing spec. Also supports a Quick Plan mode: when given only a brief (no spec file), it interviews the user to build a mini-spec and plans from that. Add `--heavy` for Heavy Plan mode: a decision-complete plan (numbered Decisions log, Design Reference with real interfaces and patterns, self-contained task blocks, cold-context audit) that keeps a long run of fresh-context tasks cohesive. Add `--parity` for numeric parity gates instead of the default functional proof. Always planning-only — it writes the plan file and stops; execution is the separate bt-execute skill."
3
+ description: "The Babylon Toolkit Plan Skill creates the detailed technical plan for the specified feature spec file. Use when asked to plan or produce implementation tasks for an existing spec. Also supports a Quick Plan mode: when given only a brief (no spec file), it interviews the user to build a mini-spec and plans from that. Add `--heavy` for Heavy Plan mode: a decision-complete plan (numbered Decisions log, Design Reference with real interfaces and patterns, self-contained task blocks, cold-context audit) that keeps a long run of fresh-context tasks cohesive. Add `--parity` for numeric parity gates instead of the default functional proof. Always planning-only — it writes the plan file into the feature's folder (`.agents/specs/<slug>/`, which a Quick Plan creates) plus the feature's live dashboard in its planned state, and stops; execution is the separate bt-execute skill."
4
4
  allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Agent, Task
5
5
  ---
6
6
 
7
- Turn a feature spec into `.agents/specs/<feature-name>_plan.md`: an ordered checklist of tasks that `bt-execute` runs. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
7
+ Turn a feature spec into `.agents/specs/<slug>/documents/<slug>_plan.md`: an ordered checklist of tasks that `bt-execute` runs — plus the feature's dashboard (`.agents/specs/<slug>/dashboard.html`) in its planned state, which bt-execute keeps current — live activity while a run is going, an After Action Report once it is over. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
8
8
 
9
9
  ```
10
10
  /bt-plan [--heavy] [--parity] [--no-time-limit] <feature-spec> <optional-brief>
11
11
 
12
- /bt-plan @.agents/specs/mute-game-audio_spec.md
13
- /bt-plan "add a settings toggle to mute all game audio" # no spec file → Quick Plan: short interview, then plan
14
- /bt-plan --heavy @.agents/specs/feature_spec.md # decision-complete plan for a long or cheaper-model run
15
- /bt-plan --heavy --parity @.agents/specs/feature_spec.md # numeric parity gates against the reference (slow)
16
- /bt-plan --no-time-limit @.agents/specs/feature_spec.md # turn off the default TIME MATTERS mode
12
+ /bt-plan @.agents/specs/mute-game-audio/documents/mute-game-audio_spec.md
13
+ /bt-plan "add a settings toggle to mute all game audio" # no spec file → Quick Plan: short interview, creates the feature folder, then plans
14
+ /bt-plan --heavy @.agents/specs/<slug>/documents/<slug>_spec.md # decision-complete plan for a long or cheaper-model run
15
+ /bt-plan --heavy --parity @.agents/specs/<slug>/documents/<slug>_spec.md # numeric parity gates against the reference (slow)
16
+ /bt-plan --no-time-limit @.agents/specs/<slug>/documents/<slug>_spec.md # turn off the default TIME MATTERS mode
17
17
  ```
18
18
 
19
19
  - `--heavy` — Heavy Plan mode (below). `--parity` — plan numeric parity proof; also on when the spec says `proof: parity`. `--no-time-limit` — turn off TIME MATTERS mode (Ground rules). Strip flags, and any literal `TIME MATTERS`, first; they are never part of the brief.
@@ -22,7 +22,7 @@ Turn a feature spec into `.agents/specs/<feature-name>_plan.md`: an ordered chec
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 plan file is the only file you write. 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. 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.
@@ -35,7 +35,9 @@ Turn a feature spec into `.agents/specs/<feature-name>_plan.md`: an ordered chec
35
35
  4. Sibling-skill pattern (e.g. bt-design's 3D-Hero-Scroll): read that skill's reference **and templates** *(where skills load through a tool: `load_skill` + `read_skill_resource`, never a guessed path; where they are files: the skills directory this skill was loaded from, e.g. `~/.claude/skills/`, `~/.agents/skills/` or the project's equivalent)*. The plan **copies and configures the template engine — never re-implements it**; each behavioral option the spec records (e.g. `sweep: page`) becomes an Acceptance item stated in observable terms. Prefer copying and wiring the template as the first task, so later tasks only configure it.
36
36
  5. Too ambiguous to plan responsibly → ask the user. **Already built?** If the research shows some or all of the feature already exists, say so first and plan only what is missing (often just tests and the live check).
37
37
 
38
- **Quick Plan (no spec file):** after the analysis, ask a small round of high-leverage questions (scope, behavior, edge cases, which systems it touches); skip anything the brief or code already answers. Unanswered items fall back to: feature name from the brief (kebab-case); `spec_impact` and `size` inferred from the analysis; `proof: functional` unless `--parity`. List the assumptions in Codebase Analysis.
38
+ **Quick Plan (no spec file):** after the analysis, ask a small round of high-leverage questions (scope, behavior, edge cases, which systems it touches); skip anything the brief or code already answers. Unanswered items fall back to: feature name from the brief — the `<slug>`: lowercase kebab-case, `a-z 0-9 -` only, max 40 chars, with `-02`, `-03` … appended if `.agents/specs/<slug>/` already holds another feature; `spec_impact` and `size` inferred from the analysis; `proof: functional` unless `--parity`. List the assumptions in Codebase Analysis. **A Quick Plan is a creation point:** it creates the feature folder `.agents/specs/<slug>/` (with `documents/`), exactly as bt-spec would, and the plan, report and tests live there.
39
+
40
+ **The feature folder.** Every feature has one: `.agents/specs/<slug>/` holding `dashboard.html` (the feature dashboard), `documents/` (`<slug>_spec.md`, `<slug>_plan.md`, bt-execute's `<slug>_autopilot.md`, the dashboard data `<slug>_dashboard.js` and live status `<slug>_live.js`), `snapshots/` and `tests/`. From a spec, `<slug>` is its folder name. A **legacy flat spec** (`.agents/specs/<slug>_spec.md`) is read where it is and left there; the plan and report still go into the new `.agents/specs/<slug>/` folder, and the report's Spec link points back to the flat file.
39
41
 
40
42
  ## Step 2. Rules for a good plan
41
43
 
@@ -44,7 +46,7 @@ Execution time is mostly *how the work is proven*, not the code. Keep proof stro
44
46
  1. **Tasks are real units of work** — something a developer would commit on its own, with its tests. Guide: `small` 1–3 tasks, `medium` 3–8, `large` as needed. Merge tasks that touch the same code for the same purpose; split only when a task would not fit in one sitting. Going well past the guide needs a one-line reason in Codebase Analysis.
45
47
  2. **Phases.** Group tasks under `### Phase N — <name>`. bt-execute runs one independent verifier per phase. Small plan = one phase; otherwise 2–4 related tasks ending at a natural checkpoint.
46
48
  3. **`Verify level`** per task: `standard` (build, named tests, diff review) or `live` (needs the dev server, a browser, Unity or Blender to observe). Mark `live` whenever correctness shows only at runtime — rendering, UI, interaction, Unity↔Babylon parity. The last feature task carries one `live` end-to-end check of the whole feature when it has anything on screen — write it into that task's Acceptance, not as a separate task; a read-and-confirm check likewise belongs in the Acceptance of the task that made the change. bt-execute's verifier performs the live checks, and does all of a phase's live tasks in **one** session. So mark as many tasks `live` as truly need it, but never schedule a capture, screenshot or page session **per task** in the Steps — the phase gets one session covering all of them, and any second engine or full-resolution pass happens once, in the final end-to-end task. A plan with more planned looks than phases is the single most expensive mistake this skill can make. If a live check may be impossible where the plan runs (needs credentials, data or hardware), say in the task what to report instead.
47
- 4. **Named tests** with expected outcomes for every task that has a testable surface. No probe suites, fuzzing or mutation testing unless the risk calls for it.
49
+ 4. **Named tests** with expected outcomes for every task that has a testable surface, in test files under the feature folder's `tests/` (`.agents/specs/<slug>/tests/` — never a root `tests/` folder). No probe suites, fuzzing or mutation testing unless the risk calls for it.
48
50
  5. **Functional proof by default:** unit tests; for anything on screen, one look per visual phase — the running result in the browser, judged against the spec and DESIGN.md, or beside a reference image when one exists (a mockup, the original site, the Unity view) — on one browser/engine at reduced resolution, with any second engine checked once in the final end-to-end task; cheap value fixtures sampled once from a reference implementation where there is one. Keep Acceptance to what a user of the feature would notice. **Numeric parity gates** (pixel thresholds, repeats, several engines) only under `--parity` / `proof: parity` or when the brief states a number — and then planned to run once per phase (iteration inside the phase uses the quick look), never loosened.
49
51
  6. **Proportional safety.** When the spec requires a safety outcome (nothing unfinished reaches the user's folders, the app keeps working between tasks), pick the cheapest mechanism that achieves it — normally a feature branch, a build output the user's folders do not read, and one copy across at the end after the live check. Version control is the archive. Add staged promotions, per-step archives or hash records only if the brief asks for them by name.
50
52
  7. **Minimal exports.** A task's Steps re-export only the Unity project the task tests and only the scenes it works on, and only when the change alters that scene's export. Never write "re-export every scene" or "re-export all projects" for consistency — other scenes pick the change up at their next natural export. Name the scenes explicitly.
@@ -54,7 +56,7 @@ Execution time is mostly *how the work is proven*, not the code. Keep proof stro
54
56
 
55
57
  ## Step 3. Write the plan
56
58
 
57
- Print `✍️ [bt-plan] Writing .agents/specs/<feature-name>_plan.md …`. The file has, in order:
59
+ Print `✍️ [bt-plan] Writing .agents/specs/<slug>/documents/<slug>_plan.md …`. The file has, in order:
58
60
 
59
61
  **`## Codebase Analysis`** — what Step 1 found, citing real files; the SPEC.md sections the plan conforms to; `spec_impact`, `size`, `proof` (say which were inferred); Quick Plan assumptions.
60
62
 
@@ -66,7 +68,7 @@ Print `✍️ [bt-plan] Writing .agents/specs/<feature-name>_plan.md …`. The f
66
68
  - [ ] **T1** — <short imperative title>
67
69
  - Files: `path/one` (create), `path/two` (modify)
68
70
  - Details: <what to do>
69
- - Tests: `<test file>` — `<case>` → <expected outcome>; … (or "no testable surface — <why>")
71
+ - Tests: `.agents/specs/<slug>/tests/<test file>` — `<case>` → <expected outcome>; … (or "no testable surface — <why>")
70
72
  - Acceptance: <observable, checkable statements>
71
73
  - Verify level: standard
72
74
  ```
@@ -106,7 +108,7 @@ Rate each task by the **kind of work it does** (classify tasks, not the plan —
106
108
 
107
109
  These rates put 17 of the 21 runs inside the −30 % / +40 % range and 20 of 21 within 0.6–1.6× (the old flat `tasks × 17 + phases × 10`: 13 of 21 within 0.6–1.6×), and the misses ran fast, not slow. Under the flat rate, plans estimated themselves about **2.5× too high** when the work was mostly code and up to **2× too low** when it was Unity, parity or GPU work — wrong in both directions, so classify every task.
108
110
 
109
- To recalibrate later, read the `⏱` lines bt-execute writes to each `<plan>_autopilot.md` — they carry the plan's estimate, active minutes per phase and per run, and waits already separated out.
111
+ To recalibrate later, read the `⏱` lines bt-execute writes to each `documents/<slug>_autopilot.md` (older runs: `<plan>_autopilot.md` beside a flat plan) — they carry the plan's estimate, active minutes per phase and per run, and waits already separated out.
110
112
 
111
113
  Write a table `Phase | Tasks | Kind (code / live / Unity) | What makes it slow | Estimate`, then one **Total** line in hours (days only if over ~16 h), the `--strict` multiplier, and the biggest uncertainty in one line. If the total averages above ~40 or below ~6 min per task, the estimate is wrong before the plan is: re-check it. An estimate, never a pin.
112
114
 
@@ -123,11 +125,22 @@ Each task above is a checkbox. To implement:
123
125
  - Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
124
126
  ```
125
127
 
128
+ ## Step 4. Write the dashboard (planned state)
129
+
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
+
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).
135
+
136
+ 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
+
126
138
  Then **stop**. Final message: a short summary, the estimated time, and:
127
139
 
128
140
  ```
129
- Plan written to .agents/specs/<feature-name>_plan.md — <n> tasks, estimated <total range> of agent time
130
- Run a single task with `bt-execute .agents/specs/<feature-name>_plan.md T1`, or every task with `bt-execute .agents/specs/<feature-name>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
141
+ Plan written to .agents/specs/<slug>/documents/<slug>_plan.md — <n> tasks, estimated <total range> of agent time
142
+ Dashboard: .agents/specs/<slug>/dashboard.html (open it in a browser; bt-execute keeps it current)
143
+ Run a single task with `bt-execute .agents/specs/<slug>/documents/<slug>_plan.md T1`, or every task with `bt-execute .agents/specs/<slug>/documents/<slug>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
131
144
  ```
132
145
 
133
146
  ## Heavy Plan mode (`--heavy`)
@@ -142,4 +155,4 @@ Sections, in order: `## Codebase Analysis` (plus the test baseline) · **`## Dec
142
155
  `- **D3 — <decision, stated as a fact>.** <why / precedent with file:line> Rejected: <alternative> (<why not>). Binds: T4, T7.`
143
156
  - **`## Design Reference`** — the shared blueprint, written as code wherever the code *is* the decision: File map (path · create/modify/delete · responsibility · tasks) · Module boundaries · Interfaces & contracts (full signatures, in the project's language) · Data shapes & state · Control flow · Algorithms & formulas with their constants · Error & edge-case policy (`when X → Y`) · Conventions to mirror (verbatim, with `file:line`) · API usage · Test strategy. Omit a heading only if it truly does not apply. **All of it is written to the Agent Reference's Coding Practices — ENFORCED**: every interface, signature, data shape, constant and snippet uses meaningful full-word names, strict types (JSDoc type tags in JavaScript) and meaningful JSDoc, and reads cleanly to a developer new to the project. Mirror the structure of existing conventions, but never copy one- or two-letter names or obfuscated code into a new name.
144
157
  - **Heavy task block** — adds to the standard block: `Depends on:` · `Applies:` (the D-numbers and Design Reference entries it must match) · `Steps:` numbered instructions, each naming the file, a real anchor (prefer quoted code over bare line numbers) and the change · `Code:` when the code is the decision, written to the Coding Practices exactly as it must ship · `Do not:` the tempting wrong turns · `Verify:` commands with expected output. `Depends on`, `Files`, `Applies`, `Steps`, `Tests`, `Acceptance`, `Verify` and `Verify level` are required on every heavy task. A task never says "like T3" — it cites the Design Reference; a name, signature or value a step introduces is added to the Design Reference first, so task 40 types what task 3 typed. Say what keeps the app working between tasks (shim, flag) and which task removes it. The `Update SPEC.md` task carries the exact text to write.
145
- - **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.
158
+ - **Cold-context audit (one pass).** After the draft, launch one fresh read-only subagent (or re-read it yourself) with: *"You have never seen this repo. For every task, check the plan against the real files and list each point where you would have to decide, guess or look something up: a missing signature, name, value or anchor; an anchor that does not match the file; a goal stated instead of an instruction; a dependence on remembering an earlier task; a name used in a task but not defined in the Design Reference; a test without an expected outcome; a Verify without an expected output; vague words ("appropriate", "as needed", "etc."); a task that would not fit in one sitting; an edge case with no decided behavior; an API call not shown; any snippet, signature or name that breaks the Agent Reference's Coding Practices — ENFORCED (code in the wrong language for the project, loose typing or needless `any`, one- or two-letter or obfuscated names, code-golf tricks, code a developer new to the project could not read and maintain). Also flag micro-tasks to merge, ceremony tasks nobody asked for, and pinned counts later tasks will change. Report `T<n> · step · what is missing`. Change nothing."* Fix every gap in the plan, ask the user what only they can answer, list any gap you chose not to resolve (with why) in Codebase Analysis, write the dashboard (Step 4) from the finished plan, then finalize: `💾 [bt-plan] Plan finalized — <n> tasks, <k> decisions`, and report the two or three most consequential decisions and anything left unresolved.
@@ -23,14 +23,14 @@ Turn a short feature idea into a spec file that `bt-plan` can plan from. Follow
23
23
  ## Ground rules
24
24
 
25
25
  - **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 spec 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-spec] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-spec] No time limit`, and do not add it). Speed never skips a required step or lowers the quality of the spec.
26
- - **Planning only.** Research read-only and write only the spec file (plus `SPEC.md` from the scaffold, if the user says yes below). No source edits, no builds, no tests, no other shell commands.
26
+ - **Planning only.** Research read-only and write only the spec file into the new feature folder (plus `SPEC.md` from the scaffold, if the user says yes below, and a builder skill's intake file in the same `documents/` folder — Step 3). No source edits, no builds, no tests, no other shell commands.
27
27
  - **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 — it is the authority for conventions and API; fetch its 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.
28
28
  - **Say what you are doing.** Before any step that takes more than a few seconds (a fetch, a big read, subagents) print one short line — `🔎 [bt-spec] <what> …` — and one line when it returns. A silent run looks like a hang and gets cancelled.
29
29
  - **Subagents:** running this skill is the user's request to use them where this skill says so. Use whatever subagent tool your host provides (its name varies by host — e.g. `Agent` or `Task`); if there is none, do the work inline and say so. Tell research subagents they need not fetch the Agent Reference.
30
30
 
31
31
  ## Step 1. Arguments, name, branch
32
32
 
33
- From the flag-stripped brief derive `feature_title` (Title Case), `feature_slug` (lowercase kebab-case, `a-z 0-9 -` only, max 40 chars) and `branch_name` = `project/feature/<feature_slug>`. If you cannot infer a sensible title, ask. Make a first estimate of the feature's `size` (defined in Step 5) — it sizes the research in Step 2.
33
+ From the flag-stripped brief derive `feature_title` (Title Case), `feature_slug` (lowercase kebab-case, `a-z 0-9 -` only, max 40 chars) and `branch_name` = `project/feature/<feature_slug>`. If `.agents/specs/<feature_slug>/` already holds another feature, append `-02`, `-03` … to the slug. If you cannot infer a sensible title, ask. Make a first estimate of the feature's `size` (defined in Step 5) — it sizes the research in Step 2.
34
34
 
35
35
  Git is optional. **Where git is available:** stop now if the working tree has uncommitted or untracked files (ask the user to commit or stash); switch to a new branch `branch_name` (if taken, append `-01`, `-02` …) just before writing the spec in Step 5, so a conflict stop leaves no empty branch behind. **Where it is not** (no binary, sandboxed host such as the Babylon Toolkit App Builder): skip this silently — the branch name recorded in the spec header is the deliverable. Do not mention git as missing.
36
36
 
@@ -49,7 +49,7 @@ If the feature is built on a pattern owned by another skill (bt-design's 3D-Hero
49
49
  - Record the pattern's behavioral config as explicit Functional Requirements, using the sub-skill's **own names and defaults, unchanged** (e.g. 3D-Hero-Scroll `sweep: page` — PLAY glides to the document bottom and END jumps there). State any override and why.
50
50
  - Keep a behavioral option separate from the feature's route/DOM scope — `sweep` is not "which page it lives on".
51
51
  - List which optional controls are in or out.
52
- - For a named builder skill, run **only its intake steps** here (bt-hero Steps 1–2 → the hero brief; bt-prototype Steps 1–2 → the `_directions.md` manifest) and fold the result in; resolve its questions now so nothing prompts later. The builder contributes intake only — this spec → plan → execute loop owns the build and the verification.
52
+ - For a named builder skill, run **only its intake steps** here (bt-hero Steps 1–2 → the hero brief, written to `.agents/specs/<feature_slug>/documents/<feature_slug>_hero-brief.md`; bt-prototype Steps 1–2 → the `_directions.md` manifest) and fold the result in; resolve its questions now so nothing prompts later. The builder contributes intake only — this spec → plan → execute loop owns the build and the verification.
53
53
 
54
54
  ## Step 4. `--grill-me` (only with the flag)
55
55
 
@@ -67,7 +67,17 @@ Interview the user until the design is decided, after Steps 2–3 so questions a
67
67
  - **`size`** — `small` ≈ 1–2 hours by hand, one system; `medium` ≈ a day, a few systems; `large` ≈ multi-day, multi-system, or Unity/Blender/export pipeline work. Classify by the real work.
68
68
  - **`proof`** — `functional` (default) or `parity` (only with `--parity`, or when the brief itself states a numeric bar). Under `functional`, Acceptance Criteria are what a user would notice — it works, it looks and feels right (against DESIGN.md, or next to a reference when there is one), the console is clean — proven by tests and a look at the running result. Never invent numeric pixel thresholds, repeat counts, per-engine matrices or evidence archives: how a feature is proven is most of what it costs to build.
69
69
 
70
- Print `✍️ [bt-spec] Drafting .agents/specs/<feature_slug>_spec.md …`, then write the spec to `.agents/specs/<feature_slug>_spec.md` using the project's `FEATURE.md` template if it exists (add any header field or section below that it lacks), otherwise this structure. No implementation detail or code examples.
70
+ **The feature folder.** This spec creates the feature's folder, which holds everything about it from here on:
71
+
72
+ ```
73
+ .agents/specs/<feature_slug>/
74
+ dashboard.html the feature dashboard (bt-plan writes it; bt-execute keeps it current)
75
+ documents/ <feature_slug>_spec.md, _plan.md, _autopilot.md, _dashboard.js, _live.js, and any builder intake file
76
+ snapshots/ the meaningful snapshots of the build, shown by the dashboard
77
+ tests/ every test the plan's tasks write
78
+ ```
79
+
80
+ Print `✍️ [bt-spec] Drafting .agents/specs/<feature_slug>/documents/<feature_slug>_spec.md …`, then write the spec to `.agents/specs/<feature_slug>/documents/<feature_slug>_spec.md` (creating the folders) using the project's `FEATURE.md` template if it exists (add any header field or section below that it lacks), otherwise this structure. No implementation detail or code examples.
71
81
 
72
82
  ```markdown
73
83
  # Spec for <feature-name>
@@ -112,7 +122,7 @@ proof: <functional|parity>
112
122
  - ...
113
123
 
114
124
  ## Testing Guidelines
115
- Create test file(s) in ./tests for these named cases, without going heavy:
125
+ Create test file(s) in .agents/specs/<feature-name>/tests/ for these named cases, without going heavy:
116
126
  - <case> → <expected outcome>
117
127
  ```
118
128
 
@@ -120,7 +130,8 @@ Create test file(s) in ./tests for these named cases, without going heavy:
120
130
 
121
131
  ```
122
132
  Branch: <branch_name>
123
- Spec file: .agents/specs/<feature_slug>_spec.md
133
+ Spec file: .agents/specs/<feature_slug>/documents/<feature_slug>_spec.md
134
+ Feature folder: .agents/specs/<feature_slug>/ (bt-plan adds the plan and the dashboard)
124
135
  Title: <feature_title>
125
136
  ```
126
137