bokata 3.0.0-beta.3 → 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 (37) 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/.agents/skills/bokata-feature-map/SKILL.md +10 -11
  5. package/.agents/skills/bokata-feature-mapper/SKILL.md +4 -5
  6. package/.agents/skills/bokata-feature-mapper/resources/output-template.md +1 -1
  7. package/.agents/skills/bokata-feature-slicer/SKILL.md +16 -12
  8. package/.agents/skills/bokata-feature-slicer/resources/output-template-bites.md +12 -4
  9. package/.agents/skills/bokata-feature-slicer/resources/phase-2-increments.md +29 -51
  10. package/.agents/skills/bokata-feature-slicer/resources/{phase-3-baby-steps.md → phase-3-skeleton.md} +3 -3
  11. package/.agents/skills/bokata-feature-slicer/resources/phase-4-bites.md +8 -7
  12. package/.agents/skills/bokata-plan/SKILL.md +21 -15
  13. package/.agents/skills/bokata-plan/resources/plan-template.md +7 -5
  14. package/.agents/skills/bokata-render/SKILL.md +62 -138
  15. package/.agents/skills/bokata-render/assets/story-map.html +428 -0
  16. package/.agents/skills/bokata-render/scripts/render.mjs +703 -0
  17. package/.agents/skills/bokata-shape/SKILL.md +1 -1
  18. package/.agents/skills/bokata-slice/SKILL.md +194 -100
  19. package/.agents/skills/bokata-slice/resources/inc-template.md +36 -0
  20. package/.agents/skills/bokata-slice/resources/slice-template.md +37 -84
  21. package/.agents/skills/bokata-status/SKILL.md +27 -15
  22. package/.agents/skills/bokata-tdd/resources/evidence-rules.md +2 -2
  23. package/LICENSE +21 -0
  24. package/README.md +54 -40
  25. package/agents/bokata-product-designer.md +2 -2
  26. package/agents/bokata-product-engineer.md +2 -2
  27. package/agents/bokata-product-manager.md +3 -3
  28. package/agents/code-executor.md +27 -16
  29. package/agents/design-reviewer.md +2 -2
  30. package/agents/feature-slicer.md +21 -9
  31. package/bin/bokata.js +17 -5
  32. package/package.json +1 -1
  33. package/src/agents.js +36 -11
  34. package/src/config.js +8 -7
  35. package/src/install.js +12 -3
  36. package/.agents/skills/bokata-render/resources/story-map-template.md +0 -835
  37. package/agents/story-map-renderer.md +0 -19
@@ -1,20 +1,23 @@
1
1
  ---
2
2
  name: feature-slicer
3
- description: Slices ONE Feature into Steps and 3+ Incremental Options per Step with the bokata-feature-slicer method, and returns the full trace, a Walking Skeleton proposal, the pruned options and the INVEST bites. Dispatched by bokata-slice, one per Feature, in parallel; never used directly.
3
+ description: Slices ONE Feature into Steps and 3+ Incremental Options per Step with the bokata-feature-slicer method, and writes the full trace, a Walking Skeleton proposal, the pruned options and the INVEST bites to the one file it is given, replying with a few lines. Dispatched by bokata-slice, one per Feature, in parallel; never used directly.
4
4
  role: trio
5
5
  mode: subagent
6
- access: read
6
+ access: write-own
7
7
  skills: ["bokata-feature-slicer"]
8
8
  ---
9
9
 
10
- You slice **one Feature**. The coordinator (`bokata-slice`) gave you the Feature, its User Tasks,
11
- its Purpose, the Discovery Context and the project memory paths. The functional ACs come in a
12
- separate block marked for the coverage check.
10
+ You slice **one Feature**. The coordinator (`bokata-slice`) gave you the Feature (its name, ID and
11
+ the path of `features.md`, where its Purpose, User Tasks and functional ACs are), the path of the
12
+ Discovery Context, the project memory paths and **the one file to write your output to**. Read those
13
+ files yourself. The functional ACs are for the coverage check only.
13
14
 
14
15
  ## Before anything else
15
16
 
16
- Read `bokata-feature-slicer`'s `SKILL.md` and **every** file in its `resources/` folder —
17
- `phase-1-steps.md`, `phase-2-increments.md`, `phase-3-baby-steps.md`, `phase-4-bites.md`,
17
+ Read `bokata-feature-slicer`'s `SKILL.md` and **every** file in its `resources/` folder — in a
18
+ project that installed bokata, `.agents/skills/bokata-feature-slicer/resources/` (also reachable as
19
+ `.claude/skills/…` or `.cursor/skills/…`): `phase-1-steps.md`, `phase-2-increments.md`,
20
+ `phase-3-skeleton.md`, `phase-4-bites.md`,
18
21
  `breakdown-strategies.md` and the output templates. Do not start slicing until you have read them. The coordinator checks
19
22
  your trace mechanically and sends it back if a phase is missing.
20
23
 
@@ -30,13 +33,22 @@ your trace mechanically and sends it back if a phase is missing.
30
33
  `deferred` one.
31
34
  - Do Phase 1 and Phase 2 on the User Tasks and the Purpose. Open the functional ACs only for
32
35
  the coverage check at the end — never derive options from them.
36
+ Without functional ACs, skip the coverage check and write `none — no functional ACs`.
37
+ - You see only your own Feature. A bite that needs another Feature says `depends on: F<n> (<what
38
+ it needs>)`, never a bite ID that is not yours. Write every bite as the canonical line of
39
+ `output-template-bites.md`.
33
40
  - A scope cut in the Discovery Context **defers** options, it does not delete them: still list
34
41
  them, marked `deferred`.
35
- - Do not write files. Return the output in your reply.
42
+ - **Write exactly one file**: the output path the coordinator gave you, with your Write tool, once,
43
+ when the output is complete and verified. Never write, edit or delete anything else, and never use
44
+ shell redirection (`>`, `tee`, `sed -i`).
45
+ - **Reply in at most 8 lines**: the output path, the Self-check counts (Steps, options before pruning,
46
+ minimum per Step, bites, pruned) and the number of assumptions. Never repeat the trace in the reply:
47
+ the coordinator reads the file.
36
48
 
37
49
  ## Output
38
50
 
39
- Exactly the `bokata-feature-slicer` output: the `## Slicing: <Feature>` trace (every User Task →
51
+ The file holds exactly the `bokata-feature-slicer` output: the `## Slicing: <Feature>` trace (every User Task →
40
52
  every Step → every option with its strategy and coverage), the `### Walking Skeleton proposal`
41
53
  as option IDs, the `### Pruned` list, the `### Bites` per User Task (with a `→ target` on each
42
54
  Step and the bite ID on each live option), and the `### Self-check` counts. Nothing else.
package/bin/bokata.js CHANGED
@@ -1,12 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const path = require('path');
4
+ const { pathToFileURL } = require('url');
3
5
  const { runInstall, runSync } = require('../src/install');
4
6
 
5
7
  const args = process.argv.slice(2);
6
8
  const [command, ...rest] = args;
7
9
 
8
10
  async function main() {
9
- if (!command || (command.startsWith('-') && !['-h', '--help'].includes(command))) {
11
+ if (command === 'help' || args.includes('-h') || args.includes('--help')) {
12
+ printHelp();
13
+ return;
14
+ }
15
+
16
+ if (!command || command.startsWith('-')) {
10
17
  await runInstall(args);
11
18
  return;
12
19
  }
@@ -16,13 +23,16 @@ async function main() {
16
23
  return;
17
24
  }
18
25
 
19
- if (command === 'sync') {
20
- await runSync();
26
+ if (command === 'render') {
27
+ const script = path.join(__dirname, '..', '.agents', 'skills', 'bokata-render', 'scripts', 'render.mjs');
28
+ const { main: render } = await import(pathToFileURL(script).href);
29
+ process.exitCode = render(rest);
21
30
  return;
22
31
  }
23
32
 
24
- if (command === '--help' || command === '-h' || command === 'help') {
25
- printHelp();
33
+ if (command === 'sync') {
34
+ if (rest.length > 0) throw new Error(`sync takes no options (got "${rest[0]}")`);
35
+ await runSync();
26
36
  return;
27
37
  }
28
38
 
@@ -38,6 +48,8 @@ Bokata — skills and agents for shaping, slicing and building in small steps
38
48
  Usage:
39
49
  npx bokata@latest install [options] install or update skills, agents and .bokata.json
40
50
  npx bokata@latest sync regenerate agents from .bokata.json (no questions)
51
+ npx bokata@latest render <dir> redraw <dir>/story-map.html from features.md, slices/ and plan.md
52
+ (--check validates the markdown and writes nothing)
41
53
 
42
54
  Options:
43
55
  --claude Install for Claude Code
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bokata",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Bokata — skills and agents to shape, slice, plan and build in small TDD steps, for Claude Code, OpenCode, Cursor and Codex",
5
5
  "keywords": [
6
6
  "bokata",
package/src/agents.js CHANGED
@@ -2,35 +2,59 @@
2
2
  //
3
3
  // Neutral frontmatter keys:
4
4
  // name, description
5
- // role trio | executor | reviewer → picks the model from config.models[harness][role]
5
+ // role trio | executor | reviewer → picks the model from config.models[harness][role]
6
6
  // mode subagent | all → opencode mode (all = usable as primary and subagent)
7
- // access read | write
8
- // skills JSON array
7
+ // access read | write-own | write
8
+ // read = no edit tool; the agent keeps a shell to run read commands,
9
+ // and its own instructions say never to write files
10
+ // write-own = may create ONE file, the one its prompt names (a Write tool, no
11
+ // Edit); its instructions say to touch nothing else — no harness can scope a path
12
+ // write = the executor: full editing, git history commands forbidden
13
+ // skills JSON array (optional, default [])
9
14
  // Anywhere in the file, "{{methods.<slot>}}" is replaced with config.methods.<slot>.
10
15
 
11
16
  const READ_TOOLS = 'Read, Grep, Glob, Bash';
17
+ const WRITE_OWN_TOOLS = 'Read, Grep, Glob, Bash, Write';
18
+ const ACCESS_NAMES = ['read', 'write-own', 'write'];
12
19
  const FORBIDDEN_GIT = ['git push*', 'git merge*', 'git rebase*', 'git stash*', 'git commit --amend*'];
13
20
 
14
- function parseAgent(source) {
15
- const match = source.match(/^---\n([\s\S]*?)\n---\n+/);
16
- if (!match) throw new Error('agent file has no frontmatter');
21
+ const ROLE_NAMES = ['trio', 'executor', 'reviewer'];
22
+ const REQUIRED_KEYS = ['name', 'description', 'role', 'access'];
23
+
24
+ function parseAgent(source, file = 'agent file') {
25
+ const match = source.replace(/\r\n/g, '\n').match(/^---\n([\s\S]*?)\n---\n+/);
26
+ if (!match) throw new Error(`${file}: no frontmatter`);
17
27
  const meta = {};
18
28
  for (const line of match[1].split('\n')) {
19
29
  const kv = line.match(/^(\w+):\s*(.*)$/);
20
30
  if (!kv) continue;
21
31
  const [, key, value] = kv;
22
- meta[key] = key === 'skills' ? JSON.parse(value) : value;
32
+ if (key === 'skills') {
33
+ try {
34
+ meta.skills = JSON.parse(value);
35
+ } catch {
36
+ throw new Error(`${file}: "skills" must be a JSON array, got ${value}`);
37
+ }
38
+ } else {
39
+ meta[key] = value;
40
+ }
41
+ }
42
+ meta.skills = meta.skills || [];
43
+ for (const key of REQUIRED_KEYS) {
44
+ if (!meta[key]) throw new Error(`${file}: frontmatter lacks "${key}"`);
23
45
  }
24
- return { meta, body: source.slice(match[0].length) };
46
+ if (!ROLE_NAMES.includes(meta.role)) throw new Error(`${file}: unknown role "${meta.role}"`);
47
+ if (!ACCESS_NAMES.includes(meta.access)) throw new Error(`${file}: access must be read, write-own or write`);
48
+ return { meta, body: source.replace(/\r\n/g, '\n').slice(match[0].length) };
25
49
  }
26
50
 
27
- function resolveAgent(source, config) {
51
+ function resolveAgent(source, config, file) {
28
52
  const filled = source.replace(/\{\{methods\.(\w+)\}\}/g, (_, slot) => {
29
53
  const skill = config.methods[slot];
30
54
  if (!skill) throw new Error(`methods.${slot} is not set in .bokata.json`);
31
55
  return skill;
32
56
  });
33
- return parseAgent(filled);
57
+ return parseAgent(filled, file);
34
58
  }
35
59
 
36
60
  function modelFor(config, harness, role) {
@@ -43,6 +67,7 @@ function renderClaude({ meta, body }, config) {
43
67
  const model = modelFor(config, 'claude', meta.role);
44
68
  if (model) lines.push(`model: ${model}`);
45
69
  if (meta.access === 'read') lines.push(`tools: ${READ_TOOLS}`);
70
+ if (meta.access === 'write-own') lines.push(`tools: ${WRITE_OWN_TOOLS}`);
46
71
  if (meta.skills.length > 0) {
47
72
  lines.push('skills:');
48
73
  for (const skill of meta.skills) lines.push(` - ${skill}`);
@@ -111,4 +136,4 @@ const RENDERERS = {
111
136
  codex: { dir: ['.codex', 'agents'], ext: '.toml', render: renderCodex }
112
137
  };
113
138
 
114
- module.exports = { parseAgent, resolveAgent, modelFor, RENDERERS };
139
+ module.exports = { parseAgent, resolveAgent, modelFor, RENDERERS, ROLE_NAMES };
package/src/config.js CHANGED
@@ -5,7 +5,6 @@ const CONFIG_FILE = '.bokata.json';
5
5
 
6
6
  const DEFAULTS = {
7
7
  docs: 'docs/initiatives',
8
- language: 'auto',
9
8
  story_map: true,
10
9
  memory: {
11
10
  constitution: 'CONSTITUTION.md',
@@ -26,15 +25,14 @@ const DEFAULTS = {
26
25
  // Model per harness and role. trio and reviewer analyse and plan; executor writes code.
27
26
  // A role set to null (or missing) uses the harness's own default model.
28
27
  models: {
29
- claude: { trio: 'opus', reviewer: 'opus', executor: 'sonnet', render: 'haiku' },
28
+ claude: { trio: 'opus', reviewer: 'opus', executor: 'sonnet' },
30
29
  opencode: {
31
30
  trio: 'opencode-go/glm-5.3-flash',
32
31
  reviewer: 'opencode-go/glm-5.3-flash',
33
- executor: 'opencode-go/deepseek-v4.1-flash',
34
- render: 'opencode-go/glm-5.3-flash'
32
+ executor: 'opencode-go/deepseek-v4.1-flash'
35
33
  },
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' }
34
+ cursor: { trio: 'glm-flash', reviewer: 'glm-flash', executor: 'sonnet' },
35
+ codex: { trio: 'gpt-5.6-sol', reviewer: 'gpt-5.6-sol', executor: 'gpt-5.6-luna' }
38
36
  }
39
37
  };
40
38
 
@@ -46,7 +44,10 @@ function readConfig(cwd) {
46
44
  const file = configPath(cwd);
47
45
  if (!fs.existsSync(file)) return { exists: false, config: clone(DEFAULTS) };
48
46
  const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
49
- return { exists: true, config: merge(clone(DEFAULTS), raw) };
47
+ const config = merge(clone(DEFAULTS), raw);
48
+ // bokata ≤ 3.0.0-beta.3 had a `render` model role for the story-map-renderer agent; it is gone.
49
+ for (const roles of Object.values(config.models)) delete roles.render;
50
+ return { exists: true, config };
50
51
  }
51
52
 
52
53
  function writeConfig(cwd, config) {
package/src/install.js CHANGED
@@ -26,11 +26,13 @@ const AGENTS = [
26
26
  'bokata-product-engineer',
27
27
  'code-executor',
28
28
  'design-reviewer',
29
- 'story-map-renderer',
30
29
  'feature-slicer'
31
30
  ];
32
31
 
33
- const ROLES = ['trio', 'executor', 'reviewer', 'render'];
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'];
34
36
 
35
37
  const HARNESS_KEYS = ['claude', 'cursor', 'opencode', 'codex'];
36
38
 
@@ -91,7 +93,11 @@ function apply(cwd, config, activeKeys) {
91
93
  printSummary(config, activeKeys);
92
94
  }
93
95
 
96
+ const KNOWN_FLAGS = ['--claude', '--cursor', '--opencode', '--codex', '--yes', '-y'];
97
+
94
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"`);
95
101
  return {
96
102
  claude: args.includes('--claude'),
97
103
  cursor: args.includes('--cursor'),
@@ -216,9 +222,12 @@ function linkSkill(cwd, parts, skill) {
216
222
  function installAgents(cwd, config, activeKeys) {
217
223
  for (const key of activeKeys) {
218
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
+ }
219
228
  for (const agent of AGENTS) {
220
229
  const source = fs.readFileSync(path.join(ROOT, 'agents', `${agent}.md`), 'utf8');
221
- writeFile(path.join(cwd, ...dir, `${agent}${ext}`), render(resolveAgent(source, config), config));
230
+ writeFile(path.join(cwd, ...dir, `${agent}${ext}`), render(resolveAgent(source, config, `agents/${agent}.md`), config));
222
231
  }
223
232
  console.log(`✅ ${AGENTS.length} agents in ${dir.join('/')}/`);
224
233
  }