bokata 2.0.1 → 3.0.0-beta.4

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.
Files changed (51) hide show
  1. package/.agents/skills/bokata-acceptance-criteria/SKILL.md +6 -7
  2. package/.agents/skills/bokata-acceptance-criteria/resources/output-template-functional.md +3 -3
  3. package/.agents/skills/bokata-acceptance-criteria/resources/output-template.md +1 -1
  4. package/{commands/task-parallel/feature-map.md → .agents/skills/bokata-feature-map/SKILL.md} +79 -79
  5. package/.agents/skills/bokata-feature-map/resources/features-template.md +83 -0
  6. package/.agents/skills/bokata-feature-mapper/SKILL.md +4 -5
  7. package/.agents/skills/bokata-feature-mapper/resources/output-template.md +1 -1
  8. package/.agents/skills/bokata-feature-slicer/SKILL.md +176 -183
  9. package/.agents/skills/bokata-feature-slicer/resources/output-template-bites.md +21 -0
  10. package/.agents/skills/bokata-feature-slicer/resources/output-template-increments.md +9 -12
  11. package/.agents/skills/bokata-feature-slicer/resources/output-template-steps.md +6 -22
  12. package/.agents/skills/bokata-feature-slicer/resources/phase-2-increments.md +51 -79
  13. package/.agents/skills/bokata-feature-slicer/resources/phase-3-skeleton.md +152 -0
  14. package/.agents/skills/bokata-feature-slicer/resources/phase-4-bites.md +139 -0
  15. package/.agents/skills/bokata-plan/SKILL.md +110 -0
  16. package/.agents/skills/bokata-plan/resources/plan-template.md +35 -0
  17. package/.agents/skills/bokata-refactor/SKILL.md +69 -0
  18. package/.agents/skills/bokata-refactor/resources/smells.md +47 -0
  19. package/.agents/skills/bokata-refactor/resources/tidyings.md +31 -0
  20. package/.agents/skills/bokata-render/SKILL.md +68 -0
  21. package/.agents/skills/bokata-render/assets/story-map.html +428 -0
  22. package/.agents/skills/bokata-render/scripts/render.mjs +703 -0
  23. package/.agents/skills/bokata-shape/SKILL.md +117 -0
  24. package/.agents/skills/bokata-shape/resources/adr-template.md +24 -0
  25. package/.agents/skills/bokata-shape/resources/breadboarding.md +47 -0
  26. package/.agents/skills/bokata-shape/resources/pitch-template.md +42 -0
  27. package/.agents/skills/bokata-slice/SKILL.md +569 -0
  28. package/.agents/skills/bokata-slice/resources/inc-template.md +36 -0
  29. package/.agents/skills/bokata-slice/resources/slice-template.md +70 -0
  30. package/.agents/skills/bokata-status/SKILL.md +77 -0
  31. package/.agents/skills/bokata-tdd/SKILL.md +109 -0
  32. package/.agents/skills/bokata-tdd/resources/evidence-rules.md +27 -0
  33. package/LICENSE +21 -0
  34. package/README.md +224 -92
  35. package/agents/bokata-product-designer.md +49 -17
  36. package/agents/bokata-product-engineer.md +49 -16
  37. package/agents/bokata-product-manager.md +50 -18
  38. package/agents/code-executor.md +64 -0
  39. package/agents/design-reviewer.md +40 -0
  40. package/agents/feature-slicer.md +54 -0
  41. package/bin/bokata.js +40 -13
  42. package/package.json +20 -7
  43. package/src/agents.js +139 -0
  44. package/src/config.js +76 -0
  45. package/src/install.js +182 -205
  46. package/.agents/skills/bokata-feature-slicer/resources/phase-3-baby-steps.md +0 -311
  47. package/commands/codex/feature-map.md +0 -263
  48. package/commands/codex/slice-feature.md +0 -291
  49. package/commands/task-parallel/resources/html-template.md +0 -560
  50. package/commands/task-parallel/resources/story-map-template.md +0 -495
  51. package/commands/task-parallel/slice-feature.md +0 -301
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,41 @@ 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
+ 'feature-slicer'
18
30
  ];
19
31
 
20
- // Note: bokata-product-coordinator is NOT installed as a subagent.
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.
32
+ const ROLES = ['trio', 'executor', 'reviewer'];
33
+
34
+ // Agents bokata used to install and no longer ships; install removes their generated files.
35
+ const RETIRED_AGENTS = ['story-map-renderer'];
24
36
 
25
37
  const HARNESS_KEYS = ['claude', 'cursor', 'opencode', 'codex'];
26
38
 
39
+ // Every harness reads skills from .agents/skills except these, which get symlinks to it.
40
+ const SKILL_LINK_DIRS = {
41
+ claude: ['.claude', 'skills'],
42
+ cursor: ['.cursor', 'skills']
43
+ };
44
+
45
+ // What bokata 2.x installed and v3 replaces.
46
+ const LEGACY_DIRS = [
47
+ ['.claude', 'commands', 'bokata'],
48
+ ['.cursor', 'commands', 'bokata'],
49
+ ['.opencode', 'command', 'bokata'],
50
+ ['.opencode', 'commands', 'bokata']
51
+ ];
52
+ // 2.x copied its HTML templates here; only remove the folder if that is what it holds.
53
+ const LEGACY_CODEX_RESOURCES = ['.codex', 'resources'];
54
+ const LEGACY_SKILL_PARENTS = [['.opencode', 'skills'], ['.codex', 'skills']];
55
+
27
56
  async function runInstall(args) {
28
57
  const cwd = process.cwd();
29
58
  const flags = parseFlags(args);
30
- const detected = detectHarnesses(cwd);
31
- const selected = await resolveHarnesses(flags, detected);
59
+ const { config } = readConfig(cwd);
60
+ const selected = await resolveHarnesses(flags, detectHarnesses(cwd));
32
61
 
33
62
  const activeKeys = HARNESS_KEYS.filter((k) => selected[k]);
34
63
  if (activeKeys.length === 0) {
@@ -36,14 +65,39 @@ async function runInstall(args) {
36
65
  return;
37
66
  }
38
67
 
39
- installSkills(cwd, selected);
40
- installAgents(cwd, selected);
41
- installCommands(cwd, selected);
68
+ config.harnesses = unique([...config.harnesses, ...activeKeys]);
69
+ if (!flags.yes) await askModels(config, activeKeys);
70
+ writeConfig(cwd, config);
71
+ console.log(`✅ ${CONFIG_FILE} written (edit it, then run "npx bokata sync")`);
72
+
73
+ apply(cwd, config, activeKeys);
74
+ }
75
+
76
+ async function runSync() {
77
+ const cwd = process.cwd();
78
+ const { exists, config } = readConfig(cwd);
79
+ if (!exists) {
80
+ throw new Error(`no ${CONFIG_FILE} here — run "npx bokata install" first`);
81
+ }
82
+ const activeKeys = HARNESS_KEYS.filter((k) => config.harnesses.includes(k));
83
+ if (activeKeys.length === 0) {
84
+ throw new Error(`${CONFIG_FILE} lists no harnesses`);
85
+ }
86
+ apply(cwd, config, activeKeys);
87
+ }
42
88
 
43
- printSummary(selected);
89
+ function apply(cwd, config, activeKeys) {
90
+ removeLegacy(cwd);
91
+ installSkills(cwd, activeKeys);
92
+ installAgents(cwd, config, activeKeys);
93
+ printSummary(config, activeKeys);
44
94
  }
45
95
 
96
+ const KNOWN_FLAGS = ['--claude', '--cursor', '--opencode', '--codex', '--yes', '-y'];
97
+
46
98
  function parseFlags(args) {
99
+ const unknown = args.find((arg) => !KNOWN_FLAGS.includes(arg));
100
+ if (unknown) throw new Error(`unknown option "${unknown}" — run "npx bokata --help"`);
47
101
  return {
48
102
  claude: args.includes('--claude'),
49
103
  cursor: args.includes('--cursor'),
@@ -57,7 +111,7 @@ function detectHarnesses(cwd) {
57
111
  return {
58
112
  claude: fs.existsSync(path.join(cwd, '.claude')),
59
113
  cursor: fs.existsSync(path.join(cwd, '.cursor')),
60
- opencode: fs.existsSync(path.join(cwd, '.opencode')),
114
+ opencode: fs.existsSync(path.join(cwd, '.opencode')) || fs.existsSync(path.join(cwd, 'opencode.json')),
61
115
  codex: fs.existsSync(path.join(cwd, '.codex'))
62
116
  };
63
117
  }
@@ -65,228 +119,155 @@ function detectHarnesses(cwd) {
65
119
  async function resolveHarnesses(flags, detected) {
66
120
  const explicit = HARNESS_KEYS.some((k) => flags[k]);
67
121
  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;
122
+ return Object.fromEntries(HARNESS_KEYS.map((k) => [k, flags[k]]));
79
123
  }
80
-
81
- if (flags.yes) {
82
- return { claude: false, cursor: false, opencode: false, codex: false };
83
- }
84
-
124
+ if (HARNESS_KEYS.some((k) => detected[k])) return detected;
125
+ if (flags.yes) return Object.fromEntries(HARNESS_KEYS.map((k) => [k, false]));
85
126
  return promptForHarnesses();
86
127
  }
87
128
 
88
129
  async function promptForHarnesses() {
89
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
90
- const ask = (question) =>
91
- new Promise((resolve) => rl.question(question, (answer) => resolve(answer.trim().toLowerCase())));
92
-
93
- console.log("No .claude/, .cursor/, .opencode/ or .codex/ found in this directory.");
94
- console.log('Which harness(es) do you want to install Bokata for? (y/n each)\n');
95
-
96
- const selected = {};
97
- for (const key of HARNESS_KEYS) {
98
- const answer = await ask(` ${key}? [y/N] `);
99
- selected[key] = answer === 'y' || answer === 'yes';
100
- }
101
-
102
- rl.close();
103
- return selected;
130
+ return withPrompt(async (ask) => {
131
+ console.log('No .claude/, .cursor/, .opencode/ or .codex/ found in this directory.');
132
+ console.log('Which harness(es) do you want to install Bokata for? (y/n each)\n');
133
+ const selected = {};
134
+ for (const key of HARNESS_KEYS) {
135
+ const answer = (await ask(` ${key}? [y/N] `)).toLowerCase();
136
+ selected[key] = answer === 'y' || answer === 'yes';
137
+ }
138
+ return selected;
139
+ });
104
140
  }
105
141
 
106
- function installSkills(cwd, selected) {
107
- const installedFor = [];
108
- for (const key of HARNESS_KEYS) {
109
- if (!selected[key]) continue;
110
- for (const skill of SKILLS) {
111
- const src = path.join(ROOT, '.agents', 'skills', skill);
112
- const dest = path.join(cwd, `.${key}`, 'skills', skill);
113
- copyDirRecursive(src, dest);
142
+ async function askModels(config, activeKeys) {
143
+ await withPrompt(async (ask) => {
144
+ console.log('\nModel per role (blank keeps the current value; "-" = harness default).');
145
+ for (const harness of activeKeys) {
146
+ config.models[harness] = config.models[harness] || {};
147
+ for (const role of ROLES) {
148
+ const current = config.models[harness][role];
149
+ const answer = await ask(` ${harness} · ${role}${current ? ` [${current}]` : ''}: `);
150
+ if (answer === '-') config.models[harness][role] = null;
151
+ else if (answer) config.models[harness][role] = answer;
152
+ }
114
153
  }
115
- installedFor.push(key);
116
- }
117
- if (installedFor.length > 0) {
118
- console.log(`✅ Skills copied to: ${installedFor.map((k) => `.${k}/skills/`).join(', ')}`);
119
- }
154
+ });
120
155
  }
121
156
 
122
- function installAgents(cwd, selected) {
123
- if (selected.claude || selected.cursor) {
124
- for (const agent of AGENTS) {
125
- const prompt = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
126
- const output = generateNameDescriptionAgent(agent, prompt);
127
- if (selected.claude) writeFile(path.join(cwd, '.claude', 'agents', `${agent}.md`), output);
128
- if (selected.cursor) writeFile(path.join(cwd, '.cursor', 'agents', `${agent}.md`), output);
129
- }
130
- if (selected.claude) console.log('✅ Agents installed for Claude Code');
131
- if (selected.cursor) console.log('✅ Agents installed for Cursor');
157
+ async function withPrompt(fn) {
158
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
159
+ const ask = (question) => new Promise((resolve) => rl.question(question, (a) => resolve(a.trim())));
160
+ try {
161
+ return await fn(ask);
162
+ } finally {
163
+ rl.close();
132
164
  }
165
+ }
133
166
 
134
- if (selected.opencode) {
135
- for (const agent of AGENTS) {
136
- const prompt = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
137
- const output = generateOpenCodeAgent(agent, prompt);
138
- writeFile(path.join(cwd, '.opencode', 'agents', `${agent}.md`), output);
167
+ function removeLegacy(cwd) {
168
+ const removed = [];
169
+ for (const parts of LEGACY_DIRS) {
170
+ const dir = path.join(cwd, ...parts);
171
+ if (fs.existsSync(dir)) {
172
+ fs.rmSync(dir, { recursive: true, force: true });
173
+ removed.push(parts.join('/'));
139
174
  }
140
- console.log('✅ Agents installed for OpenCode');
141
175
  }
142
-
143
- if (selected.codex) {
144
- for (const agent of AGENTS) {
145
- const prompt = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
146
- const output = generateCodexAgent(agent, prompt);
147
- writeFile(path.join(cwd, '.codex', 'agents', `${agent}.toml`), output);
176
+ const codexResources = path.join(cwd, ...LEGACY_CODEX_RESOURCES);
177
+ if (fs.existsSync(path.join(codexResources, 'html-template.md'))) {
178
+ fs.rmSync(codexResources, { recursive: true, force: true });
179
+ removed.push(LEGACY_CODEX_RESOURCES.join('/'));
180
+ }
181
+ for (const parts of LEGACY_SKILL_PARENTS) {
182
+ for (const skill of SKILLS) {
183
+ const dir = path.join(cwd, ...parts, skill);
184
+ if (fs.existsSync(dir)) {
185
+ fs.rmSync(dir, { recursive: true, force: true });
186
+ removed.push([...parts, skill].join('/'));
187
+ }
148
188
  }
149
- console.log('✅ Agents installed for Codex (project-scoped TOML)');
150
189
  }
190
+ if (removed.length > 0) console.log(`🧹 Removed bokata 2.x files: ${removed.join(', ')}`);
151
191
  }
152
192
 
153
- function installCommands(cwd, selected) {
154
- const taskParallelSrc = path.join(ROOT, 'commands', 'task-parallel');
155
-
156
- if (selected.claude) {
157
- copyDirRecursive(taskParallelSrc, path.join(cwd, '.claude', 'commands', 'bokata'));
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');
193
+ function installSkills(cwd, activeKeys) {
194
+ for (const skill of SKILLS) {
195
+ const dest = path.join(cwd, '.agents', 'skills', skill);
196
+ fs.rmSync(dest, { recursive: true, force: true });
197
+ copyDirRecursive(path.join(ROOT, '.agents', 'skills', skill), dest);
171
198
  }
199
+ console.log(`✅ ${SKILLS.length} skills in .agents/skills/`);
172
200
 
173
- if (selected.codex) {
174
- installCodexCommands(cwd);
201
+ for (const key of activeKeys) {
202
+ const parts = SKILL_LINK_DIRS[key];
203
+ if (!parts) continue;
204
+ for (const skill of SKILLS) linkSkill(cwd, parts, skill);
205
+ console.log(`✅ Skills linked from ${parts.join('/')}/`);
175
206
  }
176
207
  }
177
208
 
178
- function installCodexCommands(cwd) {
179
- // Codex CLI only discovers custom prompts in the global, per-user
180
- // ~/.codex/prompts/ directory, scanning top-level files only (no
181
- // subdirectories, no project-local discovery). So unlike the other three
182
- // harnesses, these files can't live inside the project.
183
- const promptsDir = path.join(os.homedir(), '.codex', 'prompts');
184
- const codexSrc = path.join(ROOT, 'commands', 'codex');
185
-
186
- writeFile(path.join(promptsDir, 'bokata-feature-map.md'), fs.readFileSync(path.join(codexSrc, 'feature-map.md'), 'utf8'));
187
- writeFile(path.join(promptsDir, 'bokata-slice-feature.md'), fs.readFileSync(path.join(codexSrc, 'slice-feature.md'), 'utf8'));
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)`);
209
+ function linkSkill(cwd, parts, skill) {
210
+ const linkPath = path.join(cwd, ...parts, skill);
211
+ const target = path.relative(path.dirname(linkPath), path.join(cwd, '.agents', 'skills', skill));
212
+ ensureDir(path.dirname(linkPath));
213
+ fs.rmSync(linkPath, { recursive: true, force: true });
214
+ try {
215
+ fs.symlinkSync(target, linkPath, 'dir');
216
+ } catch {
217
+ // Symlinks can be unavailable (e.g. Windows without developer mode): copy instead.
218
+ copyDirRecursive(path.join(cwd, '.agents', 'skills', skill), linkPath);
219
+ }
198
220
  }
199
221
 
200
- function copyDirStripFrontmatterForTopLevelMd(src, dest) {
201
- if (!fs.existsSync(src)) return;
202
- ensureDir(dest);
203
- const entries = fs.readdirSync(src, { withFileTypes: true });
204
- for (const entry of entries) {
205
- const srcPath = path.join(src, entry.name);
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);
222
+ function installAgents(cwd, config, activeKeys) {
223
+ for (const key of activeKeys) {
224
+ const { dir, ext, render } = RENDERERS[key];
225
+ for (const agent of RETIRED_AGENTS) {
226
+ fs.rmSync(path.join(cwd, ...dir, `${agent}${ext}`), { force: true });
227
+ }
228
+ for (const agent of AGENTS) {
229
+ const source = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
230
+ writeFile(path.join(cwd, ...dir, `${agent}${ext}`), render(resolveAgent(source, config, `agents/${agent}.md`), config));
214
231
  }
232
+ console.log(`✅ ${AGENTS.length} agents in ${dir.join('/')}/`);
215
233
  }
216
234
  }
217
235
 
218
- function stripFrontmatter(content) {
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
-
236
+ function printSummary(config, activeKeys) {
267
237
  console.log('');
268
238
  console.log('========================================');
269
- console.log(` Bokata installed for ${activeKeys.length} harness(es): ${activeKeys.join(', ')}`);
239
+ console.log(` Bokata installed for: ${activeKeys.join(', ')}`);
270
240
  console.log('========================================');
271
241
  console.log('');
272
- console.log('Usage:');
273
- if (nonCodexKeys.length > 0) {
274
- console.log(` (${nonCodexKeys.join(', ')})`);
275
- console.log(' /bokata:feature-map [initiative] — Generate Features Backbone + Functional ACs');
276
- console.log(' /bokata:slice-feature [feature] — Decompose Feature into Walking Skeleton + Increments');
277
- }
278
- if (selected.codex) {
279
- console.log(' (codex)');
280
- console.log(' /bokata-feature-map [initiative] — Generate Features Backbone + Functional ACs');
281
- console.log(' /bokata-slice-feature [feature] — Decompose Feature into Walking Skeleton + Increments');
242
+ console.log('Skills (invoke them by name in any harness):');
243
+ console.log(' bokata-shape grill + shape an idea into a pitch');
244
+ console.log(' bokata-feature-map features + functional ACs (large initiatives)');
245
+ console.log(' bokata-slice cut a vertical slice from 1-3 features');
246
+ console.log(' bokata-plan write the plan into the slice, inside your plan mode');
247
+ console.log(' bokata-status where an initiative stands');
248
+ console.log('');
249
+ console.log('Methods (.bokata.json → methods; name another skill to swap one):');
250
+ for (const [slot, skill] of Object.entries(config.methods)) {
251
+ console.log(` ${slot.padEnd(9)} ${skill || '(none)'}`);
282
252
  }
283
253
  console.log('');
254
+ const skillDirs = [['.agents', 'skills'], ['.claude', 'skills'], ['.opencode', 'skills']];
255
+ for (const [slot, skill] of Object.entries(config.methods)) {
256
+ if (!skill) continue;
257
+ const found = skillDirs.some((parts) => fs.existsSync(path.join(process.cwd(), ...parts, skill)));
258
+ if (!found) {
259
+ console.log(`⚠ methods.${slot} is "${skill}" but no skill with that name is installed.`);
260
+ console.log(` Install it (e.g. from mattpocock/skills) or change methods.${slot} in .bokata.json.`);
261
+ }
262
+ }
263
+ }
264
+
265
+ function unique(items) {
266
+ return [...new Set(items)];
284
267
  }
285
268
 
286
269
  function ensureDir(dir) {
287
- if (!fs.existsSync(dir)) {
288
- fs.mkdirSync(dir, { recursive: true });
289
- }
270
+ fs.mkdirSync(dir, { recursive: true });
290
271
  }
291
272
 
292
273
  function writeFile(filePath, content) {
@@ -297,16 +278,12 @@ function writeFile(filePath, content) {
297
278
  function copyDirRecursive(src, dest) {
298
279
  if (!fs.existsSync(src)) return;
299
280
  ensureDir(dest);
300
- const entries = fs.readdirSync(src, { withFileTypes: true });
301
- for (const entry of entries) {
281
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
302
282
  const srcPath = path.join(src, entry.name);
303
283
  const destPath = path.join(dest, entry.name);
304
- if (entry.isDirectory()) {
305
- copyDirRecursive(srcPath, destPath);
306
- } else {
307
- fs.copyFileSync(srcPath, destPath);
308
- }
284
+ if (entry.isDirectory()) copyDirRecursive(srcPath, destPath);
285
+ else fs.copyFileSync(srcPath, destPath);
309
286
  }
310
287
  }
311
288
 
312
- module.exports = { runInstall, detectHarnesses, stripFrontmatter };
289
+ module.exports = { runInstall, runSync, detectHarnesses, SKILLS, AGENTS };