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
@@ -0,0 +1,70 @@
1
+ <!-- THE SLICE INDEX: slices/<nn>-<name>.md. Short on purpose: it is what `--next`, the story map and
2
+ the owner read first. Everything bulky lives in the folder next to it, `slices/<nn>-<name>/`:
3
+
4
+ inc-<n>.md one increment: State, Unknowns, Gherkin, rules, decisions, Pending (inc-template.md)
5
+ slicing/F<k>.md one Feature's trace: User Task → Step → options (written once)
6
+ notes.md slice-wide notes and the Trio notes
7
+ pruned.md options pruned after the slicing, one line each with its reason
8
+ discovery.md the Discovery Context of Step 2
9
+
10
+ Nothing is said twice. The index holds what never changes once written (outcome, bites); the
11
+ state of an increment lives only in its `inc-<n>.md`, so Incs built in parallel worktrees never
12
+ touch the same file. -->
13
+
14
+ # Slice <nn> — <name>
15
+
16
+ - Initiative: [<initiative>](../pitch.md) · Features: F1 <name>, F2 <name>
17
+ - When it is done, the user can: <one or two sentences — the end-to-end flow>
18
+ - Rabbit holes that touch it: <from the pitch, or "none">
19
+ - Status: open | done <!-- set by the user: `bokata-slice <nn> --done`; a done slice shows every Inc as done -->
20
+
21
+ ## Increments
22
+
23
+ <!-- Added one at a time, in order. Inc 1 is the Walking Skeleton; every other Inc is one or several
24
+ bites. Each is functional on its own. Its State is in inc-<n>.md. A bite is listed once, in the
25
+ Backlog below; an Inc only names the bites it takes. -->
26
+
27
+ ### Inc 1 — Walking skeleton
28
+ - Outcome: <one sentence, in user language: what the user can do when this is done>
29
+ - Bites: F1-w1, F2-w1 <!-- the skeleton bites of 3e: one per User Task the skeleton covers -->
30
+ - Detail: [inc-1.md](<nn>-<name>/inc-1.md)
31
+
32
+ ### Inc 2 — <short name>
33
+ - Outcome: <…>
34
+ - Bites: F1-a, F2-c
35
+ - Detail: [inc-2.md](<nn>-<name>/inc-2.md)
36
+
37
+ ## Backlog
38
+
39
+ <!-- Every bite of the slice, one line each (INVEST group of options), per Feature and User Task, ordered
40
+ by value. Titles say who does what, so they read without the Step. A bite an Inc took ends its
41
+ priority tag with "→ Inc n". The story map draws the taken ones inside their Inc and the rest
42
+ here, in the Backlog band: keep one bite per line, in this shape. Untaken bites stay here for as
43
+ long as the slice lives, even when every Inc is done. -->
44
+
45
+ ### Proposed increments
46
+
47
+ <!-- A PROPOSAL, not a decision: the order the coordinator suggests for the bites left, written after
48
+ Inc 1 is fixed and redone by every `--next`. The owner edits it freely. Each row = one Inc
49
+ (1–3 bites; must-have first, ~nice-to-have last, dependencies respected). The next row is what
50
+ `--next` recommends first. Rows of built Incs are dropped; they live in ## Increments. -->
51
+
52
+ | Inc | Bites | What the user gains | Why this order |
53
+ |---|---|---|---|
54
+ | Inc 2 — <name> | F1-a · F2-b | <one line, in user language> | <value or dependency: "unlocks F1-c", "needs Inc 1 only"> |
55
+ | Inc 3 — <name> | F1-c | <…> | <…> |
56
+ | Later | ~F1-d · ~F1-e · deferred F1-d1 | <nice-to-have and deferred, no order promised> | — |
57
+
58
+ ### F1 — <Feature name>
59
+
60
+ - **[<User Task>]**
61
+ - **F1-w1 · <Who does or sees what in the skeleton>** (skeleton) → Inc 1 — F1-1.1, F1-2.1
62
+ - **F1-a · <Who does or sees what>** (must-have) — F1-1.2, F1-3.3 · depends on: Inc 1 · value: <one line> · check: <one sentence a test can answer>
63
+ - ~**F1-b · <Who does or sees what>** (nice-to-have) → Inc 2 — F1-2.3 · depends on: F1-a · value: <…> · check: <…>
64
+ - **[Deferred]**
65
+ - **F1-d1 · <title>** (deferred: <reason, e.g. needs F9>) — F1-1.4, F1-5.2 · prune and split when recovered
66
+
67
+ ## Files
68
+
69
+ - Slicing: [F1](<nn>-<name>/slicing/F1.md) · [F2](<nn>-<name>/slicing/F2.md)
70
+ - [Notes and trio notes](<nn>-<name>/notes.md) · [Pruned options](<nn>-<name>/pruned.md) · [Discovery Context](<nn>-<name>/discovery.md)
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: bokata-status
3
+ description: Read-only summary of where a bokata initiative stands — phase, open slices, current increment and next step, open unknowns, each slice's backlog of bites, and features not yet sliced. Use it when the user asks "where am I", "what's next", "status of <initiative>", or resumes work in a new session or another tool.
4
+ ---
5
+
6
+ # bokata-status
7
+
8
+ Read the files; change nothing. The only thing it may run is the `bokata-render` script described
9
+ at the end, which rewrites `story-map.html` from the markdown — never a state change.
10
+
11
+ ## Configuration
12
+
13
+ Read `.bokata.json` at the project root if it exists (`docs` defaults to `docs/initiatives`).
14
+
15
+ ## What to read
16
+
17
+ `<docs>/<slug>/`: `pitch.md`, `features.md`, the slice **indexes** `slices/<nn>-<name>.md`, the
18
+ `slices/<nn>-<name>/inc-<n>.md` of the increments that are not done (`State`, `Unknowns`, `Pending`) and
19
+ the `Pending` of the done ones, and `plan.md` (only what is in flight). Do not open `slicing/`,
20
+ `notes.md` or the Gherkin: status never needs them. If no slug is given, list the
21
+ initiatives under `<docs>/` that have a `pitch.md`, `features.md` or `slices/`, and ask
22
+ which one (or summarise them all in one line each).
23
+
24
+ ## What to report
25
+
26
+ Answer in the user's language, in this shape and nothing more:
27
+
28
+ ```
29
+ <initiative> — <phase: shaping | shaped | mapped | slicing | planned | building | done>
30
+ Pitch: <size>, <ambition> (if a pitch exists)
31
+ Features: <n> · sliced: <list of features with a slice> · not yet: <list>
32
+ Slice <nn>-<name> (open | done) — Features F1, F2
33
+ ✔ <built increments> ▶ Inc <n> <name> — next step: "<first unchecked step>"
34
+ ▲ <k> unknowns: <first one> | ▼ no unknowns
35
+ ⏳ <k> pending (not in the code): <first one>
36
+ ~ <open nice-to-have scenarios>
37
+ Backlog: <k> bites (<m> must-have · <d> deferred) — <first two, by ID and title>
38
+ Next: <the skill or hand-off to run next>
39
+ ```
40
+
41
+ Rules:
42
+ - **State of an increment**: `State: done` in its `inc-<n>.md` → done (also every Inc of a slice with
43
+ `Status: done`); otherwise its section in `plan.md` (the checkboxes under `## Slice <nn>` →
44
+ `### Inc <n>`): some checked → building, none → planned; no section → its own `State` (`sliced` or
45
+ `planned`). `plan.md` is temporary: a done Inc has no section there, and that is normal.
46
+ - **Phase** comes from what exists: pitch only → shaped; features → mapped; a slice with an Inc in
47
+ `sliced` (no plan yet) → slicing; Incs planned and none building → planned; some Inc building →
48
+ building; every slice done and no Feature left without a slice → done. A `features.md` carrying `<!-- Mode: single -->` was written by
49
+ `bokata-slice` in single mode, not by a feature map: it never makes the phase "mapped".
50
+ - One block per slice, open slices first; done slices get one line (`Slice <nn> done —
51
+ <k> bites left`). **Backlog** is the slice's `## Backlog` section: its bites that no `Inc` has taken
52
+ (`must-have` ones counted separately; `~nice-to-have` and deferred are the rest).
53
+ Which Features have a slice comes from their `**Slice:**` lines in `features.md`. In single
54
+ mode the `Features:` line is `Features: 1 (single mode)`.
55
+ - **▲ / ▼** is the `Unknowns` line of the increment in flight (its `inc-<n>.md`): open questions mean it
56
+ still needs the user (▲), none means only execution is left (▼). **⏳** counts the `## Pending` items
57
+ of any Inc, done ones included: manual or owner checks that are not in the code.
58
+ - **Next** is the first that applies: unknowns open → resolve them with the user; slice without
59
+ a plan → `bokata-plan`; unchecked steps → the executor hand-off line; increment built and backlog left →
60
+ `bokata-slice <nn> --next` (or `--done` if the user is finished with it); Features without a
61
+ slice → `bokata-slice` on them; nothing left → done.
62
+ - Quote steps and unknowns exactly as written. If a file is malformed, say which and where;
63
+ never guess its content.
64
+
65
+ ## Catch-up story map
66
+
67
+ `story-map.html` is a render of the markdown and can lag (an undone render, a manual edit, a
68
+ session that closed early). After reporting, if `story_map` is not `false` and `story-map.html`
69
+ is missing or older than the newest of `features.md`, anything under `slices/` and `plan.md`, run the
70
+ `bokata-render` script (milliseconds, no model) and add one line to the report saying the map was
71
+ brought up to date:
72
+
73
+ ```bash
74
+ node .agents/skills/bokata-render/scripts/render.mjs <docs>/<slug>
75
+ ```
76
+
77
+ If it prints an error, report it. If `story_map` is `false`, do nothing.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: bokata-tdd
3
+ description: Strict small-step TDD with an acceptance test per increment and evidence rules for every commit — the scenario as a failing acceptance test, then one failing test, the minimum code, a separate refactor, one commit per step. Use it to implement a planned step, a bokata slice, or a bug fix test-first; when the user says TDD, ATDD, red-green-refactor or baby steps; or when an executor agent loads it as its method.
4
+ ---
5
+
6
+ # bokata-tdd
7
+
8
+ Build in **baby steps**. Each step is tested first, made green, refactored and committed
9
+ before the next one starts.
10
+
11
+ ## Before the first step
12
+
13
+ 1. Read `AGENTS.md`, the constitution, and the project's coding standards if they exist
14
+ (paths in `.bokata.json` → `memory`; defaults `CONSTITUTION.md`, `CODING_STANDARDS.md`).
15
+ They are binding and win over this skill.
16
+ 2. Read the plan or slice you were given in full, especially owner decisions and the
17
+ scenarios your steps prove. Owner decisions override older text.
18
+ 3. Read the code the first step touches. Never assume an API exists: search for it or read
19
+ the installed package's types.
20
+ 4. Use the project's own commands for tests, lint, type-check, format and build (from
21
+ `AGENTS.md` or the project's manifest). Never invent them.
22
+ 5. Load the refactor method: the skill named in `.bokata.json` → `methods.refactor` (default
23
+ `bokata-refactor`). Steps 0 and 3 of the loop follow it.
24
+
25
+ ## Acceptance test first, once per increment
26
+
27
+ An increment is done when its scenario passes, not when its last step is committed. Before the
28
+ first step of an increment (acceptance-test-driven development, the outer loop):
29
+
30
+ 1. Write the increment's scenario as **one** test at the highest seam the project's unit test
31
+ runner reaches cheaply — usually the view model or the component, not an end-to-end spec
32
+ unless the project asks for one on this flow. Same Given/When/Then, same domain words.
33
+ 2. Run it and check it fails for the right reason.
34
+ 3. Mark it as an expected failure that turns red the moment it passes — Vitest `it.fails`,
35
+ Jest `test.failing`, pytest `xfail(strict=True)` — and commit it on its own as `test(...)`,
36
+ with the failure line in the body. If the runner has no such marker, skip it instead and
37
+ say so.
38
+ 4. Build the increment with the inner loop below, in the project's build order. The step that
39
+ makes the scenario pass removes the marker **in the same commit**.
40
+
41
+ A plan written with `bokata-plan` lists this as the increment's first step and names the seam;
42
+ use that seam. If the first step's test already *is* the scenario (a pure domain rule, say),
43
+ the two loops are one: skip this.
44
+
45
+ ## The loop, once per step
46
+
47
+ **0. MAKE THE CHANGE EASY.** If the step would land awkwardly — scattered edits, a function
48
+ growing yet another branch — tidy first with the refactor method, in its own `refactor(...)`
49
+ commit, then start the step.
50
+
51
+ **1. RED.** Write **one** failing test taken from the step's scenario. Run only that test and
52
+ check it fails *for the right reason* — a missing behaviour, not a typo or an import error.
53
+ If it passes at once, the behaviour already exists: keep it as a regression guard in its own
54
+ `test:` commit and say so.
55
+
56
+ **2. GREEN.** Write the **minimum** code that makes it pass. Faking or hard-coding is fine while
57
+ one test does not force the general case; triangulate with the next test. Write no code that
58
+ no failing test asks for.
59
+
60
+ **3. REFACTOR.** With everything green, refactor with the refactor method: Kent Beck's four
61
+ rules of simple design as the arbiter, one behaviour-preserving move at a time.
62
+
63
+ For a non-trivial step, ask the `design-reviewer` subagent to review the step's diff and apply
64
+ its findings (no subagents available? review the diff yourself with the same method).
65
+ A refactor changes structure only: run the tests before and after, and commit it on its own
66
+ as `refactor(...)`, never mixed with `feat`/`fix`.
67
+
68
+ **4. VERIFY.** Run the touched tests. At the end of each step, run the full test suite, lint
69
+ and type-check. Format only the files and hunks you touched.
70
+
71
+ **5. COMMIT.** One Conventional Commit per step — `type(scope): imperative summary` — with a
72
+ body that says *why*. Stage explicit paths, never everything. Never push, never stash, never
73
+ amend or rebase.
74
+
75
+ ## Step size
76
+
77
+ About one test file and one or two production files. If a step grows past that, split it
78
+ (a/b/c) before committing and note the split. Work from the inside out, in the order the
79
+ project builds (see `AGENTS.md`), each layer test-first.
80
+
81
+ ## Evidence rules
82
+
83
+ Every claim needs proof — see [resources/evidence-rules.md](resources/evidence-rules.md).
84
+ The short version: prove RED in the commit body, never commit red, never claim "already
85
+ implemented" without the test and commit that prove it, and record the real gate output.
86
+
87
+ ## Working from a bokata slice
88
+
89
+ If your input is `slices/<nn>-<name>.md` (its plan is in the initiative's `plan.md`): check off each
90
+ plan step there **in the same commit** as the step, fill the increment's `Tests:` lines in `plan.md`
91
+ (scenario → its acceptance test), and keep the increment's `Unknowns` current in the slice. Tests are named by behaviour in the domain's words — never by an
92
+ acceptance-criterion ID.
93
+
94
+ ## Stop and ask
95
+
96
+ Stop and ask (the user, or whoever launched you) when:
97
+ - a scenario, an ADR, an owner decision and the plan disagree;
98
+ - a requirement has two readings;
99
+ - a step needs a new dependency or an architectural pattern no ADR covers;
100
+ - a behaviour change appears outside the step's scenario (a new message, a changed flow);
101
+ - a test fails and you cannot explain why after one honest attempt.
102
+
103
+ Do not guess and continue.
104
+
105
+ ## Reporting
106
+
107
+ At the end, run the project's full definition of done and report the real output lines, the
108
+ number of commits, deviations from the plan, and any checks still pending (for example a
109
+ browser check for layout). Never claim green without running it.
@@ -0,0 +1,27 @@
1
+ # Evidence rules
2
+
3
+ They come from real executor failures: commits that claimed RED without one, "already
4
+ implemented" with no proof, reformatted neighbours, progress rows saying "pending".
5
+
6
+ 1. **Prove RED.** Each `feat`/`fix` commit body names the failing test and the failure line
7
+ seen before GREEN, e.g. `RED: "counts the moments after the new end" — expected 2, received 0`.
8
+ 2. **A test that passes at once is a `test:` commit.** Characterisation tests and guards that
9
+ pass immediately go in their own `test:` commit, even when they arrive with a feature.
10
+ 3. **Never claim "already implemented"** without naming the test that proves it and the
11
+ commit that added it.
12
+ 4. **Never commit red.** When a change alters an existing expectation, run the full suite
13
+ before that commit and change the assertion in the same commit, with the reason.
14
+ 5. **Never delete or weaken an existing test** to get green. If behaviour truly changed,
15
+ change that one assertion and explain it in the commit body.
16
+ 6. **Format only your hunks.** Format new files fully; in existing files keep your own lines
17
+ formatted and never reformat neighbouring code or tables.
18
+ 7. **No production code shaped for a test double.** If a test needs a seam, test the pure rule
19
+ and keep the production code idiomatic.
20
+ 8. **No speculative branches in tests.** No casts or conditionals in assertions; one behaviour
21
+ per test; assert a refusal by its exact value.
22
+ 9. **Record gate output per step.** Wherever progress is tracked, write the test-count line of
23
+ that step's full run and the real commit hash. Never "pending" or "(this run)".
24
+ 10. **A behaviour change outside the step's scenario** is a stop-and-ask, not a deviation note.
25
+ 11. **A refactor is structure only.** If it adds tests or widens behaviour, it is a `feat`.
26
+ 12. **Split, don't report.** If a step grows past about one test file and one or two production
27
+ files, split it before committing, unless the plan marks it indivisible.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Abraham Vallez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.