bokata 2.0.0 → 3.0.0-beta.3
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/{commands/task-parallel/feature-map.md → .agents/skills/bokata-feature-map/SKILL.md} +80 -79
- package/.agents/skills/bokata-feature-map/resources/features-template.md +83 -0
- package/.agents/skills/bokata-feature-slicer/SKILL.md +171 -182
- package/.agents/skills/bokata-feature-slicer/resources/output-template-bites.md +13 -0
- package/.agents/skills/bokata-feature-slicer/resources/output-template-increments.md +9 -12
- package/.agents/skills/bokata-feature-slicer/resources/output-template-steps.md +6 -22
- package/.agents/skills/bokata-feature-slicer/resources/phase-2-increments.md +43 -49
- package/.agents/skills/bokata-feature-slicer/resources/phase-3-baby-steps.md +90 -249
- package/.agents/skills/bokata-feature-slicer/resources/phase-4-bites.md +138 -0
- package/.agents/skills/bokata-plan/SKILL.md +104 -0
- package/.agents/skills/bokata-plan/resources/plan-template.md +33 -0
- package/.agents/skills/bokata-refactor/SKILL.md +69 -0
- package/.agents/skills/bokata-refactor/resources/smells.md +47 -0
- package/.agents/skills/bokata-refactor/resources/tidyings.md +31 -0
- package/.agents/skills/bokata-render/SKILL.md +144 -0
- package/.agents/skills/bokata-render/resources/story-map-template.md +835 -0
- package/.agents/skills/bokata-shape/SKILL.md +117 -0
- package/.agents/skills/bokata-shape/resources/adr-template.md +24 -0
- package/.agents/skills/bokata-shape/resources/breadboarding.md +47 -0
- package/.agents/skills/bokata-shape/resources/pitch-template.md +42 -0
- package/.agents/skills/bokata-slice/SKILL.md +475 -0
- package/.agents/skills/bokata-slice/resources/slice-template.md +117 -0
- package/.agents/skills/bokata-status/SKILL.md +65 -0
- package/.agents/skills/bokata-tdd/SKILL.md +109 -0
- package/.agents/skills/bokata-tdd/resources/evidence-rules.md +27 -0
- package/README.md +210 -92
- package/agents/bokata-product-designer.md +48 -16
- package/agents/bokata-product-engineer.md +48 -15
- package/agents/bokata-product-manager.md +48 -16
- package/agents/code-executor.md +53 -0
- package/agents/design-reviewer.md +40 -0
- package/agents/feature-slicer.md +42 -0
- package/agents/story-map-renderer.md +19 -0
- package/bin/bokata.js +27 -12
- package/package.json +20 -7
- package/src/agents.js +114 -0
- package/src/config.js +75 -0
- package/src/install.js +173 -205
- package/commands/codex/feature-map.md +0 -263
- package/commands/codex/slice-feature.md +0 -291
- package/commands/task-parallel/resources/html-template.md +0 -560
- package/commands/task-parallel/resources/story-map-template.md +0 -495
- package/commands/task-parallel/slice-feature.md +0 -301
package/src/config.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const CONFIG_FILE = '.bokata.json';
|
|
5
|
+
|
|
6
|
+
const DEFAULTS = {
|
|
7
|
+
docs: 'docs/initiatives',
|
|
8
|
+
language: 'auto',
|
|
9
|
+
story_map: true,
|
|
10
|
+
memory: {
|
|
11
|
+
constitution: 'CONSTITUTION.md',
|
|
12
|
+
glossary: 'GLOSSARY.md',
|
|
13
|
+
standards: 'CODING_STANDARDS.md',
|
|
14
|
+
adrs: 'docs/adrs',
|
|
15
|
+
adr_template: null
|
|
16
|
+
},
|
|
17
|
+
templates: { pitch: null, features: null, slice: null },
|
|
18
|
+
// Method slots: each names the skill that does that job. Swap one by naming another skill.
|
|
19
|
+
methods: {
|
|
20
|
+
grill: 'grill-with-docs',
|
|
21
|
+
domain: 'domain-modeling',
|
|
22
|
+
code: 'bokata-tdd',
|
|
23
|
+
refactor: 'bokata-refactor'
|
|
24
|
+
},
|
|
25
|
+
harnesses: [],
|
|
26
|
+
// Model per harness and role. trio and reviewer analyse and plan; executor writes code.
|
|
27
|
+
// A role set to null (or missing) uses the harness's own default model.
|
|
28
|
+
models: {
|
|
29
|
+
claude: { trio: 'opus', reviewer: 'opus', executor: 'sonnet', render: 'haiku' },
|
|
30
|
+
opencode: {
|
|
31
|
+
trio: 'opencode-go/glm-5.3-flash',
|
|
32
|
+
reviewer: 'opencode-go/glm-5.3-flash',
|
|
33
|
+
executor: 'opencode-go/deepseek-v4.1-flash',
|
|
34
|
+
render: 'opencode-go/glm-5.3-flash'
|
|
35
|
+
},
|
|
36
|
+
cursor: { trio: 'glm-flash', reviewer: 'glm-flash', executor: 'sonnet', render: 'glm-flash' },
|
|
37
|
+
codex: { trio: 'gpt-5.6-sol', reviewer: 'gpt-5.6-sol', executor: 'gpt-5.6-luna', render: 'gpt-5.6-luna' }
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function configPath(cwd) {
|
|
42
|
+
return path.join(cwd, CONFIG_FILE);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function readConfig(cwd) {
|
|
46
|
+
const file = configPath(cwd);
|
|
47
|
+
if (!fs.existsSync(file)) return { exists: false, config: clone(DEFAULTS) };
|
|
48
|
+
const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
49
|
+
return { exists: true, config: merge(clone(DEFAULTS), raw) };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function writeConfig(cwd, config) {
|
|
53
|
+
fs.writeFileSync(configPath(cwd), JSON.stringify(config, null, 2) + '\n');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function merge(base, override) {
|
|
57
|
+
for (const [key, value] of Object.entries(override)) {
|
|
58
|
+
if (isPlainObject(value) && isPlainObject(base[key])) {
|
|
59
|
+
base[key] = merge(base[key], value);
|
|
60
|
+
} else {
|
|
61
|
+
base[key] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return base;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isPlainObject(value) {
|
|
68
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function clone(value) {
|
|
72
|
+
return JSON.parse(JSON.stringify(value));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = { CONFIG_FILE, DEFAULTS, readConfig, writeConfig, merge };
|
package/src/install.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
-
const os = require('os');
|
|
3
2
|
const path = require('path');
|
|
4
3
|
const readline = require('readline');
|
|
4
|
+
const { readConfig, writeConfig, CONFIG_FILE } = require('./config');
|
|
5
|
+
const { resolveAgent, RENDERERS } = require('./agents');
|
|
5
6
|
|
|
6
7
|
const ROOT = path.join(__dirname, '..');
|
|
7
8
|
|
|
8
9
|
const SKILLS = [
|
|
10
|
+
'bokata-shape',
|
|
11
|
+
'bokata-feature-map',
|
|
12
|
+
'bokata-slice',
|
|
13
|
+
'bokata-plan',
|
|
14
|
+
'bokata-tdd',
|
|
15
|
+
'bokata-refactor',
|
|
16
|
+
'bokata-status',
|
|
17
|
+
'bokata-render',
|
|
9
18
|
'bokata-feature-mapper',
|
|
10
19
|
'bokata-feature-slicer',
|
|
11
20
|
'bokata-acceptance-criteria'
|
|
@@ -14,21 +23,39 @@ const SKILLS = [
|
|
|
14
23
|
const AGENTS = [
|
|
15
24
|
'bokata-product-manager',
|
|
16
25
|
'bokata-product-designer',
|
|
17
|
-
'bokata-product-engineer'
|
|
26
|
+
'bokata-product-engineer',
|
|
27
|
+
'code-executor',
|
|
28
|
+
'design-reviewer',
|
|
29
|
+
'story-map-renderer',
|
|
30
|
+
'feature-slicer'
|
|
18
31
|
];
|
|
19
32
|
|
|
20
|
-
|
|
21
|
-
// The coordinator role is executed by the main thread in all harnesses.
|
|
22
|
-
// The coordinator prompt (agents/bokata-product-coordinator.md) exists as
|
|
23
|
-
// a reference resource for reconciliation rules, not as an installable agent.
|
|
33
|
+
const ROLES = ['trio', 'executor', 'reviewer', 'render'];
|
|
24
34
|
|
|
25
35
|
const HARNESS_KEYS = ['claude', 'cursor', 'opencode', 'codex'];
|
|
26
36
|
|
|
37
|
+
// Every harness reads skills from .agents/skills except these, which get symlinks to it.
|
|
38
|
+
const SKILL_LINK_DIRS = {
|
|
39
|
+
claude: ['.claude', 'skills'],
|
|
40
|
+
cursor: ['.cursor', 'skills']
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// What bokata 2.x installed and v3 replaces.
|
|
44
|
+
const LEGACY_DIRS = [
|
|
45
|
+
['.claude', 'commands', 'bokata'],
|
|
46
|
+
['.cursor', 'commands', 'bokata'],
|
|
47
|
+
['.opencode', 'command', 'bokata'],
|
|
48
|
+
['.opencode', 'commands', 'bokata']
|
|
49
|
+
];
|
|
50
|
+
// 2.x copied its HTML templates here; only remove the folder if that is what it holds.
|
|
51
|
+
const LEGACY_CODEX_RESOURCES = ['.codex', 'resources'];
|
|
52
|
+
const LEGACY_SKILL_PARENTS = [['.opencode', 'skills'], ['.codex', 'skills']];
|
|
53
|
+
|
|
27
54
|
async function runInstall(args) {
|
|
28
55
|
const cwd = process.cwd();
|
|
29
56
|
const flags = parseFlags(args);
|
|
30
|
-
const
|
|
31
|
-
const selected = await resolveHarnesses(flags,
|
|
57
|
+
const { config } = readConfig(cwd);
|
|
58
|
+
const selected = await resolveHarnesses(flags, detectHarnesses(cwd));
|
|
32
59
|
|
|
33
60
|
const activeKeys = HARNESS_KEYS.filter((k) => selected[k]);
|
|
34
61
|
if (activeKeys.length === 0) {
|
|
@@ -36,11 +63,32 @@ async function runInstall(args) {
|
|
|
36
63
|
return;
|
|
37
64
|
}
|
|
38
65
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
config.harnesses = unique([...config.harnesses, ...activeKeys]);
|
|
67
|
+
if (!flags.yes) await askModels(config, activeKeys);
|
|
68
|
+
writeConfig(cwd, config);
|
|
69
|
+
console.log(`✅ ${CONFIG_FILE} written (edit it, then run "npx bokata sync")`);
|
|
70
|
+
|
|
71
|
+
apply(cwd, config, activeKeys);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function runSync() {
|
|
75
|
+
const cwd = process.cwd();
|
|
76
|
+
const { exists, config } = readConfig(cwd);
|
|
77
|
+
if (!exists) {
|
|
78
|
+
throw new Error(`no ${CONFIG_FILE} here — run "npx bokata install" first`);
|
|
79
|
+
}
|
|
80
|
+
const activeKeys = HARNESS_KEYS.filter((k) => config.harnesses.includes(k));
|
|
81
|
+
if (activeKeys.length === 0) {
|
|
82
|
+
throw new Error(`${CONFIG_FILE} lists no harnesses`);
|
|
83
|
+
}
|
|
84
|
+
apply(cwd, config, activeKeys);
|
|
85
|
+
}
|
|
42
86
|
|
|
43
|
-
|
|
87
|
+
function apply(cwd, config, activeKeys) {
|
|
88
|
+
removeLegacy(cwd);
|
|
89
|
+
installSkills(cwd, activeKeys);
|
|
90
|
+
installAgents(cwd, config, activeKeys);
|
|
91
|
+
printSummary(config, activeKeys);
|
|
44
92
|
}
|
|
45
93
|
|
|
46
94
|
function parseFlags(args) {
|
|
@@ -57,7 +105,7 @@ function detectHarnesses(cwd) {
|
|
|
57
105
|
return {
|
|
58
106
|
claude: fs.existsSync(path.join(cwd, '.claude')),
|
|
59
107
|
cursor: fs.existsSync(path.join(cwd, '.cursor')),
|
|
60
|
-
opencode: fs.existsSync(path.join(cwd, '.opencode')),
|
|
108
|
+
opencode: fs.existsSync(path.join(cwd, '.opencode')) || fs.existsSync(path.join(cwd, 'opencode.json')),
|
|
61
109
|
codex: fs.existsSync(path.join(cwd, '.codex'))
|
|
62
110
|
};
|
|
63
111
|
}
|
|
@@ -65,228 +113,152 @@ function detectHarnesses(cwd) {
|
|
|
65
113
|
async function resolveHarnesses(flags, detected) {
|
|
66
114
|
const explicit = HARNESS_KEYS.some((k) => flags[k]);
|
|
67
115
|
if (explicit) {
|
|
68
|
-
return
|
|
69
|
-
claude: flags.claude,
|
|
70
|
-
cursor: flags.cursor,
|
|
71
|
-
opencode: flags.opencode,
|
|
72
|
-
codex: flags.codex
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const anyDetected = HARNESS_KEYS.some((k) => detected[k]);
|
|
77
|
-
if (anyDetected) {
|
|
78
|
-
return detected;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (flags.yes) {
|
|
82
|
-
return { claude: false, cursor: false, opencode: false, codex: false };
|
|
116
|
+
return Object.fromEntries(HARNESS_KEYS.map((k) => [k, flags[k]]));
|
|
83
117
|
}
|
|
84
|
-
|
|
118
|
+
if (HARNESS_KEYS.some((k) => detected[k])) return detected;
|
|
119
|
+
if (flags.yes) return Object.fromEntries(HARNESS_KEYS.map((k) => [k, false]));
|
|
85
120
|
return promptForHarnesses();
|
|
86
121
|
}
|
|
87
122
|
|
|
88
123
|
async function promptForHarnesses() {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
selected[key] = answer === 'y' || answer === 'yes';
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
rl.close();
|
|
103
|
-
return selected;
|
|
124
|
+
return withPrompt(async (ask) => {
|
|
125
|
+
console.log('No .claude/, .cursor/, .opencode/ or .codex/ found in this directory.');
|
|
126
|
+
console.log('Which harness(es) do you want to install Bokata for? (y/n each)\n');
|
|
127
|
+
const selected = {};
|
|
128
|
+
for (const key of HARNESS_KEYS) {
|
|
129
|
+
const answer = (await ask(` ${key}? [y/N] `)).toLowerCase();
|
|
130
|
+
selected[key] = answer === 'y' || answer === 'yes';
|
|
131
|
+
}
|
|
132
|
+
return selected;
|
|
133
|
+
});
|
|
104
134
|
}
|
|
105
135
|
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
136
|
+
async function askModels(config, activeKeys) {
|
|
137
|
+
await withPrompt(async (ask) => {
|
|
138
|
+
console.log('\nModel per role (blank keeps the current value; "-" = harness default).');
|
|
139
|
+
for (const harness of activeKeys) {
|
|
140
|
+
config.models[harness] = config.models[harness] || {};
|
|
141
|
+
for (const role of ROLES) {
|
|
142
|
+
const current = config.models[harness][role];
|
|
143
|
+
const answer = await ask(` ${harness} · ${role}${current ? ` [${current}]` : ''}: `);
|
|
144
|
+
if (answer === '-') config.models[harness][role] = null;
|
|
145
|
+
else if (answer) config.models[harness][role] = answer;
|
|
146
|
+
}
|
|
114
147
|
}
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
if (installedFor.length > 0) {
|
|
118
|
-
console.log(`✅ Skills copied to: ${installedFor.map((k) => `.${k}/skills/`).join(', ')}`);
|
|
119
|
-
}
|
|
148
|
+
});
|
|
120
149
|
}
|
|
121
150
|
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
if (selected.claude) console.log('✅ Agents installed for Claude Code');
|
|
131
|
-
if (selected.cursor) console.log('✅ Agents installed for Cursor');
|
|
151
|
+
async function withPrompt(fn) {
|
|
152
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
153
|
+
const ask = (question) => new Promise((resolve) => rl.question(question, (a) => resolve(a.trim())));
|
|
154
|
+
try {
|
|
155
|
+
return await fn(ask);
|
|
156
|
+
} finally {
|
|
157
|
+
rl.close();
|
|
132
158
|
}
|
|
159
|
+
}
|
|
133
160
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
161
|
+
function removeLegacy(cwd) {
|
|
162
|
+
const removed = [];
|
|
163
|
+
for (const parts of LEGACY_DIRS) {
|
|
164
|
+
const dir = path.join(cwd, ...parts);
|
|
165
|
+
if (fs.existsSync(dir)) {
|
|
166
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
167
|
+
removed.push(parts.join('/'));
|
|
139
168
|
}
|
|
140
|
-
console.log('✅ Agents installed for OpenCode');
|
|
141
169
|
}
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
170
|
+
const codexResources = path.join(cwd, ...LEGACY_CODEX_RESOURCES);
|
|
171
|
+
if (fs.existsSync(path.join(codexResources, 'html-template.md'))) {
|
|
172
|
+
fs.rmSync(codexResources, { recursive: true, force: true });
|
|
173
|
+
removed.push(LEGACY_CODEX_RESOURCES.join('/'));
|
|
174
|
+
}
|
|
175
|
+
for (const parts of LEGACY_SKILL_PARENTS) {
|
|
176
|
+
for (const skill of SKILLS) {
|
|
177
|
+
const dir = path.join(cwd, ...parts, skill);
|
|
178
|
+
if (fs.existsSync(dir)) {
|
|
179
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
180
|
+
removed.push([...parts, skill].join('/'));
|
|
181
|
+
}
|
|
148
182
|
}
|
|
149
|
-
console.log('✅ Agents installed for Codex (project-scoped TOML)');
|
|
150
183
|
}
|
|
184
|
+
if (removed.length > 0) console.log(`🧹 Removed bokata 2.x files: ${removed.join(', ')}`);
|
|
151
185
|
}
|
|
152
186
|
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
copyDirRecursive(
|
|
158
|
-
console.log('✅ Commands installed for Claude Code');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (selected.cursor) {
|
|
162
|
-
copyDirStripFrontmatterForTopLevelMd(taskParallelSrc, path.join(cwd, '.cursor', 'commands', 'bokata'));
|
|
163
|
-
console.log('✅ Commands installed for Cursor (frontmatter stripped — unsupported there)');
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (selected.opencode) {
|
|
167
|
-
// Note the singular "command" directory — OpenCode uses .opencode/agents/ (plural)
|
|
168
|
-
// for agents but .opencode/command/ (singular) for commands.
|
|
169
|
-
copyDirRecursive(taskParallelSrc, path.join(cwd, '.opencode', 'command', 'bokata'));
|
|
170
|
-
console.log('✅ Commands installed for OpenCode');
|
|
187
|
+
function installSkills(cwd, activeKeys) {
|
|
188
|
+
for (const skill of SKILLS) {
|
|
189
|
+
const dest = path.join(cwd, '.agents', 'skills', skill);
|
|
190
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
191
|
+
copyDirRecursive(path.join(ROOT, '.agents', 'skills', skill), dest);
|
|
171
192
|
}
|
|
193
|
+
console.log(`✅ ${SKILLS.length} skills in .agents/skills/`);
|
|
172
194
|
|
|
173
|
-
|
|
174
|
-
|
|
195
|
+
for (const key of activeKeys) {
|
|
196
|
+
const parts = SKILL_LINK_DIRS[key];
|
|
197
|
+
if (!parts) continue;
|
|
198
|
+
for (const skill of SKILLS) linkSkill(cwd, parts, skill);
|
|
199
|
+
console.log(`✅ Skills linked from ${parts.join('/')}/`);
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// The html/story-map templates the commands reference do stay project-scoped,
|
|
190
|
-
// since they're read at runtime by path, not discovered as prompts.
|
|
191
|
-
copyDirRecursive(path.join(ROOT, 'commands', 'task-parallel', 'resources'), path.join(cwd, '.codex', 'resources'));
|
|
192
|
-
|
|
193
|
-
console.log('✅ Commands installed for Codex:');
|
|
194
|
-
console.log(` ⚠ /bokata-feature-map and /bokata-slice-feature written to ${promptsDir}`);
|
|
195
|
-
console.log(' This is global to your user account (shared across all Codex projects),');
|
|
196
|
-
console.log(' not scoped to this repo — Codex does not support project-local prompts.');
|
|
197
|
-
console.log(` Resource templates copied to .codex/resources/ (this project only)`);
|
|
203
|
+
function linkSkill(cwd, parts, skill) {
|
|
204
|
+
const linkPath = path.join(cwd, ...parts, skill);
|
|
205
|
+
const target = path.relative(path.dirname(linkPath), path.join(cwd, '.agents', 'skills', skill));
|
|
206
|
+
ensureDir(path.dirname(linkPath));
|
|
207
|
+
fs.rmSync(linkPath, { recursive: true, force: true });
|
|
208
|
+
try {
|
|
209
|
+
fs.symlinkSync(target, linkPath, 'dir');
|
|
210
|
+
} catch {
|
|
211
|
+
// Symlinks can be unavailable (e.g. Windows without developer mode): copy instead.
|
|
212
|
+
copyDirRecursive(path.join(cwd, '.agents', 'skills', skill), linkPath);
|
|
213
|
+
}
|
|
198
214
|
}
|
|
199
215
|
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const destPath = path.join(dest, entry.name);
|
|
207
|
-
if (entry.isDirectory()) {
|
|
208
|
-
copyDirRecursive(srcPath, destPath);
|
|
209
|
-
} else if (entry.name.endsWith('.md')) {
|
|
210
|
-
const content = fs.readFileSync(srcPath, 'utf8');
|
|
211
|
-
writeFile(destPath, stripFrontmatter(content));
|
|
212
|
-
} else {
|
|
213
|
-
fs.copyFileSync(srcPath, destPath);
|
|
216
|
+
function installAgents(cwd, config, activeKeys) {
|
|
217
|
+
for (const key of activeKeys) {
|
|
218
|
+
const { dir, ext, render } = RENDERERS[key];
|
|
219
|
+
for (const agent of AGENTS) {
|
|
220
|
+
const source = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
|
|
221
|
+
writeFile(path.join(cwd, ...dir, `${agent}${ext}`), render(resolveAgent(source, config), config));
|
|
214
222
|
}
|
|
223
|
+
console.log(`✅ ${AGENTS.length} agents in ${dir.join('/')}/`);
|
|
215
224
|
}
|
|
216
225
|
}
|
|
217
226
|
|
|
218
|
-
function
|
|
219
|
-
return content.replace(/^---\n[\s\S]*?\n---\n+/, '');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function generateNameDescriptionAgent(name, prompt) {
|
|
223
|
-
return `---
|
|
224
|
-
name: ${name}
|
|
225
|
-
description: Product Trio member — ${getRoleDescription(name)}. Invoked only by /bokata:feature-map and /bokata:slice-feature orchestrator commands.
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
${prompt}`;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function generateOpenCodeAgent(name, prompt) {
|
|
232
|
-
return `---
|
|
233
|
-
description: Product Trio member — ${getRoleDescription(name)}. Invoked only by /bokata:feature-map and /bokata:slice-feature orchestrator commands.
|
|
234
|
-
mode: subagent
|
|
235
|
-
permission:
|
|
236
|
-
edit: deny
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
${prompt}`;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function generateCodexAgent(name, prompt) {
|
|
243
|
-
return `name = "${name}"
|
|
244
|
-
description = "Product Trio member — ${getRoleDescription(name)}. Invoked only by /bokata:feature-map and /bokata:slice-feature orchestrator commands."
|
|
245
|
-
developer_instructions = """
|
|
246
|
-
${prompt}
|
|
247
|
-
"""
|
|
248
|
-
model = "gpt-5.4"
|
|
249
|
-
model_reasoning_effort = "high"
|
|
250
|
-
sandbox_mode = "read-only"
|
|
251
|
-
`;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function getRoleDescription(name) {
|
|
255
|
-
const descriptions = {
|
|
256
|
-
'bokata-product-manager': 'viability/value lens (Teresa Torres). Reviews and contributes to bokata backbone, acceptance criteria, and slicing artifacts for business value, prioritization, ROI, and scope justification',
|
|
257
|
-
'bokata-product-designer': 'usability lens broadened to UX/UI craft (visual design, interaction design, component/UI feasibility, not just journey coherence). Reviews and contributes to bokata backbone, acceptance criteria, and slicing artifacts',
|
|
258
|
-
'bokata-product-engineer': 'feasibility lens broadened to technical sustainability (architecture soundness, maintainability, tech debt, long-term implications of Walking Skeleton/increment choices), not just one-shot buildability. Reviews and contributes to bokata backbone, acceptance criteria, and slicing artifacts'
|
|
259
|
-
};
|
|
260
|
-
return descriptions[name] || 'bokata workflow participant';
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function printSummary(selected) {
|
|
264
|
-
const activeKeys = HARNESS_KEYS.filter((k) => selected[k]);
|
|
265
|
-
const nonCodexKeys = activeKeys.filter((k) => k !== 'codex');
|
|
266
|
-
|
|
227
|
+
function printSummary(config, activeKeys) {
|
|
267
228
|
console.log('');
|
|
268
229
|
console.log('========================================');
|
|
269
|
-
console.log(` Bokata installed for
|
|
230
|
+
console.log(` Bokata installed for: ${activeKeys.join(', ')}`);
|
|
270
231
|
console.log('========================================');
|
|
271
232
|
console.log('');
|
|
272
|
-
console.log('
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
console.log(
|
|
233
|
+
console.log('Skills (invoke them by name in any harness):');
|
|
234
|
+
console.log(' bokata-shape grill + shape an idea into a pitch');
|
|
235
|
+
console.log(' bokata-feature-map features + functional ACs (large initiatives)');
|
|
236
|
+
console.log(' bokata-slice cut a vertical slice from 1-3 features');
|
|
237
|
+
console.log(' bokata-plan write the plan into the slice, inside your plan mode');
|
|
238
|
+
console.log(' bokata-status where an initiative stands');
|
|
239
|
+
console.log('');
|
|
240
|
+
console.log('Methods (.bokata.json → methods; name another skill to swap one):');
|
|
241
|
+
for (const [slot, skill] of Object.entries(config.methods)) {
|
|
242
|
+
console.log(` ${slot.padEnd(9)} ${skill || '(none)'}`);
|
|
282
243
|
}
|
|
283
244
|
console.log('');
|
|
245
|
+
const skillDirs = [['.agents', 'skills'], ['.claude', 'skills'], ['.opencode', 'skills']];
|
|
246
|
+
for (const [slot, skill] of Object.entries(config.methods)) {
|
|
247
|
+
if (!skill) continue;
|
|
248
|
+
const found = skillDirs.some((parts) => fs.existsSync(path.join(process.cwd(), ...parts, skill)));
|
|
249
|
+
if (!found) {
|
|
250
|
+
console.log(`⚠ methods.${slot} is "${skill}" but no skill with that name is installed.`);
|
|
251
|
+
console.log(` Install it (e.g. from mattpocock/skills) or change methods.${slot} in .bokata.json.`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function unique(items) {
|
|
257
|
+
return [...new Set(items)];
|
|
284
258
|
}
|
|
285
259
|
|
|
286
260
|
function ensureDir(dir) {
|
|
287
|
-
|
|
288
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
289
|
-
}
|
|
261
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
290
262
|
}
|
|
291
263
|
|
|
292
264
|
function writeFile(filePath, content) {
|
|
@@ -297,16 +269,12 @@ function writeFile(filePath, content) {
|
|
|
297
269
|
function copyDirRecursive(src, dest) {
|
|
298
270
|
if (!fs.existsSync(src)) return;
|
|
299
271
|
ensureDir(dest);
|
|
300
|
-
const
|
|
301
|
-
for (const entry of entries) {
|
|
272
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
302
273
|
const srcPath = path.join(src, entry.name);
|
|
303
274
|
const destPath = path.join(dest, entry.name);
|
|
304
|
-
if (entry.isDirectory())
|
|
305
|
-
|
|
306
|
-
} else {
|
|
307
|
-
fs.copyFileSync(srcPath, destPath);
|
|
308
|
-
}
|
|
275
|
+
if (entry.isDirectory()) copyDirRecursive(srcPath, destPath);
|
|
276
|
+
else fs.copyFileSync(srcPath, destPath);
|
|
309
277
|
}
|
|
310
278
|
}
|
|
311
279
|
|
|
312
|
-
module.exports = { runInstall, detectHarnesses,
|
|
280
|
+
module.exports = { runInstall, runSync, detectHarnesses, SKILLS, AGENTS };
|