bokata 3.0.0-beta.5 → 3.0.0-beta.6

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.
@@ -11,7 +11,7 @@ The **Acceptance Criteria Generator** transforms User Tasks and requirements int
11
11
 
12
12
  This skill is flexible and methodology-agnostic regarding timing. It can generate criteria from a Feature Backbone, detailed Step Analysis, or raw User Stories.
13
13
 
14
- > **Where it fits:** `bokata-feature-map` calls it with `--functional` (a few Requirements per User Task, written into `features.md`) and `bokata-slice` calls it with `--concrete` for **one increment** at a time. Standalone, use it whenever you need **thorough coverage**: full edge cases, permission scenarios, boundary conditions, error states and concurrency rules.
14
+ > **Where it fits:** `bokata-feature-map` calls it with `--functional` (a few Requirements per User Task, written into `features.md`) and `bokata-inc` calls it with `--concrete` for **one increment** at a time. Standalone, use it whenever you need **thorough coverage**: full edge cases, permission scenarios, boundary conditions, error states and concurrency rules.
15
15
 
16
16
  ## Prerequisites
17
17
 
@@ -26,7 +26,7 @@ This skill supports two depth modes, selected via an argument flag:
26
26
 
27
27
  - **`--functional`** (used when generating ACs directly from a Features Backbone, before slicing exists): Produces **Requirement + Scenario** style output matching openspec spec conventions — a SHALL-statement Requirement per Rule, with one or more WHEN/THEN Scenarios covering the primary rule and its most important variant. Optimized for business-rule clarity and traceability, not exhaustive edge-case coverage. Never scoped to an increment (slicing has not happened yet at this stage). Use [Functional Output Template](resources/output-template-functional.md).
28
28
 
29
- - **`--concrete`** (used when generating ACs after a Feature has been sliced): Produces full Gherkin Given/When/Then coverage — happy path, edge cases, boundary conditions, error states, concurrency rules, and negative permission scenarios — for the increment named in the input (`bokata-slice` passes one: its option IDs, their descriptions and its User Task tags). Write scenarios only for what that increment's options promise: an option marked fake, hardcoded or manual gets scenarios for what the user sees, not for the real thing. Group scenarios by User Task. Use [Concrete Output Template](resources/output-template.md).
29
+ - **`--concrete`** (used by `bokata-inc`, after a Feature has been sliced, for one increment): Produces full Gherkin Given/When/Then coverage — happy path, edge cases, boundary conditions, error states, concurrency rules, and negative permission scenarios — for the increment named in the input (`bokata-inc` passes one: its option IDs, their descriptions and its User Task tags). Write scenarios only for what that increment's options promise: an option marked fake, hardcoded or manual gets scenarios for what the user sees, not for the real thing. Group scenarios by User Task. Use [Concrete Output Template](resources/output-template.md).
30
30
 
31
31
  If no flag is provided, default to `--concrete` behavior (preserves current behavior for direct/standalone invocations).
32
32
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  <!-- The backbone uses bokata-feature-mapper's output format unchanged; each User Task carries
6
6
  its functional ACs (bokata-acceptance-criteria --functional) right below it, and each
7
- Feature ends with a one-line `**Slice:**` summary that bokata-slice fills. This file is the
7
+ Feature ends with a one-line `**Slice:**` summary that bokata-slice fills (and bokata-inc keeps current). This file is the
8
8
  summary: the slicing (Steps, options, increments, backlog) lives in slices/<nn>-<name>.md.
9
9
  Single mode (bokata-slice from a pitch) writes `<!-- Mode: single -->` and keeps only the
10
10
  one Feature's header, Purpose, User Task names and Slice line. -->
@@ -52,7 +52,7 @@ The system [description of what it executes and what it produces].
52
52
  - [State name]: [Description]
53
53
 
54
54
  **Slice:** not sliced yet
55
- <!-- Set by bokata-slice: → {nn-name} · {taken}/{total} options · next: {bite ID} {bite title} [· done] -->
55
+ <!-- Set by bokata-slice, kept current by bokata-inc: → {nn-name} · {taken}/{total} options · next: {bite ID} {bite title} [· done] -->
56
56
 
57
57
  ---
58
58
 
@@ -24,8 +24,8 @@ Feature
24
24
  Bite F1-a … (Phase 4 — options of one or several Steps that make sense together; INVEST)
25
25
 
26
26
  Increment = one or several bites (or the Walking Skeleton) that the user can see or use.
27
- Increments are composed later (bokata-slice); this skill proposes the first one, the Walking
28
- Skeleton, and the bites the later ones are picked from.
27
+ Increments are proposed by bokata-slice and specified later, one at a time, by bokata-inc; this
28
+ skill proposes the first one, the Walking Skeleton, and the bites the later ones are picked from.
29
29
  ```
30
30
 
31
31
  **Exploring is wide, the backlog is narrow.** Phase 2 produces many options on purpose (quotas,
@@ -26,7 +26,7 @@ reasons, and write the reason:
26
26
 
27
27
  Rules:
28
28
  - **Never discard** an option of the skeleton, one marked `deferred`, or one an Inc has already
29
- taken (`→ Inc n`, when re-pruning after `--next`): the story map resolves each Inc's options (those of its
29
+ taken (`→ Inc n`, when `bokata-inc` re-prunes): the story map resolves each Inc's options (those of its
30
30
  bites) through the trace.
31
31
  - A discard needs one of the four reasons. "I prefer the other one" is not a reason; when two
32
32
  options are genuine alternatives, keep both and let a bite choose.
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: bokata-inc
3
+ description: Specify one increment of a slice — pick its bites (the next proposed increment, a numbered one, or any bites you name), have the Product Trio contribute rules, write concrete Acceptance Criteria (Gherkin) only for it, and re-prune what it makes obsolete. The Walking Skeleton (Inc 1) and every later increment go through it, after bokata-slice and before bokata-plan. Use it when the user wants to take the next increment, spec Inc 3, or build an increment out of named bites.
4
+ ---
5
+
6
+ Turn a **proposed** increment into a **specified** one. `bokata-slice` left the bites and a
7
+ roadmap of proposed increments in the slice; this skill commits to one of them: it fixes which bites
8
+ the increment takes, writes its concrete ACs, and lets the owner approve them before anything is
9
+ planned. You are the neutral coordinator; the PM, Designer and Engineer contribute rules from their
10
+ lenses.
11
+
12
+ ```
13
+ bokata-slice → bites + proposed increments (Inc 1 = the Walking Skeleton), no specs
14
+ (you) → review the index: move bites, add or drop, reorder the rows
15
+ bokata-inc → take an increment → trio rules → concrete ACs → you approve (this skill)
16
+ bokata-plan → checklist (refuses an Inc that is not specified)
17
+ code-executor → build → State: done
18
+ ```
19
+
20
+ An increment goes **proposed → specified → planned → done**. It is *proposed* while it is only a row
21
+ of `### Proposed increments`; it is *specified* once its `inc-<n>.md` exists with approved ACs
22
+ (`State: specified`); `bokata-plan` sets *planned*; the executor sets *done*.
23
+
24
+ ## Calls
25
+
26
+ | Call | Does |
27
+ |------|------|
28
+ | `bokata-inc` | The **next** increment: the first row of `### Proposed increments` |
29
+ | `bokata-inc <n>` | **Inc n**, the proposed row labelled `Inc n` as it stands in the table (with your hand edits) |
30
+ | `bokata-inc F1-b F2-c` | A **new** increment made of exactly those bites; it takes the highest number in use plus one, and the bites leave the row they were in |
31
+ | `bokata-inc … --slice <nn>` | Choose the slice when more than one is open |
32
+
33
+ - **Resolve the initiative** the way the other skills do: the one the user names, else the only
34
+ initiative under `<docs>` with a slice; ask if there are several.
35
+ - **Resolve the slice**: the open slice with proposed increments. If several qualify and `--slice`
36
+ is not given, ask which one, with your recommendation.
37
+ - An `<n>` that is already specified (`inc-<n>.md` exists) is not re-run: say so and point at the
38
+ file — it is edited by hand. An `<n>` that is in no row and in no Inc: say so and list the rows.
39
+ - With no rows left, say what the Backlog still holds (`Later`, deferred) and offer
40
+ `bokata-inc <bite IDs>` or `bokata-slice <nn> --done`.
41
+
42
+ ## Configuration
43
+
44
+ Read `.bokata.json` at the project root if it exists. Defaults:
45
+
46
+ ```json
47
+ { "docs": "docs/initiatives",
48
+ "memory": { "constitution": "CONSTITUTION.md", "glossary": "GLOSSARY.md", "adrs": "docs/adrs" },
49
+ "methods": { "domain": "domain-modeling" },
50
+ "story_map": true }
51
+ ```
52
+
53
+ `<docs>` is the `docs` value. The story map is drawn by the `bokata-render` script; this skill only
54
+ runs it.
55
+
56
+ ---
57
+
58
+ ## Step 1: Read
59
+
60
+ Read the slice **index** (`## Increments`, `## Backlog` — the bite lines and `### Proposed
61
+ increments`), `context.md`, `pruned.md`, and the `slicing/F<k>.md` of the Features whose bites
62
+ you may take; read an `inc-<n>.md` only for an Inc you must reason about (its `Pending` and
63
+ decisions). Also the functional ACs of the touched Features from `features.md`, the glossary and
64
+ the constitution. **Do not read the Gherkin of the Incs already built.**
65
+
66
+ ## Step 2: Choose the bites (Interactive)
67
+
68
+ 1. **Resolve the call** to a set of bites: the first row of the table, the row `Inc <n>`, or the
69
+ bites the user named. Show it as one line of what the user can do, its bite IDs and titles, and
70
+ the option each takes. Then check, and say what fails:
71
+ - every bite has a line in `## Backlog` and no Inc has taken it;
72
+ - `depends on` is satisfied: a bite ID taken by an Inc or in this one, `Inc 1` (already
73
+ specified or part of this one), `none`, or `F<n> (…)` for another Feature that is done or in the
74
+ set. Offer to add the missing bite, or to continue and flag it in `Unknowns`;
75
+ - a `deferred` bite cannot be taken as it is: ask whether its reason still holds; if not,
76
+ reclassify it (and split it if it is big) before taking it.
77
+ 2. **Inc 1 is the Walking Skeleton.** Its bites are the skeleton bites (`F<n>-w<k>`, `(skeleton)`).
78
+ It must cover **every User Task of the slice's Features**: if the table or your edits left one
79
+ out, say so. Every part must be functional on its own: an option with no visible effect alone
80
+ travels with the option that makes it visible.
81
+ 3. **Ask once, with a recommendation** (worded so "yes" accepts it): "Take these bites as Inc <n> —
82
+ <name>?" The user can swap, add or drop bites, rename the increment or write their own. **The
83
+ user decides.** If you were called with bite IDs, or the row is untouched, this is the only
84
+ question.
85
+ 4. **A request no bite has**: add it as a new option to its Step in `slicing/F<k>.md` (next free
86
+ ID, with its strategy) **and to a bite** (new or existing) before using it — the Slicing stays
87
+ the source of truth.
88
+ 5. **Options the user moves into the increment leave their bite**: if that empties a bite, remove
89
+ it; if it breaks another bite's `depends on`, repoint it to this Inc. The bites that are left
90
+ stay the backlog.
91
+
92
+ ## Step 3: Re-prune
93
+
94
+ The increment just chosen raises the floor for its Steps: any live option, in any bite, that now
95
+ sits below what the increment builds is `obsolete`. Delete it from its `slicing/F<k>.md` and list it
96
+ in `pruned.md` with its reason. **Never prune an option an Inc has taken** (`→ Inc n`): the story map
97
+ resolves each Inc's options through the Slicing, so those stay. Bites left with no options go away;
98
+ a bite whose value shrank is reworded or merged. A removal that would take value away from a bite
99
+ goes to the user as one decision point, with your recommended default.
100
+
101
+ ## Step 4: Concrete Acceptance Criteria — this increment only
102
+
103
+ Never write concrete ACs for options still in the backlog. **Subagents get paths, not pasted
104
+ content**: give them the paths of `slicing/F<k>.md` and `context.md`; the increments already in the
105
+ slice are the `## Increments` of the index.
106
+
107
+ ### 4a. Trio contributes Rules (Subagents, Parallel)
108
+
109
+ One message, three foreground calls, wait for all three:
110
+
111
+ **Task 1: PM Contribution**
112
+ ```
113
+ subagent_type: bokata-product-manager
114
+ prompt: "Contribute business-rule Rules for increment [Inc n] of slice [nn], from the viability/value lens. You have:
115
+ - The increment: [its outcome, its bites (ID and title) and their option IDs — what each option means is in the trace files: <paths>]
116
+ - Increments already in the slice (for context): the `## Increments` of <index path>
117
+ - Backbone + functional ACs of the touched User Tasks: <docs>/<slug>/features.md — [the User Task names to read]
118
+ - Discovery Context: [path of context.md]
119
+ Do NOT ask the user questions. Give launch-blocking rules for this increment and the value it
120
+ unlocks. Respect its shortcuts: an option marked fake/hardcoded/manual gets rules for what the user
121
+ sees, not for the real thing. Format per your agent file (Contributed Rules — PM Lens)."
122
+ ```
123
+
124
+ **Task 2: Designer Contribution**
125
+ ```
126
+ subagent_type: bokata-product-designer
127
+ prompt: "Contribute UX/UI Rules for increment [Inc n] of slice [nn], from the usability/craft lens. You have:
128
+ - The increment: [its outcome, its bites (ID and title) and their option IDs — what each option means is in the trace files: <paths>]
129
+ - Increments already in the slice: the `## Increments` of <index path>
130
+ - Backbone + functional ACs of the touched User Tasks: <docs>/<slug>/features.md — [the User Task names to read]
131
+ - Discovery Context: [path of context.md]
132
+ Do NOT ask the user questions. Give the UI states, component reuse and interaction patterns this
133
+ increment needs — no more than its options promise. Format per your agent file (Contributed Rules — Designer Lens)."
134
+ ```
135
+
136
+ **Task 3: Engineer Contribution**
137
+ ```
138
+ subagent_type: bokata-product-engineer
139
+ prompt: "Contribute technical Rules for increment [Inc n] of slice [nn], from the feasibility/sustainability lens. You have:
140
+ - The increment: [its outcome, its bites (ID and title) and their option IDs — what each option means is in the trace files: <paths>]
141
+ - Increments already in the slice: the `## Increments` of <index path>
142
+ - Backbone + functional ACs of the touched User Tasks: <docs>/<slug>/features.md — [the User Task names to read]
143
+ - Discovery Context: [path of context.md]
144
+ Do NOT ask the user questions. Give data shape, contracts, guards and boundary rules for this
145
+ increment, and whether it builds on earlier increments or reshapes them. Format per your agent
146
+ file (Contributed Rules — Engineer Lens)."
147
+ ```
148
+
149
+ ### 4b. Consolidate & Invoke the AC Skill
150
+
151
+ Merge the three contributions into one enrichment block (de-duplicated). Then:
152
+ ```
153
+ bokata-acceptance-criteria --concrete
154
+ Input: [the increment: outcome, bites (ID and title), option IDs; the trace files hold what each option means: <paths>]
155
+ Enrichment: [consolidated Rules]
156
+ Discovery Context: [path of context.md]
157
+ Instruction: "Skip your own Phase 0 discovery — it has been resolved upstream. Proceed directly to
158
+ Phase 1 (Input Analysis) through Phase 3 (Generate Output), using --concrete depth. Write
159
+ scenarios only for this increment, with concrete example data. Return the ## Acceptance Criteria
160
+ (Concrete) section."
161
+ ```
162
+
163
+ ### 4c. Domain Pass (Interactive)
164
+
165
+ Load the skill named in `methods.domain` (default `domain-modeling`; skip if `null` or not
166
+ installed) and run it over the concrete ACs against the glossary at `memory.glossary`:
167
+ - A term the glossary lists under _Avoid_ → replace it with the canonical term.
168
+ - Two words for one concept, or one word for two → ask the user, then use the answer everywhere.
169
+ - A new concept → settle its name with the user and add it to the glossary (terms only).
170
+ - An ADR only at `memory.adrs`, and only when hard to reverse, surprising without context, and the
171
+ result of a real trade-off.
172
+
173
+ Ask every naming question in one round, numbered, each with your recommended answer. The paths
174
+ and formats in `.bokata.json` win over the domain skill's own.
175
+
176
+ ---
177
+
178
+ ## Step 5: Review gate — the owner approves the ACs (Interactive)
179
+
180
+ The ACs are what `bokata-plan` will turn into a checklist, so this is the last point where a wrong
181
+ scenario is cheap.
182
+
183
+ 1. Write the draft to `slices/<nn>-<name>/inc-<n>.md` from [inc-template.md](resources/inc-template.md)
184
+ with **`State: draft`**, `Unknowns:` (from the reviews and anything you could not settle), an empty
185
+ `Parallel-safe:` and the concrete ACs exactly as returned. A leftover draft of an earlier run is
186
+ replaced. The index does not list the Inc yet, so the story map ignores the draft.
187
+ 2. Show the user, in the conversation: the Inc line (name, outcome, bites), the **Rules**, the
188
+ scenario titles per User Task, what was pruned, the `Unknowns`, and the path of the draft.
189
+ Say that they can read the full Gherkin there.
190
+ 3. Ask for approval, with the options *approve*, *change* (what to change) and *cancel*
191
+ (delete the draft; nothing else was touched). Apply the changes to the draft and ask again. **Do
192
+ not go on until the owner approves.** Whatever the answer, the proposed rows are untouched until
193
+ then.
194
+
195
+ ## Step 6: Write the increment
196
+
197
+ Once approved:
198
+
199
+ 1. **`inc-<n>.md`**: set `State: specified`.
200
+ 2. **The index** `slices/<nn>-<name>.md`:
201
+ - add `### Inc <n> — <short name>` to `## Increments`, in number order, with `Outcome:` (one
202
+ sentence, user language), `Bites:` and `Detail:` (link to `inc-<n>.md`);
203
+ - in `## Backlog`, append `→ Inc <n>` to the bites it took, after the priority tag (the skeleton
204
+ bites of Inc 1 included: `(skeleton) → Inc 1`);
205
+ - **redo `### Proposed increments`** with [proposed-increments.md](../bokata-slice/resources/proposed-increments.md):
206
+ drop the row of this Inc, take its bites out of any other row, and reorder what is left if the
207
+ pruning or what was built changed it.
208
+ 3. **`slicing/F<k>.md`**: append `→ Inc <n>` to every option the Inc took (replacing the slicer's
209
+ `skeleton` marker). A `skeleton` marker on an option no Inc took stays: it is only the slicer's
210
+ proposal.
211
+ 4. **`features.md`**: update the `**Slice:**` line of each touched Feature
212
+ (`→ <nn>-<name> · <taken>/<total> options · next: <bite ID> <bite title>`, where the next bite is
213
+ the first of the first proposed row).
214
+ 5. **Refresh the story map** (if `story_map`) and validate, in the foreground:
215
+ ```bash
216
+ node .agents/skills/bokata-render/scripts/render.mjs <docs>/<initiative-slug>
217
+ node .agents/skills/bokata-render/scripts/render.mjs <docs>/<initiative-slug> --check
218
+ ```
219
+ If either prints a `file:line: problem`, fix the markdown and run it again.
220
+
221
+ ## Step 7: Verify & Summarize
222
+
223
+ - [ ] The bites exist, are not taken by another Inc, and their dependencies are met or flagged
224
+ - [ ] Inc 1 covers every User Task of the slice's Features, as skeleton bites
225
+ - [ ] The re-prune deleted only options no Inc took, each listed in `pruned.md` with its reason
226
+ - [ ] Concrete ACs exist only for this increment, in full Gherkin with concrete data, and the owner approved them
227
+ - [ ] `inc-<n>.md` says `State: specified`; the index lists the Inc, its bites say `→ Inc <n>`, and no
228
+ proposed row names them
229
+ - [ ] No subagent prompt contains a pasted trace, report or Discovery Context: only paths
230
+ - [ ] No duration written anywhere
231
+ - [ ] The `bokata-render` script ran and `--check` is clean
232
+
233
+ Print:
234
+ ```
235
+ ## ✓ Increment Specified
236
+
237
+ **Slice:** <nn>-<name> · **Inc <n> — <name>** (State: specified)
238
+ **Outcome:** {{ONE_LINE}}
239
+ **Bites:** {{IDS_AND_TITLES}} · {{NUM_OPTIONS}} options · {{NUM_GHERKIN_BLOCKS}} scenarios
240
+ **Pruned now:** {{N}} · **Bites left:** {{N}} ({{NUM_MUST}} must-have) · **Unknowns:** {{N}}
241
+
242
+ **Next step:** `bokata-plan <docs>/{{INITIATIVE_SLUG}}/slices/<nn>-<name>.md` — inside your harness's plan mode.
243
+ Then `code-executor`, and `bokata-inc` again for the next increment (next proposed: Inc <m> — <name>).
244
+ ```
@@ -1,11 +1,11 @@
1
- <!-- ONE INCREMENT: slices/<nn>-<name>/inc-<n>.md. Written by `bokata-slice` when the Inc enters; after
2
- that the owner edits Unknowns and decisions, `bokata-plan` sets the State to planned, and the
3
- executor sets it to done. The Inc's name, outcome and bites are in the slice index: do not copy
4
- them here. -->
1
+ <!-- ONE INCREMENT: slices/<nn>-<name>/inc-<n>.md. Written by `bokata-inc` as a draft and approved by the
2
+ owner; after that the owner edits Unknowns and decisions, `bokata-plan` sets the State to planned,
3
+ and the executor sets it to done. The Inc's name, outcome and bites are in the slice index: do not
4
+ copy them here. -->
5
5
 
6
6
  # Inc <n> — <short name>
7
7
 
8
- - State: sliced | planned | done <!-- sliced: ACs written · planned: bokata-plan wrote its steps · done: built (the executor sets it). "building" is not written: it is derived from the checked steps of plan.md -->
8
+ - State: specified | planned | done <!-- draft: bokata-inc is still writing it and the owner has not approved it (the index does not list the Inc yet) · specified: ACs approved · planned: bokata-plan wrote its steps · done: built (the executor sets it). "building" is not written: it is derived from the checked steps of plan.md -->
9
9
  - Unknowns: <open questions, or "none">
10
10
  - Parallel-safe: <yes | no — set by bokata-plan>
11
11
 
@@ -1,14 +1,16 @@
1
1
  ---
2
2
  name: bokata-plan
3
- description: Write the technical plan for the unplanned increments of a bokata slice (usually the one just added) as checklists in the initiative's plan.md, one section per slice and increment, so an executor in another process can follow it and check it off. It is a contract to use inside your harness's own plan mode — it does not replace it. Use it when the user wants to plan a slice, or says "plan <slice>" after bokata-slice.
3
+ description: Write the technical plan for the specified, not yet planned increments of a bokata slice (usually the one bokata-inc just specified) as checklists in the initiative's plan.md, one section per slice and increment, so an executor in another process can follow it and check it off. It is a contract to use inside your harness's own plan mode — it does not replace it. Use it when the user wants to plan an increment, or says "plan <slice>" after bokata-inc.
4
4
  ---
5
5
 
6
6
  # bokata-plan
7
7
 
8
8
  Your harness's plan mode does the planning. This skill only fixes **where the plan lands and
9
9
  in what shape**, so that the executor (often another tool and another model) and
10
- `bokata-status` can read it. Plan every increment with no section yet in `plan.md` — usually the
11
- one `bokata-slice` just added (Inc 1, or the latest `--next`). Never re-plan a built increment.
10
+ `bokata-status` can read it. Plan every **specified** increment (`State: specified` in its `inc-<n>.md`) with no
11
+ section yet in `plan.md` — usually the one `bokata-inc` just specified. Never re-plan a built increment, and
12
+ never plan a proposed one: an increment with no `inc-<n>.md` has no approved ACs, so stop and tell the user
13
+ to run `bokata-inc` first.
12
14
 
13
15
  ## Configuration
14
16
 
@@ -56,7 +58,7 @@ For every increment to plan, write the steps that build it:
56
58
  `Owner decision: …`. A new pattern that needs an ADR is an owner decision too.
57
59
 
58
60
  Do not write code. Do not change the acceptance criteria: if one is wrong or missing, stop and
59
- tell the user — it goes back to `bokata-slice`.
61
+ tell the user — it goes back to `bokata-inc`.
60
62
 
61
63
  ## 3. Write it into `plan.md`
62
64
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bokata-render
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.
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-inc, 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
@@ -23,7 +23,7 @@ With `"story_map": false` in `.bokata.json` it renders nothing and says so. Opti
23
23
  `--lang en|es` (the page's language, default `en`), `--date YYYY-MM-DD`, `--out <file>`.
24
24
 
25
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.
26
+ and writes nothing (exit 1 if there is any). `bokata-slice <nn> --check` runs it (run it after editing the proposed increments by hand).
27
27
 
28
28
  Run it in the foreground, after the markdown is final (a render takes milliseconds). If it exits
29
29
  with an error, **show the user the `file:line: problem` it printed** and stop: the markdown broke
@@ -35,7 +35,7 @@ One file, no server: open it in a browser. Routes are in the URL hash.
35
35
 
36
36
  - **Map** — a column per User Task under its Feature (zoom XS · S · M · L, fold a Feature into one
37
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;
38
+ **bands**, one per increment, holding the **bite cards** it took; a dashed band per proposed increment (the roadmap of `### Proposed increments`, the Walking Skeleton of a new slice included);
39
39
  a **Backlog** band with the untaken bites by priority. Card colour = state (done, building, planned,
40
40
  proposed, untaken).
41
41
  - **Increment** (`#/inc/<slice>-<n>`) — "when it is done" (the outcome), what becomes possible, bites,
@@ -56,19 +56,19 @@ One file, no server: open it in a browser. Routes are in the URL hash.
56
56
  | File | Used for |
57
57
  |---|---|
58
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 |
59
+ | `slices/<nn>-<name>.md` | the index: `- Status: open \| done`; `### Inc <n> — <name>` with `Outcome:` and `Bites:` (only the specified increments; a new slice has none); `## Backlog`: the bite lines and the `### Proposed increments` table (the proposed increments) |
60
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
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 |
62
+ | `slices/<nn>-<name>/inc-<n>.md` | `- State: specified \| planned \| done` (an old `sliced` reads as `specified`), `Unknowns:`, the `Scenario:` lines, the `## Pending` list and the whole body for the Inc page |
63
63
  | `plan.md` | `## Slice <nn>` → `### Inc <n>` and their `- [ ]` / `- [x]` boxes → *planned / building*, progress and the "Next" banner |
64
64
 
65
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.
66
+ otherwise the steps in `plan.md` say planned / building / done; with no steps, its own `State` (specified
67
+ by default). An increment with no `inc-<n>.md` is **proposed**: a row of `### Proposed increments`, drawn dashed. `plan.md` is temporary: when an Inc is done its section is deleted and nothing is lost.
68
68
 
69
69
  A bite line is exactly the canonical one of `bokata-feature-slicer`
70
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
71
+ bites of Inc 1 are `F1-w1 … (skeleton) — F1-1.1`, and `→ Inc 1` once `bokata-inc` specifies it). A bite is **taken** when an Inc lists it in
72
72
  `Bites:` (its line then carries `→ Inc <n>`); an Inc with `Options:` and no `Bites:` (older slices) is
73
73
  drawn as loose option cards. The tests in `test/render.test.js` (and `test/fixtures/initiative/`)
74
74
  are the format specification.
@@ -46,7 +46,7 @@ code{background:#eef0f4;padding:0 4px;border-radius:3px;font-size:.92em}
46
46
  .lab .m{font-size:11.5px;color:var(--mute);margin-top:3px}
47
47
  .pill{display:inline-block;font-size:10.5px;font-weight:600;border-radius:999px;padding:1px 8px;border:1px solid;vertical-align:1px}
48
48
  .p-done{background:var(--done);border-color:var(--done-b);color:#1e6b36}.p-building{background:var(--build);border-color:var(--build-b);color:#8a5d00}
49
- .p-sliced,.p-planned,.p-proposed{background:var(--plan);border-color:var(--plan-b);color:#2f56b0}.p-open{background:#eee;border-color:#ccc;color:#555}
49
+ .p-specified,.p-planned,.p-proposed{background:var(--plan);border-color:var(--plan-b);color:#2f56b0}.p-open{background:#eee;border-color:#ccc;color:#555}
50
50
  .bar{height:4px;background:#e5e7eb;border-radius:3px;margin-top:4px;overflow:hidden}.bar i{display:block;height:100%;background:var(--build-b)}
51
51
  .card{display:flex;flex-direction:column;gap:2px;margin:3px 5px;padding:6px 8px;border-radius:8px;border:1.5px solid;font-size:12px;line-height:1.3;min-height:44px;overflow:hidden;position:relative}
52
52
  .card:hover{box-shadow:0 2px 8px rgba(0,0,0,.18);z-index:5}
@@ -166,7 +166,7 @@ const ES = String(D.lang || 'en').toLowerCase().startsWith('es');
166
166
  const I = {
167
167
  en: {
168
168
  zoom: 'Zoom', fold: 'Fold features', unfold: 'Unfold features', empty: 'Only columns with cards', minimap: 'Minimap', state: 'State', priority: 'Priority',
169
- done: 'done', building: 'building', planned: 'planned', sliced: 'sliced', proposed: 'proposed', back: 'untaken', open: 'open',
169
+ done: 'done', building: 'building', planned: 'planned', specified: 'specified', proposed: 'proposed', back: 'untaken', open: 'open',
170
170
  must: 'must', nice: 'nice', def: 'def', backlog: 'Backlog', backlogSub: 'Untaken bites, by priority', bitesN: (n) => `${n} ${n === 1 ? 'bite' : 'bites'}`, noBites: 'no bites', scN: (n) => `${n} sc.`,
171
171
  map: 'Map', mapBack: '← Map', slice: 'Slice', incsDone: (a, b) => `${a}/${b} Incs done`, bitesTotal: (n) => `${n} bites`,
172
172
  summary: (f, u, a, b, n) => `${f} features · ${u} user tasks · ${a}/${b} Incs · ${n} bites untaken`,
@@ -187,7 +187,7 @@ const I = {
187
187
  },
188
188
  es: {
189
189
  zoom: 'Zoom', fold: 'Plegar features', unfold: 'Desplegar features', empty: 'Solo columnas con tarjetas', minimap: 'Minimapa', state: 'Estado', priority: 'Prioridad',
190
- done: 'hecho', building: 'en curso', planned: 'planificado', sliced: 'cortado', proposed: 'propuesto', back: 'sin tomar', open: 'abierto',
190
+ done: 'hecho', building: 'en curso', planned: 'planificado', specified: 'especificado', proposed: 'propuesto', back: 'sin tomar', open: 'abierto',
191
191
  must: 'must', nice: 'nice', def: 'def', backlog: 'Backlog', backlogSub: 'Bites sin tomar, por prioridad', bitesN: (n) => `${n} ${n === 1 ? 'bite' : 'bites'}`, noBites: 'sin bites', scN: (n) => `${n} esc.`,
192
192
  map: 'Mapa', mapBack: '← Mapa', slice: 'Slice', incsDone: (a, b) => `${a}/${b} Incs hechos`, bitesTotal: (n) => `${n} bites`,
193
193
  summary: (f, u, a, b, n) => `${f} features · ${u} user tasks · ${a}/${b} Incs · ${n} bites sin tomar`,
@@ -225,13 +225,13 @@ try {
225
225
  } catch (e) {}
226
226
  const save = () => { try { sessionStorage.setItem('mapui', JSON.stringify({ zoom: ui.zoom, lz: ui.lz, hidePruned: ui.hidePruned, hideEmpty: ui.hideEmpty, minimap: ui.minimap })); sessionStorage.setItem('mapcol', JSON.stringify([...ui.collapsed])); } catch (e) {} };
227
227
 
228
- // done | building | planned (sliced too) | proposed | back (untaken)
228
+ // done | building | planned (specified too) | proposed | back (untaken)
229
229
  const cardState = (b) => {
230
230
  const i = b.stateInc;
231
231
  if (!i) return 'back';
232
- return i.state === 'sliced' ? 'planned' : i.state;
232
+ return i.state === 'specified' ? 'planned' : i.state;
233
233
  };
234
- const incClass = (i) => (i.state === 'sliced' ? 'planned' : i.state);
234
+ const incClass = (i) => (i.state === 'specified' ? 'planned' : i.state);
235
235
  const pad2 = (n) => String(n).padStart(2, '0');
236
236
 
237
237
  /* ---------- map ---------- */
@@ -29,7 +29,11 @@ const OPTION_ID = /F\d+-\d+\.\d+/g;
29
29
  // Bite IDs: letters per Feature (F1-a, F1-ab), d<n> for deferred, w<n> for the skeleton bites of Inc 1.
30
30
  const BITE_ID = /\bF\d+-(?:[a-z]+|[dw]\d+)\b/g;
31
31
  const PRIORITIES = ['skeleton', 'must-have', 'nice-to-have', 'deferred'];
32
- const INC_STATES = ['sliced', 'planned', 'done'];
32
+ // An increment is proposed (a row of `### Proposed increments`, no file) until bokata-inc specifies it:
33
+ // then its inc-<n>.md says specified, bokata-plan sets planned, the executor sets done. (Older slices say
34
+ // `sliced` for what is now `specified`.)
35
+ const INC_STATES = ['specified', 'planned', 'done'];
36
+ const LEGACY_STATES = { sliced: 'specified' };
33
37
 
34
38
  const read = (file) => fs.readFileSync(file, 'utf8').replace(/\r\n/g, '\n');
35
39
  const esc = (s) =>
@@ -366,7 +370,7 @@ export function parseSlice(file) {
366
370
  if (/^```/.test(raw)) fenced = !fenced;
367
371
  if (!fenced && (m = raw.match(/^##\s+(.+?)\s*$/))) sec = sectionName(m[1]);
368
372
  if (i < 12 && (m = raw.match(/^-\s*State:\s*(\S+)/))) {
369
- incRec.stateRaw = m[1].toLowerCase();
373
+ incRec.stateRaw = LEGACY_STATES[m[1].toLowerCase()] || m[1].toLowerCase();
370
374
  incRec.stateLine = i + 1;
371
375
  }
372
376
  if (i < 12 && (m = raw.match(/^-\s*Unknowns:\s*(.*)$/))) incRec.unknowns = m[1].trim();
@@ -413,12 +417,12 @@ function stateOf(steps) {
413
417
  }
414
418
 
415
419
  // The state of an increment: `State: done` in its inc-<n>.md (or a done slice) wins; otherwise the checked
416
- // steps of its section in plan.md say planned / building / done; with no steps, its own State (default sliced).
420
+ // steps of its section in plan.md say planned / building / done; with no steps, its own State (default specified).
417
421
  function incState(slice, inc, steps) {
418
422
  if (slice.status === 'done' || inc.stateRaw === 'done') return { state: 'done', done: 0, total: 0 };
419
423
  const fromPlan = stateOf(steps);
420
424
  if (fromPlan) return fromPlan;
421
- return { state: inc.stateRaw === 'planned' ? 'planned' : 'sliced', done: 0, total: 0 };
425
+ return { state: inc.stateRaw === 'planned' ? 'planned' : 'specified', done: 0, total: 0 };
422
426
  }
423
427
 
424
428
  export function buildModel(dir) {
@@ -513,7 +517,8 @@ export function buildModel(dir) {
513
517
  inc.st = incState(slice, inc, steps);
514
518
  if (!inc.detailFile) issues.push({ file: slice.file, line: inc.line, text: `Inc ${inc.n} has no ${slice.base}/inc-${inc.n}.md` });
515
519
  else if (inc.stateRaw === null) issues.push({ file: inc.detailFile, line: 1, text: 'no "- State:" line in the first lines' });
516
- else if (!INC_STATES.includes(inc.stateRaw)) issues.push({ file: inc.detailFile, line: inc.stateLine, text: `unknown State "${inc.stateRaw}" (sliced | planned | done)` });
520
+ else if (inc.stateRaw === 'draft') issues.push({ file: inc.detailFile, line: inc.stateLine, text: `Inc ${inc.n} is listed in the index but its file is still a draft (the ACs were never approved): finish \`bokata-inc\` or take the Inc out of ## Increments` });
521
+ else if (!INC_STATES.includes(inc.stateRaw)) issues.push({ file: inc.detailFile, line: inc.stateLine, text: `unknown State "${inc.stateRaw}" (specified | planned | done)` });
517
522
  if (steps && steps.length && inc.stateRaw === 'done') issues.push({ file: planFile, line: 0, text: `Slice ${slice.nn} · Inc ${inc.n} is done but still has a section in plan.md — delete it` });
518
523
  if (steps && steps.length && steps.every((s) => s.done) && inc.stateRaw !== 'done') issues.push({ file: inc.detailFile || slice.file, line: inc.stateLine || inc.line, text: `every step of Inc ${inc.n} is checked: set "- State: done" and clean its section of plan.md` });
519
524
  }
@@ -526,6 +531,19 @@ export function buildModel(dir) {
526
531
  issues.push({ file: slice.file, line: bite.line, text: `bite ${bite.id} says → Inc ${bite.takenLine}, which is not in ## Increments` });
527
532
  }
528
533
  }
534
+ // The proposed increments are edited by hand: say what a hand edit may have broken.
535
+ const rowOf = new Map();
536
+ for (const p of slice.proposed) {
537
+ if (slice.incs.some((i) => i.n === p.n)) issues.push({ file: slice.file, line: p.line, text: `proposed Inc ${p.n} is already in ## Increments — drop its row (or renumber it)` });
538
+ if (slice.proposed.some((q) => q !== p && q.n === p.n && q.line < p.line)) issues.push({ file: slice.file, line: p.line, text: `Inc ${p.n} appears twice in ### Proposed increments` });
539
+ for (const id of p.bites) {
540
+ const b = byId.get(id);
541
+ if (!b) issues.push({ file: slice.file, line: p.line, text: `proposed Inc ${p.n}: bite ${id} has no line in ## Backlog` });
542
+ else if (taker.has(id)) issues.push({ file: slice.file, line: p.line, text: `proposed Inc ${p.n}: bite ${id} is already taken by Inc ${taker.get(id)}` });
543
+ if (rowOf.has(id) && rowOf.get(id) !== p.n) issues.push({ file: slice.file, line: p.line, text: `bite ${id} is in two proposed increments (Inc ${rowOf.get(id)} and Inc ${p.n})` });
544
+ rowOf.set(id, p.n);
545
+ }
546
+ }
529
547
  slice.proposed = slice.proposed.filter((p) => !slice.incs.some((i) => i.n === p.n));
530
548
  for (const p of slice.proposed) {
531
549
  for (const id of p.bites) {
@@ -656,6 +674,8 @@ function dataOf(model, lang, date) {
656
674
  return out;
657
675
  }
658
676
 
677
+ // The next thing to do, in the order the flow goes: an unchecked plan step; a specified Inc with no plan
678
+ // (bokata-plan); with nothing in flight, the first proposed increment (bokata-inc).
659
679
  function nextStep(model) {
660
680
  for (const slice of model.slices) {
661
681
  if (slice.status !== 'open') continue;
@@ -666,6 +686,16 @@ function nextStep(model) {
666
686
  if (open) return { text: `${open.text.replace(/`/g, '')} — ${slice.base}`, link: 'plan.md' };
667
687
  }
668
688
  }
689
+ for (const slice of model.slices) {
690
+ if (slice.status !== 'open') continue;
691
+ const specified = slice.incs.find((i) => i.st.state === 'specified');
692
+ if (specified) return { text: `bokata-plan — Inc ${specified.n} ${specified.name} (${slice.base})`, link: `${slice.base}/inc-${specified.n}.md` };
693
+ const inFlight = slice.incs.some((i) => i.st.state !== 'done');
694
+ if (!inFlight && slice.proposed.length) {
695
+ const p = slice.proposed[0];
696
+ return { text: `bokata-inc — Inc ${p.n} ${p.name} (${slice.base})`, link: `${slice.base}.md` };
697
+ }
698
+ }
669
699
  return null;
670
700
  }
671
701