bokata 3.0.0-beta.3 → 3.0.0-beta.5

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 (38) 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 +71 -138
  15. package/.agents/skills/bokata-render/assets/story-map.html +590 -0
  16. package/.agents/skills/bokata-render/scripts/render.mjs +784 -0
  17. package/.agents/skills/bokata-shape/SKILL.md +12 -2
  18. package/.agents/skills/bokata-shape/resources/pitch-template.md +3 -0
  19. package/.agents/skills/bokata-slice/SKILL.md +193 -100
  20. package/.agents/skills/bokata-slice/resources/inc-template.md +36 -0
  21. package/.agents/skills/bokata-slice/resources/slice-template.md +36 -84
  22. package/.agents/skills/bokata-status/SKILL.md +27 -15
  23. package/.agents/skills/bokata-tdd/resources/evidence-rules.md +2 -2
  24. package/LICENSE +21 -0
  25. package/README.md +54 -40
  26. package/agents/bokata-product-designer.md +2 -2
  27. package/agents/bokata-product-engineer.md +2 -2
  28. package/agents/bokata-product-manager.md +3 -3
  29. package/agents/code-executor.md +27 -16
  30. package/agents/design-reviewer.md +2 -2
  31. package/agents/feature-slicer.md +21 -9
  32. package/bin/bokata.js +17 -5
  33. package/package.json +1 -1
  34. package/src/agents.js +36 -11
  35. package/src/config.js +8 -7
  36. package/src/install.js +12 -3
  37. package/.agents/skills/bokata-render/resources/story-map-template.md +0 -835
  38. package/agents/story-map-renderer.md +0 -19
@@ -1,144 +1,77 @@
1
1
  ---
2
2
  name: bokata-render
3
- description: Render and keep up to date the Patton-style story-map.html dashboard of a bokata initiative — statuses, next step, counters and the vanilla interactivity — from features.md and slices/*.md. Loaded by the story-map-renderer agent, which the bokata skills and code-executor dispatch as a cheap background subagent because rendering is mechanical, deterministic work. Never invoked by the user directly.
3
+ description: Render the initiative's story-map.html — one self-contained page with the map (Features and User Tasks as columns, one band of bite cards per increment, a Backlog band of untaken bites), a minimap, and a page per increment, bite, User Task and Feature — by running a script over features.md, slices/ and plan.md. Also validates that markdown (--check). Run by bokata-feature-map, bokata-slice, bokata-plan, bokata-status and code-executor whenever the markdown changes; no model is involved, so it is instant and always agrees with the markdown. Use it when the user asks to refresh, rebuild or validate the story map.
4
4
  ---
5
5
 
6
6
  # bokata-render
7
7
 
8
- You render and maintain **one** artifact: `<docs>/<initiative-slug>/story-map.html`. You are
9
- mechanical and deterministic: read markdown, write HTML. Never invent product content, never ask
10
- the user questions, never touch any other file.
11
-
12
- The markdown is the source of truth. `features.md` holds the backbone; `slices/*.md` hold the
13
- slicing (`## Slicing`), the increments (`### Inc <n>` with their `**[User Task]**` tags and options),
14
- the backlog of **bites** (`## Backlog`) and `Status:` (open | done); `plan.md` holds the plan
15
- checklists, under `## Slice <nn>` → `### Inc <n>`. If the HTML and the markdown
16
- ever disagree, **the markdown wins** — fix the HTML from it, never the other way round.
17
-
18
- ## Configuration
19
-
20
- Read `.bokata.json` at the project root if it exists (`docs` defaults to `docs/initiatives`).
21
- If `story_map` is `false`, do nothing and report that rendering is disabled.
22
-
23
- ## Input
24
-
25
- The caller tells you `<docs>/<initiative-slug>/`, the **operation**, and (for `slice-added`) the
26
- slice file and the increment (`Inc <n>`). Read only `features.md`, `slices/*.md` and `plan.md` inside that folder.
27
- Read nothing else and do not load the constitution or the glossary.
28
-
29
- ## Operations
30
-
31
- Pick the operation the caller passed. If it is missing, infer it: no `story-map.html` and no
32
- slices → `create`; no `story-map.html` but slices exist → `rebuild`; the file has no `v3` marker →
33
- `rebuild`; the file is current and a slice was just added → `slice-added`; otherwise →
34
- `state-sync`.
35
-
36
- ### 1. `create` — first render
37
-
38
- No `story-map.html` exists yet. Build it whole from `features.md` using
39
- [resources/story-map-template.md](resources/story-map-template.md):
40
-
41
- - Row 1: one `.feature-header` per Feature, `grid-column: span N` (N = its User Task count), in
42
- backbone journey order. **A Feature is a header, never a column holding a list of tasks.**
43
- - Row 2: one `.step-card` per User Task with `data-task-id` and `data-feature-id`, in the order
44
- listed under its Feature.
45
- - Row 3: one `.release-cell` ("Not yet sliced") per Step, with `data-task-id`.
46
- - Counters: 0 done, 0 bites left, totals from the backbone; the next banner stays `hidden`; footer
47
- with the initiative name, date and counts.
48
- - Title `"<initiative> — Story Mapping"`, subtitle
49
- `"Backbone (Features) → Steps (User Tasks) → Releases (Slices)"`.
50
-
51
- ### 2. `slice-added` — after bokata-slice (new slice or `--next`)
52
-
53
- An increment was just added to a slice file. Update the existing board **in place**, only the
54
- columns it touches:
55
-
56
- 1. Read the slice file; take the `### Inc <n> — …` heading the caller named (if none, every
57
- `### Inc` heading without a card yet), its `**[User Task Name]**` tags and its `Options:` IDs.
58
- Map each option ID to its User Task through the `## Slicing` section.
59
- 2. For each tagged User Task, find `.step-card[data-task-id="<TASK_ID>"]`, resolve its absolute
60
- `grid-column` (1-indexed over the whole grid, not per Feature).
61
- 3. `Inc 1` (the Walking Skeleton) replaces that Step's `.release-cell[data-task-id="<TASK_ID>"]`
62
- with a `.skeleton-item-card` (`grid-row: 3`). A later increment appends an `.increment-card` at
63
- the next free row of that column (`grid-row: 4, 5, …`), or replaces the placeholder at row 3 if
64
- the column has no card yet.
65
- 4. Carry on each card: `data-task-id`, `data-feature-id`, `data-increment-id` (`<nn>-Inc<n>`, the
66
- same on every card of that increment), `data-slice` (the slice file name without `.md`),
67
- `data-state` and the card body (title `Inc <n> — <name>`, a description listing the option IDs
68
- and names of this User Task and, when the Inc has a `Bites:` line, a second line with its bite
69
- IDs and titles; `.card-details` with one `<li>` per scenario and a link to
70
- `slices/<nn>-<name>.md`) and, as its last child, the corner badge
71
- `<span class="scope-badge">S<nn> · Inc <n></span>`.
72
- 5. Leave every other Step's **increment** cards untouched, including Steps this slice did not tag
73
- and every card from earlier slices.
74
- 6. **Redraw the bites of this slice** in every Step column of its Features, tagged or not (a
75
- `--next` re-prune can change any of them): one `.bite-card` per **untaken** bite of `## Backlog`
76
- (a bite whose line carries `→ Inc n` is taken and gets no bite card), in the column of its first
77
- option (resolved through `## Slicing`), below the column's last increment card, ordered
78
- must-have → nice-to-have → deferred, each with the badge `S<nn> · Backlog`. See the template for the card. A Backlog with no bite lines
79
- (a slice written before bites) draws none.
80
- 7. Finish with `state-sync` (operation 4) so statuses, counters and the next banner match the
81
- new slice immediately.
82
-
83
- ### 3. `rebuild` — migration or repair
84
-
85
- The file predates the `v3` template marker, or the auto-check of a previous run failed and could
86
- not be repaired in place. Render the **whole** board from scratch — `features.md` for the
87
- backbone, every `slices/*.md` for the cards and their state — following
88
- [resources/story-map-template.md](resources/story-map-template.md). The result must be identical to
89
- what a fresh `create` plus every `slice-added` would produce. Use it only as fallback: the normal
90
- path is in-place editing.
91
-
92
- ### 4. `state-sync` — after bokata-plan, each executor increment, or a bokata-status catch-up
93
-
94
- Do not add cards. Re-derive state from `slices/*.md` and update the existing HTML:
95
-
96
- 1. For every slice file, read `Status:` (open | done); for its plan, read `plan.md`: under
97
- `## Slice <nn>` and per `### Inc <n>` heading, its checkboxes (`- [ ]` / `- [x]`). An increment
98
- with no section in `plan.md` has no plan yet.
99
- 2. Leave every `.bite-card` as it is: bites are redrawn only by `slice-added` and `rebuild`.
100
- For each card with `data-increment-id="<nn>-Inc<n>"`, compute its state and write it as the
101
- `state-*` class and `data-state` attribute. If a card matches no heading, leave it untouched
102
- and report it in the auto-check:
103
- - every plan checkbox checked (and at least one) → `state-done`
104
- - at least one checked, not all → `state-building`
105
- - no checkboxes checked yet (with or without a plan) → `state-planned`
106
- - no slice file for that increment → remove the `state-*` class (never happens for cards
107
- written by `slice-added`).
108
- 3. Update each card's `.steps-badge` `data-done` / `data-total` attributes (steps checked vs
109
- total in its increment). Render no badge when the increment has no plan.
110
- 4. Rebuild the **next banner**: the active slice is the first `Status: open` slice with an
111
- unchecked plan step. The next step is the first `- [ ]` under its `## Slice <nn>` section in `plan.md`. Fill `.next-text` with
112
- `"<step text> — <nn>-<name>"` and `.next-link` with `plan.md`; hide the banner
113
- (`hidden`) when there is no next step.
114
- 5. Update the header counters and footer: increments done / total (`### Inc` headings), steps
115
- done / total plan steps, slices done / total slice files, bites left (the number of
116
- `.bite-card`s), `Sliced: <features with ≥1 card>/<features>`, and the generation date.
117
-
118
- ## Auto-check (mandatory before you finish)
119
-
120
- Count in the markdown and compare with the HTML you just wrote:
121
-
122
- - `.step-card` count **equals** the number of User Task IDs in `features.md`.
123
- - `.feature-header` count **equals** the number of Features; each `span N` equals its User Task
124
- count.
125
- - Cards in `state-done` **equal** the cards of increments whose checkboxes are all checked.
126
- - Every skeleton, increment and bite card has exactly one `.scope-badge`, and it says the card's own
127
- slice and increment (`S02 · Inc 2`) or `Backlog`.
128
- - `.bite-card` count **equals** the untaken bite lines (no `→ Inc n`) in every `## Backlog`, and
129
- each sits in the column of its first option.
130
- - Header/footer counters **equal** the real counts.
131
-
132
- If any check fails, fix the HTML from the markdown and run the check again. If it still fails,
133
- write what is left as a `.system-tasks-note`-style note under the board and report the mismatch —
134
- never leave counters lying.
135
-
136
- ## Hard rules
137
-
138
- - One operation per run, one file written: `story-map.html`. Never edit `features.md`,
139
- `slices/*.md`, `pitch.md` or anything else.
140
- - Keep the file self-contained: no external CSS, JS, fonts or images. Vanilla HTML/CSS/JS only.
141
- - Keep the template marker (`<meta name="bokata-story-map" content="v3">`), the Patton structure
142
- and the `data-*` attributes — the next run depends on them.
143
- - Same filename on write: the artifact is updated, not recreated (except `rebuild`).
144
- - Reply with a single line: `<operation> — story-map.html updated (<increments done>/<total> increments, <steps done>/<total> steps)`.
8
+ `story-map.html` is a **derived file**: the markdown is the truth, a script draws the site. Same
9
+ markdown, same HTML. Nothing to edit by hand, nothing to keep in sync, and not worth committing
10
+ (add it to `.gitignore`).
11
+
12
+ ## Run it
13
+
14
+ ```bash
15
+ node .agents/skills/bokata-render/scripts/render.mjs <docs>/<initiative-slug>
16
+ # or, from a project with bokata installed: npx bokata render <docs>/<initiative-slug>
17
+ ```
18
+
19
+ `<docs>` is `docs` in `.bokata.json` (default `docs/initiatives`). It writes
20
+ `<docs>/<slug>/story-map.html` and prints one line:
21
+ `story-map.html updated (<done>/<total> increments, <done>/<total> steps, <n> bites left)`.
22
+ With `"story_map": false` in `.bokata.json` it renders nothing and says so. Options:
23
+ `--lang en|es` (the page's language, default `en`), `--date YYYY-MM-DD`, `--out <file>`.
24
+
25
+ **`--check`** parses everything with the same parser, prints every problem as `file:line: problem`
26
+ and writes nothing (exit 1 if there is any). `bokata-slice <nn> --check` runs it.
27
+
28
+ Run it in the foreground, after the markdown is final (a render takes milliseconds). If it exits
29
+ with an error, **show the user the `file:line: problem` it printed** and stop: the markdown broke
30
+ the contract below, fix the markdown, never the HTML.
31
+
32
+ ## What the page shows
33
+
34
+ One file, no server: open it in a browser. Routes are in the URL hash.
35
+
36
+ - **Map** — a column per User Task under its Feature (zoom XS · S · M · L, fold a Feature into one
37
+ column, hide empty columns, minimap, filters by state and priority). Each slice is a stack of
38
+ **bands**, one per increment, holding the **bite cards** it took; a dashed band per proposed increment;
39
+ a **Backlog** band with the untaken bites by priority. Card colour = state (done, building, planned,
40
+ proposed, untaken).
41
+ - **Increment** (`#/inc/<slice>-<n>`) — "when it is done" (the outcome), what becomes possible, bites,
42
+ what is pending, the unknowns and, folded, the full detail of its `inc-<n>.md` (rules, Gherkin).
43
+ - **Bite** (`#/bite/<slice>-<id>`) — a bite is eaten across layers: each **Step it touches is a row**
44
+ (titled with its layer: Logic, UI, Integration, Data) and **every option of that Step is a card**, aligned
45
+ in columns by option number. Cards say which bite took the option (★ this bite; any other bite or increment
46
+ keeps its state colour and links to it), which were **pruned** (hatched, with the reason and its category),
47
+ and which is the Step's target (◎). Between two slices of bread: what the user gets and its dependencies
48
+ above, how it is checked below. Zoom L · M · S · XS sets the card width; "Hide pruned" hides the cut ones.
49
+ A slice cut before Steps were written down falls back to the plain list of options.
50
+ - **User Task** (`#/ut/<id>`) — where it is covered in every slice, and **all the options of each of its
51
+ Steps together**, coloured by the bite that takes them (the place where bites will be chosen).
52
+ - **Feature** (`#/feature/<code>`).
53
+
54
+ ## What it reads
55
+
56
+ | File | Used for |
57
+ |---|---|
58
+ | `features.md` | `#### Feature: <name>` (+ `<!-- ID: … -->`) → header; `##### User Task: <name>` (+ `<!-- Task ID: … -->`) → one column each; `##### System Task …` → listed on the Feature page |
59
+ | `slices/<nn>-<name>.md` | the index: `- Status: open \| done`; `### Inc <n> — <name>` with `Outcome:` and `Bites:`; `## Backlog`: the bite lines and the `### Proposed increments` table |
60
+ | `slices/<nn>-<name>/slicing/F<k>.md` | `### User Task: <name>`, Step lines `- **S1 <name>** · UI — …` and option lines `- F1-1.1 <name> — <what changes> · <strategy> · … [→ Inc n] [→ target]` → which User Task and Step each option (and so each bite) belongs to, and what it says |
61
+ | `slices/<nn>-<name>/pruned.md` | `- F1-1.0 <name> — \`obsolete\`: <reason>` → the cut options, drawn in their Step on the bite page |
62
+ | `slices/<nn>-<name>/inc-<n>.md` | `- State: sliced \| planned \| done`, `Unknowns:`, the `Scenario:` lines, the `## Pending` list and the whole body for the Inc page |
63
+ | `plan.md` | `## Slice <nn>` → `### Inc <n>` and their `- [ ]` / `- [x]` boxes → *planned / building*, progress and the "Next" banner |
64
+
65
+ **State of an increment**: `State: done` in its `inc-<n>.md` (or a slice with `Status: done`) wins;
66
+ otherwise the steps in `plan.md` say planned / building / done; with no steps, its own `State` (sliced
67
+ by default). `plan.md` is temporary: when an Inc is done its section is deleted and nothing is lost.
68
+
69
+ A bite line is exactly the canonical one of `bokata-feature-slicer`
70
+ (`- **F1-a · <title>** (must-have) — F1-1.2 · depends on: … · value: … · check: …`; the skeleton
71
+ bites of Inc 1 are `F1-w1 … (skeleton) → Inc 1 — F1-1.1`). A bite is **taken** when an Inc lists it in
72
+ `Bites:` (its line then carries `→ Inc <n>`); an Inc with `Options:` and no `Bites:` (older slices) is
73
+ drawn as loose option cards. The tests in `test/render.test.js` (and `test/fixtures/initiative/`)
74
+ are the format specification.
75
+
76
+ The page is `assets/story-map.html` with the data of the initiative embedded; it is self-contained
77
+ (no external CSS, JS, fonts or images).