@babylonjs-toolkit/agent 1.1.38 → 1.1.42
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 +73 -4
- package/bin/bt-agent.js +23 -1
- package/lib/bridge/api.js +74 -0
- package/lib/bridge/args.js +172 -0
- package/lib/bridge/blender/discover.js +98 -0
- package/lib/bridge/blender/run.js +141 -0
- package/lib/bridge/cli.js +677 -0
- package/lib/bridge/config.js +193 -0
- package/lib/bridge/log.js +103 -0
- package/lib/bridge/loop.js +239 -0
- package/lib/bridge/pairing.js +101 -0
- package/lib/bridge/policy.js +396 -0
- package/lib/bridge/protocol.js +91 -0
- package/lib/bridge/service.js +395 -0
- package/lib/bridge/unity/automation.js +135 -0
- package/lib/bridge/unity/discover.js +606 -0
- package/lib/bridge/unity/guard.js +208 -0
- package/lib/bridge/unity/ops.js +1294 -0
- package/lib/bridge/unity/run.js +169 -0
- package/lib/bridge/unity/scaffold/bt-bootstrap.cs +39 -0
- package/lib/bridge/unity/scaffold/bt-newscene.cs +27 -0
- package/lib/doctor.js +33 -0
- package/package.json +1 -1
- package/skills/bt-execute/SKILL.md +4 -2
- package/skills/bt-plan/SKILL.md +4 -2
- package/skills/bt-spec/SKILL.md +5 -2
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Runs one child process for the bridge (T24 step 4, D41): never through a shell, always with a hard
|
|
5
|
+
* timeout, stdout capped, stderr streamed line by line.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn: defaultSpawn } = require('child_process');
|
|
9
|
+
|
|
10
|
+
const MAX_STDOUT_BYTES = 5 * 1024 * 1024;
|
|
11
|
+
const MAX_STDERR_BYTES = 1024 * 1024;
|
|
12
|
+
const KILL_GRACE_MS = 5_000;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {{ code: number|null, stdout: string, stderr: string, timedOut: boolean, aborted: boolean }} RunResult
|
|
16
|
+
* @typedef {(file: string, args: string[], opts?: RunOptions) => Promise<RunResult>} RunProcess
|
|
17
|
+
* @typedef {{ cwd?: string, timeoutMs?: number, signal?: AbortSignal, onLine?: (line: string) => void, env?: NodeJS.ProcessEnv, spawn?: typeof defaultSpawn }} RunOptions
|
|
18
|
+
* @typedef {(file: string, args: string[], opts?: LaunchOptions) => Promise<RunResult>} LaunchDetached
|
|
19
|
+
* @typedef {{ cwd?: string, env?: NodeJS.ProcessEnv, waitMs?: number, signal?: AbortSignal, spawn?: typeof defaultSpawn }} LaunchOptions
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* An ordinary job: in the helper's process group, so Ctrl-C and a cancel stop it with the helper.
|
|
24
|
+
* @type {RunProcess}
|
|
25
|
+
*/
|
|
26
|
+
function runProcess(file, args, { cwd, timeoutMs = 120_000, signal, onLine, env, spawn = defaultSpawn } = {}) {
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
/** @type {Buffer[]} */
|
|
29
|
+
const out = [];
|
|
30
|
+
let outBytes = 0;
|
|
31
|
+
let err = '';
|
|
32
|
+
let partial = '';
|
|
33
|
+
let timedOut = false;
|
|
34
|
+
let aborted = false;
|
|
35
|
+
let settled = false;
|
|
36
|
+
/** @type {NodeJS.Timeout|undefined} */
|
|
37
|
+
let killTimer;
|
|
38
|
+
|
|
39
|
+
/** @type {import('child_process').ChildProcess} */
|
|
40
|
+
let child;
|
|
41
|
+
try {
|
|
42
|
+
child = spawn(file, args, { cwd, env, shell: false, windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
43
|
+
} catch (e) {
|
|
44
|
+
resolve({ code: null, stdout: '', stderr: String(e && e.message ? e.message : e), timedOut, aborted });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const stop = () => {
|
|
49
|
+
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
50
|
+
child.kill('SIGTERM');
|
|
51
|
+
killTimer = setTimeout(() => {
|
|
52
|
+
if (child.exitCode === null && child.signalCode === null) child.kill('SIGKILL');
|
|
53
|
+
}, KILL_GRACE_MS);
|
|
54
|
+
killTimer.unref();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const timer = setTimeout(() => {
|
|
58
|
+
timedOut = true;
|
|
59
|
+
stop();
|
|
60
|
+
}, timeoutMs);
|
|
61
|
+
timer.unref();
|
|
62
|
+
|
|
63
|
+
const onAbort = () => {
|
|
64
|
+
aborted = true;
|
|
65
|
+
stop();
|
|
66
|
+
};
|
|
67
|
+
if (signal) {
|
|
68
|
+
if (signal.aborted) onAbort();
|
|
69
|
+
else signal.addEventListener('abort', onAbort, { once: true });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** @param {string} line */
|
|
73
|
+
const emitLine = (line) => {
|
|
74
|
+
const trimmed = line.replace(/\r$/, '');
|
|
75
|
+
if (onLine && trimmed.trim()) {
|
|
76
|
+
try {
|
|
77
|
+
onLine(trimmed);
|
|
78
|
+
} catch {
|
|
79
|
+
// a progress sink must never break the run
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
child.stdout.on('data', (/** @type {Buffer} */ chunk) => {
|
|
85
|
+
if (outBytes >= MAX_STDOUT_BYTES) return;
|
|
86
|
+
const room = MAX_STDOUT_BYTES - outBytes;
|
|
87
|
+
const piece = chunk.length > room ? chunk.subarray(0, room) : chunk;
|
|
88
|
+
out.push(piece);
|
|
89
|
+
outBytes += piece.length;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
child.stderr.on('data', (/** @type {Buffer} */ chunk) => {
|
|
93
|
+
const text = chunk.toString('utf8');
|
|
94
|
+
if (err.length < MAX_STDERR_BYTES) err += text;
|
|
95
|
+
partial += text;
|
|
96
|
+
const lines = partial.split('\n');
|
|
97
|
+
partial = lines.pop() || '';
|
|
98
|
+
for (const line of lines) emitLine(line);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
/** @param {number|null} code @param {string} [extraErr] */
|
|
102
|
+
const finish = (code, extraErr) => {
|
|
103
|
+
if (settled) return;
|
|
104
|
+
settled = true;
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
if (killTimer) clearTimeout(killTimer);
|
|
107
|
+
if (signal) signal.removeEventListener('abort', onAbort);
|
|
108
|
+
if (partial) emitLine(partial);
|
|
109
|
+
resolve({
|
|
110
|
+
code,
|
|
111
|
+
stdout: Buffer.concat(out).toString('utf8'),
|
|
112
|
+
stderr: extraErr ? `${err}${err ? '\n' : ''}${extraErr}` : err,
|
|
113
|
+
timedOut,
|
|
114
|
+
aborted,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
child.on('error', (e) => finish(null, e.message));
|
|
119
|
+
child.on('close', (code) => finish(code));
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Starts something that must OUTLIVE the helper — the Unity Editor (`unity open`). The launcher runs
|
|
125
|
+
* detached (its own process group/session, so Ctrl-C in the helper's terminal never reaches the Editor
|
|
126
|
+
* it starts), with no pipes (an Editor that inherited a pipe to a dead helper dies on its next write),
|
|
127
|
+
* and unref'd (the helper can exit while it runs). It is never killed on cancel or timeout: stopping
|
|
128
|
+
* the launcher would stop the Editor it is starting.
|
|
129
|
+
*
|
|
130
|
+
* Resolves with the launcher's exit code when it exits within `waitMs` (`unity open` returns at once;
|
|
131
|
+
* a non-zero code means the Editor was not started), else as launched (code 0). Output is not
|
|
132
|
+
* captured — the caller confirms the Editor by polling `unity status`. A cancel ends the WAIT (never
|
|
133
|
+
* the launcher).
|
|
134
|
+
* @type {LaunchDetached}
|
|
135
|
+
*/
|
|
136
|
+
function launchDetached(file, args, { cwd, env, waitMs = 30_000, signal, spawn = defaultSpawn } = {}) {
|
|
137
|
+
return new Promise((resolve) => {
|
|
138
|
+
/** @type {import('child_process').ChildProcess} */
|
|
139
|
+
let child;
|
|
140
|
+
try {
|
|
141
|
+
child = spawn(file, args, { cwd, env, detached: true, stdio: 'ignore', shell: false, windowsHide: true });
|
|
142
|
+
} catch (e) {
|
|
143
|
+
resolve({ code: null, stdout: '', stderr: String(e && e.message ? e.message : e), timedOut: false, aborted: false });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
child.unref();
|
|
147
|
+
let settled = false;
|
|
148
|
+
/** @param {number|null} code @param {string} [stderr] */
|
|
149
|
+
const finish = (code, stderr = '') => {
|
|
150
|
+
if (settled) return;
|
|
151
|
+
settled = true;
|
|
152
|
+
clearTimeout(timer);
|
|
153
|
+
if (signal) signal.removeEventListener('abort', onAbort);
|
|
154
|
+
resolve({ code, stdout: '', stderr, timedOut: false, aborted: Boolean(signal && signal.aborted) });
|
|
155
|
+
};
|
|
156
|
+
// NOT unref'd: the child is, so this timer is what keeps the helper alive while it waits for the
|
|
157
|
+
// launcher to exit (found live — with both unref'd, a process with nothing else pending exited mid-job).
|
|
158
|
+
const timer = setTimeout(() => finish(0), waitMs);
|
|
159
|
+
const onAbort = () => finish(null);
|
|
160
|
+
if (signal) {
|
|
161
|
+
if (signal.aborted) onAbort();
|
|
162
|
+
else signal.addEventListener('abort', onAbort, { once: true });
|
|
163
|
+
}
|
|
164
|
+
child.on('error', (e) => finish(null, e.message));
|
|
165
|
+
child.on('exit', (code) => finish(code));
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
module.exports = { runProcess, launchDetached, MAX_STDOUT_BYTES, KILL_GRACE_MS };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SOURCE: AgentReference references/scripts/bt-bootstrap.cs (the babylontoolkit/agent repo) - keep in sync.
|
|
2
|
+
// Everything below the marker line is a VERBATIM copy of that file. tests/bridge-unity-scaffold.test.js pins its
|
|
3
|
+
// sha256 (7970a089b7600e344e8c2ac482d1480bcd8d9567853fc8248f0e792d8b66f824), recorded from the source at copy time: re-copy the file and update the hash together.
|
|
4
|
+
// ---- verbatim from here ----
|
|
5
|
+
// Headless replication of CVPanel.OnEnable() - the Scene Exporter bootstrap.
|
|
6
|
+
// Safe to run in a GUI Editor too (it is idempotent).
|
|
7
|
+
var sb = new System.Text.StringBuilder();
|
|
8
|
+
CanvasTools.CanvasToolsExporter.Initialize();
|
|
9
|
+
CanvasToolsInfo.DefaultProjectFolder = UnityTools.GetDefaultExportFolder();
|
|
10
|
+
UnityTools.ValidateRequirements();
|
|
11
|
+
UnityTools.ValidateImageLibrary();
|
|
12
|
+
UnityTools.ValidateProjectScript();
|
|
13
|
+
UnityTools.ValidateProjectLayers();
|
|
14
|
+
UnityTools.ValidateColorSpaceSettings();
|
|
15
|
+
UnityTools.ValidateGraphicsLibSettings();
|
|
16
|
+
UnityTools.ValidateProjectRootNamespace();
|
|
17
|
+
UnityTools.ValidateProjectShaderSettings();
|
|
18
|
+
UnityTools.ValidateReflectionProbeSettings();
|
|
19
|
+
// The GPU Resident Drawer is Unity-only batching the export never uses; left on, a failed registration makes
|
|
20
|
+
// camera captures render only the sky. Toolkit 9.25+, dialog-free.
|
|
21
|
+
sb.Append("residentDrawerOff=" + RenderPathTools.DisableResidentDrawer(false) + " ");
|
|
22
|
+
if (System.String.IsNullOrWhiteSpace(CanvasToolsInfo.Instance.ProductShortName)
|
|
23
|
+
&& !System.String.IsNullOrWhiteSpace(UnityEngine.Application.productName))
|
|
24
|
+
CanvasToolsInfo.Instance.ProductShortName = UnityEngine.Application.productName;
|
|
25
|
+
if (CanvasToolsInfo.Instance.InlineNonceHash == null) CanvasToolsInfo.Instance.InlineNonceHash = "";
|
|
26
|
+
string root = UnityTools.GetRootPath();
|
|
27
|
+
string pj = System.IO.Path.Combine(root, "package.json");
|
|
28
|
+
if (!System.IO.File.Exists(pj)) {
|
|
29
|
+
string j = "{\r\n\t\"name\": \"" + BabylonCore.Info.NAME + "\",\r\n\t\"version\": \"" + BabylonCore.Info.VERSION
|
|
30
|
+
+ "\",\r\n\t\"description\": \"Babylon Toolkit Project\",\r\n\t\"license\": \"MIT\",\r\n\t\"devDependencies\": {\r\n\t\t\"typescript\": \"^"
|
|
31
|
+
+ BabylonCore.Info.TYPESCRIPT + "\"\r\n\t}\r\n}\r\n";
|
|
32
|
+
System.IO.File.WriteAllText(pj, j);
|
|
33
|
+
sb.Append("packageJson=written ");
|
|
34
|
+
} else sb.Append("packageJson=present ");
|
|
35
|
+
CanvasToolsInfo.SaveSettings();
|
|
36
|
+
UnityEditor.AssetDatabase.Refresh();
|
|
37
|
+
sb.Append("exportRoot=" + CanvasToolsInfo.DefaultProjectFolder);
|
|
38
|
+
sb.Append(" pro=" + ToolkitManager.IsPro());
|
|
39
|
+
return sb.ToString();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SOURCE: AgentReference references/scripts/bt-newscene.cs (the babylontoolkit/agent repo) - keep in sync.
|
|
2
|
+
// Everything below the marker line is a VERBATIM copy of that file. tests/bridge-unity-scaffold.test.js pins its
|
|
3
|
+
// sha256 (00829f0a2eb162dcf63d56f54a69e16dd1d5decd3c7addcfef41e34af3d2ff97), recorded from the source at copy time: re-copy the file and update the hash together.
|
|
4
|
+
// ---- verbatim from here ----
|
|
5
|
+
// Create a starter scene WITH LightingSettings (order: NewScene -> build -> save -> lighting).
|
|
6
|
+
string sceneName = "Level01";
|
|
7
|
+
var scene = UnityEditor.SceneManagement.EditorSceneManager.NewScene(
|
|
8
|
+
UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects,
|
|
9
|
+
UnityEditor.SceneManagement.NewSceneMode.Single);
|
|
10
|
+
var ground = UnityEngine.GameObject.CreatePrimitive(UnityEngine.PrimitiveType.Plane);
|
|
11
|
+
ground.name = "Ground"; ground.transform.localScale = new UnityEngine.Vector3(5f,1f,5f);
|
|
12
|
+
UnityEngine.RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox;
|
|
13
|
+
System.IO.Directory.CreateDirectory(UnityEngine.Application.dataPath + "/Scenes");
|
|
14
|
+
UnityEditor.SceneManagement.EditorSceneManager.SaveScene(scene, "Assets/Scenes/" + sceneName + ".unity");
|
|
15
|
+
UnityEngine.LightingSettings ls = null;
|
|
16
|
+
if (!UnityEditor.Lightmapping.TryGetLightingSettings(out ls) || ls == null) {
|
|
17
|
+
var nls = new UnityEngine.LightingSettings(); nls.name = "BtLightingSettings";
|
|
18
|
+
System.IO.Directory.CreateDirectory(UnityEngine.Application.dataPath + "/Settings");
|
|
19
|
+
UnityEditor.AssetDatabase.CreateAsset(nls, "Assets/Settings/BtLightingSettings.lighting");
|
|
20
|
+
UnityEditor.Lightmapping.lightingSettings = nls;
|
|
21
|
+
}
|
|
22
|
+
// Assigning lightingSettings does NOT mark the scene dirty, so SaveOpenScenes() skips it
|
|
23
|
+
// and the reference is lost the next time the scene is loaded (sec 8.1).
|
|
24
|
+
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(scene);
|
|
25
|
+
UnityEditor.SceneManagement.EditorSceneManager.SaveOpenScenes();
|
|
26
|
+
UnityEditor.AssetDatabase.SaveAssets();
|
|
27
|
+
return "scene=Assets/Scenes/" + sceneName + ".unity lighting=ok";
|
package/lib/doctor.js
CHANGED
|
@@ -7,6 +7,10 @@ const { resolveTargets } = require('./targets');
|
|
|
7
7
|
const { listSkills } = require('./payload');
|
|
8
8
|
const { hasPersona } = require('./persona');
|
|
9
9
|
const { hasCodexNetwork } = require('./codex-config');
|
|
10
|
+
const { readSettings } = require('./bridge/config');
|
|
11
|
+
const { serviceStatus, hostDeps } = require('./bridge/service');
|
|
12
|
+
const { discoverUnity } = require('./bridge/unity/discover');
|
|
13
|
+
const { discoverBlender } = require('./bridge/blender/discover');
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Verify an install.
|
|
@@ -49,6 +53,26 @@ function doctor(opts = {}) {
|
|
|
49
53
|
if (!hasCodexNetwork(file)) missing.push(`${file} (sandbox_workspace_write.network_access = true)`);
|
|
50
54
|
}
|
|
51
55
|
|
|
56
|
+
// Informational only (D46): a user who only wants skills must still get INSTALL OK.
|
|
57
|
+
const { servers } = readSettings();
|
|
58
|
+
let unityCli = false;
|
|
59
|
+
let blender = null;
|
|
60
|
+
/** @type {{ installed: boolean, running: boolean|null }} */
|
|
61
|
+
let svc = { installed: false, running: null };
|
|
62
|
+
try {
|
|
63
|
+
const st = serviceStatus(opts.serviceDeps || hostDeps());
|
|
64
|
+
svc = { installed: st.installed, running: st.running };
|
|
65
|
+
} catch {
|
|
66
|
+
// informational only — never affects ok
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
unityCli = Boolean(discoverUnity({ cwd: process.cwd() }).cli);
|
|
70
|
+
const found = discoverBlender({});
|
|
71
|
+
blender = found ? found.version : null;
|
|
72
|
+
} catch {
|
|
73
|
+
// informational only — never affects ok
|
|
74
|
+
}
|
|
75
|
+
|
|
52
76
|
return {
|
|
53
77
|
ok: missing.length === 0,
|
|
54
78
|
missing,
|
|
@@ -59,6 +83,15 @@ function doctor(opts = {}) {
|
|
|
59
83
|
instructionFiles: resolved.instructionFiles.map((f) => f.file),
|
|
60
84
|
configFiles: resolved.configFiles.map((f) => f.file),
|
|
61
85
|
},
|
|
86
|
+
bridge: {
|
|
87
|
+
paired: servers.length > 0,
|
|
88
|
+
server: servers.length ? servers[0].server : null,
|
|
89
|
+
servers: servers.map((c) => c.server),
|
|
90
|
+
service: svc.installed ? 'installed' : 'not installed',
|
|
91
|
+
serviceRunning: svc.running,
|
|
92
|
+
unityCli,
|
|
93
|
+
blender,
|
|
94
|
+
},
|
|
62
95
|
};
|
|
63
96
|
}
|
|
64
97
|
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ allowed-tools: Read, Grep, Glob, Edit, Write, Bash, WebFetch(domain:raw.githubus
|
|
|
7
7
|
Run tasks from a plan: build each one with its tests, have an independent verifier check it, and only then tick its box. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
/bt-execute [--auto-pilot] [--strict] <plan> [task] [brief]
|
|
10
|
+
/bt-execute [--auto-pilot] [--strict] [--no-time-limit] <plan> [task] [brief]
|
|
11
11
|
|
|
12
12
|
/bt-execute @plan.md # NEXT: the next unchecked task
|
|
13
13
|
/bt-execute @plan.md T4 # one task
|
|
@@ -17,15 +17,17 @@ Run tasks from a plan: build each one with its tests, have an independent verifi
|
|
|
17
17
|
/bt-execute @plan.md "mind the physics layer" # a brief shapes HOW, never WHICH task
|
|
18
18
|
/bt-execute --strict @plan.md ALL # adversarial verifier on every task
|
|
19
19
|
/bt-execute --auto-pilot @plan.md ALL # unattended; combine with --strict if wanted
|
|
20
|
+
/bt-execute --no-time-limit @plan.md ALL # turn off the default TIME MATTERS mode
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
- Strip `--auto-pilot` / `--strict` first (anywhere in the arguments, never part of the brief). `<plan>` is required — if missing, ask (auto-pilot: say so and end). Never guess a path.
|
|
23
|
+
- Strip `--auto-pilot` / `--strict` / `--no-time-limit`, and any literal `TIME MATTERS`, first (anywhere in the arguments, never part of the brief). `<plan>` is required — if missing, ask (auto-pilot: say so and end). Never guess a path.
|
|
23
24
|
- `[task]` is the token right after the plan, only if it is `T<id>`, `T<a>-T<b>`, `T<a>-`, `NEXT`, `NEXT:<n>` or `ALL` (case-insensitive). Otherwise it is part of the brief, and the task defaults to `NEXT` (`ALL` under auto-pilot). Never ask which task to run.
|
|
24
25
|
- A range is a slice of the checklist **in file order** (sub-tasks like `T3.1` between the endpoints included). An unknown id → list the available ids and stop. A reversed range → error; never swap it. Tasks outside the slice are never touched.
|
|
25
26
|
- Tasks already `- [x]` are skipped — that is what makes every mode resumable. Nothing left to do → say so and stop. Except in `ALL` / range / `NEXT:<n>` runs, do one task and do not continue to the next.
|
|
26
27
|
|
|
27
28
|
## Ground rules
|
|
28
29
|
|
|
30
|
+
- **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — follow the *Work fast* rules below to the letter, take the direct route to each task's Acceptance, and do not re-read what you already have. Begin every implementer and verifier prompt with `TIME MATTERS.` Print `⏱️ [bt-execute] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-execute] No time limit`, and do not add it). Speed never relaxes tests, the independent verifier, live checks, or "tick only on PASS".
|
|
29
31
|
- **Scope.** Implement only the selected task(s). No "while I'm here" work on other tasks. Ambiguous, or blocked by an unfinished task → stop and tell the user *(auto-pilot: decide and log it)*.
|
|
30
32
|
- **Read the docs once.** For Babylon work, if you have not read the Agent Reference this session, fetch it once — https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — plus only the sub-documents the plan's tasks need. It is the authority for conventions and API. Fetch fails → stop and tell the user *(auto-pilot: retry 3×, then continue on what you know and log it)*. Read the plan's checklist and the parts of `SPEC.md` the tasks touch; re-read after a context compaction.
|
|
31
33
|
- **SPEC.md** constrains how you build. If the code and SPEC.md disagree, stop and tell the user *(auto-pilot: decide which is right, fix SPEC.md in the same task, log it)*. When a task changes architecture, a system, a convention or a dependency, SPEC.md must end up matching — normally the plan's final `Update SPEC.md` task; if the plan has none, do it anyway; a new dependency is recorded in SPEC.md by the task that introduces it. Follow SPEC.md's "How to update this spec". **Write the product, never the procedure** — no capture protocols, tool lists, ledgers or gates: recorded there, they become a bar every later feature must clear.
|
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -7,19 +7,21 @@ allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.co
|
|
|
7
7
|
Turn a feature spec into `_specs/<feature-name>_plan.md`: an ordered checklist of tasks that `bt-execute` runs. Follow the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md). The user's message after the skill name is the `arguments`.
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
/bt-plan [--heavy] [--parity] <feature-spec> <optional-brief>
|
|
10
|
+
/bt-plan [--heavy] [--parity] [--no-time-limit] <feature-spec> <optional-brief>
|
|
11
11
|
|
|
12
12
|
/bt-plan @_specs/mute-game-audio_spec.md
|
|
13
13
|
/bt-plan "add a settings toggle to mute all game audio" # no spec file → Quick Plan: short interview, then plan
|
|
14
14
|
/bt-plan --heavy @_specs/feature_spec.md # decision-complete plan for a long or cheaper-model run
|
|
15
15
|
/bt-plan --heavy --parity @_specs/feature_spec.md # numeric parity gates against the reference (slow)
|
|
16
|
+
/bt-plan --no-time-limit @_specs/feature_spec.md # turn off the default TIME MATTERS mode
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
- `--heavy` — Heavy Plan mode (below). `--parity` — plan numeric parity proof; also on when the spec says `proof: parity`. Strip flags first; they are never part of the brief.
|
|
19
|
+
- `--heavy` — Heavy Plan mode (below). `--parity` — plan numeric parity proof; also on when the spec says `proof: parity`. `--no-time-limit` — turn off TIME MATTERS mode (Ground rules). Strip flags, and any literal `TIME MATTERS`, first; they are never part of the brief.
|
|
19
20
|
- Spec file (± brief) → plan from it. **Brief only → Quick Plan.** Neither → ask for a brief. Never guess a path or URL.
|
|
20
21
|
|
|
21
22
|
## Ground rules
|
|
22
23
|
|
|
24
|
+
- **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — research only what the plan needs, keep subagents few and their questions narrow, and do not re-read what you already have. Begin every subagent prompt with `TIME MATTERS.` Print `⏱️ [bt-plan] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-plan] No time limit`, and do not add it). Speed never skips a required step, the Heavy Plan cold-context audit, or anything the plan needs to be complete.
|
|
23
25
|
- **Planning only — in every mode.** Research read-only; the plan file is the only file you write. Never implement a task, edit source, or run builds/tests — not even a trivial first task. Writing the plan is the last action; the user runs `bt-execute` separately.
|
|
24
26
|
- **Babylon work:** if you have not read the Babylon Toolkit Agent Reference in this session, fetch and read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — the authority for conventions and API; fetch sub-documents only when relevant, and again only if a context compaction made you forget it. If the fetch fails, stop and tell the user — do not guess at the API.
|
|
25
27
|
- **Say what you are doing.** Before any step that takes more than a few seconds print one short line — `🔎 [bt-plan] <what> …` — and one when it returns; one line per subagent going out and coming back. A silent run looks like a hang and gets cancelled.
|
package/skills/bt-spec/SKILL.md
CHANGED
|
@@ -7,19 +7,22 @@ allowed-tools: Read, Grep, Glob, Write, WebFetch(domain:raw.githubusercontent.co
|
|
|
7
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
9
|
```
|
|
10
|
-
/bt-spec [--grill-me] [--parity] <feature-brief>
|
|
10
|
+
/bt-spec [--grill-me] [--parity] [--no-time-limit] <feature-brief>
|
|
11
11
|
|
|
12
12
|
/bt-spec "add a settings toggle to mute all game audio"
|
|
13
13
|
/bt-spec --grill-me "add a settings toggle to mute all game audio" # interview first, then spec
|
|
14
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)
|
|
15
|
+
/bt-spec --no-time-limit "redesign the save system" # turn off the default TIME MATTERS mode
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
- `--grill-me` — interview the user, one question at a time, before writing (Step 4).
|
|
18
19
|
- `--parity` — the spec may set numeric parity bars against a reference. Without it, `proof: functional`.
|
|
19
|
-
-
|
|
20
|
+
- `--no-time-limit` — turn off TIME MATTERS mode (Ground rules).
|
|
21
|
+
- Strip the flags, and any literal `TIME MATTERS`, 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.
|
|
20
22
|
|
|
21
23
|
## Ground rules
|
|
22
24
|
|
|
25
|
+
- **TIME MATTERS** — on by default; `--no-time-limit` turns it off. Treat the arguments as ending with `TIME MATTERS`: the user is waiting on this run, so finish quickly — research only what the spec needs, keep subagents few and their questions narrow, and do not re-read what you already have. Begin every subagent prompt with `TIME MATTERS.` Print `⏱️ [bt-spec] TIME MATTERS` at the start (`--no-time-limit`: print `⏱️ [bt-spec] No time limit`, and do not add it). Speed never skips a required step or lowers the quality of the spec.
|
|
23
26
|
- **Planning only.** Research read-only and write only the spec file (plus `SPEC.md` from the scaffold, if the user says yes below). No source edits, no builds, no tests, no other shell commands.
|
|
24
27
|
- **Babylon work:** if you have not read the Babylon Toolkit Agent Reference in this session, fetch and read it once: https://raw.githubusercontent.com/babylontoolkit/agent/main/reference.md — it is the authority for conventions and API; fetch its sub-documents only when relevant, and again only if a context compaction made you forget it. If the fetch fails, stop and tell the user — do not guess at the API.
|
|
25
28
|
- **Say what you are doing.** Before any step that takes more than a few seconds (a fetch, a big read, subagents) print one short line — `🔎 [bt-spec] <what> …` — and one line when it returns. A silent run looks like a hang and gets cancelled.
|