@babylonjs-toolkit/agent 1.1.28 → 1.1.33
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 +12 -3
- package/package.json +1 -1
- package/skills/bt-atlas/SKILL.md +23 -20
- package/skills/bt-design/references/3d-hero-docs.md +8 -8
- package/skills/bt-design/references/3d-hero-scroll.md +26 -21
- package/skills/bt-execute/SKILL.md +52 -309
- package/skills/bt-gauntlet/SKILL.md +3 -3
- package/skills/bt-gauntlet/references/spec-composition.md +2 -2
- package/skills/bt-gauntlet/references/target-images.md +22 -17
- package/skills/bt-gauntlet/references/unity-pipeline.md +6 -5
- package/skills/bt-hero/SKILL.md +2 -2
- package/skills/bt-landing/SKILL.md +1 -1
- package/skills/bt-plan/SKILL.md +64 -315
- package/skills/bt-prototype/SKILL.md +3 -3
- package/skills/bt-spec/SKILL.md +81 -326
package/skills/bt-hero/SKILL.md
CHANGED
|
@@ -37,7 +37,7 @@ Whatever is present is used verbatim; the intake resolves the rest (Step 1). **T
|
|
|
37
37
|
Every piece of a 3D hero scroll belongs to exactly one tier. This is the rule that keeps the intake small and the output deterministic:
|
|
38
38
|
|
|
39
39
|
- **Tier 1 — Invariants.** How the mechanic works. Owned by bt-design's reference and templates; never asked, never in the brief, never overridable: muted footage, the all-intra scrub encode, blob preload, veiled cuts, film-speed autoplay, cancel semantics, the `HS_CONFIG`/markup syntax, and the **verification protocol — which always runs, without being requested.**
|
|
40
|
-
- **Tier 2 — Defaults.** Sensible values supplied silently; the user may override any of them in their input (recorded in the brief's `Overrides` section): aspect ratio (default 16:9), clip duration (**backend-derived — probe the configured video model's real output; never assume a number**), the 4-beat REVEAL → MOTION → SHIFT → FINALE arc, `sweep: page`, controls all-on (`sweep: page`) / HUD+PLAY (`sweep: hero`), the scroll-length formula, poster = first film frame, generation backend (**KIE MCP by default; Higgsfield
|
|
40
|
+
- **Tier 2 — Defaults.** Sensible values supplied silently; the user may override any of them in their input (recorded in the brief's `Overrides` section): aspect ratio (default 16:9), clip duration (**backend-derived — probe the configured video model's real output; never assume a number**), the 4-beat REVEAL → MOTION → SHIFT → FINALE arc, `sweep: page`, controls all-on (`sweep: page`) / HUD+PLAY (`sweep: hero`), the scroll-length formula, poster = first film frame, generation backend (**KIE MCP by default; the Higgsfield CLI when that is what's set up or the user names it**; see bt-design `3d-hero-scroll.md` §2 for the Higgsfield mapping).
|
|
41
41
|
- **Tier 3 — Creative slots.** The only things intake deals in — the eight slots below.
|
|
42
42
|
|
|
43
43
|
If it's how the mechanic works → Tier 1. If it's a value that could legitimately differ per project → Tier 2. If it's a creative decision about *this* product → Tier 3.
|
|
@@ -62,7 +62,7 @@ Then resolve every unfilled slot by exactly one of two paths:
|
|
|
62
62
|
- **Enough to fly** — the input contains a usable star (an idea sentence, or an image/video whose subject is clear): fill every remaining slot from its default, ask **nothing**, and proceed. This is the one-shot path.
|
|
63
63
|
- **Not enough to fly** — empty input, or fragments with no discernible star: ask **only the unanswered questions** — inline, conversationally, as ONE compact numbered list (never one-at-a-time interrogation, never a structured question UI). Tell the user loose prose, partial answers, and "you pick" are all fine. What they answer is used; what they skip gets the default. Then proceed — do not re-confirm.
|
|
64
64
|
|
|
65
|
-
**Footage feasibility check:** if there is no provided footage AND no image/video generation backend configured (KIE MCP — the default, Higgsfield
|
|
65
|
+
**Footage feasibility check:** if there is no provided footage AND no image/video generation backend configured (KIE MCP — the default, Higgsfield CLI, built-in generation, …), STOP — this pattern is wrong without footage; recommend a static hero instead (per the bt-design reference intake).
|
|
66
66
|
|
|
67
67
|
## Step 2 — Write the hero brief (the save file)
|
|
68
68
|
|
|
@@ -113,7 +113,7 @@ The Layout law from Step 2 binds these surfaces too — full-bleed, responsive,
|
|
|
113
113
|
|
|
114
114
|
If the platform's `generate_image` / `generate_video` tools are available on this turn, use them to make the design beautiful: a hero background, a logo/wordmark, splash-adjacent accents (16:9 for wide heroes, 1:1 for badges/logos; png when alpha matters). Make ALL generate calls FIRST, in ONE parallel round, before writing any files; reference the returned `/assets/generated/…` paths exactly as returned (the one exception to never-invent-an-asset-path) — the renders land in the background, so every surface must look finished while they do (styled color/gradient fallback behind each image, never a blank box). At most ONE short looping hero video, and only if it truly elevates the design — video costs the user hundreds of credits. If the tools are absent, design with CSS + the images on disk instead.
|
|
115
115
|
|
|
116
|
-
**Backend mapping (Claude Code and other MCP hosts).** Where no platform-native `generate_*` is present, use the **KIE MCP** servers by default (`web-kie-servers.md`): pass `out_path` under the project's `assets/generated/` folder and reference that path. When **Higgsfield
|
|
116
|
+
**Backend mapping (Claude Code and other MCP hosts).** Where no platform-native `generate_*` is present, use the **KIE MCP** servers by default (`web-kie-servers.md`): pass `out_path` under the project's `assets/generated/` folder and reference that path. When the **Higgsfield CLI** is the set-up or requested backend (`web-higgsfield-cli.md`), generate through the reference's `scripts/hf-generate.mjs` wrapper, which saves each result to `--out` (for example `node scripts/hf-generate.mjs gpt_image_2_5 --prompt "…" --aspect_ratio 16:9 --resolution 2k --out assets/generated/hero-bg.png`). Launch all the calls in ONE parallel round in the background (shell `&`), write the files with their fallbacks in place, then `wait`. Image results are **PNG**, so reference `.png` paths (the wrapper saves `--out x.jpg` as `x.png` and reports it). Never reference a Higgsfield CDN URL. Run `--cost` first and state the total.
|
|
117
117
|
|
|
118
118
|
Generated art goes on the LANDING PAGE — never on the splash/preloader (Step 3's lightweight rule). Art direction for every generate call comes from `DESIGN.md` — prompt the renders in its palette and atmosphere so the art belongs to the same design as the CSS around it.
|
|
119
119
|
|
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -1,356 +1,84 @@
|
|
|
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.
|
|
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."
|
|
4
4
|
allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Agent, Task
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Turn a feature spec into `_specs/<feature-name>_plan.md`: an ordered checklist of tasks that `bt-execute` runs. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
|
|
8
8
|
|
|
9
|
-
Use the user’s message after the skill name as the `arguments`.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Invocation
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
/bt-plan [--heavy] <feature-spec> <optional-brief>
|
|
17
|
-
```
|
|
18
|
-
- **`<feature-spec>`** — the feature spec file to create a plan for. This is the *blueprint*.
|
|
19
|
-
- **`<optional-brief>`** — the brief or instructions for generating the plan. This is the *variable*.
|
|
20
|
-
- **`--heavy`** *(optional flag)* — **Heavy Plan mode**: write the plan as the feature's complete shared memory (a numbered Decisions log, a Design Reference, self-contained task blocks) and audit it from a cold context before finalizing, so a long run of tasks executed in fresh contexts stays cohesive. See **Heavy Plan mode**. Without the flag, the plan is produced exactly as described in Step 2. The flag may appear anywhere in the arguments and is never part of the brief — **strip it first**, then resolve the rest below.
|
|
21
|
-
- Never guess a file path or URL. Resolve the (flag-stripped) arguments as follows:
|
|
22
|
-
- **Both a spec file and a brief** → normal full planning.
|
|
23
|
-
- **A spec file only** → normal full planning; the brief defaults to "Generate a detailed implementation plan".
|
|
24
|
-
- **A brief only, no spec file** → **Quick Plan mode** (see below). Do not ask *for a spec file* — treat the brief as the feature request. But because there is no spec, **interview the user with clarifying questions** to pin down the requirements before finalizing the plan.
|
|
25
|
-
- **Neither** → ask the user for at least a brief before starting.
|
|
26
|
-
|
|
27
|
-
Example:
|
|
28
|
-
```
|
|
29
|
-
/bt-plan → @feature_spec.md → "Generate a detailed implementation plan"
|
|
30
|
-
/bt-plan → "add a settings toggle to mute all game audio" # no spec file → Quick Plan mode, automatically
|
|
31
|
-
/bt-plan --heavy @feature_spec.md # Heavy Plan mode: decision-complete plan for a long run
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Quick Plan mode (no feature spec file)
|
|
37
|
-
|
|
38
|
-
> 🛑 **"Quick" refers ONLY to skipping the spec file — never to skipping steps, and NEVER to executing the plan.**
|
|
39
|
-
> Quick Plan is still **PLANNING MODE**. It ends the moment `_specs/<feature-name>_plan.md` is written. Do **NOT** implement any task, do **NOT** edit application/source files, do **NOT** run builds or tests, and do **NOT** continue into the tasks you just wrote — not even the first one, not even if the tasks look small, obvious, or trivially automatable. The user executes tasks separately with the **bt-execute** skill, deliberately, with a clean context between steps. Auto-executing destroys that workflow.
|
|
40
|
-
|
|
41
|
-
When invoked with a brief but **no feature spec file**, produce a plan from the brief. Do not stop to ask *for a spec file* — instead **interview the user** to build a **mini-spec** from their answers, then plan from that mini-spec exactly as you would from a real spec file. A spec is largely the product of that Q&A; skipping the file must not mean skipping the questions. Everything the skill would normally read from the feature spec is supplied by sensible defaults only as a **last-resort fallback** for anything left unanswered:
|
|
42
|
-
|
|
43
|
-
| Normally from the spec | Quick Plan default |
|
|
44
|
-
| --- | --- |
|
|
45
|
-
| Feature name (for `<feature-name>_plan.md`) | Derive a short kebab-case name from the brief (e.g. "mute all game audio" → `mute-game-audio`). |
|
|
46
|
-
| Full feature requirements | Use the brief itself as the requirements, expanded by the Step 1 codebase analysis. |
|
|
47
|
-
| `spec_impact: yes/no` | **Infer** it from the Step 1 analysis: `yes` if the feature adds/changes a system, convention, dependency, or architectural decision; otherwise `no`. |
|
|
48
|
-
| `Project Spec Alignment` section | Derive alignment directly from root `SPEC.md` + the analysis. |
|
|
49
|
-
| `size: small/medium/large` | **Infer** it from the brief + analysis per *Size the plan to the feature*. |
|
|
50
|
-
|
|
51
|
-
**The one and only difference in Quick Plan mode is operating without a spec file** — the interview produces a mini-spec that stands in for it. Everything else is identical to a normal run: Step 1's comprehensive codebase analysis (including reading root `SPEC.md`) runs in full, the plan document has the same structure, the SPEC.md write-back task is still appended when the inferred `spec_impact` is `yes`, and the run still **STOPS after writing the plan file**. Nothing about Quick Plan grants permission to implement.
|
|
52
|
-
|
|
53
|
-
Emit one visible status line when this path is taken: `⚡ [bt-plan] Quick Plan mode — no feature spec file; interviewing, then planning from the brief`.
|
|
54
|
-
|
|
55
|
-
### Finishing a Quick Plan (hard stop)
|
|
56
|
-
|
|
57
|
-
After writing `_specs/<feature-name>_plan.md`, **STOP**. Your final response must be a short summary of the plan plus the exact next-step hint below — and nothing else. Do not begin T1. Do not offer to "go ahead and start". If the user wants execution, they will invoke bt-execute themselves:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
Plan written to _specs/<feature-name>_plan.md — <n> tasks, estimated <total range> of agent time
|
|
61
|
-
Run a single task with `bt-execute _specs/<feature-name>_plan.md T1`, or every task with `bt-execute _specs/<feature-name>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Interview before planning (Quick Plan)
|
|
65
|
-
|
|
66
|
-
Because there is no spec, the clarifying questions the spec process would have asked are now **your** responsibility. After the Step 1 analysis (so your questions are grounded in the real codebase, not generic), and **before** writing the plan:
|
|
67
|
-
|
|
68
|
-
- Ask the user a focused round of clarifying questions covering the things that most change the plan: scope and non-goals, target UX/behavior, edge cases, which existing systems/files it should integrate with, constraints, and — critically — anything ambiguous in the brief or where the codebase suggests more than one reasonable approach.
|
|
69
|
-
- Prefer a small number of high-leverage questions (grouped, easy to answer) over interrogating the user. Do not ask about things the brief or codebase already make clear.
|
|
70
|
-
- Only fall back to the defaults table for items the user leaves unanswered or explicitly says "you decide". Never silently pick a default when a quick question would materially improve the plan.
|
|
71
|
-
- If the user declines to answer or says "just make the plan", proceed with the defaults and state which assumptions you made in the plan's Codebase Analysis section.
|
|
72
|
-
|
|
73
|
-
The goal is the same as a spec: a plan optimized to what the user actually wants — reached by asking, not by guessing.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Heavy Plan mode (`--heavy`)
|
|
78
|
-
|
|
79
|
-
Run this mode **only when the `--heavy` flag is present**. Without it, nothing in this section applies and the plan is produced exactly as Step 2 describes.
|
|
80
|
-
|
|
81
|
-
Heavy Plan mode changes **only two things**: the structure of the plan document (Step 2 below is replaced by the *Heavy plan document* structure in this section) and one extra step before finalizing (the *cold-context audit*). Everything else — the argument rules, Quick Plan mode (yes, `--heavy` combines with a brief-only Quick Plan), the subagent and narration rules, the Agent Reference requirement, planning-only mode, and the full Step 1 analysis — runs unchanged. Emit one visible status line when this path is taken: `🏋️ [bt-plan] Heavy Plan mode — writing a decision-complete plan with a cold-context audit`.
|
|
82
|
-
|
|
83
|
-
### Why: the plan is the memory
|
|
84
|
-
|
|
85
|
-
A long plan is not executed in one sitting. It can hold **fifty or more tasks**, run over **several days**, and each task is typically executed by **bt-execute in a fresh context** (`/clear` between tasks, new sessions, resumed runs). The only thing that survives from one task to the next is the plan file. Whatever is not written in it is gone: the executor of task 40 has never seen task 3, does not know what it decided, and will re-derive conventions from the codebase — possibly differently. Across a long run, that is how features drift: two naming styles, two error-handling patterns, a helper written twice, an interface that changed shape halfway through.
|
|
86
|
-
|
|
87
|
-
So a heavy plan is the **complete, shared memory** of the feature: every decision, every name, every signature, every pattern to mirror, written once, in one place, and cited from every task that depends on it. **The test:** could an engineer with a fresh context, who has never seen this repo or the earlier tasks, open task 40 and produce code consistent with tasks 1–39 — same names, same shapes, same conventions — using only the plan? If they would have to look at what earlier tasks produced and infer the pattern, the plan is not carrying the memory.
|
|
88
|
-
|
|
89
|
-
**What a heavy plan must decide and record, rather than leave to be re-derived per task:**
|
|
90
|
-
|
|
91
|
-
| Class | What the plan must record |
|
|
92
|
-
| --- | --- |
|
|
93
|
-
| Architecture | module boundaries, which layer owns what, dependency direction, where state lives, sync vs async, event vs call |
|
|
94
|
-
| File layout | every file created / modified / deleted, by exact path; each new file's responsibility; where in an existing file new code goes (an anchor: "after `foo()`", "inside the `switch` at `:412`") |
|
|
95
|
-
| Interfaces & contracts | full signatures of every new/changed function, class, type, interface, event name, message shape, config key, CLI flag, route — written as code, not prose, so every task types the same thing |
|
|
96
|
-
| Data shapes & state | schemas, field names + types, defaults, invariants, persistence format, migration behaviour |
|
|
97
|
-
| Algorithms & formulas | pseudocode or real code for anything non-obvious: math, ordering, caching, retry, timing, physics tuning values |
|
|
98
|
-
| Naming | the actual names of the new things (classes, functions, fields, files, CSS classes, events, test names) — chosen once, following the repo's conventions |
|
|
99
|
-
| Error & edge-case policy | for every edge case the spec lists (and every one the analysis found): the decided behaviour, written as "when X → do Y" |
|
|
100
|
-
| Dependencies | exactly which packages/versions are added, or an explicit "no new dependencies" |
|
|
101
|
-
| Sibling-skill behavioural config | every option of a sibling-skill pattern (e.g. 3D-Hero-Scroll `sweep`) with its value, not just its name |
|
|
102
|
-
| Test design | the test file(s), the harness/pattern to copy, the named cases with expected outcomes, and the exact command to run |
|
|
103
|
-
| Ordering & dependencies | which tasks depend on which; what must keep working between tasks (temporary shims, feature flags) and which later task removes them |
|
|
104
|
-
|
|
105
|
-
**Write the code when the code IS the decision.** This skill never edits source files, but a heavy plan may (and should) put code *inside the plan*: full signatures, type definitions, data schemas, the tricky 20-line algorithm, a config block, a test skeleton. When the shape of the code is the decision, prose is a lossy encoding of it — write the code once here, and every task that needs it copies the same thing. Leave to prose only the mechanical glue ("wire `X` into `Y`'s constructor the same way `Z` is at `:88`").
|
|
106
|
-
|
|
107
|
-
**Self-contained tasks, sized to real work.** A task should fit in one fresh context: one clear outcome, everything it needs either in its own block or cited by name from the Decisions and Design Reference. Split a task when it would not fit in one sitting — not merely because it touches several files. *Size the plan to the feature* (task budget, no ceremony tasks, phases, `Verify level`, no brittle pins) applies to heavy plans too: every task and phase costs a verification round at execution time. Heavy mode fits whenever execution runs in fresh contexts or on a cheaper model than planning — any feature size. The task budget still follows the spec's `size`.
|
|
108
|
-
|
|
109
|
-
**Do the API homework once, here.** When a task uses a Babylon Toolkit component or BabylonJS API, show the exact call the way the Agent Reference (or its sub-document) shows it, in the Design Reference › *API usage* section — so every task across the run uses the same API the same way instead of each fresh context rediscovering it. Fetch the relevant sub-documents during Step 1 and copy the correct usage into the plan.
|
|
110
|
-
|
|
111
|
-
**Ask now, while the whole feature is in view.** Anything ambiguous that Step 1 or the interview surfaces is resolved here, with the user if necessary — a question deferred to execution gets answered by whichever task happens to hit it, in isolation, without the context to answer it consistently.
|
|
112
|
-
|
|
113
|
-
### Step 1 additions in Heavy Plan mode
|
|
114
|
-
|
|
115
|
-
The analysis is the same eight points; ask for **plan-grade detail** when running it. Exploration subagents (or you, on the sequential path) should return `file:line` references, the real signatures of the functions the feature will call or change, and verbatim snippets of the conventions to mirror (the actual pattern, ten to thirty lines, with its location) — not summaries like "uses a manager pattern". Also carry forward the feature spec's `Decisions` entries and note its `Open Questions` (each gets resolved in the plan's `## Decisions`), and establish the **test baseline** (command, current pass/fail state, which failures are pre-existing), so a task run days later can tell new failures from old ones.
|
|
116
|
-
|
|
117
|
-
### Heavy plan document
|
|
118
|
-
|
|
119
|
-
Emit `✍️ [bt-plan] Writing draft _specs/<feature-name>_plan.md …` before writing, and `💾 [bt-plan] Draft written — _specs/<feature-name>_plan.md (<n> tasks)` once the file is saved. The document has **five required sections, in this order** (plus the `## Estimated execution time` section before the last). A plan missing any of them is invalid; do not produce one.
|
|
120
|
-
|
|
121
|
-
**1. `## Codebase Analysis`** — exactly as in Step 2 (the Step 1 findings with `file:line` citations and the SPEC.md alignment note), plus the **test baseline** and, in Quick Plan mode, the **interview answers** that stand in for the spec.
|
|
122
|
-
|
|
123
|
-
**2. `## Decisions`** — the feature-scoped decision log; the part of the plan that keeps task 40 consistent with task 3. One entry per decision, numbered `D1`, `D2`, … so tasks can cite them. Carry every entry from the feature spec's `Decisions` section forward (keep its wording, add the D-number), then add every decision *you* made while planning — architecture, layout, naming, algorithms, error policy, test strategy — using the table above as the checklist. Every entry has the same shape:
|
|
124
|
-
|
|
125
|
-
```markdown
|
|
126
|
-
- **D3 — <decision, stated as a fact>.** <why: the deciding constraint, or the precedent in the codebase with file:line>
|
|
127
|
-
Rejected: <alternative> (<why not>). Binds: T4, T7.
|
|
128
9
|
```
|
|
10
|
+
/bt-plan [--heavy] [--parity] <feature-spec> <optional-brief>
|
|
129
11
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- **File map** — a table of every file the feature creates, modifies, or deletes: `path | create/modify/delete | responsibility | touched by tasks`.
|
|
135
|
-
- **Module boundaries** — what owns what, which direction dependencies point, where state lives. A short ASCII diagram is welcome where it clarifies flow.
|
|
136
|
-
- **Interfaces & contracts** — every new or changed function, class, type, interface, event, message, config key, or route, **written as code in the project's language** with full signatures, parameter types, return types and a one-line doc comment. These are the exact names every task will type.
|
|
137
|
-
- **Data shapes & state** — schemas / type definitions, defaults, invariants, persistence format.
|
|
138
|
-
- **Control flow** — the key sequences, numbered ("1. `onPointerDown` → 2. `#pick()` → 3. …"), including what happens on the failure branches.
|
|
139
|
-
- **Algorithms & formulas** — pseudocode or real code for anything non-obvious, with the constants and tuning values decided (`offset = max(halfWidth + 4, 18)`, not "a sensible offset").
|
|
140
|
-
- **Error & edge-case policy** — one line per edge case: `when <X> → <Y>`.
|
|
141
|
-
- **Conventions to mirror** — verbatim snippets of the repo's existing pattern with `file:line`, one per convention the feature must copy (component registration, debug-drawing pattern, test harness, styling tokens from `DESIGN.md`, …).
|
|
142
|
-
- **API usage** — for every Babylon Toolkit / BabylonJS / third-party API the feature calls, the exact call as the Agent Reference (or the library docs) shows it.
|
|
143
|
-
- **Test strategy** — the test file(s) to create or extend, the harness/pattern to copy (with `file:line`), how to run them, and the baseline to compare against.
|
|
144
|
-
|
|
145
|
-
**4. `## Tasks`** — the ordered checklist, numbered `T1`, `T2`, `T3` … in dependency order with GitHub-style checkboxes, grouped under `### Phase N — <name>` headings, each task implementable and verifiable on its own in a fresh context. Every task uses this block. Fields marked **required** must be present on every task; the others are omitted only when they genuinely have nothing to say.
|
|
146
|
-
|
|
147
|
-
```markdown
|
|
148
|
-
## Tasks
|
|
149
|
-
|
|
150
|
-
- [ ] **T7** — <short imperative title>
|
|
151
|
-
- Depends on: T3, T5 # required (write "none" for the first task)
|
|
152
|
-
- Files: `src/foo.ts` (create), `src/bar.ts` (modify — `Bar.init()`), `src/old.ts` (delete) # required
|
|
153
|
-
- Applies: D2, D5 · Design Reference › Interfaces › `FooService` · Conventions to mirror › debug drawing # required — what this task must stay consistent with
|
|
154
|
-
- Steps: # required — numbered, concrete, one action each
|
|
155
|
-
1. In `src/bar.ts`, directly after the `import` block, add `import { FooService } from "./foo";`.
|
|
156
|
-
2. In `Bar.init()` (currently `src/bar.ts:41-58`), after the line `this.scene = scene;`, add `this.foo = new FooService(scene, { mode: "page" });`.
|
|
157
|
-
3. Create `src/foo.ts` with the code in **Code** below.
|
|
158
|
-
4. …
|
|
159
|
-
- Code: # when the code is the decision: full or skeleton code, in the project's language
|
|
160
|
-
```ts
|
|
161
|
-
export class FooService { … }
|
|
162
|
-
```
|
|
163
|
-
- Do not: … # the tempting wrong turns: "do not add a second guard in pull()", "do not touch the metadata override"
|
|
164
|
-
- Tests: `tests/foo.test.ts` (create, copy harness from `tests/bar.test.ts:1-30`) — # required unless the task has no testable surface, in which case say so
|
|
165
|
-
- `constructs with page mode by default` → `service.mode === "page"`
|
|
166
|
-
- `throws on a null scene` → rejects with `TypeError`
|
|
167
|
-
- run: `npm test -- tests/foo.test.ts`
|
|
168
|
-
- Acceptance: <observable, checkable statements — what is true when this task is done> # required
|
|
169
|
-
- Verify: `npm test -- tests/foo.test.ts` → both named cases pass · `npx tsc --noEmit` → no errors · `grep -n "new FooService" src/bar.ts` → 1 hit # required — commands + expected output (never an absolute suite count)
|
|
170
|
-
- Verify level: standard # required — `standard` or `live` (see Size the plan to the feature)
|
|
12
|
+
/bt-plan @_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 @_specs/feature_spec.md # decision-complete plan for a long or cheaper-model run
|
|
15
|
+
/bt-plan --heavy --parity @_specs/feature_spec.md # numeric parity gates against the reference (slow)
|
|
171
16
|
```
|
|
172
17
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- **Every task is self-contained.** Its Steps plus the Decisions and Design Reference sections it cites on **Applies** are everything needed to do it. A task must never say "follow the pattern from T3" — T3's context is gone by then; say "follow Design Reference › Conventions to mirror › <name>" and put the pattern there, once.
|
|
176
|
-
- **Steps are instructions, not goals.** "Add validation" is a goal; "In `submit()` at `:120`, before the `fetch` call, add `if (!form.name) { setError('name', 'Required'); return; }`" is a step. Every step names the file, the anchor, and the change.
|
|
177
|
-
- **Anchors are real.** Every `file:line` and "after `<code>`" anchor comes from Step 1's reading of the actual file. Prefer code anchors ("after the line `this.scene = scene;`") to bare line numbers where lines are likely to shift during a long run — or give both.
|
|
178
|
-
- **Names, signatures and values come from the Design Reference.** If a step introduces a name that is not in the Design Reference, add it there first. That is what keeps the fortieth task's naming identical to the third's.
|
|
179
|
-
- **Acceptance is observable.** Something a verifier can check by running a command or inspecting a file: a test count, a grep result, a rendered behaviour ("PLAY auto-scrolls to the document bottom"), never "works correctly". Sibling-skill behaviours are asserted in observable terms exactly as Step 2 requires.
|
|
180
|
-
- **Verify gives the command and the expected output**, so a fresh context compares against a stated value rather than judging. Expected outputs never pin absolute counts that later tasks change (total tests passed, suite sizes, ledger figures).
|
|
181
|
-
- **Keep the system working between tasks.** When a change spans tasks, say what temporary shim, flag, or compatibility write keeps the app running after each one, and which later task removes it — a resumed run may pause for days between them.
|
|
18
|
+
- `--heavy` — Heavy Plan mode (below). `--parity` — plan numeric parity proof; also on when the spec says `proof: parity`. Strip flags first; they are never part of the brief.
|
|
19
|
+
- Spec file (± brief) → plan from it. **Brief only → Quick Plan.** Neither → ask for a brief. Never guess a path or URL.
|
|
182
20
|
|
|
183
|
-
|
|
21
|
+
## Ground rules
|
|
184
22
|
|
|
185
|
-
**
|
|
23
|
+
- **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.
|
|
24
|
+
- **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.
|
|
25
|
+
- **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.
|
|
26
|
+
- **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.
|
|
186
27
|
|
|
187
|
-
|
|
28
|
+
## Step 1. Analyze (required before writing)
|
|
188
29
|
|
|
189
|
-
|
|
30
|
+
1. Read the feature spec in full, and `SPEC.md`'s headings, Architecture, Conventions and the systems the feature touches. The plan must conform to SPEC.md — **if it would conflict, stop and tell the user.** Verification procedures described in SPEC.md are tooling you may reuse, not a bar the plan must meet. Note the spec's `spec_impact`, `size` and `proof`.
|
|
31
|
+
2. **Start from the spec's `## Research Notes`.** Spot-check that the paths exist, then research only what a plan needs beyond them: how the app is built and tested, the real conventions and the closest feature to mirror, the concrete files and integration points, available dependencies, constraints from the agent instructions.
|
|
32
|
+
3. Size the research: `small` → inline; `medium` / `large` (or no Research Notes) → up to 3 **read-only** subagents returning findings and paths, not file dumps.
|
|
33
|
+
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.
|
|
34
|
+
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).
|
|
190
35
|
|
|
191
|
-
|
|
36
|
+
**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.
|
|
192
37
|
|
|
193
|
-
|
|
38
|
+
## Step 2. Rules for a good plan
|
|
194
39
|
|
|
195
|
-
|
|
40
|
+
Execution time is mostly *how the work is proven*, not the code. Keep proof strong and cheap:
|
|
196
41
|
|
|
197
|
-
|
|
42
|
+
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.
|
|
43
|
+
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.
|
|
44
|
+
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. If a live check may be impossible where the plan runs (needs credentials, data or hardware), say in the task what to report instead.
|
|
45
|
+
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.
|
|
46
|
+
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.
|
|
47
|
+
6. **No ceremony.** No standalone "verification sweep / open the review / final check" tasks, and no ledgers, md5 or environment records, archives, checked-in capture trees, standing evidence suites, doc-integrity registration or staged promotions — unless the brief asks.
|
|
48
|
+
7. **No brittle pins.** Never pin counts later tasks will change (tests passed, suite sizes, hashes). Say "the named tests pass, no new failures versus the baseline".
|
|
198
49
|
|
|
199
|
-
|
|
50
|
+
## Step 3. Write the plan
|
|
200
51
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
## Subagents — invoking this skill IS the request
|
|
204
|
-
|
|
205
|
-
This skill's workflow depends on subagents. **Invoking it is the user's explicit request to use them**, so any host default of the form *"do not spawn subagents / do not call the agent tool unless the user asks for it"* is **ALREADY SATISFIED** — the user asked by running this command. Never silently downgrade to the inline path on that basis, and never stop to ask permission for it first.
|
|
206
|
-
|
|
207
|
-
Downgrading is not a neutral choice. It removes the one property that makes the step worth running: independence. A verifier that is the same context which just wrote the code cannot adversarially check it — it re-confirms its own reasoning and reports PASS.
|
|
208
|
-
|
|
209
|
-
The ONE legitimate reason to run inline is that you genuinely have **no** subagent-spawning tool. Check the tools you actually have — Claude Code exposes it as **`Agent`** (older builds name it `Task`); other hosts have their own equivalent. Never call a subagent tool you do not have. Use the exact fan-out / inline status strings this skill specifies for the *path-chosen* line (the progress-narration lines below carry a fixed prefix but free wording), and if you do run inline, state plainly that no subagent tool was available, never a policy.
|
|
210
|
-
|
|
211
|
-
## ⚠️ Progress narration — NEVER go silent
|
|
212
|
-
|
|
213
|
-
The user is watching a terminal, not your reasoning. Research and analysis in this skill routinely take several minutes, and **a silent span of more than about 30 seconds is indistinguishable from a hang or a crash** — users cancel runs on exactly that basis, throwing away all the work done so far. Silence is therefore a failure of this skill, not a neutral default. Narrate continuously, in short one-line status updates, from the first action to the final summary.
|
|
214
|
-
|
|
215
|
-
**Hard rules:**
|
|
216
|
-
|
|
217
|
-
1. **Announce before every long action.** Before any tool call that can take more than a few seconds — fetching the Agent Reference, reading `SPEC.md` / `DESIGN.md` / a sibling skill, launching subagents, a broad search — emit one visible line saying what you are about to do and why. Example: `🔎 [bt-plan] Reading SPEC.md and DESIGN.md to find the sections this feature must conform to …`
|
|
218
|
-
2. **Report after every result.** After each tool result, emit one line stating what you learned and what comes next, *before* the next tool call. The text between tool calls IS the progress display; a run of back-to-back tool calls with no text between them is a silent run.
|
|
219
|
-
3. **Subagents get a line each, going out and coming back.** When fanning out, print one line per subagent naming what it is investigating (`🚀 [bt-plan] Subagent 1/3 → mapping project structure, build + dependencies`). Prefer the host's background / non-blocking launch mode where it exists (Claude Code's `Agent` with `run_in_background: true`), so each completion returns control to you and you can report it: `✅ [bt-plan] Subagent 1/3 done — <one-line finding>`. Never block on all subagents in silence and then report them together.
|
|
220
|
-
4. **Waiting is also something to say.** If you are waiting on subagents with nothing else to do, say so once, naming what is still outstanding: `⏳ [bt-plan] Waiting on 2/3 research subagents (conventions to mirror, integration points) — typically 1–3 minutes …`. One line per wait, not repeated spam.
|
|
221
|
-
5. **Mark the phase transitions.** Emit a line when research starts, when it completes, and when drafting begins — e.g. `🧩 [bt-plan] Research complete — <n> findings synthesized` followed by a **3–6 bullet research summary** (the key findings, with file paths) so the user can see what the run is based on, then `✍️ [bt-plan] Drafting the document …`.
|
|
222
|
-
6. **Keep the lines short and uniform.** Format: `<emoji> [bt-plan] <what> — <detail>`. One line each. The prefix and emoji are fixed; the `<what>` / `<detail>` wording is yours. Do not dump findings, file contents, or tool output as progress — a status line says what happened, the document holds the detail.
|
|
223
|
-
7. **A silent gap may never span more than a single tool call.** If one tool call is itself long (a subagent, a large fetch), the line *preceding* it must say what it is and roughly how long it is expected to take.
|
|
224
|
-
|
|
225
|
-
This applies to every phase of this skill — the Agent Reference fetch, `SPEC.md`/`DESIGN.md` reads, the fan-out research, sibling-skill reads, interviewing, and drafting. When in doubt, say what you are doing.
|
|
226
|
-
|
|
227
|
-
## ⚠️ Required Reading Before Any Babylon Work
|
|
228
|
-
|
|
229
|
-
For any task involving Babylon, BabylonJS, or the Babylon Toolkit, first ensure you have already fetched and read the Babylon Toolkit Agent Reference in the current remembered session/context:
|
|
230
|
-
|
|
231
|
-
https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md
|
|
232
|
-
|
|
233
|
-
If you have not read it in this session/context, or you no longer remember it due to context loss/compaction, fetch and read it before scaffolding or writing code.
|
|
234
|
-
|
|
235
|
-
Do not refetch the Agent Reference repeatedly during the same remembered session/context, including across spec, plan, and execute phases, if you are still aware of its contents.
|
|
236
|
-
|
|
237
|
-
Treat the Agent Reference as the authority for conventions, API, and patterns. It routes to deeper docs. Fetch linked subpages only when they are relevant to the task, and do not refetch a subpage in the same remembered session/context unless you no longer remember it.
|
|
238
|
-
|
|
239
|
-
If a required fetch fails, STOP and tell me. Do not guess at the API.
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Planning mode — do not implement
|
|
244
|
-
|
|
245
|
-
This command runs in PLANNING MODE. Research read-only and produce ONLY the technical plan document. Do NOT implement the feature, edit any existing application/source files, or run build, test, or other shell commands. The only file you may create is the plan markdown in `_specs/`, named `<feature-name>_plan.md`.
|
|
246
|
-
|
|
247
|
-
**This applies identically in Quick Plan mode.** Planning and execution are deliberately separate skills: `bt-plan` writes the plan, `bt-execute` runs it — one task at a time, with a clean context between tasks, at the user's discretion. Rolling straight from planning into implementation defeats the entire purpose of that split. Writing the plan file is the LAST action of this skill in every mode.
|
|
248
|
-
|
|
249
|
-
## Step 0. Confirm planning mode
|
|
250
|
-
|
|
251
|
-
A trustworthy plan requires a thorough, read-only investigation of the codebase before any plan is written.
|
|
252
|
-
|
|
253
|
-
- This skill is intended to run as a read-only planning pass. If you have been invoked in a mode that would modify source, begin your response with a short visible warning that you will only produce the plan document, then continue.
|
|
254
|
-
- Either way, you MUST still perform the comprehensive analysis in Step 1 with full rigor. Never skip it.
|
|
255
|
-
|
|
256
|
-
## Step 1. Comprehensive project analysis (REQUIRED before any plan)
|
|
257
|
-
|
|
258
|
-
This analysis can be **fanned out**. First check whether you actually have a subagent-spawning tool, and **emit one visible status line** so the user can see the path chosen — either `🔀 [bt-plan] subagent tool detected — fanning out analysis to N read-only subagents` or `➡️ [bt-plan] no subagent tool — analyzing sequentially`. If a subagent-spawning tool is available to you (e.g. Claude Code's `Agent`, Lovable's subagent tool, or your host's equivalent — check the tools you actually have; if there is none, or you are unsure, do the analysis yourself sequentially), launch up to 3 parallel **read-only** exploration subagents and divide the eight investigation points below among them (for example: one maps structure/build and dependencies; one extracts the real conventions and the closest existing feature to mirror; one lists integration points and constraints). Each subagent returns concise conclusions — findings and file paths, not file dumps — which you synthesize into the `## Codebase Analysis` section. Exploration subagents need not re-read the Agent Reference. Never call a subagent tool you do not actually have.
|
|
259
|
-
|
|
260
|
-
**Narrate the whole step** (see *Progress narration — NEVER go silent* above). This is the step that most often runs for minutes, so it is where the rule matters most. The required cadence:
|
|
261
|
-
|
|
262
|
-
- One `🚀 [bt-plan] Subagent i/N → <what it investigates>` line per subagent as it is launched, and prefer the background / non-blocking launch mode so completions return to you one at a time.
|
|
263
|
-
- One `✅ [bt-plan] Subagent i/N done — <one-line finding>` line as each returns; a `⏳ [bt-plan] Waiting on …` line if you are idle with subagents still outstanding.
|
|
264
|
-
- On the sequential path, one `🔎 [bt-plan] …` line before each read/search (each of the eight investigation points below) and one result line after it.
|
|
265
|
-
- When everything is in: `🧩 [bt-plan] Analysis complete — <n> findings synthesized`, followed by a 3–6 bullet analysis summary (key findings with file paths), before moving on to the interview (Quick Plan) or Step 2.
|
|
52
|
+
Print `✍️ [bt-plan] Writing _specs/<feature-name>_plan.md …`. The file has, in order:
|
|
266
53
|
|
|
267
|
-
|
|
54
|
+
**`## 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.
|
|
268
55
|
|
|
269
|
-
|
|
270
|
-
2. Map the project: top-level structure, entry points, how the app is built and run (build scripts, test runner, package manifests).
|
|
271
|
-
3. Identify the conventions actually used in this repo: naming, file/folder organization, state management, styling, error handling, testing patterns.
|
|
272
|
-
4. Find the closest existing feature(s) or modules to the one being planned and study how they are implemented — the plan should follow these patterns.
|
|
273
|
-
5. List the concrete integration points the feature will touch: files, modules, APIs, data models, routes, config.
|
|
274
|
-
6. Note relevant dependencies already available (and their versions) versus anything new that would be required.
|
|
275
|
-
7. Capture any constraints from the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md) and the feature spec.
|
|
276
|
-
8. If the feature builds on a **sibling-skill pattern** (e.g. bt-design's 3D-Hero-Scroll), read that sub-skill's reference **and its templates**. *(How to read one: where skills are loaded with a tool — the Babylon Toolkit App Builder platform — call `load_skill('<name>')`, then fetch its references and templates with `read_skill_resource` using the paths the load returns, never a guessed path. Where skills are files on disk — Claude Code — read them from the same skills directory, `~/.claude/skills/` or the project's `.claude/skills/`. Skip the load for anything already in your context.)* The plan MUST **copy and configure the sub-skill's template engine — never re-implement it from memory**; re-implementation is exactly how documented behaviors (`sweep`, veiled cuts, the preload gate, HUD auto-hide, graceful degradation) silently get dropped. Turn every behavioral-config requirement the spec records (e.g. `sweep: page`) into a concrete task whose Acceptance asserts that behavior in observable terms.
|
|
277
|
-
|
|
278
|
-
If the spec or codebase is too ambiguous to analyze responsibly, stop and ask the user rather than guessing.
|
|
279
|
-
|
|
280
|
-
*(In Heavy Plan mode, also apply the **Step 1 additions** listed under *Heavy Plan mode* above.)*
|
|
281
|
-
|
|
282
|
-
## Size the plan to the feature (all modes)
|
|
283
|
-
|
|
284
|
-
Execution cost is paid **per verification unit**, not per line of code: every phase bt-execute runs costs an implementer pass plus a fresh independent verifier. A plan that splits a one-hour feature into eight micro-tasks, adds bookkeeping tasks, and asks for live Unity/browser QA on each one turns an hour of work into a day. Rigor comes from good Acceptance, named tests and an independent verifier — not from the number of tasks. So:
|
|
285
|
-
|
|
286
|
-
1. **Read the size.** Take `size: small | medium | large` from the feature spec header. In Quick Plan mode (or for an older spec without it), infer it: **small** ≈ something a developer would do by hand in about 1–2 hours, touching one system; **medium** ≈ a day, a few systems; **large** ≈ multi-day, multi-system, or Unity/Blender/export pipeline work. Record it in Codebase Analysis.
|
|
287
|
-
2. **Task budget.** small → **1–3 tasks**; medium → **3–8**; large → as many as the work needs. Going over the budget needs a one-line reason in Codebase Analysis.
|
|
288
|
-
3. **A task is a meaningful unit of work** — a coherent change a developer would commit on its own, with its own tests. Merge tasks that edit the same file for the same purpose, or that cannot be tested apart (adding a constant and the code that uses it is ONE task). Split only when a task would not fit in one sitting.
|
|
289
|
-
4. **No ceremony tasks.** Do not write standalone "verification sweep", "confirm all callers", "open the review / ledger / baseline / archive" or "final check" tasks unless the brief asks for them. A read-and-confirm check belongs in the **Acceptance** of the task that made the change; the final end-to-end check belongs in the last phase's last task.
|
|
290
|
-
5. **Phases.** Group tasks under `### Phase N — <name>` headings inside `## Tasks`. bt-execute runs one independent verifier per phase, so a phase is "what should be checked together": a small plan is **one phase**; otherwise phases of 2–4 related tasks, ending where a checkpoint is natural (a working intermediate state, a UI becoming visible, the SPEC.md write-back).
|
|
291
|
-
6. **`Verify level` per task.** `standard` (default — build/typecheck, the named tests, diff review) or `live` (needs the dev server, a browser, or Unity/Blender to observe). Mark `live` whenever the task's Acceptance depends on runtime behavior — rendering, visuals, interaction, Unity↔Babylon parity; bt-execute runs live QA on such tasks even if unmarked. Whatever the per-task levels, the **last feature task** (before the SPEC.md write-back) carries one `live` **end-to-end check** of the whole feature when the feature has a rendered, exported or interactive surface — that is where "loaded in the browser, screenshotted, console clean" is verified, once.
|
|
292
|
-
7. **No brittle pins.** Never pin absolute counts that later tasks will change — total tests passed, suite sizes, ledger figures, file hashes of files later tasks edit. Say "the named tests pass and there are no new failures versus the baseline" instead. A pin that goes stale makes a correct task FAIL and costs a whole fix-loop round.
|
|
293
|
-
8. **Named tests, not exhaustive ones.** Each task with a testable surface names its test cases with expected outcomes. Cover the Acceptance and the edge cases the spec lists; do not ask for probe suites, fuzzing or mutation testing unless the feature's risk genuinely calls for it (say why).
|
|
294
|
-
|
|
295
|
-
## Step 2. Write the plan
|
|
296
|
-
|
|
297
|
-
> **Heavy Plan mode (`--heavy`):** the *Heavy plan document* structure and the *cold-context audit* under **Heavy Plan mode** above replace this step. The Codebase Analysis requirements, the SPEC.md write-back rules, and the verbatim `How to execute this plan` section below still apply unchanged inside that structure. Without the flag, follow this step exactly as written.
|
|
298
|
-
|
|
299
|
-
Emit `✍️ [bt-plan] Writing _specs/<feature-name>_plan.md …` before writing, and `💾 [bt-plan] Plan written — _specs/<feature-name>_plan.md` once the file is saved.
|
|
300
|
-
|
|
301
|
-
Only after Step 1 is complete, write the plan markdown to `_specs/` as `<feature-name>_plan.md`. The document MUST open with a `## Codebase Analysis` section that summarizes the findings from Step 1 (cite the real files/modules you inspected) — this is the evidence that the analysis happened. This section MUST include a short **SPEC.md alignment** note: which SPEC.md sections the plan conforms to, and whether the feature is spec-impacting (carry over the feature spec's `spec_impact`, or in Quick Plan mode the value you inferred, and say it was inferred). A plan without a grounded analysis section is invalid; do not produce one.
|
|
302
|
-
|
|
303
|
-
Then write the implementation as an ordered checklist of tasks, sized and grouped per *Size the plan to the feature* above. Use GitHub-style checkboxes so progress can be tracked directly in the file — one task per line, numbered T1, T2, T3 … in dependency order, grouped under phase headings:
|
|
56
|
+
**`## Tasks`**
|
|
304
57
|
|
|
305
58
|
```markdown
|
|
306
|
-
## Tasks
|
|
307
|
-
|
|
308
59
|
### Phase 1 — <name>
|
|
309
60
|
|
|
310
|
-
- [ ] **T1** — <short
|
|
311
|
-
- Files: `path/one
|
|
61
|
+
- [ ] **T1** — <short imperative title>
|
|
62
|
+
- Files: `path/one` (create), `path/two` (modify)
|
|
312
63
|
- Details: <what to do>
|
|
313
|
-
- Tests:
|
|
314
|
-
- Acceptance: <
|
|
64
|
+
- Tests: `<test file>` — `<case>` → <expected outcome>; … (or "no testable surface — <why>")
|
|
65
|
+
- Acceptance: <observable, checkable statements>
|
|
315
66
|
- Verify level: standard
|
|
316
|
-
- [ ] **T2** — <short task title>
|
|
317
|
-
- Files: `...`
|
|
318
|
-
- Details: <...>
|
|
319
|
-
- Tests: <...>
|
|
320
|
-
- Acceptance: <...; includes the end-to-end check of the whole feature if this is the last feature task>
|
|
321
|
-
- Verify level: live
|
|
322
67
|
```
|
|
323
68
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
### SPEC.md write-back task (required when the feature is spec-impacting)
|
|
327
|
-
|
|
328
|
-
If the feature is spec-impacting (`spec_impact: yes`, or your analysis found it adds/changes a system, convention, dependency, or architectural decision), the plan MUST end with an explicit final task that updates the project spec, so the write-back is tracked and independently verified like any other task — never left as a soft afterthought:
|
|
69
|
+
**`Update SPEC.md` — the last task, when the feature is spec-impacting** — `spec_impact: yes`, or your analysis found it adds or changes a system, convention, dependency or architectural decision (otherwise state in Codebase Analysis that none is needed):
|
|
329
70
|
|
|
330
71
|
```markdown
|
|
331
72
|
- [ ] **T<n>** — Update SPEC.md to match what was built
|
|
332
73
|
- Files: `SPEC.md`
|
|
333
|
-
- Details: Update the
|
|
334
|
-
- Acceptance: SPEC.md
|
|
74
|
+
- Details: Update the sections named in the spec's Project Spec Alignment, following SPEC.md's "How to update this spec" (replace/merge current-state sections; append Decisions). Record the product only — never verification procedure, tool lists, ledgers or gates.
|
|
75
|
+
- Acceptance: SPEC.md matches what the tasks above shipped; new dependencies listed; nothing contradicts the code.
|
|
335
76
|
- Verify level: standard
|
|
336
77
|
```
|
|
337
78
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
### Estimated execution time (required, all modes)
|
|
341
|
-
|
|
342
|
-
Directly **before** `## How to execute this plan`, write a `## Estimated execution time` section so the user knows up front whether this is hours or days of agent time. Estimate bt-execute's wall-clock time per phase, from what the phase actually does, using these calibration rates (Standard mode, one implementer + one independent verifier per phase):
|
|
79
|
+
**`## Estimated execution time`** — a table `Phase | Tasks | Build | Prove | Estimate` (Build = code and tests; Prove = exports, captures, comparisons, fix-until-green), then one **Total** range in hours (days if over ~16 h) = the sum of the phases plus 20–40 % for fix loops, the `--strict` multiplier (~2–3×), what would cut Prove if it exceeds Build, and the biggest uncertainty. Rates per phase (whole-phase figures; split each into Build and Prove by what the phase does): code + unit tests 15–25 min · adds a C#/native build or a full test chain 30–45 min · adds Unity authoring/bake/export or browser captures 45–90 min · a visual fix-until-green loop 1–3 h. An estimate, never a pin.
|
|
343
80
|
|
|
344
|
-
|
|
345
|
-
| --- | --- |
|
|
346
|
-
| Code + Node/unit tests only | 15–25 min |
|
|
347
|
-
| Adds a C#/native build, DLL rebuild or a full test chain | 30–45 min |
|
|
348
|
-
| Adds Unity authoring / bake / export, or browser read-backs and screenshots | 45–90 min |
|
|
349
|
-
| Visual / parity "fix until green" loop | 1–3 h |
|
|
350
|
-
|
|
351
|
-
Write a small table (`Phase | Tasks | What makes it slow | Estimate`), then one **Total** line as a range in hours (and days if over ~16 h), including a 20–40 % allowance for fix loops, e.g. `**Total: ~5–8 h of unattended agent time (Standard mode); ~2–3× that with --strict.**` Name the single biggest uncertainty in one line. This is an estimate, not a pin: bt-execute never verifies against it.
|
|
352
|
-
|
|
353
|
-
Finally, include this exact `## How to execute this plan` section verbatim in the document so the plan is self-describing no matter how it is later run:
|
|
81
|
+
**`## How to execute this plan`** — this text verbatim:
|
|
354
82
|
|
|
355
83
|
```markdown
|
|
356
84
|
## How to execute this plan
|
|
@@ -362,3 +90,24 @@ Each task above is a checkbox. To implement:
|
|
|
362
90
|
- When a task is fully implemented and its **Acceptance** criteria are met, mark it complete by editing this file and changing that task's `- [ ]` to `- [x]`.
|
|
363
91
|
- Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
|
|
364
92
|
```
|
|
93
|
+
|
|
94
|
+
Then **stop**. Final message: a short summary, the estimated time, and:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Plan written to _specs/<feature-name>_plan.md — <n> tasks, estimated <total range> of agent time
|
|
98
|
+
Run a single task with `bt-execute _specs/<feature-name>_plan.md T1`, or every task with `bt-execute _specs/<feature-name>_plan.md ALL` (add `--strict` for an adversarial verifier on every task).
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Heavy Plan mode (`--heavy`)
|
|
102
|
+
|
|
103
|
+
Use when the plan will be executed in fresh contexts, over days, or by a cheaper model than the one planning. The plan file is then the only memory that survives between tasks: **whatever it does not say, task 40 will re-decide differently from task 3.** So a heavy plan decides everything once, in one place, and every task cites it. Print `🏋️ [bt-plan] Heavy Plan mode`. Everything above still applies; the document gains two sections and richer task blocks. There is no limit on how much a heavy plan may say — write what the executor needs — but the number of tasks still follows the spec's `size`.
|
|
104
|
+
|
|
105
|
+
In Step 1, collect plan-grade detail: `file:line` references, the real signatures the feature calls or changes, verbatim 10–30-line snippets of the conventions to mirror, the exact API usage from the Agent Reference sub-documents, and the test baseline (command, current state, pre-existing failures). Carry the spec's Decisions forward and resolve every Open Question — with the user if needed. "TBD", "as appropriate", "the implementer may choose" are forbidden.
|
|
106
|
+
|
|
107
|
+
Sections, in order: `## Codebase Analysis` (plus the test baseline) · **`## Decisions`** · **`## Design Reference`** · `## Tasks` · `## Estimated execution time` · `## How to execute this plan`.
|
|
108
|
+
|
|
109
|
+
- **`## Decisions`** — numbered `D1, D2 …`, one per choice that binds more than one task or rejects a plausible alternative — architecture, file layout, naming, algorithms and constants, error policy, dependencies (exact packages and versions, or "no new dependencies"), sibling-skill option values, test strategy:
|
|
110
|
+
`- **D3 — <decision, stated as a fact>.** <why / precedent with file:line> Rejected: <alternative> (<why not>). Binds: T4, T7.`
|
|
111
|
+
- **`## 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.
|
|
112
|
+
- **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 · `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.
|
|
113
|
+
- **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. 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.
|
|
@@ -53,7 +53,7 @@ Use the user's message after the skill name as the `arguments`.
|
|
|
53
53
|
|
|
54
54
|
## ⚠️ Required reading before any build
|
|
55
55
|
|
|
56
|
-
For any Babylon / BabylonJS / Babylon Toolkit work, ensure the **Agent Reference** is already read in this session/context (fetch `https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md` first if not; and its `web-kie-servers.md` sub-document if using the KIE MCP servers, or its `web-higgsfield-
|
|
56
|
+
For any Babylon / BabylonJS / Babylon Toolkit work, ensure the **Agent Reference** is already read in this session/context (fetch `https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md` first if not; and its `web-kie-servers.md` sub-document if using the KIE MCP servers, or its `web-higgsfield-cli.md` sub-document if using the Higgsfield CLI). If a required fetch fails, STOP and tell the user. Do not refetch what you already remember.
|
|
57
57
|
|
|
58
58
|
If the project keeps a root **SPEC.md**, read it first and conform to its architecture/conventions; record the shipped prototypes per the project's working agreement when the batch lands.
|
|
59
59
|
|
|
@@ -74,7 +74,7 @@ The **difference** between prototypes is in the *design language* — layout, mo
|
|
|
74
74
|
1. Read the flags (`--type`, `--count`, `--motionsites`, `--awwwards[:forensic]`, `--3d-hero-scroll`) and the `<theme>`. Apply defaults (`html`, `10`).
|
|
75
75
|
2. **Theme gate:** if no theme is discernible, ask **once** — one short inline question — then proceed. This is the only interactive stop; once the batch starts, it runs autonomously.
|
|
76
76
|
3. Ingest attached screenshots into a world anchor (above). Note the host: React (Vite/TS) vs plain HTML, per `--type` and any existing project.
|
|
77
|
-
4. **Asset-backend check:** the Fable-grade bar assumes asset generation is available. Confirm what's configured — KIE MCP (image/video/Kling — the **default**), Higgsfield
|
|
77
|
+
4. **Asset-backend check:** the Fable-grade bar assumes asset generation is available. Confirm what's configured — KIE MCP (image/video/Kling — the **default**), the Higgsfield CLI (`node_modules/.bin/higgsfield account status --json` succeeds), GPT Image 2 keys, Pinterest source. Pass the chosen backend to every subagent so the batch is consistent. **If Higgsfield is the backend, check `account status`, run one image and one video through `scripts/hf-generate.mjs … --cost`, then tell the user the estimated batch cost before fanning out**: N prototypes × video is where credits disappear. If none is available, say so and proceed with hand-authored CSS/SVG/WebGL craft rather than silently producing flat pages.
|
|
78
78
|
|
|
79
79
|
## Step 2 — Compose the direction spread (N genuinely-different lenses)
|
|
80
80
|
|
|
@@ -130,7 +130,7 @@ Each prototype subagent gets: its **direction**, the **theme**, the **world anch
|
|
|
130
130
|
|
|
131
131
|
1. **Own its folder.** Create `_prototypes/<NN-slug>/` and put **everything self-contained inside it** — markup, styles, scripts, and all generated/downloaded assets. No shared globals; a prototype is copy-out-able on its own.
|
|
132
132
|
2. **Build to the Fable bar for its lens** — advanced 3D tactics, otherworldly animation, exceptional palette, novel type. Not a template with the colors swapped; a distinct, *mind-blowing* execution of that direction for this game. **Full-bleed console UI by default** (bt-design's *Layout Philosophy*): fill the whole viewport edge-to-edge like a console dashboard / game menu, not a centered fixed-width website — unless this direction is the noted contained exception.
|
|
133
|
-
3. **Produce assets** via any mix of the available workflows: Pinterest pulls for reference, **GPT Image 2** for stills, **KIE MCP servers (default) / Higgsfield
|
|
133
|
+
3. **Produce assets** via any mix of the available workflows: Pinterest pulls for reference, **GPT Image 2** for stills, **KIE MCP servers (default) / the Higgsfield CLI (Kling, Seedance, etc.)** for motion/video, hand-authored WebGL/SVG/CSS. All assets stay faithful to the world anchor and live in the prototype's folder. **On Higgsfield, every generation goes through the reference's `scripts/hf-generate.mjs` wrapper** with `--out _prototypes/<NN-slug>/<file>`: the CLI alone only returns a CDN URL, and a prototype must never hot-link one. Local reference images are passed as file paths (`--image-references`, `--start-image`, `--end-image`) and uploaded automatically.
|
|
134
134
|
4. **3D-hero-scroll directions:** follow *The 3D-hero-scroll batch rule* below.
|
|
135
135
|
5. Run its own **iteration passes** (Step 4) before returning.
|
|
136
136
|
|