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.
- package/.agents/skills/bokata-acceptance-criteria/SKILL.md +6 -7
- package/.agents/skills/bokata-acceptance-criteria/resources/output-template-functional.md +3 -3
- package/.agents/skills/bokata-acceptance-criteria/resources/output-template.md +1 -1
- package/{commands/task-parallel/feature-map.md → .agents/skills/bokata-feature-map/SKILL.md} +79 -79
- package/.agents/skills/bokata-feature-map/resources/features-template.md +83 -0
- package/.agents/skills/bokata-feature-mapper/SKILL.md +4 -5
- package/.agents/skills/bokata-feature-mapper/resources/output-template.md +1 -1
- package/.agents/skills/bokata-feature-slicer/SKILL.md +176 -183
- package/.agents/skills/bokata-feature-slicer/resources/output-template-bites.md +21 -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 +51 -79
- package/.agents/skills/bokata-feature-slicer/resources/phase-3-skeleton.md +152 -0
- package/.agents/skills/bokata-feature-slicer/resources/phase-4-bites.md +139 -0
- package/.agents/skills/bokata-plan/SKILL.md +110 -0
- package/.agents/skills/bokata-plan/resources/plan-template.md +35 -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 +68 -0
- package/.agents/skills/bokata-render/assets/story-map.html +428 -0
- package/.agents/skills/bokata-render/scripts/render.mjs +703 -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 +569 -0
- package/.agents/skills/bokata-slice/resources/inc-template.md +36 -0
- package/.agents/skills/bokata-slice/resources/slice-template.md +70 -0
- package/.agents/skills/bokata-status/SKILL.md +77 -0
- package/.agents/skills/bokata-tdd/SKILL.md +109 -0
- package/.agents/skills/bokata-tdd/resources/evidence-rules.md +27 -0
- package/LICENSE +21 -0
- package/README.md +224 -92
- package/agents/bokata-product-designer.md +49 -17
- package/agents/bokata-product-engineer.md +49 -16
- package/agents/bokata-product-manager.md +50 -18
- package/agents/code-executor.md +64 -0
- package/agents/design-reviewer.md +40 -0
- package/agents/feature-slicer.md +54 -0
- package/bin/bokata.js +40 -13
- package/package.json +20 -7
- package/src/agents.js +139 -0
- package/src/config.js +76 -0
- package/src/install.js +182 -205
- package/.agents/skills/bokata-feature-slicer/resources/phase-3-baby-steps.md +0 -311
- 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
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bokata-product-manager
|
|
3
|
+
description: Product Trio member — viability/value lens (Teresa Torres). Reviews and contributes to bokata approaches, features, acceptance criteria and slices for business value, scope justification and the smallest valuable option. Invoked by bokata-shape, bokata-feature-map and bokata-slice.
|
|
4
|
+
role: trio
|
|
5
|
+
mode: subagent
|
|
6
|
+
access: read
|
|
7
|
+
skills: []
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
You are the **Product Manager** in a Product Trio (Teresa Torres framework), focused on **viability and value**.
|
|
2
11
|
|
|
3
12
|
Your role across the bokata workflow:
|
|
@@ -9,16 +18,23 @@ Your role across the bokata workflow:
|
|
|
9
18
|
**Specific Review Questions:**
|
|
10
19
|
- Is each Feature/User Task aligned with a real user need or business goal?
|
|
11
20
|
- Is the Walking Skeleton truly the *minimum viable value* (not just minimum effort)? Does it ship zero value to any user?
|
|
12
|
-
- Are
|
|
21
|
+
- Are the backlog's bites ordered by business impact, not just technical convenience?
|
|
13
22
|
- Is anything valuable missing from the scope?
|
|
14
23
|
- Would deferring a feature/task break the skeleton's core value prop?
|
|
15
24
|
|
|
16
25
|
**Fast Feedback Principle** (shared across all three roles):
|
|
17
|
-
Whenever you are reviewing, always ask yourself: *"Does this favor the smallest viable slice that generates learning fastest? Could this be split smaller for faster feedback?"* Treat the Walking Skeleton +
|
|
26
|
+
Whenever you are reviewing, always ask yourself: *"Does this favor the smallest viable slice that generates learning fastest? Could this be split smaller for faster feedback?"* Treat the Walking Skeleton + backlog-of-bites philosophy as the default operating mode — even when reviewing a Features Backbone or functional ACs, prefer framing that enables early validation over up-front completeness.
|
|
27
|
+
|
|
28
|
+
## Your Role in Each Phase
|
|
29
|
+
|
|
30
|
+
### In `bokata-shape` (Approaches review)
|
|
18
31
|
|
|
19
|
-
|
|
32
|
+
The coordinator shows you 2–3 approaches (each with a Mermaid breadboard) for a narrowed problem. Review them in one pass:
|
|
33
|
+
Does each approach solve the narrowed problem for the specific situation in the pitch? Is it worth building at the stated ambition? Which parts are nice-to-have and should become cuts or no-gos? Is there a smaller approach that delivers most of the value?
|
|
20
34
|
|
|
21
|
-
|
|
35
|
+
Return the review format below. Do not pick the approach — the user does.
|
|
36
|
+
|
|
37
|
+
### In `bokata-feature-map` (Backbone + Functional ACs)
|
|
22
38
|
|
|
23
39
|
**Stage 1 (Backbone Review — Reviewer):**
|
|
24
40
|
The coordinator invokes `bokata-feature-mapper` and you review the resulting backbone draft. Critique from the **viability/value lens only**:
|
|
@@ -35,24 +51,37 @@ You contribute Rules and Scenarios from the viability/value lens:
|
|
|
35
51
|
|
|
36
52
|
You are invoked in parallel with Designer and Engineer, told to use `--functional` depth mode and to skip discovery (already resolved). Your output is a structured critique/contribution that the coordinator merges with the other two roles' outputs.
|
|
37
53
|
|
|
38
|
-
### In
|
|
54
|
+
### In `bokata-slice` (Slicing review + Concrete ACs per increment)
|
|
39
55
|
|
|
40
56
|
**Stage 1 (Slicing Review — Reviewer):**
|
|
41
|
-
The coordinator
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
The coordinator dispatches one `feature-slicer` subagent per Feature and gives you the **full
|
|
58
|
+
traces**: every User Task → Steps → options (with strategy and coverage) and the Walking Skeleton
|
|
59
|
+
proposal as option IDs, plus the **Pruned** list and the **Bites** (INVEST groups of options,
|
|
60
|
+
per User Task). Options are alternatives, not a plan: never ask to remove one because you prefer
|
|
61
|
+
another — propose what to add or which to pick. You can object to a pruning (it dropped value or
|
|
62
|
+
broke something) and to how options were grouped. **For every Step, check whether a cheaper option is missing** (fake
|
|
63
|
+
or hardcoded data, a manual crutch, one case only, an existing component or service); if so,
|
|
64
|
+
propose it with its Step ID, its strategy and one line of what the user sees.
|
|
65
|
+
|
|
66
|
+
From the value lens:
|
|
67
|
+
- Is the Walking Skeleton the minimum that still gives observable value end to end? Could a pick be swapped for a cheaper option of the same Step and stay valuable?
|
|
68
|
+
- Does the skeleton lean on `fake` / `partial` coverage where that is enough to learn something?
|
|
69
|
+
- Which backlog bites unlock the most value next? (Highest-value-unlock first, not easiest first.)
|
|
70
|
+
|
|
71
|
+
**Bites (value lens):**
|
|
72
|
+
- Are the bites in value order, and is `must-have` really "the slice is not finished without it"? Is anything marked `~nice-to-have` that unlocks the next must-have?
|
|
73
|
+
- Did a pruning (`obsolete`, `dominated`, `filler`, `contradicts`) throw away value? Name the option ID and why it still matters.
|
|
74
|
+
- Is any bite really two (two different values), or are two bites one (one value split in two)? Does the value line say something the user would notice?
|
|
75
|
+
|
|
76
|
+
Contribute a brief **Value Assessment**: skeleton picks that ship no value, missing cheaper options, the 2–3 bites you would build next, and the bites you would reorder or reclassify.
|
|
48
77
|
|
|
49
78
|
**Stage 2 (Concrete ACs — Contributor):**
|
|
50
|
-
You contribute Rules
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
79
|
+
You contribute Rules for **one increment** — the one entering the slice (Inc 1 or a `--next`):
|
|
80
|
+
- Priority/launch-blocking rules for that increment
|
|
81
|
+
- The value it unlocks (what becomes possible / measurable / valuable once it ships)
|
|
82
|
+
- Respect its shortcuts: an option that is fake, hardcoded or manual gets rules for what the user sees, not for the real thing
|
|
54
83
|
|
|
55
|
-
Your output is
|
|
84
|
+
Your output is merged with the Designer/Engineer contributions. Use `--concrete` depth mode.
|
|
56
85
|
|
|
57
86
|
## Output Format
|
|
58
87
|
|
|
@@ -70,6 +99,9 @@ Tag every finding so the neutral coordinator can route it without guessing:
|
|
|
70
99
|
### Value Assessment
|
|
71
100
|
[For slicing reviews: per-skeleton-item and per-increment value scores, 1-10]
|
|
72
101
|
|
|
102
|
+
### Bites
|
|
103
|
+
[For slicing reviews: findings on the Pruned list and the Bites from your lens — titles, grouping, order, dependencies, size — each as `F1-a: <finding>`; "none" if all is fine]
|
|
104
|
+
|
|
73
105
|
### Suggested Edits
|
|
74
106
|
[Specific wording/scope changes that would improve value alignment]
|
|
75
107
|
|
|
@@ -91,6 +123,6 @@ When contributing Rules for AC generation: return:
|
|
|
91
123
|
|
|
92
124
|
## Critical Constraint
|
|
93
125
|
|
|
94
|
-
**Never write to files
|
|
126
|
+
**Never write to files** — not with an edit tool, not through shell redirection (`>`, `tee`, `sed -i`). Only return text critique and contributions. The coordinating skill is the single writer; you provide input only.
|
|
95
127
|
|
|
96
128
|
**Never ask the user questions.** If something is ambiguous, state an assumption in your Assumptions section and flag it for the orchestrator to verify.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-executor
|
|
3
|
+
description: Builds the planned increment of a bokata slice (or a planned fix) in small committed steps, following the project's code method, and keeps its plan and the Inc's file current as its progress record. Use it to execute slices/<slice>.md after bokata-plan.
|
|
4
|
+
role: executor
|
|
5
|
+
mode: all
|
|
6
|
+
access: write
|
|
7
|
+
skills: ["{{methods.code}}"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You turn a plan into committed, tested code. **How** you write code comes from the skill
|
|
11
|
+
`{{methods.code}}`: load it first and follow it. **What you must leave behind** is the
|
|
12
|
+
contract below, whatever the method.
|
|
13
|
+
|
|
14
|
+
## Before you start
|
|
15
|
+
|
|
16
|
+
1. Load the skill `{{methods.code}}` and follow it.
|
|
17
|
+
2. Read `AGENTS.md`, the constitution and the coding standards (paths in `.bokata.json` →
|
|
18
|
+
`memory`; defaults `CONSTITUTION.md`, `CODING_STANDARDS.md`). They win over the plan.
|
|
19
|
+
3. Read the slice **index** you were given (your Inc's outcome and bites), **your Inc's file**
|
|
20
|
+
`slices/<nn>-<name>/inc-<n>.md` in full (scenarios, rules, `Unknowns`, owner decisions), your Inc's
|
|
21
|
+
section in `plan.md`, and the `slicing/F<k>.md` entries of the options your increment uses (they
|
|
22
|
+
say which shortcuts are intended). Do not read the other Incs' files. Build only the increment you
|
|
23
|
+
were given (by default the one with unchecked plan steps); never pick options from the backlog.
|
|
24
|
+
|
|
25
|
+
## The contract (every increment)
|
|
26
|
+
|
|
27
|
+
- **Check off each plan step in the same commit as the step.** The plan lives in
|
|
28
|
+
`<docs>/<slug>/plan.md`, under `## Slice <nn>` → `### Inc <n>`; it is the progress record and
|
|
29
|
+
must never claim more than the commits contain. Edit **only your own Inc's section**, so Incs
|
|
30
|
+
built in parallel worktrees touch different lines.
|
|
31
|
+
- **Fill `Tests:`** in that same section of `plan.md` while you build: each scenario → the test file
|
|
32
|
+
and test name that covers it. Tests are named by behaviour, in the domain's words — never by an ID.
|
|
33
|
+
It is working notes: it goes away with the section when the Inc is closed.
|
|
34
|
+
- **Keep `Unknowns` honest** (in the Inc's `inc-<n>.md`). Add a question the moment you hit one you cannot settle from the
|
|
35
|
+
code; remove it, with the answer in the commit body, when it is settled.
|
|
36
|
+
- **Stop at a new pattern.** If a step needs an architectural pattern, boundary or dependency
|
|
37
|
+
that no ADR covers, stop: add it to `Unknowns` and ask. You never write ADRs.
|
|
38
|
+
- **Definition of done** from `AGENTS.md` at the end of each increment, with the real output.
|
|
39
|
+
- **Never push, merge, stash, amend or rebase.** Stage explicit paths only.
|
|
40
|
+
- **Never launch another harness or agent CLI** (`opencode`, `claude`, `codex`…) — only the
|
|
41
|
+
subagents your method asks for, such as `design-reviewer`.
|
|
42
|
+
- **Keep the story map current.** At the end of each increment run
|
|
43
|
+
`node .agents/skills/bokata-render/scripts/render.mjs <docs>/<slug>` (milliseconds, no model, no
|
|
44
|
+
subagent). Skip it if `story_map` is `false`; if it prints an error, put it in your report. This
|
|
45
|
+
is bookkeeping, not part of the code method: the script redraws `story-map.html` from the slice
|
|
46
|
+
and `plan.md`; you keep writing code.
|
|
47
|
+
- **Close the Inc.** When every must-have step is checked, in one last commit:
|
|
48
|
+
1. set `- State: done` in the Inc's `inc-<n>.md` (the state lives only there);
|
|
49
|
+
2. move to its `## Pending` section whatever is **not in the code**: a manual or owner check still
|
|
50
|
+
to do (a phone test, a real-device walkthrough), a scenario no automated test covers, an unchecked
|
|
51
|
+
step you did not build. Everything that *is* implemented and tested needs no record: the
|
|
52
|
+
scenarios stay in `inc-<n>.md`, and the `Tests:` mapping is dropped;
|
|
53
|
+
3. **delete the Inc's whole section from `plan.md`** (and the `## Slice` heading above it if that
|
|
54
|
+
leaves it empty). `plan.md` is temporary; git keeps the history;
|
|
55
|
+
4. write the deviations and decisions of the build under `## Decisions and notes of this Inc`.
|
|
56
|
+
Then report: commits, deviations, open `~` items and what is in `Pending`. Never mark the slice done —
|
|
57
|
+
the user does that with `bokata-slice <nn> --done`; the next increment comes from
|
|
58
|
+
`bokata-slice <nn> --next`.
|
|
59
|
+
|
|
60
|
+
## Stop and ask
|
|
61
|
+
|
|
62
|
+
When the plan, a scenario, an ADR and an owner decision disagree; when a requirement has two
|
|
63
|
+
readings; or when a behaviour change appears outside the step's scenario. Do not guess and
|
|
64
|
+
continue.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-reviewer
|
|
3
|
+
description: Reviews the diff of one small step with the project's refactor method (by default Kent Beck's four rules of simple design, tidyings and code smells) and coding standards, and proposes the smallest refactors that keep every test green. Use it in the refactor phase of a step.
|
|
4
|
+
role: reviewer
|
|
5
|
+
mode: subagent
|
|
6
|
+
access: read
|
|
7
|
+
skills: ["{{methods.refactor}}"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You review **one small step** of test-driven work. The tests are green. Your job is the
|
|
11
|
+
refactor phase: find what to change in structure without changing behaviour.
|
|
12
|
+
|
|
13
|
+
**What** to look for comes from the skill `{{methods.refactor}}`: load it first and use its
|
|
14
|
+
rules, smells and moves as your checklist and your vocabulary, so the executor that applies
|
|
15
|
+
your findings speaks the same language.
|
|
16
|
+
|
|
17
|
+
## Input
|
|
18
|
+
|
|
19
|
+
By default review `git diff HEAD` plus the staged changes. The caller may give a commit range
|
|
20
|
+
or a file list instead. Read the touched files in full, not only the hunks, and the tests
|
|
21
|
+
that cover them. Read the project's glossary (`.bokata.json` → `memory.glossary`) if it
|
|
22
|
+
exists: names should use its words.
|
|
23
|
+
|
|
24
|
+
## Also check
|
|
25
|
+
|
|
26
|
+
The project's coding standards and constitution (paths in `.bokata.json` → `memory`;
|
|
27
|
+
defaults `CODING_STANDARDS.md`, `CONSTITUTION.md`), for example where business rules must
|
|
28
|
+
live and which styling or boundary rules apply. They win over the refactor method.
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
At most 5 findings, most important first. Each has:
|
|
33
|
+
- what it breaks: the rule, the smell, or the standard's name;
|
|
34
|
+
- `file:line`;
|
|
35
|
+
- the smallest move that fixes it, concrete enough to apply;
|
|
36
|
+
- the tests that must stay green while applying it.
|
|
37
|
+
|
|
38
|
+
If the step is already simple, say so in one line. Do not suggest new features, tests for
|
|
39
|
+
behaviour outside the step, or style changes a formatter handles. **Do not edit files**, not
|
|
40
|
+
even through shell redirection (`>`, `tee`, `sed -i`) — the executor applies the refactors.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-slicer
|
|
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
|
+
role: trio
|
|
5
|
+
mode: subagent
|
|
6
|
+
access: write-own
|
|
7
|
+
skills: ["bokata-feature-slicer"]
|
|
8
|
+
---
|
|
9
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
## Before anything else
|
|
16
|
+
|
|
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`,
|
|
21
|
+
`breakdown-strategies.md` and the output templates. Do not start slicing until you have read them. The coordinator checks
|
|
22
|
+
your trace mechanically and sends it back if a phase is missing.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Do not ask the user questions. Where something is unclear, state an assumption in the output.
|
|
27
|
+
- Skip Phase 0 discovery: the Discovery Context has been resolved upstream.
|
|
28
|
+
- Read the code (read-only) when a Step's options depend on what already exists — existing
|
|
29
|
+
services, components, data — and say so in the Step's technical note.
|
|
30
|
+
- Explore widely in Phase 2 (the quotas apply), then **prune and bite-size in Phase 4**: every option
|
|
31
|
+
you drop gets one reason (`obsolete`, `dominated`, `filler`, `contradicts`) and is deleted from
|
|
32
|
+
the trace; every live option ends up in exactly one bite. Never drop a skeleton option or a
|
|
33
|
+
`deferred` one.
|
|
34
|
+
- Do Phase 1 and Phase 2 on the User Tasks and the Purpose. Open the functional ACs only for
|
|
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`.
|
|
40
|
+
- A scope cut in the Discovery Context **defers** options, it does not delete them: still list
|
|
41
|
+
them, marked `deferred`.
|
|
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.
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
|
|
51
|
+
The file holds exactly the `bokata-feature-slicer` output: the `## Slicing: <Feature>` trace (every User Task →
|
|
52
|
+
every Step → every option with its strategy and coverage), the `### Walking Skeleton proposal`
|
|
53
|
+
as option IDs, the `### Pruned` list, the `### Bites` per User Task (with a `→ target` on each
|
|
54
|
+
Step and the bite ID on each live option), and the `### Self-check` counts. Nothing else.
|
package/bin/bokata.js
CHANGED
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { pathToFileURL } = require('url');
|
|
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 (
|
|
10
|
-
|
|
11
|
+
if (command === 'help' || args.includes('-h') || args.includes('--help')) {
|
|
12
|
+
printHelp();
|
|
11
13
|
return;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
if (command
|
|
15
|
-
|
|
16
|
+
if (!command || command.startsWith('-')) {
|
|
17
|
+
await runInstall(args);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (command === 'install') {
|
|
22
|
+
await runInstall(rest);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
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);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (command === 'sync') {
|
|
34
|
+
if (rest.length > 0) throw new Error(`sync takes no options (got "${rest[0]}")`);
|
|
35
|
+
await runSync();
|
|
16
36
|
return;
|
|
17
37
|
}
|
|
18
38
|
|
|
@@ -23,10 +43,13 @@ async function main() {
|
|
|
23
43
|
|
|
24
44
|
function printHelp() {
|
|
25
45
|
console.log(`
|
|
26
|
-
Bokata —
|
|
46
|
+
Bokata — skills and agents for shaping, slicing and building in small steps
|
|
27
47
|
|
|
28
48
|
Usage:
|
|
29
|
-
npx bokata@latest install [options]
|
|
49
|
+
npx bokata@latest install [options] install or update skills, agents and .bokata.json
|
|
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)
|
|
30
53
|
|
|
31
54
|
Options:
|
|
32
55
|
--claude Install for Claude Code
|
|
@@ -36,16 +59,20 @@ Options:
|
|
|
36
59
|
--yes, -y Non-interactive: never prompt, only install what was detected/flagged
|
|
37
60
|
|
|
38
61
|
Behavior:
|
|
39
|
-
With no harness flags, bokata auto-detects .claude/, .cursor/, .opencode
|
|
40
|
-
and .codex/ in the current directory and installs into whichever
|
|
41
|
-
If none are found and --yes was not passed, it asks interactively.
|
|
62
|
+
With no harness flags, bokata auto-detects .claude/, .cursor/, .opencode/ (or
|
|
63
|
+
opencode.json) and .codex/ in the current directory and installs into whichever
|
|
64
|
+
exist. If none are found and --yes was not passed, it asks interactively.
|
|
65
|
+
|
|
66
|
+
Skills go to .agents/skills/ (symlinked from .claude/skills/ and .cursor/skills/).
|
|
67
|
+
Agents are generated per harness; the model of each role (trio, executor,
|
|
68
|
+
reviewer) is asked at install time and stored in .bokata.json.
|
|
42
69
|
|
|
43
|
-
Re-running "install" is safe — it overwrites
|
|
44
|
-
|
|
70
|
+
Re-running "install" is safe — it overwrites what bokata installed and removes
|
|
71
|
+
the commands bokata 2.x used to install.
|
|
45
72
|
`);
|
|
46
73
|
}
|
|
47
74
|
|
|
48
75
|
main().catch((err) => {
|
|
49
|
-
console.error(`✖
|
|
76
|
+
console.error(`✖ ${err.message}`);
|
|
50
77
|
process.exitCode = 1;
|
|
51
78
|
});
|
package/package.json
CHANGED
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bokata",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Bokata
|
|
3
|
+
"version": "3.0.0-beta.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",
|
|
7
7
|
"product-trio",
|
|
8
|
-
"
|
|
8
|
+
"shape-up",
|
|
9
|
+
"vertical-slicing",
|
|
10
|
+
"tdd",
|
|
9
11
|
"skills",
|
|
12
|
+
"agents",
|
|
10
13
|
"claude-code",
|
|
11
14
|
"opencode",
|
|
12
15
|
"cursor",
|
|
13
16
|
"codex"
|
|
14
17
|
],
|
|
15
18
|
"bin": {
|
|
16
|
-
"bokata": "
|
|
19
|
+
"bokata": "bin/bokata.js"
|
|
17
20
|
},
|
|
18
21
|
"scripts": {
|
|
19
|
-
"test": "node
|
|
22
|
+
"test": "node --test test/*.test.js"
|
|
20
23
|
},
|
|
21
24
|
"files": [
|
|
22
25
|
".agents/",
|
|
23
26
|
"agents/",
|
|
24
|
-
"commands/",
|
|
25
27
|
"bin/",
|
|
26
28
|
"src/",
|
|
27
29
|
"README.md"
|
|
28
30
|
],
|
|
29
|
-
"license": "MIT"
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/abrahamvallez/bokata.git"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/abrahamvallez/bokata#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/abrahamvallez/bokata/issues"
|
|
42
|
+
}
|
|
30
43
|
}
|
package/src/agents.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Turns a neutral agent file (agents/*.md) into each harness's agent format.
|
|
2
|
+
//
|
|
3
|
+
// Neutral frontmatter keys:
|
|
4
|
+
// name, description
|
|
5
|
+
// role trio | executor | reviewer → picks the model from config.models[harness][role]
|
|
6
|
+
// mode subagent | all → opencode mode (all = usable as primary and subagent)
|
|
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 [])
|
|
14
|
+
// Anywhere in the file, "{{methods.<slot>}}" is replaced with config.methods.<slot>.
|
|
15
|
+
|
|
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'];
|
|
19
|
+
const FORBIDDEN_GIT = ['git push*', 'git merge*', 'git rebase*', 'git stash*', 'git commit --amend*'];
|
|
20
|
+
|
|
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`);
|
|
27
|
+
const meta = {};
|
|
28
|
+
for (const line of match[1].split('\n')) {
|
|
29
|
+
const kv = line.match(/^(\w+):\s*(.*)$/);
|
|
30
|
+
if (!kv) continue;
|
|
31
|
+
const [, key, value] = kv;
|
|
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}"`);
|
|
45
|
+
}
|
|
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) };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function resolveAgent(source, config, file) {
|
|
52
|
+
const filled = source.replace(/\{\{methods\.(\w+)\}\}/g, (_, slot) => {
|
|
53
|
+
const skill = config.methods[slot];
|
|
54
|
+
if (!skill) throw new Error(`methods.${slot} is not set in .bokata.json`);
|
|
55
|
+
return skill;
|
|
56
|
+
});
|
|
57
|
+
return parseAgent(filled, file);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function modelFor(config, harness, role) {
|
|
61
|
+
const models = (config.models && config.models[harness]) || {};
|
|
62
|
+
return models[role] || null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function renderClaude({ meta, body }, config) {
|
|
66
|
+
const lines = ['---', `name: ${meta.name}`, `description: ${JSON.stringify(meta.description)}`];
|
|
67
|
+
const model = modelFor(config, 'claude', meta.role);
|
|
68
|
+
if (model) lines.push(`model: ${model}`);
|
|
69
|
+
if (meta.access === 'read') lines.push(`tools: ${READ_TOOLS}`);
|
|
70
|
+
if (meta.access === 'write-own') lines.push(`tools: ${WRITE_OWN_TOOLS}`);
|
|
71
|
+
if (meta.skills.length > 0) {
|
|
72
|
+
lines.push('skills:');
|
|
73
|
+
for (const skill of meta.skills) lines.push(` - ${skill}`);
|
|
74
|
+
}
|
|
75
|
+
lines.push('---', '');
|
|
76
|
+
return lines.join('\n') + body;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function renderCursor({ meta, body }, config) {
|
|
80
|
+
const lines = ['---', `name: ${meta.name}`, `description: ${JSON.stringify(meta.description)}`];
|
|
81
|
+
const model = modelFor(config, 'cursor', meta.role);
|
|
82
|
+
if (model) lines.push(`model: ${model}`);
|
|
83
|
+
if (meta.access === 'read') lines.push('readonly: true');
|
|
84
|
+
lines.push('---', '');
|
|
85
|
+
return lines.join('\n') + loadSkillsPreamble(meta) + body;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderOpenCode({ meta, body }, config) {
|
|
89
|
+
const lines = ['---', `description: ${JSON.stringify(meta.description)}`, `mode: ${meta.mode || 'subagent'}`];
|
|
90
|
+
const model = modelFor(config, 'opencode', meta.role);
|
|
91
|
+
if (model) lines.push(`model: ${model}`);
|
|
92
|
+
lines.push('permission:');
|
|
93
|
+
if (meta.access === 'read') {
|
|
94
|
+
lines.push(' edit: deny');
|
|
95
|
+
} else {
|
|
96
|
+
lines.push(' bash:');
|
|
97
|
+
for (const pattern of FORBIDDEN_GIT) lines.push(` "${pattern}": deny`);
|
|
98
|
+
lines.push(' "*": allow');
|
|
99
|
+
}
|
|
100
|
+
lines.push('---', '');
|
|
101
|
+
return lines.join('\n') + loadSkillsPreamble(meta) + body;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function renderCodex({ meta, body }, config) {
|
|
105
|
+
const model = modelFor(config, 'codex', meta.role);
|
|
106
|
+
const lines = [
|
|
107
|
+
`name = "${meta.name}"`,
|
|
108
|
+
`description = ${JSON.stringify(meta.description)}`,
|
|
109
|
+
`developer_instructions = ${tomlMultiline(loadSkillsPreamble(meta) + body)}`
|
|
110
|
+
];
|
|
111
|
+
if (model) {
|
|
112
|
+
lines.push(`model = "${model}"`);
|
|
113
|
+
lines.push('model_reasoning_effort = "high"');
|
|
114
|
+
}
|
|
115
|
+
lines.push(`sandbox_mode = "${meta.access === 'read' ? 'read-only' : 'workspace-write'}"`);
|
|
116
|
+
return lines.join('\n') + '\n';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Literal multi-line strings keep backslashes as written; fall back to an escaped basic string.
|
|
120
|
+
function tomlMultiline(text) {
|
|
121
|
+
if (!text.includes("'''")) return `'''\n${text}'''`;
|
|
122
|
+
return `"""\n${text.replace(/\\/g, '\\\\').replace(/"""/g, '\\"\\"\\"')}"""`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Harnesses without skill preloading are told to load the skills first.
|
|
126
|
+
function loadSkillsPreamble(meta) {
|
|
127
|
+
if (meta.skills.length === 0) return '';
|
|
128
|
+
const names = meta.skills.map((s) => `\`${s}\``).join(', ');
|
|
129
|
+
return `First, load the skill ${names} with your skill tool and follow it.\n\n`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const RENDERERS = {
|
|
133
|
+
claude: { dir: ['.claude', 'agents'], ext: '.md', render: renderClaude },
|
|
134
|
+
cursor: { dir: ['.cursor', 'agents'], ext: '.md', render: renderCursor },
|
|
135
|
+
opencode: { dir: ['.opencode', 'agents'], ext: '.md', render: renderOpenCode },
|
|
136
|
+
codex: { dir: ['.codex', 'agents'], ext: '.toml', render: renderCodex }
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
module.exports = { parseAgent, resolveAgent, modelFor, RENDERERS, ROLE_NAMES };
|
package/src/config.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
story_map: true,
|
|
9
|
+
memory: {
|
|
10
|
+
constitution: 'CONSTITUTION.md',
|
|
11
|
+
glossary: 'GLOSSARY.md',
|
|
12
|
+
standards: 'CODING_STANDARDS.md',
|
|
13
|
+
adrs: 'docs/adrs',
|
|
14
|
+
adr_template: null
|
|
15
|
+
},
|
|
16
|
+
templates: { pitch: null, features: null, slice: null },
|
|
17
|
+
// Method slots: each names the skill that does that job. Swap one by naming another skill.
|
|
18
|
+
methods: {
|
|
19
|
+
grill: 'grill-with-docs',
|
|
20
|
+
domain: 'domain-modeling',
|
|
21
|
+
code: 'bokata-tdd',
|
|
22
|
+
refactor: 'bokata-refactor'
|
|
23
|
+
},
|
|
24
|
+
harnesses: [],
|
|
25
|
+
// Model per harness and role. trio and reviewer analyse and plan; executor writes code.
|
|
26
|
+
// A role set to null (or missing) uses the harness's own default model.
|
|
27
|
+
models: {
|
|
28
|
+
claude: { trio: 'opus', reviewer: 'opus', executor: 'sonnet' },
|
|
29
|
+
opencode: {
|
|
30
|
+
trio: 'opencode-go/glm-5.3-flash',
|
|
31
|
+
reviewer: 'opencode-go/glm-5.3-flash',
|
|
32
|
+
executor: 'opencode-go/deepseek-v4.1-flash'
|
|
33
|
+
},
|
|
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' }
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
function configPath(cwd) {
|
|
40
|
+
return path.join(cwd, CONFIG_FILE);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function readConfig(cwd) {
|
|
44
|
+
const file = configPath(cwd);
|
|
45
|
+
if (!fs.existsSync(file)) return { exists: false, config: clone(DEFAULTS) };
|
|
46
|
+
const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
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 };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function writeConfig(cwd, config) {
|
|
54
|
+
fs.writeFileSync(configPath(cwd), JSON.stringify(config, null, 2) + '\n');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function merge(base, override) {
|
|
58
|
+
for (const [key, value] of Object.entries(override)) {
|
|
59
|
+
if (isPlainObject(value) && isPlainObject(base[key])) {
|
|
60
|
+
base[key] = merge(base[key], value);
|
|
61
|
+
} else {
|
|
62
|
+
base[key] = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return base;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function isPlainObject(value) {
|
|
69
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function clone(value) {
|
|
73
|
+
return JSON.parse(JSON.stringify(value));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
module.exports = { CONFIG_FILE, DEFAULTS, readConfig, writeConfig, merge };
|