@babylonjs-toolkit/agent 1.1.6 → 1.1.10
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/.codex/config.toml +2 -0
- package/README.md +28 -2
- package/bin/bt-agent.js +12 -3
- package/lib/codex-config.js +108 -0
- package/lib/doctor.js +6 -0
- package/lib/install.js +10 -0
- package/lib/targets.js +12 -4
- package/package.json +5 -3
- package/scripts/postinstall.js +3 -1
- package/skills/bt-plan/SKILL.md +26 -1
- package/skills/bt-spec/SKILL.md +31 -2
package/README.md
CHANGED
|
@@ -16,8 +16,9 @@ npx @babylonjs-toolkit/agent install
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
That installs **every skill** into every skills directory and the **Agent Persona** into every
|
|
19
|
-
global instruction file, on macOS, Linux and Windows.
|
|
20
|
-
|
|
19
|
+
global instruction file, on macOS, Linux and Windows. Codex targets also enable outbound
|
|
20
|
+
network access in their workspace-write configuration. Restart your agent session to pick
|
|
21
|
+
up the skills, instructions and configuration.
|
|
21
22
|
|
|
22
23
|
### Commands
|
|
23
24
|
|
|
@@ -76,6 +77,31 @@ Use `--no-self-update` to skip the npm check entirely.
|
|
|
76
77
|
Gemini CLI is a separate entry on purpose: it reads `GEMINI.md`, **not** `AGENTS.md`, so
|
|
77
78
|
`~/.agents/AGENTS.md` alone never reaches it.
|
|
78
79
|
|
|
80
|
+
Codex installs (the default `codex` target, or `codex-legacy`) also merge the shipped
|
|
81
|
+
[`.codex/config.toml`](.codex/config.toml) setting into `~/.codex/config.toml`, or
|
|
82
|
+
`<project>/.codex/config.toml` with `--project`:
|
|
83
|
+
|
|
84
|
+
```toml
|
|
85
|
+
[sandbox_workspace_write]
|
|
86
|
+
network_access = true
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This allows outbound network access to all domains while using the workspace-write
|
|
90
|
+
sandbox, including fetching the Agent Reference from GitHub. It does not change the
|
|
91
|
+
sandbox mode, filesystem permissions or approval policy. Managed policies can override
|
|
92
|
+
this setting; project configuration applies only to trusted projects.
|
|
93
|
+
|
|
94
|
+
Install, update and the global npm postinstall hook apply this setting whenever a Codex
|
|
95
|
+
target is selected, including `--persona-only` and `--no-persona` runs. An existing
|
|
96
|
+
`network_access = false` is changed to `true`; other settings and comments are preserved.
|
|
97
|
+
Changed configurations are backed up to `config.toml.bak`; repeated installs are idempotent
|
|
98
|
+
and `--dry-run` writes nothing. Standard TOML sections and root dotted keys are supported;
|
|
99
|
+
an inline `sandbox_workspace_write = { ... }` table is left untouched with an actionable
|
|
100
|
+
error, so convert it to the section form above before retrying.
|
|
101
|
+
`bt-agent doctor` checks the setting, and `bt-agent targets` lists its destination.
|
|
102
|
+
Uninstall retains this configuration and its backup as user preferences. Selecting only
|
|
103
|
+
non-Codex targets leaves Codex configuration untouched.
|
|
104
|
+
|
|
79
105
|
Your instruction files are never truncated. The persona goes in as a managed block:
|
|
80
106
|
|
|
81
107
|
```markdown
|
package/bin/bt-agent.js
CHANGED
|
@@ -12,7 +12,8 @@ const USAGE = `
|
|
|
12
12
|
@babylonjs-toolkit/agent ${version}
|
|
13
13
|
|
|
14
14
|
Installs the Babylon Toolkit agent skills and Agent Persona for every
|
|
15
|
-
supported AI client, on macOS, Linux and Windows.
|
|
15
|
+
supported AI client, on macOS, Linux and Windows. Codex targets also
|
|
16
|
+
enable outbound network access in their workspace-write configuration.
|
|
16
17
|
|
|
17
18
|
Usage
|
|
18
19
|
bt-agent [command] [options]
|
|
@@ -137,6 +138,11 @@ function printInstall(report) {
|
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
|
|
141
|
+
for (const entry of report.config) {
|
|
142
|
+
console.log(` config ${prettyPath(entry.file)} — ${entry.action} (network_access = true)`);
|
|
143
|
+
if (entry.backup) console.log(` backup: ${prettyPath(entry.backup)}`);
|
|
144
|
+
}
|
|
145
|
+
|
|
140
146
|
if (report.pruned.length) {
|
|
141
147
|
console.log('');
|
|
142
148
|
for (const p of report.pruned) console.log(` pruned ${prettyPath(p)} (no longer shipped)`);
|
|
@@ -194,7 +200,8 @@ function restartNote(report) {
|
|
|
194
200
|
const parts = [];
|
|
195
201
|
if (report.skillsInstalled !== false) parts.push('skills');
|
|
196
202
|
if (report.persona.length) parts.push('persona');
|
|
197
|
-
|
|
203
|
+
if (report.config.length) parts.push('Codex configuration');
|
|
204
|
+
const what = parts.length > 1 ? `${parts.join(', ')} are` : `${parts[0] || 'files'} ${parts[0] === 'skills' ? 'are' : 'is'}`;
|
|
198
205
|
console.log('\nRestart your agent session (Claude Code, Codex, Copilot, Gemini CLI)');
|
|
199
206
|
console.log(`so the ${what} picked up.\n`);
|
|
200
207
|
}
|
|
@@ -203,7 +210,7 @@ function printDoctor(result) {
|
|
|
203
210
|
const { checked } = result;
|
|
204
211
|
console.log(
|
|
205
212
|
`\nChecked ${checked.skills} skills / ${checked.files} files across ` +
|
|
206
|
-
`${checked.skillDirs.length} skill dir(s)
|
|
213
|
+
`${checked.skillDirs.length} skill dir(s), ${checked.instructionFiles.length} instruction file(s) and ${checked.configFiles.length} config file(s).\n`
|
|
207
214
|
);
|
|
208
215
|
if (result.ok) {
|
|
209
216
|
console.log('INSTALL OK');
|
|
@@ -222,6 +229,7 @@ function targetsJson(mode, projectRoot) {
|
|
|
222
229
|
default: Boolean(t.default),
|
|
223
230
|
skills: spec.skills ? resolveTargetPath(spec.skills, mode, projectRoot) : null,
|
|
224
231
|
instructions: spec.instructions ? resolveTargetPath(spec.instructions, mode, projectRoot) : null,
|
|
232
|
+
config: spec.config ? resolveTargetPath(spec.config, mode, projectRoot) : null,
|
|
225
233
|
};
|
|
226
234
|
});
|
|
227
235
|
}
|
|
@@ -234,6 +242,7 @@ function printTargets(mode) {
|
|
|
234
242
|
console.log(` [${flag}] ${t.id.padEnd(13)} ${t.label}`);
|
|
235
243
|
if (spec.skills) console.log(` skills: ${spec.skills}`);
|
|
236
244
|
if (spec.instructions) console.log(` instructions: ${spec.instructions}`);
|
|
245
|
+
if (spec.config) console.log(` config: ${spec.config}`);
|
|
237
246
|
}
|
|
238
247
|
console.log('');
|
|
239
248
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { PACKAGE_ROOT } = require('./paths');
|
|
6
|
+
|
|
7
|
+
const KEY = '(?:network_access|"network_access"|\'network_access\')';
|
|
8
|
+
const TABLE = '(?:sandbox_workspace_write|"sandbox_workspace_write"|\'sandbox_workspace_write\')';
|
|
9
|
+
const header = new RegExp(`^\\s*\\[\\s*${TABLE}\\s*\\]\\s*(?:#.*)?$`);
|
|
10
|
+
const setting = new RegExp(`^(\\s*${KEY}\\s*=\\s*)(true|false)(\\s*(?:#.*)?)$`);
|
|
11
|
+
const dotted = new RegExp(`^(\\s*${TABLE}\\s*\\.\\s*${KEY}\\s*=\\s*)(true|false)(\\s*(?:#.*)?)$`);
|
|
12
|
+
|
|
13
|
+
/** Ignore apparent settings inside TOML strings (including multiline strings). */
|
|
14
|
+
function codeLines(lines) {
|
|
15
|
+
let quote = null;
|
|
16
|
+
return lines.map((line) => {
|
|
17
|
+
const startsInString = quote !== null;
|
|
18
|
+
let code = '';
|
|
19
|
+
for (let i = 0; i < line.length; i += 1) {
|
|
20
|
+
const c = line[i];
|
|
21
|
+
if (quote) {
|
|
22
|
+
if (quote[0] === '"' && c === '\\') { i += 1; continue; }
|
|
23
|
+
if (line.startsWith(quote, i)) {
|
|
24
|
+
let end = i + quote.length;
|
|
25
|
+
// A multiline TOML string may end in four or five quotes.
|
|
26
|
+
if (quote.length === 3) while (end < i + 5 && line[end] === quote[0]) end += 1;
|
|
27
|
+
i = end - 1;
|
|
28
|
+
quote = null;
|
|
29
|
+
}
|
|
30
|
+
} else if (c === '#') {
|
|
31
|
+
break;
|
|
32
|
+
} else if (c === '"' || c === "'") {
|
|
33
|
+
quote = line.startsWith(c.repeat(3), i) ? c.repeat(3) : c;
|
|
34
|
+
i += quote.length - 1;
|
|
35
|
+
} else {
|
|
36
|
+
code += c;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return startsInString ? '' : code.trim();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Change only this boolean; keep comments, other settings and line endings. */
|
|
44
|
+
function enableNetwork(source) {
|
|
45
|
+
const eol = source.includes('\r\n') ? '\r\n' : '\n';
|
|
46
|
+
const lines = source.split(/\r?\n/);
|
|
47
|
+
const code = codeLines(lines);
|
|
48
|
+
let inTable = false;
|
|
49
|
+
let root = true;
|
|
50
|
+
let tableLine = -1;
|
|
51
|
+
let rootDottedSibling = false;
|
|
52
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
53
|
+
if (!code[i]) continue;
|
|
54
|
+
if (code[i].startsWith('[')) {
|
|
55
|
+
root = false;
|
|
56
|
+
inTable = header.test(lines[i]);
|
|
57
|
+
if (inTable) tableLine = i;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const match = (inTable ? setting : root ? dotted : /$^/).exec(lines[i]);
|
|
61
|
+
if (match) {
|
|
62
|
+
lines[i] = `${match[1]}true${match[3]}`;
|
|
63
|
+
return lines.join(eol);
|
|
64
|
+
}
|
|
65
|
+
if (root && new RegExp(`^\\s*${TABLE}\\s*\\.`).test(lines[i])) rootDottedSibling = true;
|
|
66
|
+
// Do not create duplicate TOML keys for an unsupported representation.
|
|
67
|
+
if ((root && new RegExp(`^\\s*${TABLE}\\s*=`).test(lines[i])) ||
|
|
68
|
+
(inTable && new RegExp(`^\\s*${KEY}\\s*=`).test(lines[i])) ||
|
|
69
|
+
(root && new RegExp(`^\\s*${TABLE}\\s*\\.\\s*${KEY}\\s*=`).test(lines[i]))) {
|
|
70
|
+
throw new Error('Cannot safely merge Codex network_access. Use [sandbox_workspace_write] with network_access = true or false.');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (tableLine !== -1) {
|
|
74
|
+
lines.splice(tableLine + 1, 0, 'network_access = true');
|
|
75
|
+
return lines.join(eol);
|
|
76
|
+
}
|
|
77
|
+
// Dotted sibling keys define the table already; extend it at the root.
|
|
78
|
+
if (rootDottedSibling) {
|
|
79
|
+
return `sandbox_workspace_write.network_access = true${eol}${source}`;
|
|
80
|
+
}
|
|
81
|
+
const template = fs.readFileSync(path.join(PACKAGE_ROOT, '.codex', 'config.toml'), 'utf8').replace(/\r?\n/g, eol);
|
|
82
|
+
return source + (source && !source.endsWith('\n') ? eol : '') + (source ? eol : '') + template;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function applyCodexConfig(file, { dryRun = false } = {}) {
|
|
86
|
+
const exists = fs.existsSync(file);
|
|
87
|
+
const source = exists ? fs.readFileSync(file, 'utf8') : '';
|
|
88
|
+
const next = enableNetwork(source);
|
|
89
|
+
const action = !exists ? 'created' : next === source ? 'unchanged' : 'updated';
|
|
90
|
+
const backup = action === 'updated' ? `${file}.bak` : undefined;
|
|
91
|
+
if (!dryRun && action !== 'unchanged') {
|
|
92
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
93
|
+
if (backup) fs.copyFileSync(file, backup);
|
|
94
|
+
fs.writeFileSync(file, next, 'utf8');
|
|
95
|
+
}
|
|
96
|
+
return { file, action, ...(backup ? { backup } : {}) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function hasCodexNetwork(file) {
|
|
100
|
+
try {
|
|
101
|
+
const source = fs.readFileSync(file, 'utf8');
|
|
102
|
+
return enableNetwork(source) === source;
|
|
103
|
+
} catch {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
module.exports = { enableNetwork, applyCodexConfig, hasCodexNetwork };
|
package/lib/doctor.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const { resolveTargets } = require('./targets');
|
|
7
7
|
const { listSkills } = require('./payload');
|
|
8
8
|
const { hasPersona } = require('./persona');
|
|
9
|
+
const { hasCodexNetwork } = require('./codex-config');
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Verify an install.
|
|
@@ -44,6 +45,10 @@ function doctor(opts = {}) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
for (const { file } of resolved.configFiles) {
|
|
49
|
+
if (!hasCodexNetwork(file)) missing.push(`${file} (sandbox_workspace_write.network_access = true)`);
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
return {
|
|
48
53
|
ok: missing.length === 0,
|
|
49
54
|
missing,
|
|
@@ -52,6 +57,7 @@ function doctor(opts = {}) {
|
|
|
52
57
|
files: skills.reduce((n, s) => n + s.files.length, 0),
|
|
53
58
|
skillDirs: checkSkills ? resolved.skillDirs.map((d) => d.dir) : [],
|
|
54
59
|
instructionFiles: resolved.instructionFiles.map((f) => f.file),
|
|
60
|
+
configFiles: resolved.configFiles.map((f) => f.file),
|
|
55
61
|
},
|
|
56
62
|
};
|
|
57
63
|
}
|
package/lib/install.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const { resolveTargets } = require('./targets');
|
|
7
7
|
const { listSkills, copyDir } = require('./payload');
|
|
8
8
|
const { applyPersona, removePersona, personaText } = require('./persona');
|
|
9
|
+
const { applyCodexConfig } = require('./codex-config');
|
|
9
10
|
const manifest = require('./manifest');
|
|
10
11
|
const { manifestPath } = require('./paths');
|
|
11
12
|
|
|
@@ -48,10 +49,17 @@ function install(opts = {}) {
|
|
|
48
49
|
skills: skills.map((s) => s.name),
|
|
49
50
|
skillDirs: [],
|
|
50
51
|
persona: [],
|
|
52
|
+
config: [],
|
|
51
53
|
pruned: [],
|
|
52
54
|
manifest: manifestPath(mode, projectRoot),
|
|
53
55
|
};
|
|
54
56
|
|
|
57
|
+
// Preflight every merge before changing installed skills or instructions.
|
|
58
|
+
for (const { file } of resolved.configFiles) applyCodexConfig(file, { dryRun: true });
|
|
59
|
+
for (const { file, targets } of resolved.configFiles) {
|
|
60
|
+
report.config.push({ ...applyCodexConfig(file, { dryRun }), targets });
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
for (const { dir, targets } of installSkills ? resolved.skillDirs : []) {
|
|
56
64
|
if (!dryRun) fs.mkdirSync(dir, { recursive: true });
|
|
57
65
|
|
|
@@ -97,6 +105,7 @@ function install(opts = {}) {
|
|
|
97
105
|
mode,
|
|
98
106
|
projectRoot: mode === 'project' ? projectRoot : undefined,
|
|
99
107
|
skillDirs,
|
|
108
|
+
config: report.config,
|
|
100
109
|
persona: report.persona.map(({ file, action }) => ({ file, action })),
|
|
101
110
|
});
|
|
102
111
|
}
|
|
@@ -106,6 +115,7 @@ function install(opts = {}) {
|
|
|
106
115
|
|
|
107
116
|
/**
|
|
108
117
|
* Remove the skills this package installed, plus the managed persona block.
|
|
118
|
+
* Codex config is retained as a user preference, including its backup.
|
|
109
119
|
* Manifest-scoped: anything the manifest does not list is left alone.
|
|
110
120
|
*/
|
|
111
121
|
function uninstall(opts = {}) {
|
package/lib/targets.js
CHANGED
|
@@ -32,8 +32,8 @@ const TARGETS = [
|
|
|
32
32
|
id: 'codex',
|
|
33
33
|
label: 'Codex chat clients (Codex CLI / Codex IDE)',
|
|
34
34
|
default: true,
|
|
35
|
-
global: { skills: null, instructions: '~/.codex/AGENTS.md' },
|
|
36
|
-
project: { skills: null, instructions: 'AGENTS.md' },
|
|
35
|
+
global: { skills: null, instructions: '~/.codex/AGENTS.md', config: '~/.codex/config.toml' },
|
|
36
|
+
project: { skills: null, instructions: 'AGENTS.md', config: '.codex/config.toml' },
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: 'gemini',
|
|
@@ -49,8 +49,8 @@ const TARGETS = [
|
|
|
49
49
|
// Pre-`.agents` Codex CLI builds read ~/.codex/skills. Opt in with --legacy-codex.
|
|
50
50
|
label: 'Legacy Codex CLI skills directory',
|
|
51
51
|
default: false,
|
|
52
|
-
global: { skills: '~/.codex/skills', instructions: null },
|
|
53
|
-
project: { skills: '.codex/skills', instructions: null },
|
|
52
|
+
global: { skills: '~/.codex/skills', instructions: null, config: '~/.codex/config.toml' },
|
|
53
|
+
project: { skills: '.codex/skills', instructions: null, config: '.codex/config.toml' },
|
|
54
54
|
},
|
|
55
55
|
];
|
|
56
56
|
|
|
@@ -76,10 +76,17 @@ function resolveTargets({ mode = 'global', projectRoot = process.cwd(), ids = nu
|
|
|
76
76
|
const selected = TARGETS.filter((t) => wanted.has(t.id));
|
|
77
77
|
const skillDirs = new Map();
|
|
78
78
|
const instructionFiles = new Map();
|
|
79
|
+
const configFiles = new Map();
|
|
79
80
|
|
|
80
81
|
for (const t of selected) {
|
|
81
82
|
const spec = mode === 'project' ? t.project : t.global;
|
|
82
83
|
|
|
84
|
+
const config = resolveTargetPath(spec.config, mode, projectRoot);
|
|
85
|
+
if (config) {
|
|
86
|
+
if (!configFiles.has(config)) configFiles.set(config, { file: config, targets: [] });
|
|
87
|
+
configFiles.get(config).targets.push(t.id);
|
|
88
|
+
}
|
|
89
|
+
|
|
83
90
|
const skillsDir = resolveTargetPath(spec.skills, mode, projectRoot);
|
|
84
91
|
if (skillsDir) {
|
|
85
92
|
if (!skillDirs.has(skillsDir)) skillDirs.set(skillsDir, { dir: skillsDir, targets: [] });
|
|
@@ -99,6 +106,7 @@ function resolveTargets({ mode = 'global', projectRoot = process.cwd(), ids = nu
|
|
|
99
106
|
selected,
|
|
100
107
|
skillDirs: [...skillDirs.values()],
|
|
101
108
|
instructionFiles: [...instructionFiles.values()],
|
|
109
|
+
configFiles: [...configFiles.values()],
|
|
102
110
|
};
|
|
103
111
|
}
|
|
104
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs-toolkit/agent",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Installs the Babylon Toolkit agent skills and Agent Persona for Claude Code, Codex, GitHub Copilot, Gemini CLI and Antigravity.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babylonjs",
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
"bin",
|
|
29
29
|
"lib",
|
|
30
30
|
"scripts",
|
|
31
|
-
"persona.md"
|
|
31
|
+
"persona.md",
|
|
32
|
+
".codex/config.toml"
|
|
32
33
|
],
|
|
33
34
|
"scripts": {
|
|
34
35
|
"postinstall": "node scripts/postinstall.js",
|
|
35
|
-
"deploy-all": "npm publish --access public"
|
|
36
|
+
"deploy-all": "npm publish --access public",
|
|
37
|
+
"test": "node --test tests/*.test.js"
|
|
36
38
|
},
|
|
37
39
|
"engines": {
|
|
38
40
|
"node": ">=18"
|
package/scripts/postinstall.js
CHANGED
|
@@ -34,8 +34,10 @@ function main() {
|
|
|
34
34
|
for (const entry of report.skillDirs) console.log(` skills ${entry.dir}`);
|
|
35
35
|
for (const p of report.persona) console.log(` persona ${p.file} — ${p.action}`);
|
|
36
36
|
|
|
37
|
+
for (const c of report.config) console.log(` config ${c.file} — ${c.action} (network_access = true)`);
|
|
38
|
+
|
|
37
39
|
console.log(check.ok ? '\nINSTALL OK' : '\nINSTALL INCOMPLETE — run `bt-agent doctor` for details');
|
|
38
|
-
console.log('\nRestart your agent session so the skills and
|
|
40
|
+
console.log('\nRestart your agent session so the skills, persona and Codex configuration are picked up.\n');
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
try {
|
package/skills/bt-plan/SKILL.md
CHANGED
|
@@ -77,7 +77,23 @@ This skill's workflow depends on subagents. **Invoking it is the user's explicit
|
|
|
77
77
|
|
|
78
78
|
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.
|
|
79
79
|
|
|
80
|
-
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.
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
## ⚠️ Progress narration — NEVER go silent
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
**Hard rules:**
|
|
87
|
+
|
|
88
|
+
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 …`
|
|
89
|
+
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.
|
|
90
|
+
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.
|
|
91
|
+
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.
|
|
92
|
+
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 …`.
|
|
93
|
+
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.
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
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.
|
|
81
97
|
|
|
82
98
|
## ⚠️ Required Reading Before Any Babylon Work
|
|
83
99
|
|
|
@@ -112,6 +128,13 @@ A trustworthy plan requires a thorough, read-only investigation of the codebase
|
|
|
112
128
|
|
|
113
129
|
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.
|
|
114
130
|
|
|
131
|
+
**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:
|
|
132
|
+
|
|
133
|
+
- 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.
|
|
134
|
+
- 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.
|
|
135
|
+
- 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.
|
|
136
|
+
- 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.
|
|
137
|
+
|
|
115
138
|
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:
|
|
116
139
|
|
|
117
140
|
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.
|
|
@@ -127,6 +150,8 @@ If the spec or codebase is too ambiguous to analyze responsibly, stop and ask th
|
|
|
127
150
|
|
|
128
151
|
## Step 2. Write the plan
|
|
129
152
|
|
|
153
|
+
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.
|
|
154
|
+
|
|
130
155
|
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.
|
|
131
156
|
|
|
132
157
|
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:
|
package/skills/bt-spec/SKILL.md
CHANGED
|
@@ -33,7 +33,23 @@ This skill's workflow depends on subagents. **Invoking it is the user's explicit
|
|
|
33
33
|
|
|
34
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
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.
|
|
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.
|
|
37
53
|
|
|
38
54
|
## ⚠️ Required Reading Before Any Babylon Work
|
|
39
55
|
|
|
@@ -137,6 +153,17 @@ this feature must conform to; one finds the closest existing feature and extract
|
|
|
137
153
|
mirror; one lists integration points, constraints, and existing dependencies. Each returns concise
|
|
138
154
|
conclusions — findings and file paths, not file dumps — which you synthesize yourself.
|
|
139
155
|
|
|
156
|
+
**Narrate the whole step** (see *Progress narration — NEVER go silent* above). This is the step that most
|
|
157
|
+
often runs for minutes, so it is where the rule matters most. The required cadence:
|
|
158
|
+
|
|
159
|
+
- One `🚀 [bt-spec] Subagent i/N → <what it investigates>` line per subagent as it is launched, and prefer
|
|
160
|
+
the background / non-blocking launch mode so completions return to you one at a time.
|
|
161
|
+
- One `✅ [bt-spec] Subagent i/N done — <one-line finding>` line as each returns; a `⏳ [bt-spec] Waiting on
|
|
162
|
+
…` line if you are idle with subagents still outstanding.
|
|
163
|
+
- On the sequential path, one `🔎 [bt-spec] …` line before each read/search and one result line after it.
|
|
164
|
+
- When everything is in: `🧩 [bt-spec] Research complete — <n> findings synthesized`, followed by a 3–6
|
|
165
|
+
bullet research summary (key findings with file paths), before moving on to Step 2.5.
|
|
166
|
+
|
|
140
167
|
Two hard rules, because this skill is planning-only: every subagent is **read-only** (it may read,
|
|
141
168
|
search and report; it may NOT edit files, write files, or run build/test/shell commands), and **you**
|
|
142
169
|
write the spec — a subagent never drafts spec content. Research subagents need not re-read the Agent
|
|
@@ -186,7 +213,7 @@ Run this **after Step 2.4**, so every question is grounded in the real codebase
|
|
|
186
213
|
The rules that make that loop work:
|
|
187
214
|
|
|
188
215
|
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.
|
|
189
|
-
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.
|
|
216
|
+
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.
|
|
190
217
|
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.
|
|
191
218
|
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.
|
|
192
219
|
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.
|
|
@@ -207,6 +234,8 @@ and execute phases have a stable name to refer to regardless of host.
|
|
|
207
234
|
|
|
208
235
|
## Step 4. Draft the spec content
|
|
209
236
|
|
|
237
|
+
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.
|
|
238
|
+
|
|
210
239
|
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 a required `spec_impact` header field 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:
|
|
211
240
|
```
|
|
212
241
|
# Feature Spec Template
|