@babylonjs-toolkit/agent 1.1.32 → 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.
@@ -4,396 +4,151 @@ description: "The Babylon Toolkit Spec Skill creates a feature spec file and bra
4
4
  allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.com), Bash(git switch:*), AskUserQuestion, Agent, Task
5
5
  ---
6
6
 
7
- You are helping to spin up a new feature spec for this application, from a short idea provided in the user input below. Always adhere to any rules or requirements set out in the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md) when responding.
7
+ Turn a short feature idea into a spec file that `bt-plan` can plan from. 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-spec [--grill-me] <feature-brief>
17
9
  ```
18
- - **`<feature-brief>`** — the short idea or brief for the feature spec. This is the *variable*.
19
- - **`--grill-me`** *(optional flag)* — interrogate the user relentlessly, one question at a time, until the design tree is actually resolved, instead of drafting the spec in a single pass from the brief. See **Step 2.7**. The flag may appear anywhere in the arguments and is never part of the brief.
20
- - If the brief is missing, ask for it before starting. Never guess a file path or URL.
10
+ /bt-spec [--grill-me] [--parity] <feature-brief>
21
11
 
22
- Example:
23
- ```
24
- /bt-spec → "Generate a detailed implementation plan for the new feature"
25
- /bt-spec --grill-me "add a settings toggle to mute all game audio" # interview first, then spec
12
+ /bt-spec "add a settings toggle to mute all game audio"
13
+ /bt-spec --grill-me "add a settings toggle to mute all game audio" # interview first, then spec
14
+ /bt-spec --parity "port the Unity water shader and match it to within 2% in the browser" # numeric parity bars allowed (slow — hours become days)
26
15
  ```
27
16
 
28
- ---
29
-
30
- ## Subagents — invoking this skill IS the request
31
-
32
- 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.
33
-
34
- 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.
35
-
36
- 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.
37
-
38
- ## ⚠️ Progress narration — NEVER go silent
39
-
40
- 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.
41
-
42
- **Hard rules:**
43
-
44
- 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-spec] Reading SPEC.md and DESIGN.md to find the sections this feature must conform to …`
45
- 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.
46
- 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-spec] 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-spec] Subagent 1/3 done — <one-line finding>`. Never block on all subagents in silence and then report them together.
47
- 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-spec] Waiting on 2/3 research subagents (conventions to mirror, integration points) — typically 1–3 minutes …`. One line per wait, not repeated spam.
48
- 5. **Mark the phase transitions.** Emit a line when research starts, when it completes, and when drafting begins — e.g. `🧩 [bt-spec] 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-spec] Drafting the document …`.
49
- 6. **Keep the lines short and uniform.** Format: `<emoji> [bt-spec] <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.
50
- 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.
51
-
52
- 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.
53
-
54
- ## ⚠️ Required Reading Before Any Babylon Work
55
-
56
- 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:
57
-
58
- https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md
59
-
60
- 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.
61
-
62
- 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.
63
-
64
- 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.
65
-
66
- If a required fetch fails, STOP and tell me. Do not guess at the API.
67
-
68
- ---
69
-
70
- ## ⚠️ The Project Specification (SPEC.md) — read before drafting
71
-
72
- The project's **SPEC.md** at the repository root is the source of truth for the project: it defines the durable architecture, game systems, conventions, and decisions. **Read it before drafting any feature spec.**
73
-
74
- - Align the feature idea to the existing architecture, systems, and conventions in SPEC.md. The feature spec you produce must be derived from and constrained by SPEC.md.
75
- - **If the feature idea conflicts with SPEC.md** (contradicts an architectural decision, a system boundary, or a convention), STOP and flag the conflict to the user before writing the spec. Do not silently override the project spec.
76
- - **Classify the feature's `spec_impact`:** it is `yes` if implementing the feature would add or change a game system, a convention, a dependency, or an architectural decision recorded in SPEC.md — otherwise `no`. This drives whether the plan will include a SPEC.md write-back task, so classify honestly.
77
- - **Classify the feature's `size`:** `small` ≈ what a developer would do by hand in about 1–2 hours, touching one system; `medium` ≈ about a day, a few systems; `large` ≈ multi-day, multi-system, or Unity/Blender/export pipeline work. bt-plan sizes the plan (task count, phases, how much live QA) from this, and execution cost follows the plan — so classify by the real work, not by how important the feature feels.
78
- - **If SPEC.md is missing or is still a stub with no real content, STOP and ask the user FIRST — before generating the feature spec — whether to create a default project `SPEC.md` from the fallback scaffold** (the scaffold is defined in *Validate The Project Spec* under Step 4). Do not draft the feature spec until they answer.
79
- - **If the user says yes:** create `SPEC.md` at the repository root from the fallback scaffold, then continue — treat the newly written SPEC.md as the source of truth and align the feature spec to it (this is the normal path; the project now has a spec to grow).
80
- - **If the user says no:** continue **without** a project-level SPEC.md, and record this note in the feature spec: `"No project SPEC.md content yet — following existing codebase conventions."`
81
-
82
- ---
83
-
84
- ## Planning mode — do not implement
85
-
86
- This command runs in PLANNING MODE. Research read-only and produce ONLY the spec document (plus, where git is available, its branch). Do NOT implement the feature, edit any existing application/source files, or run build, test, or other shell commands. The only files you may create are the feature spec markdown described below and — **only if the user opts in** when the project `SPEC.md` is missing/stub (see *The Project Specification* above) — the project `SPEC.md` written from the fallback scaffold. Creating that `SPEC.md` from the scaffold is the sole exception to "do not edit other files", and only with the user's yes.
87
-
88
- ## High level behavior
89
-
90
- Your job will be to turn the user input above into:
91
-
92
- - A human friendly feature title in kebab-case (e.g. new-heist-form)
93
- - A safe branch name (e.g. project/feature/new-heist-form) — always RECORDED in the spec header; actually cut only where git is available
94
- - A detailed markdown spec file under the _specs/ directory
95
-
96
- Then save the spec file to disk and print a short summary of what you did.
97
-
98
- ## Step 1. Check the working tree (only where git is available)
99
-
100
- **Git is optional for this skill, and its absence is normal — not a degraded environment.** Some hosts
101
- run this skill in a sandbox with no git binary and a restricted shell (for example the Babylon Toolkit
102
- App Builder, where the project's real branching and commits are performed by the host against the
103
- user's own repository, not from inside the sandbox). The spec file is the deliverable; the branch is a
104
- convenience where the tooling happens to support it.
105
-
106
- - **If git is available:** check the current branch and stop if the working directory has uncommitted,
107
- unstaged, or untracked files. Tell the user to commit or stash before proceeding.
108
- - **If git is NOT available** (no binary, or the shell refuses the command): skip this step entirely and
109
- continue to Step 2. Do not abort, do not ask the user to install anything, and do not report it as a
110
- problem or a limitation — record the branch name as spec metadata as described in Step 3 and carry on.
111
- Say nothing about git in your summary; the user asked for a spec, not a branch.
112
-
113
- ## Step 2. Parse the arguments
114
-
115
- **First, extract and remove any flags — before deriving anything from the text.** Scan `arguments` for `--grill-me`; set `grill_me = true` if present, then **delete it from `arguments`** and collapse the surrounding whitespace. Everything below derives from the flag-stripped remainder. Skipping this produces a spec named `_specs/mute-game-audio-grill-me_spec.md`. Treat an unrecognised `--flag` as part of the brief only if the user clearly meant it as prose; otherwise ask.
116
-
117
- From the flag-stripped `arguments`, extract:
118
-
119
- 1. `feature_title`
120
- - A short, human readable title in Title Case.
121
- - Example: "Card Component for Dashboard Stats".
122
-
123
- 2. `feature_slug`
124
- - A git safe slug.
125
- - Rules:
126
- - Lowercase
127
- - Kebab-case
128
- - Only `a-z`, `0-9` and `-`
129
- - Replace spaces and punctuation with `-`
130
- - Collapse multiple `-` into one
131
- - Trim `-` from start and end
132
- - Maximum length 40 characters
133
- - Example: `card-component` or `card-component-dashboard`.
134
-
135
- 3. `branch_name`
136
- - Format: `project/feature/<feature_slug>`
137
- - Example: `project/feature/card-component`.
138
-
139
- If you cannot infer a sensible `feature_title` and `feature_slug`, ask the user to clarify instead of guessing.
140
-
141
- ## Step 2.4 Research the codebase read-only (fan out where possible)
17
+ - `--grill-me` — interview the user, one question at a time, before writing (Step 4).
18
+ - `--parity` — the spec may set numeric parity bars against a reference. Without it, `proof: functional`.
19
+ - Strip the flags first; they are never part of the brief or the file name. An unrecognised `--flag` is part of the brief only if it is clearly prose — otherwise ask. No brief → ask for one. Never guess a path or URL.
142
20
 
143
- A spec that guesses at the codebase produces a plan that guesses at the codebase. Before drafting any
144
- requirement, investigate read-only: the project `SPEC.md` (in full), `DESIGN.md` where the feature has a
145
- UI, any sibling-skill protocol the feature is built on (Step 2.6), the closest existing feature to
146
- mirror, the real conventions in use, and the concrete integration points the feature will touch.
21
+ ## Ground rules
147
22
 
148
- This research can be **fanned out**. Emit one visible status line so the user sees the path chosen —
149
- either `🔀 [bt-spec] subagent tool detected — fanning out research to N read-only subagents` or
150
- `➡️ [bt-spec] no subagent tool — researching sequentially`. If a subagent-spawning tool is available
151
- (see *Subagents — invoking this skill IS the request* above), launch up to 3 **read-only** subagents and
152
- divide the targets among them — for example: one reads `SPEC.md` + `DESIGN.md` and reports the sections
153
- this feature must conform to; one finds the closest existing feature and extracts the conventions to
154
- mirror; one lists integration points, constraints, and existing dependencies. Each returns concise
155
- conclusions — findings and file paths, not file dumps — which you synthesize yourself.
23
+ - **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.
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 — 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.
25
+ - **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.
26
+ - **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.
156
27
 
157
- **Narrate the whole step** (see *Progress narration — NEVER go silent* above). This is the step that most
158
- often runs for minutes, so it is where the rule matters most. The required cadence:
28
+ ## Step 1. Arguments, name, branch
159
29
 
160
- - One `🚀 [bt-spec] Subagent i/N → <what it investigates>` line per subagent as it is launched, and prefer
161
- the background / non-blocking launch mode so completions return to you one at a time.
162
- - One `✅ [bt-spec] Subagent i/N done — <one-line finding>` line as each returns; a `⏳ [bt-spec] Waiting on
163
- …` line if you are idle with subagents still outstanding.
164
- - On the sequential path, one `🔎 [bt-spec] …` line before each read/search and one result line after it.
165
- - When everything is in: `🧩 [bt-spec] Research complete — <n> findings synthesized`, followed by a 3–6
166
- bullet research summary (key findings with file paths), before moving on to Step 2.5.
30
+ 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.
167
31
 
168
- Two hard rules, because this skill is planning-only: every subagent is **read-only** (it may read,
169
- search and report; it may NOT edit files, write files, or run build/test/shell commands), and **you**
170
- write the spec — a subagent never drafts spec content. Research subagents need not re-read the Agent
171
- Reference. If anything they report contradicts `SPEC.md`, that is a finding to raise with the user, not
172
- something to silently resolve.
32
+ 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.
173
33
 
174
- ## Step 2.5 Apply the project design system (DESIGN.md)
34
+ ## Step 2. Read the project
175
35
 
176
- This project's design system is defined in the `DESIGN.md` file at the repository root. `DESIGN.md` is the single source of truth for all design decisions — do NOT pull styling from Figma, external links, or invent your own values. (Figma may be used in a separate process to author `DESIGN.md`, but specs reference `DESIGN.md`, never Figma directly.)
36
+ - **`SPEC.md`** (repository root) is the project's source of truth for architecture, systems, conventions and decisions. Read its headings, Architecture, Conventions, and the systems this feature touches. The feature must fit it. **If the idea conflicts with SPEC.md, stop and tell the user before writing.** Verification procedures described in SPEC.md are tooling the feature may reuse, not requirements it inherits.
37
+ - **If `SPEC.md` is missing or an empty stub, ask the user first** whether to create it from the scaffold at the end of this file. Yes → write it, then continue against it. No → continue, and note in the spec: `"No project SPEC.md content yet — following existing codebase conventions."`
38
+ - **`DESIGN.md`** (only if the feature has UI): it is the single source of truth for design — never Figma or invented values. Cite the tokens and shared components the feature uses in 3–8 bullets. Missing → note `"No DESIGN.md design system found — follow the existing UI conventions already in the codebase."` No UI → say no design tokens apply.
39
+ - **Research the codebase, sized to the feature.** Find the closest existing feature to mirror, the real conventions, and the integration points. For a `small` feature do this inline; fan out to up to 3 **read-only** subagents only for `medium` / `large` (they report findings and file paths, never draft the spec; if a finding contradicts SPEC.md, raise it with the user rather than resolving it silently). Record the result in the spec's `## Research Notes` so bt-plan starts from it.
177
40
 
178
- If the feature has any UI or visual surface:
41
+ ## Step 3. Sibling-skill patterns
179
42
 
180
- 1. Read `DESIGN.md`. If it is missing or has no real design system yet, record this note in the spec and continue: `"No DESIGN.md design system found — follow the existing UI conventions already in the codebase."`
181
- 2. Identify the parts of the design system relevant to this feature and cite them, by name, in the spec — for example:
182
- - Layout and spacing scale
183
- - Typography tokens (font family, size, weight)
184
- - Color tokens and semantic roles (primary, surface, border, error, etc.)
185
- - Border radius, shadows, elevation
186
- - Shared components, icons, buttons and inputs the feature should reuse
187
- 3. Summarise these as 3 to 8 concise bullet points that reference the `DESIGN.md` tokens and components by name, so implementation stays consistent with the system.
43
+ If the feature is built on a pattern owned by another skill (bt-design's 3D-Hero-Scroll, bt-atlas, bt-convert …), or the brief names a builder skill ("using bt-hero …", "using bt-prototype …"), **read that skill's SKILL.md and relevant reference before writing requirements.** *(Where skills load through a tool: `load_skill('<name>')`, then `read_skill_resource` with the paths it returns — never a guessed path. Where skills are files on disk: read them from the skills directory this skill was loaded from — e.g. `~/.claude/skills/`, `~/.agents/skills/`, or the project's `.claude/skills/` / `.agents/skills/`.)* For 3D-scroll / scroll-scrubbed / cinematic-hero features that is bt-design's `references/3d-hero-scroll.md`.
188
44
 
189
- If the feature is purely non-visual (no UI), note that no design system tokens apply and continue.
45
+ - 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.
46
+ - Keep a behavioral option separate from the feature's route/DOM scope — `sweep` is not "which page it lives on".
47
+ - List which optional controls are in or out.
48
+ - 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.
190
49
 
191
- ## Step 2.6 Honor sibling-skill patterns (read the sub-skill's protocol)
50
+ ## Step 4. `--grill-me` (only with the flag)
192
51
 
193
- Some features are built on a deterministic pattern **owned by a sibling skill** — e.g. bt-design's **3D-Hero-Scroll** (scroll-scrubbed cinematic hero), bt-atlas texture variants, bt-convert conversions. When the feature matches such a pattern, that sub-skill — not your own paraphrase of the brief — is the authority for how the feature must behave. Skipping this step is how a documented behavior silently disappears from the spec.
52
+ Interview the user until the design is decided, after Steps 2–3 so questions are grounded in the real code:
194
53
 
195
- 1. **Detect the pattern — or an explicitly named builder skill.** Decide whether the feature matches a sibling-skill pattern. If it does, **read that sub-skill's SKILL.md and the relevant reference BEFORE drafting Functional Requirements.** *(How to read a sibling skill: where skills are loaded with a tool — the Babylon Toolkit App Builder platform — call `load_skill('<name>')`, then fetch its bundled references with `read_skill_resource` using the paths the load returns, never a guessed path. Where skills are files on disk — Claude Code — read `<name>/SKILL.md` and its `references/` from the same skills directory, `~/.claude/skills/` or the project's `.claude/skills/`. Skip the load for anything already in your context; on a tool host the per-response load budget is small, so spend it on the skills this feature actually needs.)* (For 3D-scroll / scroll-scrubbed / cinematic-hero features, read bt-design's `references/3d-hero-scroll.md`.) **If the brief explicitly names a sibling _builder_ skill** — e.g. "…**using bt-hero** to create …" or "…**using bt-prototype** --count:25 …" — read that skill's SKILL.md and run **its own intake step** (bt-hero Steps 1–2 → a hero brief; bt-prototype Steps 1–2 → the `_directions.md` manifest), then fold that output into this spec. The builder contributes intake only; this spec loop owns the build and verification. Resolve any of the builder's intake questions here, at spec time, so nothing prompts downstream.
196
- 2. **Capture the required behavioral config verbatim.** Record the pattern's required config/behavior as explicit Functional Requirements, using the sub-skill's **own names and defaults, unchanged** — do not rename, omit, or invent defaults. Example (3D-Hero-Scroll): `sweep: page|hero`, default **`page`** — PLAY glides through to the document bottom and END jumps there, and the whole landing page is swept and must share the film's design system. If the sub-skill specifies a default, the spec inherits it unless the brief explicitly overrides it (state the override and why).
197
- 3. ⚠️ **Never collapse a sub-skill's behavioral setting into a route/DOM-scope classifier.** A feature's *scope* (which route or surface it targets) is a **different axis** from a sub-skill's *behavioral options*. Keep them separate and name the behavior with the sub-skill's own term. Concretely: a 3D-hero's `sweep` is NOT "which page the feature lives on" — record `sweep` as its own requirement; do **not** fold it under a "reach / scope / routing" heading, where it will be lost or inverted.
198
- 4. **List optional controls in/out.** Record which of the pattern's optional controls/features are included or omitted (with the sub-skill's defaults), so the plan and execute phases can verify them.
54
+ - One question at a time (`AskUserQuestion` where available), your recommended answer first, labelled `(Recommended)`.
55
+ - If the answer is in the repo, go find it instead of asking. Never ask what the brief, SPEC.md, DESIGN.md or a sibling skill already settles.
56
+ - Go depth-first: resolve a decision before the questions that depend on it.
57
+ - Write every answer into the spec (requirement, acceptance criterion or edge case) plus a `## Decisions` entry with the why and the rejected alternative.
58
+ - Stop when only implementation choices remain, or when the user says "enough" — then put unexplored branches in `## Open Questions` with your recommended answer, and note in the spec that grilling ended early.
199
59
 
200
- If the feature matches no sibling-skill pattern, note that and continue.
60
+ ## Step 5. Classify, then write the spec
201
61
 
202
- ## Step 2.7 `--grill-me` — interrogate until the design is decided (ONLY when the flag is present)
62
+ - **`spec_impact`** — `yes` if the feature adds or changes a system, convention, dependency or architectural decision in SPEC.md; else `no`. This decides whether the plan ends with an `Update SPEC.md` task.
63
+ - **`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.
64
+ - **`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.
203
65
 
204
- Run this step **only if `grill_me` is true**. Skip it entirely otherwise — the default one-shot path is unchanged.
205
-
206
- Without the flag this skill drafts a spec from a short brief in a single pass, and every decision it could not make lands in `## Open Questions` — a section nothing downstream is obligated to read or resolve. Grill mode replaces that guessing with a real interview, and its output lands in the sections that *are* read: `## Functional Requirements`, `## Acceptance Criteria`, `## Possible Edge Cases`, and the `## Decisions` log.
207
-
208
- Run this **after Step 2.4**, so every question is grounded in the real codebase rather than generic, and **after Step 2.6**, so a sibling skill's own intake questions are folded into this one interview instead of being asked twice.
209
-
210
- **The loop:**
211
-
212
- > Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one by one. For each question provide your recommended answer. Ask the questions one at a time. If a question can be answered by exploring the codebase, explore the codebase instead.
213
-
214
- The rules that make that loop work:
215
-
216
- 1. **One question at a time.** Use `AskUserQuestion` where you have it, with your recommended answer as the FIRST option, labelled `(Recommended)`. Never batch a wall of questions, and never move on past a question the user has not answered.
217
- 2. **Explore before you ask.** If the answer is discoverable in the repo — an existing convention, how the closest prior feature did it, a dependency already present — go find it and offer what you found as the recommendation, rather than spending a question on it. Reuse the Step 2.4 findings first; a read-only subagent is the right tool only when the search is genuinely broad. Say so while you do it — `🔎 [bt-spec] Checking the codebase for <X> before asking …` — so a pause between questions never reads as the interview having stalled.
218
- 3. **Depth-first down the design tree.** Resolve a branch's dependencies before opening the next branch — a decision that invalidates three later questions must be asked *before* them. Name the branch you are on, so the user can see the shape of what remains.
219
- 4. **Never ask what is already settled.** The brief, `SPEC.md`, `DESIGN.md`, and a named sibling skill's documented defaults are answers, not questions. Confirm one of them in a single line only where this feature would plausibly override it.
220
- 5. **Record as you go.** Write every answer into the spec body — as a requirement, an acceptance criterion, or an edge case — *plus* a `## Decisions` entry carrying the *why* and the rejected alternative. An answer that exists only in this transcript is gone the moment the plan phase opens a fresh context.
221
- 6. **Stop when the tree is resolved, not when you run out of questions.** You are done when every remaining unknown is genuinely an implementation choice for bt-plan, or something only the user can decide later. Say so explicitly, then continue to Step 3.
222
- 7. **The user can end it at any time** — "that's enough", "you decide the rest". Honor that immediately: record each unexplored branch in `## Open Questions` *with your recommended answer*, note in the spec that grilling ended early, and continue.
223
-
224
- **What must be true when this step ends:** `## Decisions` is non-empty and every entry carries a rationale, and `## Open Questions` holds only genuinely-undecided items — never something the user already answered.
225
-
226
- ## Step 3. Record the branch name (and switch to it where git is available)
227
-
228
- The `branch_name` derived from the `arguments` is **always** recorded in the spec header, so the plan
229
- and execute phases have a stable name to refer to regardless of host.
230
-
231
- - **If git is available:** before making any content, switch to a new branch using that name. If the name
232
- is already taken, append a version number: e.g. `project/feature/card-component-01`
233
- - **If git is NOT available:** the recorded name in the spec header IS the deliverable for this step. This
234
- is the expected outcome on such hosts — do not mention it as missing, unavailable, or a fallback.
235
-
236
- ## Step 4. Draft the spec content
237
-
238
- Emit `✍️ [bt-spec] Drafting _specs/<feature_slug>_spec.md …` before writing, and `💾 [bt-spec] Spec written — _specs/<feature_slug>_spec.md` once the file is saved.
239
-
240
- Create a markdown spec document that Plan mode can use directly and save it in the _specs folder as `<feature_slug>_spec.md`. Use the exact structure as defined in the feature spec template file @FEATURE.md located at the project root. **If that project template predates grill mode and has no `## Decisions` section, append one anyway whenever `grill_me` is true** (using the shape in the fallback template below, placed directly before `## Open Questions`) — the rationale must be recorded regardless of which template the project ships. The template includes required `spec_impact` and `size` header fields (**if the project's FEATURE.md predates `size`, add the `size:` line under `spec_impact:` anyway**) and a `Project Spec Alignment` section — fill both in from your SPEC.md read above (cite the SPEC.md sections the feature relies on, describe how it fits the architecture, and for `spec_impact: yes` state exactly what will change in SPEC.md and in which section). Do not add technical implementation details such as code examples. If the feature spec template file is missing, create a new feature spec file with the following sections:
241
- ```
242
- # Feature Spec Template
243
-
244
- > This is the template bt-spec uses to author `_specs/<feature_slug>_spec.md`.
245
- > Copy this structure verbatim. A feature spec is derived **from** and constrained
246
- > **by** the project [SPEC.md](SPEC.md) — the `Project Spec Alignment` section and
247
- > the `spec_impact` header field are required, not optional.
248
-
249
- ---
66
+ Print `✍️ [bt-spec] Drafting _specs/<feature_slug>_spec.md …`, then write the spec to `_specs/<feature_slug>_spec.md` using the project's `FEATURE.md` template if it exists (add any header field or section below that it lacks), otherwise this structure. No implementation detail or code examples.
250
67
 
68
+ ```markdown
251
69
  # Spec for <feature-name>
252
70
 
253
71
  branch: project/feature/<feature-name>
254
72
  design_system: DESIGN.md
255
- spec_impact: <yes|no> # yes if this feature adds/changes a system, convention, dependency, or architectural decision in SPEC.md
256
- size: <small|medium|large> # small ≈ 1–2 h by hand, one system; medium ≈ a day; large ≈ multi-day / multi-system / pipeline — drives plan size
73
+ spec_impact: <yes|no>
74
+ size: <small|medium|large>
75
+ proof: <functional|parity>
257
76
 
258
77
  ## Summary
259
- <one-paragraph description of the feature>
78
+ <one paragraph>
260
79
 
261
- ## Project Spec Alignment (from SPEC.md — REQUIRED)
262
- - SPEC.md sections this feature relies on or must conform to: <cite by name, e.g. "Game Systems › Inventory", "Conventions">
263
- - How this feature fits the existing architecture: <...>
264
- - **spec_impact = yes** → what will change in SPEC.md and which section(s): <architecture / system / convention / decision / dependency + the new state>
265
- - **spec_impact = no** → confirm this feature introduces no architectural, system, convention, or dependency change.
266
- - Conflicts with SPEC.md (if any): <describe; these must be resolved/flagged before planning>
80
+ ## Project Spec Alignment (from SPEC.md)
81
+ - SPEC.md sections this feature relies on: <by name>
82
+ - How it fits the architecture: <...>
83
+ - spec_impact = yes → what will change in SPEC.md, and where: <...> (or: confirms no architectural change)
84
+ - Conflicts with SPEC.md (if any): <...>
267
85
 
268
86
  ## Functional Requirements
269
- - ...
270
- <!-- If this feature is built on a sibling-skill pattern (e.g. bt-design
271
- 3D-Hero-Scroll), record that pattern's REQUIRED behavioral config here as
272
- explicit requirements, using the sub-skill's own names + defaults verbatim
273
- (e.g. `sweep: page` — PLAY/END sweep to the document bottom). Keep such
274
- behavior SEPARATE from the feature's route/DOM scope; never fold a
275
- behavioral setting under a "reach/scope/routing" heading. (See bt-spec
276
- Step 2.6.) -->
277
-
278
- ## Design System Reference (from DESIGN.md, only if the feature has UI)
279
- - DESIGN.md tokens/components this feature uses: ...
280
- - Layout / spacing / typography notes: ...
281
- - Key visual constraints: ...
282
- - Sibling-skill behavioral config (if any), e.g. 3D-Hero-Scroll `sweep`: ...
87
+ - ... <!-- sibling-skill behavioral config goes here verbatim, separate from route/scope -->
88
+
89
+ ## Design System Reference (only if the feature has UI)
90
+ - DESIGN.md tokens/components used: ...
283
91
 
284
92
  ## Possible Edge Cases
285
93
  - ...
286
94
 
287
95
  ## Acceptance Criteria
96
+ - ... <!-- what a user would notice; numeric parity bars only when proof: parity -->
97
+
98
+ ## Decisions <!-- required with --grill-me -->
99
+ - **<decision>.** <why.> Rejected: <alternative> (<why not>).
100
+
101
+ ## Open Questions <!-- only genuinely undecided items -->
288
102
  - ...
289
103
 
290
- ## Decisions _(the "why" — REQUIRED when run with `--grill-me`)_
291
- <!-- Mirrors SPEC.md's Decisions log, at feature scope. One entry per settled
292
- design decision: what was chosen, why, and what was rejected. bt-plan reads
293
- the feature spec in full, so this is how a decision's rationale survives into
294
- the plan phase instead of being relitigated there — and for
295
- spec_impact: yes features it feeds the final `Update SPEC.md` task directly. -->
296
- - **<decision>.** <why — the deciding constraint or the precedent in the codebase.>
297
- Rejected: <alternative> (<why not>). → <FR-n, AC-n>
298
-
299
- ## Open Questions
300
- <!-- ONLY genuinely-undecided items. Anything answered during grilling belongs in
301
- Functional Requirements / Acceptance Criteria / Possible Edge Cases plus a
302
- Decisions entry above — never parked here. -->
104
+ ## Research Notes <!-- key files, the pattern to mirror, integration points — with paths -->
303
105
  - ...
304
106
 
305
107
  ## Testing Guidelines
306
- Create a test file(s) in the ./tests folder for the new feature, and create meaningful tests for the following named cases (each with its expected outcome), without going too heavy — cover the Acceptance Criteria and the listed edge cases, not exhaustive probing:
108
+ Create test file(s) in ./tests for these named cases, without going heavy:
307
109
  - <case> → <expected outcome>
308
110
  ```
309
111
 
310
- ### Validate The Project Spec
112
+ ## Step 6. Report
311
113
 
312
- This is the **fallback scaffold** referenced by the prompt-first decision in *The Project Specification* (top of this skill). When the project's **SPEC.md** is missing or is still a stub and **the user answered yes**, write exactly this content to `SPEC.md` at the repository root *before* drafting the feature spec, then align the feature to it. If the user answered **no**, skip creating it and record the "No project SPEC.md content yet…" note in the feature spec instead. The default project spec scaffold:
313
114
  ```
314
- # Project Spec
115
+ Branch: <branch_name>
116
+ Spec file: _specs/<feature_slug>_spec.md
117
+ Title: <feature_title>
118
+ ```
315
119
 
316
- > **This is the source of truth for the project.** It defines the durable,
317
- > cross-feature architecture, systems, conventions, and decisions. Feature specs
318
- > in `_specs/` are derived **from** and constrained **by** this document.
319
- >
320
- > **Read this before speccing, planning, or executing any feature.** If a request
321
- > conflicts with this spec, flag it before proceeding. When a landed feature
322
- > changes anything below, update this file to match what was built.
120
+ Do not print the spec unless asked.
323
121
 
324
- ---
122
+ ## Project SPEC.md scaffold (used only when the user says yes in Step 2)
325
123
 
326
- ## Architecture & Module Layout _(current-state — replace/merge)_
327
- _Top-level structure, entry points, how the app is built and run. How modules are
328
- organized and depend on each other._
124
+ ```markdown
125
+ # Project Spec
329
126
 
127
+ > The source of truth for this project: its durable architecture, systems, conventions and decisions.
128
+ > Feature specs in `_specs/` are derived from and constrained by this file. It describes the **product** —
129
+ > what exists and why — never how a feature was verified (capture protocols, tool lists, ledgers).
130
+
131
+ ## Architecture & Module Layout _(current-state — replace/merge)_
330
132
  - _(Seed placeholder — replaced on first real content.)_
331
133
 
332
134
  ## Game Systems _(current-state — replace/merge)_
333
- _Each system, its responsibility, and its boundaries (what it owns vs. what it
334
- delegates). One subsection per system._
335
-
336
- - _(Seed placeholder — replaced on first real content.)_
135
+ - _(Seed placeholder — one subsection per system: what it owns, what it delegates.)_
337
136
 
338
137
  ## Conventions _(current-state — replace/merge)_
339
- _Naming, file/folder organization, script-component patterns, state management,
340
- styling, error handling, testing patterns actually used in this repo._
341
-
342
138
  - Prefer ESM imports throughout.
343
139
  - Use Babylon Toolkit script component patterns rather than ad-hoc BabylonJS wiring, per the Agent Reference.
344
140
  - Keep game systems modular.
345
141
 
346
142
  ## Decisions _(append-only log)_
347
- _Architectural decisions and their rationale — the "why", so future features don't
348
- relitigate settled choices. Append new entries; supersede rather than delete._
349
-
350
- - _(Record decisions here as they are made, newest last.)_
143
+ - _(Newest last. To reverse a decision, add a new entry that supersedes it.)_
351
144
 
352
145
  ## Dependencies _(current-state — replace/merge)_
353
- _Runtime and build dependencies with versions, and why each is here. Nothing new
354
- lands without an entry._
355
-
356
146
  - **BabylonJS** — engine.
357
147
  - **Babylon Toolkit** — Unity-style script components, scene management.
358
148
 
359
- ---
360
-
361
149
  ## How to update this spec
362
-
363
- This file is an initial **seed scaffold**. Sections carry a mode tag in their
364
- heading — follow it exactly when writing back:
365
-
366
- - **`(current-state — replace/merge)`** — Architecture, Game Systems, Conventions,
367
- Dependencies. These describe *what is true now*. On the first real content,
368
- **remove the seed placeholder** and write the actual content. On later features,
369
- **merge/replace** so the section keeps matching the shipped code — never leave
370
- stale text, never let it contradict reality.
371
- - **`(append-only log)`** — Decisions. **Append** a new entry (newest last);
372
- preserve history. To reverse a past decision, add a new entry that supersedes it
373
- — do not delete the old one.
374
-
375
- Add a new Game System as its own subsection under Game Systems. Record every new
376
- dependency (with version + why) under Dependencies as part of the task that
377
- introduces it.
378
-
379
- ## How this spec stays true (the spec-driven loop)
380
-
381
- - **bt-spec (read down):** reads this file, aligns the feature to it, flags
382
- conflicts, and records a `spec_impact` classification in the feature spec.
383
- - **bt-plan (read down):** treats this file as a required analysis input; the plan
384
- must conform. For spec-impacting features it appends an explicit
385
- **`Update SPEC.md`** task so the write-back is tracked.
386
- - **bt-execute (write up):** reads this file before each task, flags any divergence
387
- from reality, and runs the `Update SPEC.md` task through the same verifier gate
388
- as every other task — this file is never allowed to silently drift.
150
+ - `(current-state — replace/merge)` sections say what is true now: replace seed placeholders with real content, then keep them matching the shipped code.
151
+ - `(append-only log)`: append, never delete.
152
+ - Add each new Game System as its own subsection; record every new dependency (version + why) in the task that introduces it.
153
+ - bt-spec reads this file and aligns the feature to it; bt-plan conforms to it and adds an `Update SPEC.md` task for spec-impacting features; bt-execute runs that task through the same verifier as every other task.
389
154
  ```
390
-
391
- ## Step 5. Final output to the user
392
-
393
- After the file is saved, respond to the user with a short summary in this exact format:
394
-
395
- Branch: <branch_name>
396
- Spec file: _specs/<feature_slug>_spec.md
397
- Title: <feature_title>
398
-
399
- Do not repeat the full spec in the chat output unless the user explicitly asks to see it. The main goal is to save the spec file and report where it lives and what branch name to use.