@babylonjs-toolkit/agent 1.1.11 → 1.1.14
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 +42 -18
- package/package.json +1 -1
- package/skills/bt-gauntlet/SKILL.md +173 -220
- package/skills/bt-gauntlet/references/blender-model-pipeline.md +194 -0
- package/skills/bt-gauntlet/references/critic-rubrics.md +179 -0
- package/skills/bt-gauntlet/references/loop-templates.md +131 -0
- package/skills/bt-gauntlet/references/spec-composition.md +87 -0
- package/skills/bt-gauntlet/references/target-images.md +121 -0
- package/skills/bt-gauntlet/references/unity-level-pipeline.md +285 -0
- package/skills/bt-gauntlet/references/workspace.md +133 -0
- package/skills/bt-plan/SKILL.md +173 -169
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
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.
|
|
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. 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
|
-
Create a detailed technical
|
|
7
|
+
Create a detailed technical implmentation plan for the specified feature spec and save in the _specs folder as `<feature-name>_plan.md`. Always generate implmentation tasks or steps (prefer to call them tasks).
|
|
8
8
|
|
|
9
|
-
Use the user
|
|
9
|
+
Use the user’s message after the skill name as the `arguments`.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Invocation
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
/bt-plan <feature-spec> <optional-brief>
|
|
16
|
+
/bt-plan [--heavy] <feature-spec> <optional-brief>
|
|
17
17
|
```
|
|
18
18
|
- **`<feature-spec>`** — the feature spec file to create a plan for. This is the *blueprint*.
|
|
19
19
|
- **`<optional-brief>`** — the brief or instructions for generating the plan. This is the *variable*.
|
|
20
|
-
-
|
|
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:
|
|
21
22
|
- **Both a spec file and a brief** → normal full planning.
|
|
22
23
|
- **A spec file only** → normal full planning; the brief defaults to "Generate a detailed implementation plan".
|
|
23
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.
|
|
@@ -27,42 +28,15 @@ Example:
|
|
|
27
28
|
```
|
|
28
29
|
/bt-plan → @feature_spec.md → "Generate a detailed implementation plan"
|
|
29
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
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
---
|
|
33
35
|
|
|
34
|
-
## ⚠️ The plan is the memory — write it for a fresh context, forty tasks later
|
|
35
|
-
|
|
36
|
-
A plan from this skill 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.
|
|
37
|
-
|
|
38
|
-
So the plan must be 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 that is 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.
|
|
39
|
-
|
|
40
|
-
**What must be decided in the plan, not left to be re-derived per task:**
|
|
41
|
-
|
|
42
|
-
| Class | What the plan must record |
|
|
43
|
-
| --- | --- |
|
|
44
|
-
| Architecture | module boundaries, which layer owns what, dependency direction, where state lives, sync vs async, event vs call |
|
|
45
|
-
| 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`") |
|
|
46
|
-
| 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 |
|
|
47
|
-
| Data shapes & state | schemas, field names + types, defaults, invariants, persistence format, migration behaviour |
|
|
48
|
-
| Algorithms & formulas | pseudocode or real code for anything non-obvious: math, ordering, caching, retry, timing, physics tuning values |
|
|
49
|
-
| Naming | the actual names of the new things (classes, functions, fields, files, CSS classes, events, test names) — chosen once, following the repo's conventions |
|
|
50
|
-
| 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" |
|
|
51
|
-
| Dependencies | exactly which packages/versions are added, or an explicit "no new dependencies" |
|
|
52
|
-
| Sibling-skill behavioural config | every option of a sibling-skill pattern (e.g. 3D-Hero-Scroll `sweep`) with its value, not just its name |
|
|
53
|
-
| Test design | the test file(s), the harness/pattern to copy, the named cases with expected outcomes, and the exact command to run |
|
|
54
|
-
| Ordering & dependencies | which tasks depend on which; what must keep working between tasks (temporary shims, feature flags) and which later task removes them |
|
|
55
|
-
|
|
56
|
-
**Corollary — write the code when the code IS the decision.** This skill never edits source files, but it 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`").
|
|
57
|
-
|
|
58
|
-
**Corollary — many small, self-contained tasks beat few large ones.** A task should fit in one fresh context: a handful of files, one clear outcome, everything it needs either in its own block or cited by name from the Decisions and Design Reference. Split a task whenever it grows past roughly ten steps, two hundred lines of new code, or four files.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
36
|
## Quick Plan mode (no feature spec file)
|
|
63
37
|
|
|
64
38
|
> 🛑 **"Quick" refers ONLY to skipping the spec file — never to skipping steps, and NEVER to executing the plan.**
|
|
65
|
-
> Quick Plan is still **PLANNING MODE**. It ends the moment `_specs/<feature-name>_plan.md` is
|
|
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.
|
|
66
40
|
|
|
67
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:
|
|
68
42
|
|
|
@@ -72,9 +46,8 @@ When invoked with a brief but **no feature spec file**, produce a plan from the
|
|
|
72
46
|
| Full feature requirements | Use the brief itself as the requirements, expanded by the Step 1 codebase analysis. |
|
|
73
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`. |
|
|
74
48
|
| `Project Spec Alignment` section | Derive alignment directly from root `SPEC.md` + the analysis. |
|
|
75
|
-
| `Decisions` section | Start empty; every interview answer and every choice you make becomes a plan `## Decisions` entry. |
|
|
76
49
|
|
|
77
|
-
**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
|
|
50
|
+
**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.
|
|
78
51
|
|
|
79
52
|
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`.
|
|
80
53
|
|
|
@@ -94,122 +67,68 @@ Because there is no spec, the clarifying questions the spec process would have a
|
|
|
94
67
|
- 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.
|
|
95
68
|
- 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.
|
|
96
69
|
- 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.
|
|
97
|
-
- 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
|
|
70
|
+
- 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.
|
|
98
71
|
|
|
99
72
|
The goal is the same as a spec: a plan optimized to what the user actually wants — reached by asking, not by guessing.
|
|
100
73
|
|
|
101
74
|
---
|
|
102
75
|
|
|
103
|
-
##
|
|
76
|
+
## Heavy Plan mode (`--heavy`)
|
|
104
77
|
|
|
105
|
-
|
|
78
|
+
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.
|
|
106
79
|
|
|
107
|
-
|
|
80
|
+
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`.
|
|
108
81
|
|
|
109
|
-
|
|
82
|
+
### Why: the plan is the memory
|
|
110
83
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
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.
|
|
114
|
-
|
|
115
|
-
**Hard rules:**
|
|
116
|
-
|
|
117
|
-
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, writing a large plan — 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 …`
|
|
118
|
-
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.
|
|
119
|
-
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.
|
|
120
|
-
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.
|
|
121
|
-
5. **Mark the phase transitions.** Emit a line when research starts, when it completes, when drafting begins, when the cold-context audit starts and what it found, and when the final write happens — 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 …`.
|
|
122
|
-
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.
|
|
123
|
-
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, a large write), the line *preceding* it must say what it is and roughly how long it is expected to take. A plan with 50 tasks is a large write — say so before writing it, and consider writing it in two or three appends with a status line between them.
|
|
124
|
-
|
|
125
|
-
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, drafting, and the audit. When in doubt, say what you are doing.
|
|
126
|
-
|
|
127
|
-
## ⚠️ Required Reading Before Any Babylon Work
|
|
128
|
-
|
|
129
|
-
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:
|
|
130
|
-
|
|
131
|
-
https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md
|
|
132
|
-
|
|
133
|
-
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.
|
|
134
|
-
|
|
135
|
-
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.
|
|
84
|
+
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.
|
|
136
85
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
**Do the API homework once, here.** When a task uses a Babylon Toolkit component or BabylonJS API, the plan should name the exact class/method/property and show the 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 *now* and copy the correct usage into the plan.
|
|
86
|
+
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.
|
|
140
87
|
|
|
141
|
-
|
|
88
|
+
**What a heavy plan must decide and record, rather than leave to be re-derived per task:**
|
|
142
89
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- Either way, you MUST still perform the comprehensive analysis in Step 1 with full rigor. Never skip it.
|
|
157
|
-
|
|
158
|
-
## Step 1. Comprehensive project analysis (REQUIRED before any plan)
|
|
159
|
-
|
|
160
|
-
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 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.
|
|
161
|
-
|
|
162
|
-
**Ask the subagents for plan-grade detail.** Because the plan must carry exact anchors and patterns, they 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". You will paste these into the Design Reference.
|
|
163
|
-
|
|
164
|
-
**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:
|
|
165
|
-
|
|
166
|
-
- 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.
|
|
167
|
-
- 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.
|
|
168
|
-
- On the sequential path, one `🔎 [bt-plan] …` line before each read/search (each of the investigation points below) and one result line after it.
|
|
169
|
-
- 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.
|
|
170
|
-
|
|
171
|
-
Before writing a single task, investigate the actual codebase read-only. This is mandatory — do NOT generate any plan content until this analysis is complete. Read and search the repo to discover, not assume:
|
|
90
|
+
| Class | What the plan must record |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| Architecture | module boundaries, which layer owns what, dependency direction, where state lives, sync vs async, event vs call |
|
|
93
|
+
| 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`") |
|
|
94
|
+
| 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 |
|
|
95
|
+
| Data shapes & state | schemas, field names + types, defaults, invariants, persistence format, migration behaviour |
|
|
96
|
+
| Algorithms & formulas | pseudocode or real code for anything non-obvious: math, ordering, caching, retry, timing, physics tuning values |
|
|
97
|
+
| Naming | the actual names of the new things (classes, functions, fields, files, CSS classes, events, test names) — chosen once, following the repo's conventions |
|
|
98
|
+
| 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" |
|
|
99
|
+
| Dependencies | exactly which packages/versions are added, or an explicit "no new dependencies" |
|
|
100
|
+
| Sibling-skill behavioural config | every option of a sibling-skill pattern (e.g. 3D-Hero-Scroll `sweep`) with its value, not just its name |
|
|
101
|
+
| Test design | the test file(s), the harness/pattern to copy, the named cases with expected outcomes, and the exact command to run |
|
|
102
|
+
| Ordering & dependencies | which tasks depend on which; what must keep working between tasks (temporary shims, feature flags) and which later task removes them |
|
|
172
103
|
|
|
173
|
-
|
|
174
|
-
2. Map the project: top-level structure, entry points, how the app is built and run (build scripts, test runner, package manifests). Record the exact build and test commands — the plan's tasks will quote them.
|
|
175
|
-
3. Identify the conventions actually used in this repo: naming, file/folder organization, state management, styling, error handling, testing patterns. Capture each as a verbatim snippet with its `file:line`, not a description.
|
|
176
|
-
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, and its tasks should point at the exact functions to mirror.
|
|
177
|
-
5. List the concrete integration points the feature will touch: files, modules, APIs, data models, routes, config — with the real signatures at each point and the line where new code will be inserted.
|
|
178
|
-
6. Note relevant dependencies already available (and their versions) versus anything new that would be required.
|
|
179
|
-
7. Capture any constraints from the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md) and the feature spec.
|
|
180
|
-
8. Establish the test baseline: how tests are run, which tests cover the code being touched, and whether the suite is currently green (record the failing set if not, so a task run days later can tell new failures from old ones).
|
|
181
|
-
9. 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, and write the exact config values into the Design Reference.
|
|
104
|
+
**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`").
|
|
182
105
|
|
|
183
|
-
|
|
106
|
+
**Many small, self-contained tasks beat few large ones.** A task should fit in one fresh context: a handful of files, one clear outcome, everything it needs either in its own block or cited by name from the Decisions and Design Reference. Split a task whenever it grows past roughly ten steps, two hundred lines of new code, or four files.
|
|
184
107
|
|
|
185
|
-
|
|
108
|
+
**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.
|
|
186
109
|
|
|
187
|
-
|
|
110
|
+
**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.
|
|
188
111
|
|
|
189
|
-
|
|
112
|
+
### Step 1 additions in Heavy Plan mode
|
|
190
113
|
|
|
191
|
-
|
|
114
|
+
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.
|
|
192
115
|
|
|
193
|
-
|
|
116
|
+
### Heavy plan document
|
|
194
117
|
|
|
195
|
-
-
|
|
196
|
-
- the **test baseline** (command, current pass/fail state, which failures are pre-existing);
|
|
197
|
-
- in Quick Plan mode, the **interview answers** that stand in for the spec.
|
|
118
|
+
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**. A plan missing any of them is invalid; do not produce one.
|
|
198
119
|
|
|
199
|
-
|
|
120
|
+
**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.
|
|
200
121
|
|
|
201
|
-
|
|
122
|
+
**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:
|
|
202
123
|
|
|
203
124
|
```markdown
|
|
204
125
|
- **D3 — <decision, stated as a fact>.** <why: the deciding constraint, or the precedent in the codebase with file:line>
|
|
205
126
|
Rejected: <alternative> (<why not>). Binds: T4, T7.
|
|
206
127
|
```
|
|
207
128
|
|
|
208
|
-
|
|
129
|
+
Resolve every `Open Question` from the spec here. An open question that survives into execution gets answered by one task in isolation and, days later, differently by another. If you genuinely cannot resolve one without the user, ask the user now, then record the answer. "TBD", "to be decided during implementation", "the implementer may choose" and similar phrases are forbidden anywhere in a heavy plan.
|
|
209
130
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
The blueprint every task cites. This is where the shared names, shapes and code live, so that each task copies from one source instead of inventing its own. Use the sub-headings below (omit one only if it truly does not apply, and say so in one line):
|
|
131
|
+
**3. `## Design Reference`** — the blueprint every task cites, where the shared names, shapes and code live so each task copies from one source instead of inventing its own. Use these sub-headings (omit one only if it truly does not apply, and say so in one line):
|
|
213
132
|
|
|
214
133
|
- **File map** — a table of every file the feature creates, modifies, or deletes: `path | create/modify/delete | responsibility | touched by tasks`.
|
|
215
134
|
- **Module boundaries** — what owns what, which direction dependencies point, where state lives. A short ASCII diagram is welcome where it clarifies flow.
|
|
@@ -222,9 +141,7 @@ The blueprint every task cites. This is where the shared names, shapes and code
|
|
|
222
141
|
- **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.
|
|
223
142
|
- **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.
|
|
224
143
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
The ordered checklist. Use GitHub-style checkboxes so progress can be tracked directly in the file — one task per checkbox, numbered `T1`, `T2`, `T3` … in dependency order, each small enough to be implemented and verified on its own in a fresh context (see *many small, self-contained tasks* above). Every task uses this block. The fields marked **required** must be present on every task; the others are omitted only when they genuinely have nothing to say.
|
|
144
|
+
**4. `## Tasks`** — the ordered checklist, numbered `T1`, `T2`, `T3` … in dependency order with GitHub-style checkboxes, each small enough to be implemented and verified 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.
|
|
228
145
|
|
|
229
146
|
```markdown
|
|
230
147
|
## Tasks
|
|
@@ -251,74 +168,161 @@ The ordered checklist. Use GitHub-style checkboxes so progress can be tracked di
|
|
|
251
168
|
- Verify: `npm test -- tests/foo.test.ts` → 2 passing · `npx tsc --noEmit` → no errors · `grep -n "new FooService" src/bar.ts` → 1 hit # required — commands + expected output
|
|
252
169
|
```
|
|
253
170
|
|
|
254
|
-
Rules for
|
|
171
|
+
Rules for heavy task blocks:
|
|
255
172
|
|
|
256
173
|
- **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.
|
|
257
174
|
- **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.
|
|
258
175
|
- **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.
|
|
259
176
|
- **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.
|
|
260
|
-
- **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".
|
|
177
|
+
- **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.
|
|
261
178
|
- **Verify gives the command and the expected output**, so a fresh context compares against a stated value rather than judging.
|
|
262
179
|
- **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.
|
|
263
|
-
- When a task implements a **sibling-skill pattern**, its **Acceptance** must assert the skill-defined behavior in observable terms — e.g. for `sweep: page`, "PLAY auto-scrolls through to the document bottom and END jumps there", not merely "the hero renders". A plausible-looking result that dropped a documented behavior must fail acceptance. Prefer copying the sub-skill's template files as an early task (e.g. "T1 — copy + wire the 3D-Hero-Scroll engine") so later tasks only configure it, and put the exact config values in the Steps.
|
|
264
180
|
|
|
265
|
-
|
|
181
|
+
The **SPEC.md write-back task** is required under the same conditions as in Step 2 and is still the LAST task. In a heavy plan, **write the SPEC.md content in the task** — the exact paragraphs to merge into each current-state section and the exact Decisions entries to append (your `## Decisions` entries, promoted to project scope) — using the heavy task block (Steps that name each SPEC.md section and the text to insert, a **Code** block holding the exact markdown, a **Verify** of `grep -n "<distinctive phrase>" SPEC.md` → one hit each), so the write-back records what was planned rather than what one fresh context remembers at the end.
|
|
266
182
|
|
|
267
|
-
|
|
183
|
+
**5. `## How to execute this plan`** — the exact verbatim section from Step 2, unchanged.
|
|
268
184
|
|
|
269
|
-
|
|
270
|
-
- [ ] **T<n>** — Update SPEC.md to match what was built
|
|
271
|
-
- Depends on: T<n-1>
|
|
272
|
-
- Files: `SPEC.md` (modify)
|
|
273
|
-
- Applies: D1–D<k>
|
|
274
|
-
- Steps:
|
|
275
|
-
1. Under `## Game Systems` › `<System>`, replace the paragraph beginning "<first words>" with the text in **Code** › *Game Systems*.
|
|
276
|
-
2. Under `## Conventions`, append the bullet(s) in **Code** › *Conventions*.
|
|
277
|
-
3. Under `## Decisions`, append (never edit or delete) the entries in **Code** › *Decisions*, newest last.
|
|
278
|
-
4. Under `## Dependencies`, add <dependency + version + why> — or, if none was added, make no change.
|
|
279
|
-
- Code:
|
|
280
|
-
<the exact markdown for each section>
|
|
281
|
-
- Acceptance: SPEC.md accurately describes the architecture/systems/conventions/dependencies as actually implemented by the tasks above; no section contradicts the shipped code; the Decisions entries are appended, nothing deleted; new dependencies are listed. Follow SPEC.md's "How to update this spec" contract: **replace/merge** current-state sections (removing seed placeholders on first real content), **append** to the Decisions log.
|
|
282
|
-
- Verify: `grep -n "<a distinctive phrase from each inserted paragraph>" SPEC.md` → one hit each.
|
|
283
|
-
```
|
|
185
|
+
### Cold-context audit (required in Heavy Plan mode, before the plan is final)
|
|
284
186
|
|
|
285
|
-
|
|
187
|
+
The draft is not the plan. A plan written in one pass by the same mind that holds all the context always leaves gaps that mind cannot see — the "obvious" choice that was never written down, the name that was in your head but not on the page, the task that quietly assumes you remember an earlier one. Those gaps are exactly what a fresh context at task 40 will fill in differently. The audit finds them now.
|
|
188
|
+
|
|
189
|
+
Emit `🕵️ [bt-plan] Cold-context audit — reading the draft as a fresh executor …`. Then, if a subagent-spawning tool is available, launch **one read-only audit subagent** with a fresh context (it must NOT see your reasoning, only the files), and give it: the path of the draft plan, the repository root, and these instructions verbatim:
|
|
286
190
|
|
|
287
|
-
|
|
191
|
+
> You are a competent engineer with a fresh context. You have never seen this repository or this feature before, and you will execute one task at a time with no memory of the others. Read the plan at `<path>` in full. Then, for **every** task, check the plan against the actual codebase (read the files and anchors it names) and list every point where you would be **forced to decide, guess, look up, or infer** something the plan should have given you: a missing signature, name, value, file location or anchor; an anchor that does not match the real file; a step that states a goal instead of an instruction; a step that depends on knowing what an earlier task did rather than on the Design Reference; a name used in a task that is not defined in the Design Reference; a test case without an expected outcome; a Verify without an expected output; an edge case with no decided behaviour; an API call whose exact usage is not shown; any use of "TBD", "appropriate", "suitable", "as needed", "etc." or "the implementer may". Also flag any task that would not fit in one sitting or touches more than four files. Report as a list: `T<n> · step <k> · <what is missing> · <what you would have had to decide>`. Do not fix anything, do not write files, do not run builds or tests. Report "NO GAPS" only if you found none.
|
|
288
192
|
|
|
289
|
-
|
|
193
|
+
If no subagent tool is available, emit `➡️ [bt-plan] no subagent tool — self-auditing the draft` and perform the same read yourself, deliberately re-reading the plan top to bottom against the real files with the checklist above, one task at a time.
|
|
290
194
|
|
|
291
|
-
|
|
292
|
-
## How to execute this plan
|
|
195
|
+
Emit `🧾 [bt-plan] Audit found <n> gaps across <m> tasks` (or `… found NO GAPS`). Then **resolve every reported gap by editing the plan** — add the missing decision to `## Decisions`, the missing code/signature/name to `## Design Reference`, the missing instruction to the task — and emit `🔧 [bt-plan] Resolved <n>/<n> gaps`. If the audit found more than a handful of gaps, run it **once more** on the revised plan (`🕵️ [bt-plan] Second audit pass …`); stop after the second pass regardless, and list any gap you chose not to resolve, with why, in the plan's Codebase Analysis. A gap the audit reports that you cannot resolve without the user is a question for the user — ask it now. Re-writing the plan file after the audit is the one case where this skill writes it more than once; it is still the only file this skill ever writes.
|
|
293
196
|
|
|
294
|
-
|
|
295
|
-
- Run a single task with the bt-execute command (e.g. `bt-execute <this-file> T<n>`), run every remaining task in order with `bt-execute <this-file> ALL` (resumable — it skips tasks already checked), or implement the whole plan from a prompt like "implement the plan at <this-file>".
|
|
296
|
-
- Work the tasks top to bottom unless a task notes a different dependency order.
|
|
297
|
-
- 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]`.
|
|
298
|
-
- Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
|
|
299
|
-
```
|
|
197
|
+
Finish with `💾 [bt-plan] Plan finalized — _specs/<feature-name>_plan.md (<n> tasks, <k> decisions)`, then report the number of tasks and decisions, the two or three most consequential decisions (with their D-numbers), anything you were unable to resolve, and the same next-step hint as Quick Plan mode. Then **STOP** — heavy or not, this skill never begins T1.
|
|
300
198
|
|
|
301
|
-
|
|
199
|
+
---
|
|
302
200
|
|
|
303
|
-
|
|
201
|
+
## Subagents — invoking this skill IS the request
|
|
304
202
|
|
|
305
|
-
|
|
203
|
+
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.
|
|
306
204
|
|
|
307
|
-
|
|
205
|
+
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.
|
|
308
206
|
|
|
309
|
-
|
|
207
|
+
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.
|
|
310
208
|
|
|
311
|
-
|
|
209
|
+
## ⚠️ Progress narration — NEVER go silent
|
|
312
210
|
|
|
313
|
-
|
|
211
|
+
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.
|
|
314
212
|
|
|
315
|
-
|
|
213
|
+
**Hard rules:**
|
|
316
214
|
|
|
317
|
-
|
|
215
|
+
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 …`
|
|
216
|
+
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.
|
|
217
|
+
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.
|
|
218
|
+
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.
|
|
219
|
+
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 …`.
|
|
220
|
+
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.
|
|
221
|
+
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.
|
|
318
222
|
|
|
223
|
+
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.
|
|
224
|
+
|
|
225
|
+
## ⚠️ Required Reading Before Any Babylon Work
|
|
226
|
+
|
|
227
|
+
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:
|
|
228
|
+
|
|
229
|
+
https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md
|
|
230
|
+
|
|
231
|
+
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.
|
|
232
|
+
|
|
233
|
+
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.
|
|
234
|
+
|
|
235
|
+
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.
|
|
236
|
+
|
|
237
|
+
If a required fetch fails, STOP and tell me. Do not guess at the API.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Planning mode — do not implement
|
|
242
|
+
|
|
243
|
+
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`.
|
|
244
|
+
|
|
245
|
+
**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.
|
|
246
|
+
|
|
247
|
+
## Step 0. Confirm planning mode
|
|
248
|
+
|
|
249
|
+
A trustworthy plan requires a thorough, read-only investigation of the codebase before any plan is written.
|
|
250
|
+
|
|
251
|
+
- 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.
|
|
252
|
+
- Either way, you MUST still perform the comprehensive analysis in Step 1 with full rigor. Never skip it.
|
|
253
|
+
|
|
254
|
+
## Step 1. Comprehensive project analysis (REQUIRED before any plan)
|
|
255
|
+
|
|
256
|
+
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.
|
|
257
|
+
|
|
258
|
+
**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:
|
|
259
|
+
|
|
260
|
+
- 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.
|
|
261
|
+
- 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.
|
|
262
|
+
- 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.
|
|
263
|
+
- 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.
|
|
264
|
+
|
|
265
|
+
Before writing a single implementation step, investigate the actual codebase read-only. This is mandatory — do NOT generate any plan content until this analysis is complete. Read and search the repo to discover, not assume:
|
|
266
|
+
|
|
267
|
+
1. Read the referenced feature spec in full (from `_specs/` or the file named in `arguments`), **and read the project `SPEC.md` at the repository root in full.** SPEC.md is the source of truth for the durable architecture, systems, conventions, and decisions — the plan MUST conform to it. Note the feature spec's `spec_impact` field and its `Project Spec Alignment` section. **In Quick Plan mode there is no feature spec file** — treat the brief as the feature request, still read root `SPEC.md` in full, and *infer* the `spec_impact` and Project Spec Alignment from the analysis per the Quick Plan defaults table. If the plan you are about to write would conflict with SPEC.md (contradict a decision, cross a system boundary, break a convention), STOP and flag the conflict to the user before writing the plan; do not silently override the project spec.
|
|
268
|
+
2. Map the project: top-level structure, entry points, how the app is built and run (build scripts, test runner, package manifests).
|
|
269
|
+
3. Identify the conventions actually used in this repo: naming, file/folder organization, state management, styling, error handling, testing patterns.
|
|
270
|
+
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.
|
|
271
|
+
5. List the concrete integration points the feature will touch: files, modules, APIs, data models, routes, config.
|
|
272
|
+
6. Note relevant dependencies already available (and their versions) versus anything new that would be required.
|
|
273
|
+
7. Capture any constraints from the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md) and the feature spec.
|
|
274
|
+
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.
|
|
275
|
+
|
|
276
|
+
If the spec or codebase is too ambiguous to analyze responsibly, stop and ask the user rather than guessing.
|
|
277
|
+
|
|
278
|
+
*(In Heavy Plan mode, also apply the **Step 1 additions** listed under *Heavy Plan mode* above.)*
|
|
279
|
+
|
|
280
|
+
## Step 2. Write the plan
|
|
281
|
+
|
|
282
|
+
> **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.
|
|
283
|
+
|
|
284
|
+
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.
|
|
285
|
+
|
|
286
|
+
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.
|
|
287
|
+
|
|
288
|
+
Then write the implementation as an ordered checklist of discrete tasks. Use GitHub-style checkboxes so progress can be tracked directly in the file — one task per line, numbered T1, T2, T3 … in dependency order, each small enough to be implemented and verified on its own:
|
|
289
|
+
|
|
290
|
+
```markdown
|
|
291
|
+
## Tasks
|
|
292
|
+
|
|
293
|
+
- [ ] **T1** — <short task title>
|
|
294
|
+
- Files: `path/one`, `path/two`
|
|
295
|
+
- Details: <what to do>
|
|
296
|
+
- Acceptance: <how to know it is done>
|
|
297
|
+
- [ ] **T2** — <short task title>
|
|
298
|
+
- Files: `...`
|
|
299
|
+
- Details: <...>
|
|
300
|
+
- Acceptance: <...>
|
|
319
301
|
```
|
|
320
|
-
|
|
321
|
-
|
|
302
|
+
|
|
303
|
+
When a task implements a **sibling-skill pattern**, its **Acceptance** must assert the skill-defined behavior in observable terms — e.g. for `sweep: page`, "PLAY auto-scrolls through to the document bottom and END jumps there", not merely "the hero renders". A plausible-looking result that dropped a documented behavior must fail acceptance. Prefer copying the sub-skill's template files as an early task (e.g. "T1 — copy + wire the 3D-Hero-Scroll engine") so later tasks only configure it.
|
|
304
|
+
|
|
305
|
+
### SPEC.md write-back task (required when the feature is spec-impacting)
|
|
306
|
+
|
|
307
|
+
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:
|
|
308
|
+
|
|
309
|
+
```markdown
|
|
310
|
+
- [ ] **T<n>** — Update SPEC.md to match what was built
|
|
311
|
+
- Files: `SPEC.md`
|
|
312
|
+
- Details: Update the specific SPEC.md section(s) named in the feature spec's Project Spec Alignment — e.g. add/modify the affected Game System, record the new Convention or Decision (with rationale), and add any new Dependency + version. Follow SPEC.md's "How to update this spec" contract: **replace/merge** the current-state sections (Architecture, Game Systems, Conventions, Dependencies) — removing seed placeholders on first real content — and **append** to the Decisions log (never delete; supersede with a newer entry).
|
|
313
|
+
- Acceptance: SPEC.md accurately describes the architecture/systems/conventions/dependencies as actually implemented by the tasks above; no section contradicts the shipped code; new dependencies are listed.
|
|
322
314
|
```
|
|
323
315
|
|
|
324
|
-
|
|
316
|
+
Make this the LAST task so it captures the true final state. If the feature is genuinely not spec-impacting (`spec_impact: no`), omit this task, but state in the Codebase Analysis that no SPEC.md change is required.
|
|
317
|
+
|
|
318
|
+
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:
|
|
319
|
+
|
|
320
|
+
```markdown
|
|
321
|
+
## How to execute this plan
|
|
322
|
+
|
|
323
|
+
Each task above is a checkbox. To implement:
|
|
324
|
+
- Run a single task with the bt-execute command (e.g. `bt-execute <this-file> T<n>`), run every remaining task in order with `bt-execute <this-file> ALL` (resumable — it skips tasks already checked), or implement the whole plan from a prompt like "implement the plan at <this-file>".
|
|
325
|
+
- Work the tasks top to bottom unless a task notes a different dependency order.
|
|
326
|
+
- 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]`.
|
|
327
|
+
- Stop and report if a task cannot be completed. Do NOT check a box for partial, skipped, or unverified work.
|
|
328
|
+
```
|