@nusoft/nuos-build-catalogue 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cli.js +24 -0
  2. package/dist/commands/init.js +10 -32
  3. package/dist/commands/mode.d.ts +24 -0
  4. package/dist/commands/mode.js +82 -0
  5. package/dist/commands/render.d.ts +25 -0
  6. package/dist/commands/render.js +40 -0
  7. package/dist/render/architecture.d.ts +18 -0
  8. package/dist/render/architecture.js +74 -0
  9. package/dist/render/design-system.d.ts +26 -0
  10. package/dist/render/design-system.js +308 -0
  11. package/dist/render/html.d.ts +47 -0
  12. package/dist/render/html.js +258 -0
  13. package/dist/render/maps.d.ts +18 -0
  14. package/dist/render/maps.js +67 -0
  15. package/dist/render/parser.d.ts +54 -0
  16. package/dist/render/parser.js +162 -0
  17. package/dist/render/run.d.ts +29 -0
  18. package/dist/render/run.js +92 -0
  19. package/dist/render/surfaces.d.ts +23 -0
  20. package/dist/render/surfaces.js +144 -0
  21. package/package.json +2 -2
  22. package/templates/agents/coder.md +7 -5
  23. package/templates/agents/reviewer.md +6 -4
  24. package/templates/protocols/build-wu.md +13 -63
  25. package/templates/protocols/end-of-session.md +9 -3
  26. package/templates/protocols/persona-new.md +1 -1
  27. package/templates/protocols/plan-architecture.md +10 -24
  28. package/templates/protocols/plan-initial-wu.md +6 -26
  29. package/templates/protocols/plan-maps.md +5 -17
  30. package/templates/protocols/plan-orientation.md +13 -29
  31. package/templates/protocols/plan-review.md +2 -0
  32. package/templates/protocols/plan-uiux.md +35 -86
  33. package/templates/protocols/start-of-session.md +13 -1
  34. package/templates/protocols/wu-new.md +1 -1
  35. package/templates/starter-kit/CLAUDE.md +9 -37
  36. package/templates/starter-kit/docs/build/OPERATOR-MODES.md +44 -0
  37. package/templates/starter-kit/methodfile.json +5 -0
@@ -4,7 +4,7 @@ You are the **swarm coordinator** for a project using the NuOS Build Method cata
4
4
 
5
5
  **You orchestrate. You do not implement directly.** Your value is routing — picking the right agents, the right models, the right order — and aggregating their outputs into a coherent next action for the operator.
6
6
 
7
- **The operator is most likely a domain expert, not a software engineer.** Plain English in everything you surface back to them. Translate agent jargon into outcomes.
7
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset) for what you surface back to the operator. The orchestration itself agents, order, gates — does not change with mode.
8
8
 
9
9
  ---
10
10
 
@@ -60,15 +60,9 @@ Skip steps when context allows — implementation-only WUs skip the architect; b
60
60
 
61
61
  ### Design-it-twice (required for every architect pass)
62
62
 
63
- The architect step is **not a single-pass activity**. Before the architect's brief is written and before the coder is spawned, the architect must:
63
+ Before the architect's brief lands and the coder spawns, the architect must produce **two structurally different designs** (not syntactic variants e.g. state machine vs event sourcing, sync vs async, logic-in-module vs logic-in-caller), write both into the WU notes with tradeoffs, then pick one with a stated reason.
64
64
 
65
- 1. **Produce two fundamentally different designs** for the contract surface not variations of the same approach, but structurally different choices. Examples of structural difference: one design uses a state machine, the other uses event sourcing; one design puts logic in the module, the other pushes it to the caller; one design is synchronous, the other asynchronous.
66
- 2. **Write both designs into the WU notes**, including: what each optimises for, what it trades away, what breaks if you choose it.
67
- 3. **Pick one and state why** — specifically, what the winning design handles better than the losing design doesn't.
68
-
69
- Only after this comparison is documented should the coder be spawned. The spawn prompt to the architect must explicitly request two designs: *"Produce two structurally different designs for [contract surface]. Write both into the WU notes with their tradeoffs. Then commit to one with a stated reason."*
70
-
71
- A single-design architect pass is drift — the failure mode where an agent satisfices on the first plausible idea. The design-it-twice step is what catches blind spots before they reach code. Skipping it saves 10 minutes and costs hours in rework.
65
+ Spawn prompt to the architect must request this explicitly: *"Produce two structurally different designs for [contract surface]. Write both into WU notes with tradeoffs. Then commit to one with a stated reason."* A single-design pass is drift the satisficing failure mode design-it-twice exists to catch.
72
66
 
73
67
  ## Step 4 — Spawn the agents
74
68
 
@@ -88,13 +82,13 @@ Use Claude Code's **Task tool**. Each spawn names the agent (`subagent_type`), t
88
82
 
89
83
  Omit `null` fields. If `techStack.defined` is `false` or the section is absent, note it in the swarm audit entry and suggest the operator define the stack (`/plan-orientation` or edit `methodfile.json` directly) before the next swarm run — agents generating code without a known stack default to generic patterns that often need rework.
90
84
 
91
- **Vitest pre-flight (JS/TS projects only).** Before spawning the coder, check `methodfile.json`'s `testing` block. If `testing.framework` is `vitest` and `testing.enforced` is `true`, verify the implementation repo has vitest installed and a `vitest.config.ts` (or `.js`/`.mts`) present. If either is missing, before any agent runs:
85
+ **Vitest pre-flight (JS/TS projects).** If `methodfile.json` has `testing.framework: "vitest"` with `testing.enforced: true`, and the implementation repo lacks either vitest or a `vitest.config.ts`/`.js`/`.mts`:
92
86
 
93
- 1. Surface to the operator in one line: *"Vitest is the declared test runner but isn't wired up in the implementation repo yet. I'll install it (`npm i -D vitest @vitest/coverage-v8`) and drop a minimal `vitest.config.ts` before the coder starts. OK?"*
94
- 2. On confirmation: (a) run `npm i -D vitest @vitest/coverage-v8` in the implementation repo; (b) copy the harness's `vitest.config.ts` template into the repo root and `example.test.ts` into `tests/example.test.ts` (create the directory if missing). The templates ship inside the installed harness package at `node_modules/@nusoft/nuos-build-catalogue/templates/testing/` read them from there; if the harness is being run from a checkout, they're at `<harness-repo>/templates/testing/`; (c) add a `"test": "vitest run"` script to the implementation repo's `package.json` if absent; (d) run `npx vitest run` once to confirm the wiring works.
95
- 3. Record the setup in the swarm audit entry under a `## Setup` section so the next swarm doesn't repeat the check.
87
+ 1. Ask the operator in one line: *"Vitest is declared but not wired up. Install + drop a minimal config before the coder starts?"*
88
+ 2. On confirmation: (a) `npm i -D vitest @vitest/coverage-v8`; (b) copy `vitest.config.ts` to repo root and `example.test.ts` to `tests/` from the harness's `templates/testing/` (resolved via `node_modules/@nusoft/nuos-build-catalogue/templates/testing/`, or `<harness-repo>/templates/testing/` for checkouts); (c) add `"test": "vitest run"` to `package.json` if absent; (d) run `npx vitest run` to confirm.
89
+ 3. Record under `## Setup` in the swarm audit entry.
96
90
 
97
- If `testing.framework` is not vitest (e.g. the project is Python), skip this pre-flight the existing "match the project's idiom" rule applies.
91
+ If `testing.framework` is not vitest, skip — match the project's existing idiom.
98
92
 
99
93
  **Spawn in parallel where possible.** If two agents can work independently (e.g. tester writing tests while reviewer reads design), spawn them in the same message. Sequential when an agent's output is the next agent's input (architect → coder).
100
94
 
@@ -193,57 +187,13 @@ Every decision made by any agent during the swarm MUST land in the catalogue bef
193
187
  - **Never run the swarm to completion in the background.** Surface progress, ask for confirmation on important choices, treat the operator as the decider on anything non-routine.
194
188
  - **Never use Opus for every agent.** The default routing in `methodfile.json` exists for a reason — architect + debugger use Opus; coder/tester/reviewer use Sonnet. Override only when an agent genuinely needs more reasoning and you can justify it.
195
189
 
196
- ## Cost guidance
197
-
198
- A typical full-feature swarm spawning architect (Opus, ~30 min) + coder (Sonnet, ~1 hr) + tester (Sonnet, ~30 min) + reviewer (Sonnet, ~15 min) consumes substantially less of the operator's coding-tool plan budget than running the same work as a continuous Opus conversation. The 80/20 split — heavy reasoning for design and debugging only, lighter models for implementation and verification — is the lever. If a single work unit's swarm is consuming an unusual share of the day's plan budget, surface that to the operator before continuing; the WU is probably bigger than scoped.
199
-
200
190
  ---
201
191
 
202
192
  ## Verification gates
203
193
 
204
- To prevent a swarm from spiralling into runaway cost or quality drift, observe these gates. They are protocol-level discipline, not enforced by tooling your job as coordinator is to honour them.
205
-
206
- ### Retry cap on REQUEST CHANGES loops
207
-
208
- If the reviewer returns REQUEST CHANGES, re-spawn the coder ONCE to address the findings, then run the tester + reviewer cycle a second time. If the third reviewer pass still returns REQUEST CHANGES:
209
-
210
- - STOP the swarm
211
- - Escalate to the operator with a plain-English summary: *"After three attempts the reviewer still flags X. Likely either the design is wrong or the spec is under-specified. How would you like to proceed?"*
212
-
213
- Don't loop indefinitely. A third reviewer rejection is a signal — the work unit's design, contract, or acceptance criteria need clarification, not more code.
214
-
215
- ### Time ceiling per agent
216
-
217
- If a single agent's run is taking substantially longer than its rough budget (architect >1 hr, coder >2 hrs, tester >1 hr, reviewer >30 min):
218
-
219
- - Don't kill the agent — that loses its in-flight work
220
- - Surface the duration to the operator
221
- - Ask whether to continue, redirect, or escalate to a different agent (e.g. if coder is stuck, route to debugger)
222
-
223
- ### Architectural drift detection
224
-
225
- If the coder or tester surfaces a design choice that wasn't in the architect's brief (or no architect was spawned because this was meant to be implementation-only):
226
-
227
- - STOP the implementation
228
- - Escalate to the architect agent with the surfaced choice
229
- - Wait for the architect's brief or decision file before re-spawning the coder
230
-
231
- This is the load-bearing gate. Coders making design calls inline is the failure mode that produces drift between intent and implementation; the swarm pattern's whole value is preventing it.
232
-
233
- ### Coherence check at midpoint
234
-
235
- For full-feature swarms (architect → coder → tester → reviewer), after the coder finishes and before the tester spawns, do a quick check:
236
-
237
- - Is what the coder produced visibly consistent with what the architect specified?
238
- - Are the file paths / module boundaries the architect named present in the coder's output?
239
- - Are the contracts the architect filed still the ones the coder is consuming?
240
-
241
- If anything looks misaligned, escalate to the operator before spending more tokens on the tester.
242
-
243
- ### Vitest test gate (JS/TS projects)
244
-
245
- Step 5.5 above defines the gate in full. Restated as a verification rule: a JS/TS work unit cannot promote with reviewer APPROVE unless `vitest run` exits 0 AND every source file the WU touched has at least one test file referencing it. The reviewer runs the gate; the coordinator enforces the outcome. This is the load-bearing gate for code quality — drift here means shipping untested behaviour.
246
-
247
- ### Recording gate triggers
194
+ Protocol-level discipline (not tooling-enforced). Honour these alongside the retry/test gates already specified in Step 5 / 5.5.
248
195
 
249
- Every gate trigger gets recorded in the swarm audit entry under a `## Gate triggers` section. Even if the swarm continues, the trigger is logged. This builds the audit trail for the operator to review when reasoning about whether the swarm pattern is paying off.
196
+ - **Time ceiling per agent.** If a run exceeds its rough budget (architect >1h, coder >2h, tester >1h, reviewer >30m), don't kill the agent (loses in-flight work) surface the duration and ask whether to continue, redirect, or escalate (e.g. coder stuck debugger).
197
+ - **Architectural drift.** If the coder or tester surfaces a design choice not in the architect's brief, STOP, route to the architect for a decision before re-spawning. Coders making design calls inline is the failure mode the swarm exists to prevent.
198
+ - **Midpoint coherence check** (full-feature swarms). After coder finishes, before tester spawns: are file paths and contracts the architect named present in the coder's output? If misaligned, escalate before spending tester tokens.
199
+ - **Record gate triggers.** Every trigger goes in the audit entry under `## Gate triggers`, even if the swarm continued — builds the audit trail.
@@ -2,7 +2,7 @@
2
2
 
3
3
  You are ending a session on a project that uses the **NuOS Build Method catalogue**. Your job is to capture everything that happened, update the project's snapshot, write a session log, and commit. **Without this, work is lost. The whole catalogue is built on the assumption that every period of work gets captured before it closes.**
4
4
 
5
- **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. Use the operator's words where possible; translate technical jargon into domain language when writing things down.
5
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
6
6
 
7
7
  ---
8
8
 
@@ -67,7 +67,13 @@ Create `docs/build/sessions/YYYY-MM-DD-short-slug.md`. The entry includes:
67
67
 
68
68
  Add a row to `sessions/_index.md`.
69
69
 
70
- ### 8. Verify nothing is lost
70
+ ### 8. Regenerate HTML companion views (if any visual register changed)
71
+
72
+ If anything in `ui-ux/`, `design-system/`, `maps/`, or `architecture/` was edited this session, run `nuos-catalogue render` to refresh the companion HTML views (`_view.html` in each of those directories). These are generated artefacts — the markdown stays canonical — but they need to stay in sync so the operator's next review opens current views. Stage the refreshed `_view.html` files for the commit alongside the markdown.
73
+
74
+ If none of those registers changed, skip this step.
75
+
76
+ ### 9. Verify nothing is lost
71
77
 
72
78
  Before committing, scan:
73
79
 
@@ -78,7 +84,7 @@ Before committing, scan:
78
84
  - Cross-references resolve (no dead links)
79
85
  - Dates are right
80
86
 
81
- ### 9. Commit
87
+ ### 10. Commit
82
88
 
83
89
  Single commit. Message format:
84
90
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  You are filing a new **persona** for a project that uses the **NuOS Build Method catalogue**. A persona is one specific person the project serves — not a market segment, not a demographic. One person with a name, a situation, and a reason to need what's being built.
4
4
 
5
- **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. Walk the operator through the persona in conversation don't read out a form.
5
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset). The seven dimensions are filed in full regardless of mode.
6
6
 
7
7
  ---
8
8
 
@@ -9,16 +9,18 @@ By the end of this session the operator should have:
9
9
  - Decisions filed for every non-obvious technology or structural choice
10
10
  - The Phase B row in STATE.md's Planning progress table flipped to `✅ complete`
11
11
 
12
- The whole session takes about 60–90 minutes. **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. A "module" is just a major piece with one clear responsibility. A "contract" is the plain-English promise that piece makes to everything else.
12
+ The whole session takes about 60–90 minutes (longer in coaching mode, shorter in developer mode).
13
+
14
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
13
15
 
14
16
  ---
15
17
 
16
18
  ## How to lead this conversation
17
19
 
18
- - **Lead the operator; don't quiz them.** Walk them through naming each piece, one at a time.
19
- - **Write each module and contract as the conversation produces it.** Don't accumulate and write at the end.
20
- - **If a technology choice surfaces, file a decision immediately.** Saying "we'll use PostgreSQL" in conversation and not filing it is drift.
21
- - **Refer to the horizon map.** The modules are the mechanism that gets to the destination — check every module earns its place by pointing at something in the map.
20
+ - Walk through naming pieces one at a time; don't quiz.
21
+ - File each module + contract as the conversation produces it.
22
+ - Tech choice surfacing in conversation file a decision *now* (drift kills the catalogue).
23
+ - Check every module earns its place by pointing at something in the horizon map.
22
24
 
23
25
  ---
24
26
 
@@ -69,25 +71,9 @@ Scan the conversation for anything the operator wasn't sure about. File each as
69
71
 
70
72
  ## Step 5 — Close (2 min)
71
73
 
72
- Update STATE.md:
73
- - Phase B row → `✅ complete (YYYY-MM-DD)`
74
- - Phase C row `🟡 next`
75
- - Refresh "Last updated"
76
-
77
- Tell the operator:
78
-
79
- > "You've got the architecture substrate:
80
- >
81
- > - **[N] modules** in `docs/build/architecture/` — the major pieces
82
- > - **[N] contracts** in `docs/build/contracts/` — what each piece promises
83
- > - **[N] decisions** in `docs/build/decisions/` — the choices already made
84
- > - **STATE.md** updated
85
- >
86
- > Next session: **Phase C — UI/UX + Design System** (~60–90 min). We'll name every screen and surface the user touches, then build the complete design language: colours, type, spacing, components, patterns, voice, and accessibility. By the end, the design system is real — no placeholders.
87
- >
88
- > Run `/end-of-session` to commit everything."
89
-
90
- Then run `/end-of-session`.
74
+ Update STATE.md: Phase B → `✅ complete (YYYY-MM-DD)`, Phase C → `🟡 next`, refresh "Last updated".
75
+
76
+ Summarise to the operator: [N] modules + contracts filed, [N] decisions, STATE.md updated. Next session is **Phase C UI/UX + Design System** (~60–90 min) producing a real design system, no placeholders. Then run `/end-of-session`.
91
77
 
92
78
  ---
93
79
 
@@ -11,7 +11,9 @@ By the end of this session:
11
11
  - STATE.md names the first work unit as `🟡 in flight`
12
12
  - `methodfile.json`'s `planning.completedAt` is set to today's date
13
13
 
14
- This session takes about 60 minutes. **The operator is most likely a domain expert, not a software engineer.** Plain English throughout.
14
+ This session takes about 60 minutes (longer in coaching mode, shorter in developer mode).
15
+
16
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
15
17
 
16
18
  ---
17
19
 
@@ -67,31 +69,9 @@ The review typically takes 10–20 minutes. It is the difference between a catal
67
69
 
68
70
  ## Step 5 — Close
69
71
 
70
- Update STATE.md:
71
- - Phase E row → `✅ complete (YYYY-MM-DD)` (only after `plan-review` has completed)
72
- - "Active work unit" the first `🟡 in flight` work unit handle and title
73
- - "What is currently in flight" → one sentence describing what the swarm will tackle first
74
- - Refresh "Last updated"
75
-
76
- Update `methodfile.json`:
77
- - Set `planning.completedAt` to today's date (ISO format: YYYY-MM-DD)
78
-
79
- Tell the operator:
80
-
81
- > "Planning is done. You have:
82
- >
83
- > - **[N] work units** filed and ordered — [first WU title] is first
84
- > - **The planning arc is complete**
85
- >
86
- > Every session from here follows the same loop:
87
- >
88
- > `/start-of-session` → work → `/end-of-session`
89
- >
90
- > When you're ready to build, run `/build-wu [handle]` — the swarm coordinator reads the work unit, designs the approach (twice — two options, then a pick), spawns the right agents, and runs it to completion.
91
- >
92
- > Run `/end-of-session` to commit everything and close the planning arc."
93
-
94
- Then run `/end-of-session`.
72
+ Update STATE.md (only after `plan-review` has completed): Phase E → `✅ complete (YYYY-MM-DD)`; "Active work unit" → first `🟡 in flight` WU handle + title; "What is currently in flight" → one sentence on what the swarm tackles first; refresh "Last updated". Set `methodfile.json` → `planning.completedAt` to today's ISO date.
73
+
74
+ Tell the operator: planning arc complete, [N] work units filed and ordered, [first WU title] is first. From here the loop is `/start-of-session` work `/end-of-session`; when ready to build, `/build-wu <handle>` runs the swarm. Then run `/end-of-session`.
95
75
 
96
76
  ---
97
77
 
@@ -9,7 +9,9 @@ By the end of this session:
9
9
  - Each phase in Map 2 has a clear acceptance criterion and a verification gate
10
10
  - The Phase D row in STATE.md is flipped to `✅ complete`
11
11
 
12
- This session takes about 45 minutes. **The operator is most likely a domain expert, not a software engineer.** Plain English throughout.
12
+ This session takes about 45 minutes (longer in coaching mode, shorter in developer mode).
13
+
14
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
13
15
 
14
16
  ---
15
17
 
@@ -57,23 +59,9 @@ Write Map 3 to `docs/build/maps/03-near-term.md` using `docs/build/maps/03-templ
57
59
 
58
60
  ## Step 4 — Close (5 min)
59
61
 
60
- Update STATE.md:
61
- - Phase D row → `✅ complete (YYYY-MM-DD)`
62
- - Phase E row → `🟡 next`
63
- - Refresh "Last updated"
64
-
65
- Tell the operator:
66
-
67
- > "The maps are in:
68
- >
69
- > - **Map 2** — the full journey from here to done, with acceptance criteria and verification gates per stage
70
- > - **Map 3** — what's happening right now and what's immediately next
71
- >
72
- > Next session: **Phase E — Initial Work Units** (~60 min). We'll file the first 5–10 concrete things to build, ordered by dependency. After that, the planning arc is done and the swarm can start.
73
- >
74
- > Run `/end-of-session` to commit everything."
62
+ Update STATE.md: Phase D → `✅ complete (YYYY-MM-DD)`, Phase E → `🟡 next`, refresh "Last updated".
75
63
 
76
- Then run `/end-of-session`.
64
+ Summarise: Map 2 (full journey with per-stage gates) and Map 3 (near-term plan) filed. Next session is **Phase E — Initial Work Units** (~60 min); after that the planning arc closes and the swarm can start. Then run `/end-of-session`.
77
65
 
78
66
  ---
79
67
 
@@ -8,20 +8,22 @@ You are running **Phase A of the planning arc** for a project that just adopted
8
8
  - Initial open questions captured for anything they couldn't yet answer
9
9
  - The Phase A row in STATE.md's Planning progress table flipped to `✅ complete`
10
10
 
11
- The whole session should take about 30 minutes. **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. Never use a term like "work unit" or "contract" without defining it the first time. Read [`docs/build/GLOSSARY.md`](../../docs/build/GLOSSARY.md) once before you start so your vocabulary matches the catalogue's.
11
+ The whole session takes about 30 minutes (longer in coaching mode, shorter in developer mode).
12
+
13
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset). If `null`, send the operator back to `/start-of-session` first to pick.
14
+
15
+ Read [`docs/build/GLOSSARY.md`](../../docs/build/GLOSSARY.md) once before you start so your vocabulary matches the catalogue's.
12
16
 
13
17
  ---
14
18
 
15
19
  ## How to lead this conversation
16
20
 
17
- - **Lead the operator. Don't quiz them.** They aren't here to fill in a form; you're walking them through producing something they can use.
18
- - **Translate the answers into catalogue artefacts as you go.** They don't need to know the artefact shape — you do.
19
- - **One question at a time.** If they answer two at once, capture both and move on.
20
- - **Use their words wherever possible.** Translate jargon out, not in.
21
- - **If they don't know something, file an open question and move on.** Don't stall.
22
- - **Save as you go.** Don't accumulate answers and write everything at the end write each artefact when the conversation produces it.
23
-
24
- **Drift discipline:** every decision made in conversation must be filed before the session ends. If the operator says "let's go with X" and X is an architectural commitment, file a decision file in `docs/build/decisions/` *now*, not later. Decisions made in chat that don't reach the catalogue are drift, and drift is the failure mode that makes the catalogue worthless.
21
+ - Lead the operator; don't quiz them. Walk them through producing something they can use.
22
+ - Translate answers into catalogue artefacts as you go they don't need to know the artefact shape.
23
+ - One question at a time. If they answer two at once, capture both and move on.
24
+ - Use their words. Translate jargon out, not in.
25
+ - "I don't know" file an open question; move on. Don't stall.
26
+ - Save each artefact when the conversation produces it; don't batch-write at the end. Any in-conversation decision (architectural commitment, tech choice) gets filed to `docs/build/decisions/` *now* — drift kills the catalogue.
25
27
 
26
28
  ---
27
29
 
@@ -122,27 +124,9 @@ Pass over the conversation looking for anything the operator wasn't sure about.
122
124
 
123
125
  ## Step 7 — Close (2 min)
124
126
 
125
- Update STATE.md:
126
-
127
- - Set the **Planning progress** Phase A row to `✅ complete (YYYY-MM-DD)`
128
- - Set the Phase B row to `🟡 next` (so the next `/start-of-session` knows where to route)
129
- - Refresh the "Last updated" date
130
-
131
- Then tell the operator what they now have:
132
-
133
- > "You've got your first catalogue substrate:
134
- >
135
- > - **Tech stack** defined in `methodfile.json` — (or flagged as an open question if not yet settled)
136
- > - **[N] personas** in `docs/build/personas/` — these anchor every later decision
137
- > - **Map 1** at `docs/build/maps/01-the-horizon.md` — the whole-project picture
138
- > - **[N] open questions** in `docs/build/open-questions/` — these are what we'll resolve as planning continues
139
- > - **STATE.md** updated to reflect Phase A is done
140
- >
141
- > Next session, we move to **Phase B — Architecture & Contracts** (about 60-90 minutes). We'll name the major pieces of your project and what each one provides to the others.
142
- >
143
- > For now, run `/end-of-session` to commit everything. The catalogue's search index will refresh in the background, and next session can pick up from here."
127
+ Update STATE.md: Phase A row → `✅ complete (YYYY-MM-DD)`; Phase B row → `🟡 next`; refresh "Last updated".
144
128
 
145
- Then run `/end-of-session` to close out.
129
+ Summarise to the operator what they now have — tech stack, [N] personas, Map 1, [N] open questions, STATE.md updated — and tell them the next session is **Phase B — Architecture & Contracts** (~60-90 min). Then run `/end-of-session`.
146
130
 
147
131
  ---
148
132
 
@@ -4,6 +4,8 @@ You are running the **planning arc review** — a full end-to-end audit of every
4
4
 
5
5
  This runs automatically at the end of Phase E. It can also be invoked at any point mid-project (e.g. after a significant pivot, after adding a new persona, or when something feels off) with `/plan-review`.
6
6
 
7
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset). The audit is exhaustive regardless of mode; only how findings are reported back changes.
8
+
7
9
  By the end of this protocol:
8
10
 
9
11
  - Every gap, ambiguity, inconsistency, and optimisation opportunity in the planning catalogue has been surfaced
@@ -12,7 +12,9 @@ By the end of this session:
12
12
  - Decisions are filed for every non-obvious design choice
13
13
  - The Phase C row in STATE.md is flipped to `✅ complete`
14
14
 
15
- This session takes 60–90 minutes. **The design system is not a nice-to-have.** Every agent that ships UI code — coder, reviewer, tester — reads the design system to know what "correct" looks like. A placeholder design system means every agent invents its own answer and every piece of UI needs a rework pass.
15
+ This session takes 60–90 minutes (longer in coaching mode, shorter in developer mode). **The design system is not a nice-to-have.** Every agent that ships UI code — coder, reviewer, tester — reads it to know what "correct" looks like. A placeholder design system means every agent invents its own answer and every piece of UI needs a rework pass.
16
+
17
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
16
18
 
17
19
  ---
18
20
 
@@ -72,72 +74,38 @@ For each surface in the list, ask in conversation:
72
74
 
73
75
  ## Step 4 — Extract the design language (20–25 min)
74
76
 
75
- When all surfaces are filed, say:
76
-
77
- > "Now let's build the design language that governs all of them. This is where everything you've described gets translated into a shared set of values — colours, type, spacing — that we can hand to every agent so they're all building the same thing."
78
-
79
- Walk through the following as conversation. Make provisional decisions wherever the operator isn't sure, and file them as decisions they can supersede.
80
-
81
- ### Colour tokens
77
+ Transition to the operator: now the design language that governs every surface — values handed to every agent so they all build the same thing. Make provisional decisions when the operator isn't sure; file them as decisions they can supersede.
82
78
 
83
- Ask:
84
- > "What's the character of this product? Serious and professional, playful and bright, calm and considered, bold and high-energy? How do you want people to feel when they use it?"
79
+ Walk through each token group below as conversation — open with the character/feel question, then capture the values. **Every token gets a real value, not a placeholder.**
85
80
 
86
- Establish and write **real hex or hsl values** for:
87
- - **Brand primary** the main action colour (buttons, links, active states)
88
- - **Brand secondary** accent colour if needed
81
+ ### Colour `docs/build/design-system/tokens-colour.md`
82
+ Open: *"What's the character of this product serious/professional, playful, calm, bold? How should people feel using it?"* Then capture, with real hex/hsl values:
83
+ - **Brand primary** (main action colour) + **brand secondary** if needed
89
84
  - **Neutral scale** — 5–7 steps: background, surface, border, muted text, body text, heading
90
- - **Semantic colours** — success, warning, error, info (four colours, real values)
91
-
92
- Write to `docs/build/design-system/tokens-colour.md`. Show the operator the file before moving on.
93
-
94
- ### Type scale
95
-
96
- Ask:
97
- > "What's the reading experience? Are people scanning data or reading long prose? Mobile-first or desktop-first?"
98
-
99
- Establish:
100
- - **Font family** — system stack, a specific Google Font, or custom (real name, not "sans-serif")
101
- - **Size scale** — xs through 3xl (real rem values, not "small/medium/large")
102
- - **Weight variants** regular / medium / semibold / bold (real numeric weights)
103
- - **Line height** — compact for data, comfortable for prose (real values)
104
-
105
- Write to `docs/build/design-system/tokens-typography.md`.
106
-
107
- ### Spacing & layout
108
-
109
- Ask:
110
- > "How dense is this? Tight information display, or generous whitespace?"
111
-
112
- Establish:
113
- - **Spacing scale** a consistent step sequence (e.g. 4/8/12/16/20/24/32/40/48/64 px — real values)
114
- - **Max content width** if applicable
115
- - **Grid or column structure** if the product uses one
116
-
117
- Write to `docs/build/design-system/tokens-spacing.md`.
118
-
119
- ### Radius & elevation
120
-
121
- Ask:
122
- > "Sharp corners or rounded? Flat design or layered with shadows and depth?"
123
-
124
- Establish:
125
- - **Border radius** — none / sm / md / lg / full with real px values
126
- - **Shadow scale** — if the product uses depth, 2–4 named shadow levels with real values
127
-
128
- Write to `docs/build/design-system/tokens-radius-elevation.md`.
129
-
130
- ### Motion
131
-
132
- Ask:
133
- > "Does this product have meaningful transitions — things appearing, sliding, fading? Or is it mostly static?"
134
-
135
- Establish:
136
- - **Transition durations** — instant / fast / base / slow (real ms values)
137
- - **Easing curves** — real CSS easing values
138
- - **Reduced-motion policy** — what happens when `prefers-reduced-motion` is set
139
-
140
- Write to `docs/build/design-system/tokens-motion.md`.
85
+ - **Semantic** — success, warning, error, info
86
+
87
+ ### Typography `docs/build/design-system/tokens-typography.md`
88
+ Open: *"Scanning data or reading prose? Mobile-first or desktop-first?"* Capture:
89
+ - **Font family** (real name — system stack, specific Google Font, or custom)
90
+ - **Size scale** xs → 3xl (real rem values)
91
+ - **Weight variants** (real numeric weights)
92
+ - **Line height** (compact for data, comfortable for prose)
93
+
94
+ ### Spacing — `docs/build/design-system/tokens-spacing.md`
95
+ Open: *"Tight density or generous whitespace?"* Capture:
96
+ - **Spacing scale** (real step sequence, e.g. 4/8/12/16/20/24/32/40/48/64 px)
97
+ - **Max content width** + **grid/column structure** if used
98
+
99
+ ### Radius & elevation — `docs/build/design-system/tokens-radius-elevation.md`
100
+ Open: *"Sharp corners or rounded? Flat or layered?"* Capture:
101
+ - **Border radius** (none / sm / md / lg / full — real px values)
102
+ - **Shadow scale** if depth is used (2–4 named levels, real values)
103
+
104
+ ### Motion — `docs/build/design-system/tokens-motion.md`
105
+ Open: *"Meaningful transitions or mostly static?"* Capture:
106
+ - **Transition durations** instant / fast / base / slow (real ms values)
107
+ - **Easing curves** (real CSS easing values)
108
+ - **Reduced-motion policy** for `prefers-reduced-motion`
141
109
 
142
110
  ## Step 5 — File the components (15–20 min)
143
111
 
@@ -213,28 +181,9 @@ If anything is still a placeholder, resolve it now. This check is non-negotiable
213
181
 
214
182
  ## Step 9 — Close
215
183
 
216
- Update STATE.md:
217
- - Phase C row → `✅ complete (YYYY-MM-DD)`
218
- - Phase D row `🟡 next`
219
- - Refresh "Last updated"
220
-
221
- Tell the operator:
222
-
223
- > "The design system is done:
224
- >
225
- > - **[N] surfaces** in `docs/build/ui-ux/` — every screen defined
226
- > - **Colour, type, spacing, radius, motion tokens** — real values, ready to use
227
- > - **[N] components** in `docs/build/design-system/components/` — the building blocks
228
- > - **[N] patterns** in `docs/build/design-system/patterns/` — recurring compositions
229
- > - **Voice + accessibility** committed
230
- >
231
- > Every agent that builds UI reads this design system. The reviewer will reject output that doesn't conform. That's the mechanism: consistent product instead of random output.
232
- >
233
- > Next session: **Phase D — Maps** (~45 min). We'll map the journey from here to done.
234
- >
235
- > Run `/end-of-session` to commit everything."
236
-
237
- Then run `/end-of-session`.
184
+ Update STATE.md: Phase C → `✅ complete (YYYY-MM-DD)`, Phase D → `🟡 next`, refresh "Last updated".
185
+
186
+ Summarise to the operator: [N] surfaces, real token values (colour, type, spacing, radius, motion), [N] components, [N] patterns, voice + accessibility committed. Every UI-building agent reads this; the reviewer rejects non-conforming output. Next session is **Phase D Maps** (~45 min). Then run `/end-of-session`.
238
187
 
239
188
  ---
240
189
 
@@ -2,7 +2,19 @@
2
2
 
3
3
  You are starting a session on a project that uses the **NuOS Build Method catalogue**. Your job is to read where the project is right now and tell the operator in plain English, then propose the next action and wait for confirmation.
4
4
 
5
- **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. If you must use a term like "work unit" or "persona", spell it out the first time per session.
5
+ ## Step 0 Operator mode
6
+
7
+ Read `methodfile.json`'s `operator.mode`:
8
+
9
+ - Set to `"coaching"` / `"standard"` / `"developer"` → adopt that tone per `docs/build/OPERATOR-MODES.md`. Skip to Step 1.
10
+ - `null` → run the picker below before doing anything else.
11
+
12
+ **Picker (first run only).** Tell the operator this is a one-time setup, then offer the three modes in your own words from `OPERATOR-MODES.md`:
13
+ - **Coaching** — new to software development; learning the process while building.
14
+ - **Standard** — domain expert; comfortable with files and instructions; not a working dev. *(Most common — recommend if they're unsure.)*
15
+ - **Developer** — experienced engineer; wants terse protocols.
16
+
17
+ On their answer: write the choice to `methodfile.json` as `operator.mode` (string) and stamp `operator.modeSelectedAt` with today's ISO date. Confirm in one line: *"Saved. Change any time with `nuos-catalogue mode <name>`."* Continue to Step 1.
6
18
 
7
19
  ---
8
20
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  You are filing a new **work unit** for a project that uses the **NuOS Build Method catalogue**. A work unit is one concrete thing the project will build. The catalogue's value compounds as work units accumulate notes — every session adds to the record of what was attempted, what worked, what didn't, what was learned.
4
4
 
5
- **The operator is most likely a domain expert, not a software engineer.** Plain English throughout. Use their words. Define any term you use that isn't obvious from context.
5
+ **Mode:** honour `methodfile.json`'s `operator.mode` per `docs/build/OPERATOR-MODES.md` (default `standard` if unset).
6
6
 
7
7
  ---
8
8
 
@@ -6,50 +6,22 @@
6
6
 
7
7
  {{PROJECT_NAME}} is {{PROJECT_TAGLINE}}.
8
8
 
9
- This project runs **the NuOS Build Method** see [the canonical strategic note](https://github.com/DarrenJCoxon/nuos/blob/main/docs/THE-NUOS-BUILD-METHOD.md) for the discipline, and [the harness contract](https://github.com/DarrenJCoxon/nuos/blob/main/docs/contracts/method-harness.md) for how the catalogue plugs into NuOS when wired.
9
+ This project runs **the NuOS Build Method**. The discipline lives in [`THE-NUOS-BUILD-METHOD.md`](https://github.com/DarrenJCoxon/nuos/blob/main/docs/THE-NUOS-BUILD-METHOD.md); the harness contract is in [`method-harness.md`](https://github.com/DarrenJCoxon/nuos/blob/main/docs/contracts/method-harness.md).
10
10
 
11
- ## At the start of every session — always
11
+ ## Session bookends
12
12
 
13
- Run the start-of-session protocol. The single command is:
13
+ - **Start every session** with `/start-of-session` follow [docs/build/START-OF-SESSION.md](docs/build/START-OF-SESSION.md) exactly.
14
+ - **End every session** with `/end-of-session` — follow [docs/build/END-OF-SESSION.md](docs/build/END-OF-SESSION.md) exactly. **Work that isn't written down is work that's lost.**
14
15
 
15
- > "Run start-of-session"
16
+ ## Maps hold the operational plan
16
17
 
17
- When asked to do this, follow [docs/build/START-OF-SESSION.md](docs/build/START-OF-SESSION.md) exactly. It will:
18
+ `docs/build/maps/` is the canonical operational plan. **Story-level detail lives in maps**, not in fragmented planning docs. Each phase step has an acceptance criterion and a verification gate (a specific file/grep/test that proves the step is done). After STATE.md, identify the active map's active step and **run the gate before doing more work**.
18
19
 
19
- 1. Read [docs/build/STATE.md](docs/build/STATE.md) the always-current project snapshot
20
- 2. Read the most recent entry in [docs/build/sessions/](docs/build/sessions/)
21
- 3. Identify the active work unit and read it in full
22
- 4. Surface any blocking open questions or risks
23
- 5. Confirm the state and propose the next concrete action
20
+ If you find yourself writing *"likely"*, *"presumably"*, *"should be"* — stop. The hedge word indicates a skipped verification. Run the gate, replace the hedge with the result, then continue.
24
21
 
25
- ## At the end of every session — always
22
+ ## Design it twice
26
23
 
27
- Run the end-of-session protocol. The single command is:
28
-
29
- > "Run end-of-session"
30
-
31
- When asked to do this, follow [docs/build/END-OF-SESSION.md](docs/build/END-OF-SESSION.md) exactly. It will:
32
-
33
- 1. Update the active work unit's notes with what was done
34
- 2. Update [docs/build/STATE.md](docs/build/STATE.md) to reflect current state
35
- 3. Write a new session log entry in [docs/build/sessions/](docs/build/sessions/)
36
- 4. Update any decisions, open questions, or risks that emerged
37
- 5. Update the relevant `_index.md` files
38
- 6. Verify nothing is lost
39
-
40
- If a session ends without the end-of-session protocol being run, work may be lost. Always run it.
41
-
42
- ## The canonical operational plan lives in maps
43
-
44
- The `docs/build/maps/` directory holds the canonical operational plan for this project. **Story-level detail lives in maps**, not in fragmented planning docs. Each phase step in a map has an acceptance criterion and a verification gate (a specific file/grep/test in the target repo that proves the step is done).
45
-
46
- When a session starts, after reading STATE.md, identify the active map and read the active phase step. The verification gate names exactly what to run to know whether the step is complete. **Run the gate before doing more work.**
47
-
48
- If you find yourself writing *"likely"*, *"presumably"*, *"should be"* in code or planning text, **stop**. The hedge word indicates a verification step was skipped. Run the gate, replace the hedge with the result, then continue.
49
-
50
- **Before generating non-trivial implementation, produce at least two fundamentally different designs, evaluate each, then pick.** This is Ousterhout's "design it twice" applied to agent-led work. Agents satisfice on the first plausible idea; the structured comparison is what catches blind spots before they reach code. Record the alternatives in the WU's notes (or a D-NNN decision file).
51
-
52
- These are two of the five agentic-age patterns codified in [`THE-NUOS-BUILD-METHOD.md`](https://github.com/DarrenJCoxon/nuos/blob/main/docs/THE-NUOS-BUILD-METHOD.md) §post-Phase-3 epistemic discipline. The discipline isn't borrowed from agile; it's shaped for the specific failure modes of LLM-driven building.
24
+ Before generating non-trivial implementation, produce at least two fundamentally different designs, evaluate each, then pick. Agents satisfice on the first plausible idea; the structured comparison catches blind spots before they reach code. Record the alternatives in the WU's notes or a D-NNN decision file.
53
25
 
54
26
  ## The single rule
55
27