@nusoft/nuos-build-catalogue 0.11.0 → 0.14.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 (57) hide show
  1. package/dist/cli.js +52 -39
  2. package/dist/commands/init.js +119 -42
  3. package/dist/commands/plan.d.ts +12 -0
  4. package/dist/commands/plan.js +83 -0
  5. package/dist/commands/write.js +16 -5
  6. package/dist/embedder/ollama.d.ts +14 -8
  7. package/dist/embedder/ollama.js +15 -9
  8. package/dist/path-resolution.d.ts +68 -0
  9. package/dist/path-resolution.js +147 -0
  10. package/dist/runtime/ac-parse.js +10 -6
  11. package/dist/runtime/markdown-edit.d.ts +5 -0
  12. package/dist/runtime/markdown-edit.js +13 -6
  13. package/dist/runtime/mis-adapter.js +7 -2
  14. package/package.json +2 -2
  15. package/templates/hooks/install-hooks.sh +44 -0
  16. package/templates/hooks/post-commit +96 -0
  17. package/templates/hooks/pre-commit +162 -0
  18. package/templates/protocols/end-of-session.md +101 -13
  19. package/templates/protocols/persona-new.md +64 -30
  20. package/templates/protocols/plan-orientation.md +122 -0
  21. package/templates/protocols/start-of-session.md +52 -13
  22. package/templates/protocols/wu-new.md +75 -50
  23. package/templates/starter-kit/docs/build/GLOSSARY.md +115 -0
  24. package/templates/starter-kit/docs/build/STATE.md +30 -16
  25. package/templates/starter-kit/docs/build/WELCOME.md +79 -0
  26. package/templates/starter-kit/docs/build/architecture/_index.md +39 -0
  27. package/templates/starter-kit/docs/build/architecture/module-template.md +47 -0
  28. package/templates/starter-kit/docs/build/contracts/_index.md +39 -0
  29. package/templates/starter-kit/docs/build/contracts/contract-template.md +64 -0
  30. package/templates/starter-kit/docs/build/decisions/_index.md +21 -17
  31. package/templates/starter-kit/docs/build/design-system/_index.md +57 -0
  32. package/templates/starter-kit/docs/build/design-system/accessibility.md +77 -0
  33. package/templates/starter-kit/docs/build/design-system/components/_index.md +29 -0
  34. package/templates/starter-kit/docs/build/design-system/components/_template.md +60 -0
  35. package/templates/starter-kit/docs/build/design-system/patterns/_index.md +37 -0
  36. package/templates/starter-kit/docs/build/design-system/patterns/_template.md +57 -0
  37. package/templates/starter-kit/docs/build/design-system/tokens-colour.md +52 -0
  38. package/templates/starter-kit/docs/build/design-system/tokens-motion.md +42 -0
  39. package/templates/starter-kit/docs/build/design-system/tokens-radius-elevation.md +34 -0
  40. package/templates/starter-kit/docs/build/design-system/tokens-spacing.md +48 -0
  41. package/templates/starter-kit/docs/build/design-system/tokens-typography.md +46 -0
  42. package/templates/starter-kit/docs/build/design-system/voice.md +53 -0
  43. package/templates/starter-kit/docs/build/maps/01-template.md +15 -112
  44. package/templates/starter-kit/docs/build/maps/02-template.md +52 -0
  45. package/templates/starter-kit/docs/build/maps/03-template.md +46 -0
  46. package/templates/starter-kit/docs/build/maps/99-template-power-user-operational-plan.md +126 -0
  47. package/templates/starter-kit/docs/build/maps/_index.md +17 -52
  48. package/templates/starter-kit/docs/build/open-questions/_index.md +27 -13
  49. package/templates/starter-kit/docs/build/personas/_index.md +26 -60
  50. package/templates/starter-kit/docs/build/risks/_index.md +20 -13
  51. package/templates/starter-kit/docs/build/sessions/_index.md +18 -16
  52. package/templates/starter-kit/docs/build/ui-ux/_index.md +48 -0
  53. package/templates/starter-kit/docs/build/ui-ux/surface-template.md +72 -0
  54. package/templates/starter-kit/docs/build/work-units/001-template-simple.md +43 -0
  55. package/templates/starter-kit/docs/build/work-units/_index.md +18 -20
  56. package/templates/starter-kit/methodfile.json +19 -8
  57. /package/templates/starter-kit/docs/build/work-units/{001-template.md → 001-template-full.md} +0 -0
@@ -0,0 +1,115 @@
1
+ # Glossary
2
+
3
+ Every term this catalogue uses, defined once in plain English. If you see a term you don't recognise in any file, this is where to look.
4
+
5
+ ## Acceptance Criteria
6
+
7
+ How you'll know a piece of work is done. A short list — usually 3 to 6 lines — where each line is something you can check by looking. Each should be either yes or no, not "better" or "worse". Often abbreviated **AC**.
8
+
9
+ > Example: "When a teacher opens the morning briefing, they see their three highest-need students at the top of the screen."
10
+
11
+ ## Architecture
12
+
13
+ The big pieces of your project and how they fit together. Filed in `architecture/`. Different from contracts: architecture is about *what the pieces are*; contracts are about *what they exchange*.
14
+
15
+ ## Catalogue
16
+
17
+ This whole folder — `docs/build/` — and everything in it. It's your project's memory: who it's for, what's built, what's been decided, what's still unknown. The catalogue is updated at the start and end of every session so future-you (or anyone joining) can pick up without needing to be told.
18
+
19
+ ## Drift (and why we never let it happen)
20
+
21
+ Drift is when the project's reality diverges from what the catalogue says. Someone makes a decision in conversation and forgets to file it. Someone changes their mind about a persona but the persona file still says the old thing. Two weeks later a new contributor reads the catalogue, builds against what it says, and the work is wrong.
22
+
23
+ **The no-drift rule is the catalogue's load-bearing commitment.** Every decision made in conversation gets saved to the catalogue before the session ends. Every change to an existing artefact flows through the protocol that keeps the catalogue and its search index in sync. The pre-commit hook blocks modifications to accepted decisions (so you can't edit them silently — you have to file a superseding decision and link forward). The post-commit hook auto-refreshes the search index after every commit, so what the AI finds when you ask "what did we decide about X?" is always current.
24
+
25
+ If the AI is asked something and the answer would normally come from project memory but the memory hasn't captured something said in conversation, **the AI should pause the conversation and file the missing artefact first**, then resume. Drift isn't a small problem; it's the failure mode that makes the whole catalogue worthless.
26
+
27
+ ## Contract
28
+
29
+ What a piece of your project guarantees it will provide to other pieces, and what it expects from them in return. Filed one per major piece, in `contracts/`. Written in everyday language — "facts about the world the system now knows" — not database tables or API endpoints.
30
+
31
+ > Example: "Overnight Consolidation contract — produces a per-student plan for tomorrow, ranked by need. Consumes today's record of every interaction with that student."
32
+
33
+ ## Decision
34
+
35
+ A choice that's been made and shouldn't drift. Filed in `decisions/` as **D001**, **D002**, etc. Once a decision is accepted, it doesn't get edited — if circumstances change, file a new decision that supersedes the old one and link forward. Decisions are the project's load-bearing commitments.
36
+
37
+ > When to file one: when you're choosing between two reasonable approaches; when you're adopting a constraint future work must honour; when you're overriding something previously decided.
38
+
39
+ ## Design System
40
+
41
+ The shared visual and interaction language every part of the user-facing project uses. Filed in `design-system/`. Includes:
42
+
43
+ - **Tokens** — colour, typography, spacing, radius, shadow, motion — the smallest atomic units
44
+ - **Components** — the buttons, inputs, cards, modals, navigation elements; each with its variants, states, and accessibility commitments
45
+ - **Patterns** — how components combine into recurring layouts (forms, lists, page templates)
46
+ - **Voice & tone** — how the project speaks in writing (microcopy, error messages, empty states)
47
+ - **Accessibility commitments** — what the project promises (e.g. AA contrast minimum, keyboard-navigable, screen-reader-tested)
48
+
49
+ The design system is end-to-end: every per-surface file in `ui-ux/` references it; every implementation in code consumes it. Changes to design tokens propagate everywhere automatically, so the system stays consistent as it grows.
50
+
51
+ ## Handle
52
+
53
+ The short identifier for any catalogue item: **WU 001**, **D012**, **Q003**, **P002**, **R005**, **M003**. Letters identify the register (Work Unit, Decision, Open Question, Persona, Risk, Map). Numbers run sequentially as items are filed.
54
+
55
+ ## Map
56
+
57
+ A picture of where the project is going. Three of them by default:
58
+
59
+ - **Map 1 — The Horizon**: the whole journey in plain language, written once and updated only when the destination changes
60
+ - **Map 2 — Phases in Detail**: what each phase delivers, with entry and exit conditions
61
+ - **Map 3 — The Near-Term Plan**: what's happening this week or this month
62
+
63
+ Filed in `maps/`.
64
+
65
+ ## Open Question
66
+
67
+ Something the project hasn't decided yet but might need to. Filed in `open-questions/` as **Q001**, **Q002**, etc. When an open question gets resolved, it becomes a Decision (or it becomes obvious and gets closed). The open-questions register is where uncertainty lives until it's ready to settle.
68
+
69
+ ## Outcome
70
+
71
+ What's true after a piece of work ships that wasn't true before. Written as one sentence. The single-sentence test: *can you say what changed in the world?*
72
+
73
+ > Example: "Teachers can see tomorrow's high-priority students before they go home tonight."
74
+
75
+ ## Persona
76
+
77
+ One specific person the project serves. Not a market segment ("teachers"), not a demographic ("women aged 30-50") — one person with a name and a situation. Personas are first-class because everything downstream — work units, UI/UX surfaces, contracts — hangs off who specifically you're building for. Filed in `personas/` as **P001**, **P002**, etc.
78
+
79
+ The seven dimensions of a persona: identity, reality (where they are when they need this), psychology, trigger (what brought them here), history, success (what done looks like for them), constraints (what they cannot or will not do).
80
+
81
+ ## Risk
82
+
83
+ Something that could go wrong and would matter if it did. Filed in `risks/_index.md`. Severity scale:
84
+
85
+ - **High** — blocks work or threatens a decision
86
+ - **Medium** — would slow things materially
87
+ - **Low** — worth tracking; not blocking
88
+
89
+ ## Session
90
+
91
+ A period of focused work — could be an hour, could be an afternoon. Each session starts with `/start-of-session` (which shows you where the project is) and ends with `/end-of-session` (which writes down what just happened). Filed in `sessions/`, one entry per session.
92
+
93
+ ## Surface
94
+
95
+ A piece of the user-facing experience. A page, a screen, a modal, a command-line prompt, an email the user receives — anything they see or interact with. Each surface gets its own file in `ui-ux/`. Different from a screen mockup: a surface file says *who uses it, what they see, what they do, what happens next, which contracts it touches.*
96
+
97
+ ## Trigger
98
+
99
+ The real-world event that makes someone need an outcome. Not a UI interaction — the moment in the persona's day or week that creates the need.
100
+
101
+ > Example trigger for a teacher persona: "It's 4pm on a Tuesday. The teacher is finishing up. Tomorrow's class includes three students with high SEN needs and one new arrival." That's the trigger. "Clicking the planning button" is not.
102
+
103
+ ## UI/UX
104
+
105
+ Short for "user interface and user experience". The catalogue treats UI/UX as a first-class register at `ui-ux/`. One file per surface (see above). Captures the user-facing shape of the project: what people see, what they do, what happens.
106
+
107
+ ## Walkthrough
108
+
109
+ A story of what happens, told from the persona's perspective. Numbered steps describing what they do, what they see, what happens next. Walkthroughs include failure paths — what happens if information is missing, if they make a mistake, if the system fails, if they need to come back tomorrow. Walkthroughs are how outcomes get checked: if you can walk through the persona's day with this in place, you understand what you're building.
110
+
111
+ ## Work Unit
112
+
113
+ One concrete thing the project will build. Filed in `work-units/` as **WU 001**, **WU 002**, etc. Each has a title, an outcome, a walkthrough, and acceptance criteria. Often abbreviated **WU**. Work units are the unit of progress — when one is done, something has changed in the world.
114
+
115
+ > When to file one: when you're about to start work that you'll want to track. The catalogue's value compounds with accumulated work-unit notes — every session adds to the record of *what was attempted, what worked, what didn't, what was learned.*
@@ -1,14 +1,26 @@
1
- # {{PROJECT_NAME}} — Always-Current State
1
+ # {{PROJECT_NAME}} — where we are right now
2
2
 
3
- > The single snapshot read at the start of every session. If anything important is not here, it is not real. Update this file at the end of every session via the end-of-session protocol.
3
+ > This file is the snapshot read at the start of every session. If anything important about the project's current state is not here, it is not real. The end-of-session protocol updates this file every time work stops.
4
4
 
5
5
  **Last updated:** {{TODAY}}
6
- **Active phase:** Phase 0 — bootstrap
7
- **Active work unit:** WU 001 — [first work unit name]
6
+
7
+ ## Planning progress
8
+
9
+ This project is at the start of its planning arc. The AI will walk you through five phases before you begin building. Each phase is its own session.
10
+
11
+ | Phase | What it produces | Status |
12
+ | --- | --- | --- |
13
+ | A — Orientation | Project description, 1-3 personas, the horizon map | 🔵 not yet started |
14
+ | B — Architecture & Contracts | The major pieces of the project and what they exchange | 🔵 not yet started |
15
+ | C — UI/UX + Design System | The user-facing surfaces and the shared visual language | 🔵 not yet started |
16
+ | D — Maps | Phases of work and the near-term plan | 🔵 not yet started |
17
+ | E — Initial Work Units | The first 5-10 things to build, in dependency order | 🔵 not yet started |
18
+
19
+ When you run `/start-of-session` on this fresh project, the AI will see this tracker and offer to begin Phase A.
8
20
 
9
21
  ## What is currently in flight
10
22
 
11
- [One paragraph describing what work is happening right now. Edit when work changes shape.]
23
+ [Filled in once Phase A is underway. Today, this is a brand-new catalogue with no work in flight yet.]
12
24
 
13
25
  ## What just shipped
14
26
 
@@ -16,7 +28,7 @@ Nothing yet — this catalogue was just adopted on {{TODAY}}.
16
28
 
17
29
  ## What is next
18
30
 
19
- [The next concrete action. Should be specific enough that an LLM teammate can pick it up and start without further context.]
31
+ Run `/start-of-session` to begin. The AI will read this file and walk you through Phase A of planning.
20
32
 
21
33
  ## Open questions blocking progress
22
34
 
@@ -32,16 +44,18 @@ None currently filed. Filed risks live in [`risks/_index.md`](risks/_index.md).
32
44
  | --- | --- | --- |
33
45
  | _none yet_ | | |
34
46
 
35
- ## Work units in flight
47
+ ## Active work units
48
+
49
+ | Work Unit | Status | Notes |
50
+ | --- | --- | --- |
51
+ | _none yet — phase E of planning produces the first batch_ | | |
36
52
 
37
- | WU | Status | Owner | Notes |
38
- | --- | --- | --- | --- |
39
- | WU 001 | 🟡 in flight | — | First work unit |
53
+ ## How to read this file
40
54
 
41
- ## Status legend
55
+ - **Planning progress** shows where you are in the 5-phase arc that takes a brand-new project to "ready to build"
56
+ - **What is currently in flight** describes ongoing work; updated when work changes shape
57
+ - **What just shipped** notes the most recent completion(s)
58
+ - **What is next** points at the immediate concrete action
59
+ - Below: open questions, risks, decisions, and active work units — pulled from their respective registers for quick scanning
42
60
 
43
- - 🔵 **proposed** written down, not yet started
44
- - 🟡 **in flight** — actively being worked on
45
- - 🟣 **built / awaiting review** — implementation done, review pending
46
- - ✅ **merged / shipped** — complete and integrated
47
- - 🔴 **blocked** — cannot proceed; see notes for blocker
61
+ This file is the project's executive summary. The detail lives in the register files; this is the one-screen view that says where the project is.
@@ -0,0 +1,79 @@
1
+ # Welcome — what this catalogue is, and how it works
2
+
3
+ You're looking at the **catalogue** for {{PROJECT_NAME}}. It's your project's memory. Read this once and you'll understand the whole shape. It takes five minutes.
4
+
5
+ ## What the catalogue is for
6
+
7
+ A real project — one that handles real complexity — has more moving parts than anyone can hold in their head. Who's it for? What does each piece do? What did we decide last month? What are we still unsure about? What's at risk? Without a place to keep all of this, you end up rebuilding the same understanding over and over, every time you sit down to work, every time someone new joins, every time you open a fresh chat with an AI.
8
+
9
+ The catalogue solves that. Everything load-bearing about your project lives here in plain Markdown files, organised into ten **registers**. The catalogue stays current through two protocols — `/start-of-session` and `/end-of-session` — that run at the bookends of every period of work.
10
+
11
+ You don't have to remember any of it. The catalogue does.
12
+
13
+ ## The principle that makes it work
14
+
15
+ **Project memory never drifts from project reality.** Every decision made in conversation gets saved before the session ends. Every change to an existing piece flows through a protocol that keeps the catalogue and its search index in sync. The pre-commit hook blocks silent edits to accepted decisions. The post-commit hook auto-refreshes the search index after every commit. The AI you're working with reads from the catalogue and writes back to it; what it finds when you ask "what did we decide about X?" is always current.
16
+
17
+ If anything ever feels out of date, that's a bug, not a feature. The repair is to file the missing piece before continuing.
18
+
19
+ ## How a project gets built
20
+
21
+ A project starts with a 5-phase **planning arc** the AI walks you through. Each phase is its own session. By the end of the arc, the catalogue has the substrate that makes everything downstream coherent.
22
+
23
+ 1. **Orientation** (~30 min) — what is this project, who's it for. You'll describe the project in your own words and name 1-3 specific people it serves.
24
+
25
+ 2. **Architecture & Contracts** (~60-90 min) — what are the major pieces, what does each one provide to the others. The shape of the system in everyday language.
26
+
27
+ 3. **UI/UX + Design System** (~60-90 min) — every page, screen, modal, or command the user touches, plus the complete design system (colour, typography, spacing, components, patterns, voice, accessibility commitments) that every surface uses. End-to-end: a surface in `ui-ux/` references components in `design-system/`; a component carries tokens; tokens propagate everywhere. The system stays consistent as it grows because everything references one shared language.
28
+
29
+ 4. **Maps** (~45 min) — the journey from now to done. Phases. What's happening this week, this month.
30
+
31
+ 5. **Initial Work Units** (~60 min) — the first 5 to 10 concrete things to build, ordered by what depends on what.
32
+
33
+ After phase 5, you start building. Every session from then on follows the same shape: `/start-of-session` shows where you are, you work, `/end-of-session` writes down what just happened.
34
+
35
+ ## The eleven registers
36
+
37
+ | Register | What lives here | Handle |
38
+ | --- | --- | --- |
39
+ | **personas/** | One file per specific person the project serves | P001, P002… |
40
+ | **maps/** | The horizon, the phases, the near-term plan | M001, M002, M003 |
41
+ | **architecture/** | What the major pieces are and how they relate | (per-module files) |
42
+ | **contracts/** | What each piece provides to the others | (per-contract files) |
43
+ | **ui-ux/** | Every user-facing surface (page, screen, command, email) | (per-surface files) |
44
+ | **design-system/** | The shared visual + interaction language every surface uses (tokens, components, patterns, voice) | (per-piece files) |
45
+ | **decisions/** | Choices made and not to be drifted from | D001, D002… |
46
+ | **open-questions/** | Things we haven't decided yet | Q001, Q002… |
47
+ | **work-units/** | Concrete things being built | WU 001, WU 002… |
48
+ | **risks/** | Things that could go wrong | R001, R002… |
49
+ | **sessions/** | A log of every period of work | one file per session |
50
+
51
+ The full vocabulary lives in [`GLOSSARY.md`](GLOSSARY.md). Read it once; come back when you need it.
52
+
53
+ ## The three commands you need
54
+
55
+ Everything else is automatic.
56
+
57
+ ```text
58
+ npx @nusoft/nuos-build-catalogue init — once, when starting a new project
59
+ /start-of-session — every time you begin working
60
+ /end-of-session — every time you stop
61
+ ```
62
+
63
+ `/start-of-session` reads where you are, what just happened, what's next, and surfaces any blockers. If this is the very first session on a fresh project, it routes you into the orientation phase of the planning arc.
64
+
65
+ `/end-of-session` writes down what was attempted, what worked, what didn't, what was learned. It commits. The catalogue's search index updates in the background.
66
+
67
+ That's it. The catalogue handles the rest.
68
+
69
+ ## What never to do
70
+
71
+ - **Never close a session without `/end-of-session`.** Work that isn't written down is work that's lost.
72
+ - **Never edit an accepted decision file.** If something changes, file a new decision that supersedes the old one. The pre-commit hook will block silent edits.
73
+ - **Never make an architectural decision in conversation without filing it.** If the AI says "let's go with X" and you agree, file it as a decision *before moving on*. Drift is the failure mode that makes the catalogue worthless.
74
+
75
+ ## Where to go from here
76
+
77
+ - **Brand new project?** Run `/start-of-session`. The AI will walk you through phase 1 of planning. By the end of today you'll have the project oriented.
78
+ - **Returning to existing work?** Same — `/start-of-session` reads STATE.md, the latest session log, and the active work unit. You'll be told where you are and what's next within a minute.
79
+ - **Want to look around first?** Open [`STATE.md`](STATE.md) for the current snapshot, [`maps/01-the-horizon.md`](maps/01-the-horizon.md) for the whole-project picture, or [`GLOSSARY.md`](GLOSSARY.md) for any term you don't recognise.
@@ -0,0 +1,39 @@
1
+ # Architecture
2
+
3
+ The **architecture** register describes the major pieces of {{PROJECT_NAME}} and how they relate. Each major piece (module, service, surface, area of responsibility) gets its own file. The architecture is *what the pieces are*; the [contracts register](../contracts/_index.md) is *what they exchange*. See [the glossary](../GLOSSARY.md#architecture) for the full definition.
4
+
5
+ ## Index
6
+
7
+ | Module | Purpose | Status |
8
+ | --- | --- | --- |
9
+ | _none yet — populated during the Architecture phase of planning (phase B)_ | | |
10
+
11
+ ## What goes in this register
12
+
13
+ For each major piece of your project:
14
+
15
+ - **What it does** — a paragraph in plain language
16
+ - **Who's responsible for it** — which persona or role uses it most directly
17
+ - **What it depends on** — other modules, external services, hardware
18
+ - **What depends on it** — what would break if this module went away
19
+ - **Open questions about it** — anything unresolved about its shape
20
+ - **Links to relevant contracts** — what this module produces and consumes
21
+
22
+ Architecture files are *what's true about each piece*; they're not implementation specs. Implementation lives in code; this register lives in the catalogue.
23
+
24
+ ## When the architecture register gets populated
25
+
26
+ During the **Architecture & Contracts** phase of planning (phase B), after the orientation phase. The AI walks you through identifying the major pieces of your project — usually 3-7 modules for a starting project — and helps you file one architecture entry per module.
27
+
28
+ ## How architecture connects to everything else
29
+
30
+ - Every work unit names which module it lives in
31
+ - Every contract belongs to exactly one module (the one that owns it)
32
+ - Every UI/UX surface references which modules it talks to
33
+ - Architecture changes (a module splits, two modules merge, a new module enters scope) get filed as decisions
34
+
35
+ ## How to add a module
36
+
37
+ During planning: the AI does this for you via `nuos-catalogue architecture create`.
38
+
39
+ Outside planning: copy `module-template.md` to `<short-module-name>.md`, fill it in, and add a row to the table above. Use `nuos-catalogue architecture create` if you want the interactive prompts.
@@ -0,0 +1,47 @@
1
+ # [Module name]
2
+
3
+ > *Replace bracketed placeholders. Delete this hint block once filled in.*
4
+
5
+ **Status:** 🔵 proposed / 🟡 in flight / 🟢 active / ⚫ retired
6
+ **Owner:** [persona handle and name — or "infrastructure" if not user-facing]
7
+ **Last updated:** {{TODAY}}
8
+
9
+ ## What this module does
10
+
11
+ [One paragraph in plain language. Avoid implementation language. Describe the responsibility, not the code.]
12
+
13
+ > Example: "The Overnight Consolidation module processes every interaction with a student during a school day and produces, by morning, a per-student plan ranked by need."
14
+
15
+ ## Who uses it directly
16
+
17
+ [List the personas who interact with this module via UI/UX surfaces. Each as `[P001](../personas/P001-name.md)` with a one-line note on how they use it.]
18
+
19
+ ## What it depends on
20
+
21
+ - **Other modules:** [list with links to their architecture files]
22
+ - **External services:** [APIs, vendors, hardware]
23
+ - **Hardware or infrastructure:** [if relevant]
24
+
25
+ ## What depends on it
26
+
27
+ [What would break if this module went away or returned wrong results? List the affected modules + the affected user-facing surfaces.]
28
+
29
+ ## Contracts this module owns
30
+
31
+ [List the contracts in `contracts/` that this module produces. One per row.]
32
+
33
+ | Contract | What it provides |
34
+ | --- | --- |
35
+ | [contract handle/file] | [one-line description] |
36
+
37
+ ## Open questions about this module
38
+
39
+ [Link to Q-NNN entries in `open-questions/` that affect this module specifically. If none yet, write _none currently_.]
40
+
41
+ ## Decisions specific to this module
42
+
43
+ [Link to D-NNN entries that affect just this module. Cross-cutting decisions can stay in the decisions register without being linked here.]
44
+
45
+ ## Notes
46
+
47
+ [Date-stamped notes about how this module has evolved. Use this section the way you'd use a work unit's notes section — what was tried, what worked, what didn't.]
@@ -0,0 +1,39 @@
1
+ # Contracts
2
+
3
+ A **contract** is what one piece of the project guarantees it will provide to other pieces — and what it expects from them in return. Written in everyday language: "facts about the world the system now knows", not database tables or API endpoints. The contracts register is where the project commits to what each piece is responsible for. See [the glossary](../GLOSSARY.md#contract) for the full definition.
4
+
5
+ ## Index
6
+
7
+ | Contract | Owner module | Status |
8
+ | --- | --- | --- |
9
+ | _none yet — populated during the Architecture phase of planning (phase B)_ | | |
10
+
11
+ ## What a contract captures
12
+
13
+ For each major module, one contract describes:
14
+
15
+ - **What this module produces** — the facts, capabilities, or guarantees other modules can rely on. *"After Overnight Consolidation runs, every active student has a tomorrow-plan ranked by need."*
16
+ - **What this module consumes** — what must already be in place for this module to do its job. *"Overnight Consolidation needs today's interaction records for every active student."*
17
+ - **What it does not provide** — things adjacent that someone might assume are included but aren't. Naming the negative space prevents drift.
18
+ - **How it fails** — what happens if its inputs are missing, late, or wrong; what downstream modules can rely on as the failure behaviour.
19
+
20
+ Contracts are **load-bearing commitments**. They're the boundaries between modules — and they don't drift silently. If a contract changes, that's an architectural decision that gets filed.
21
+
22
+ ## When the contracts register gets populated
23
+
24
+ During the **Architecture & Contracts** phase of planning (phase B). The AI walks you through one contract per module. Each contract gets filed as you go.
25
+
26
+ After planning, contracts evolve. Adding a new produced fact, or relaxing a consumed precondition, is usually a decision — file it in the decisions register and update the contract to match.
27
+
28
+ ## How contracts connect to everything else
29
+
30
+ - Every contract belongs to exactly one module (the architecture file in `architecture/`)
31
+ - Every work unit names which contract(s) it produces or consumes
32
+ - Every UI/UX surface references the contracts it talks to
33
+ - Contract changes get filed as decisions
34
+
35
+ ## How to add a contract
36
+
37
+ During planning: the AI does this for you via `nuos-catalogue contract create`.
38
+
39
+ Outside planning: copy `contract-template.md` to `<short-name>.md`, fill it in, and add a row to the table above. Or use `nuos-catalogue contract create` for the interactive prompts.
@@ -0,0 +1,64 @@
1
+ # Contract: [module name]
2
+
3
+ > *Replace bracketed placeholders. Delete this hint block once filled in.*
4
+
5
+ **Owner module:** [link to the architecture file for this module]
6
+ **Status:** 🔵 proposed / 🟡 in flight / 🟢 active / ⚫ retired
7
+ **Last updated:** {{TODAY}}
8
+
9
+ ## In one sentence
10
+
11
+ [What does this module make true in the world? One sentence. *"Overnight Consolidation produces, by morning, a per-student plan ranked by need."*]
12
+
13
+ ## What this module produces
14
+
15
+ [What facts, capabilities, or guarantees can other parts of the system rely on, once this module is in place? Use everyday language. Bullet list.]
16
+
17
+ - [fact 1]
18
+ - [fact 2]
19
+ - ...
20
+
21
+ ## What this module consumes
22
+
23
+ [What must already be true (data, signals, services) before this module can do its job? Bullet list, with links to other contracts where the input is produced.]
24
+
25
+ - [input 1] — produced by [contract link]
26
+ - [input 2] — produced by [contract link or "external — [source]"]
27
+ - ...
28
+
29
+ ## What this module does not provide
30
+
31
+ [The negative space. Things adjacent that someone might assume are included but aren't. Naming these prevents downstream confusion.]
32
+
33
+ - [thing it doesn't do, despite proximity]
34
+ - ...
35
+
36
+ ## How it fails
37
+
38
+ [What happens when inputs are missing, late, or wrong? What can downstream modules rely on as the failure behaviour? *"If today's interaction records are missing, Overnight Consolidation skips that student in tomorrow's plan and surfaces a flag in the morning briefing."*]
39
+
40
+ ## Personas this contract serves
41
+
42
+ [The personas whose outcomes depend on this contract. Linked to their P-NNN files.]
43
+
44
+ ## Work units that produce this contract
45
+
46
+ [As work units ship that fulfil this contract, link them here. During planning this list is empty; it fills in as the project builds.]
47
+
48
+ | WU | Status |
49
+ | --- | --- |
50
+
51
+ ## Work units that consume this contract
52
+
53
+ [Work units elsewhere in the project that rely on this contract being in place.]
54
+
55
+ | WU | Status |
56
+ | --- | --- |
57
+
58
+ ## Decisions that shaped this contract
59
+
60
+ [Link to D-NNN files that materially shaped what this contract is. Examples: "D003 — All overnight processing happens on-device".]
61
+
62
+ ## Notes
63
+
64
+ [Date-stamped notes about how this contract has evolved.]
@@ -1,30 +1,34 @@
1
1
  # Decisions
2
2
 
3
- > Architectural commitments made by this project. Each decision lives in its own D-NNN file. Decisions are dated, justified, and have a status (`accepted`, `superseded`, `withdrawn`).
3
+ A **decision** is a choice that's been made and shouldn't drift. Once accepted, a decision isn't edited if circumstances change, you file a new decision that supersedes the old one and link forward. Decisions are the project's load-bearing commitments: the things future work has to honour. See [the glossary](../GLOSSARY.md#decision) for the full definition.
4
4
 
5
5
  ## Index
6
6
 
7
7
  | ID | Title | Status | Date |
8
8
  | --- | --- | --- | --- |
9
- | _none yet — see the template_ | | | |
9
+ | _none yet — file your first one with `/decision-new` or `nuos-catalogue decision create`_ | | | |
10
10
 
11
- ## How to add a decision
11
+ ## When to file a decision
12
12
 
13
- 1. Copy `D001-template.md` to `DNNN-short-title-with-dashes.md` (next available number)
14
- 2. Fill in the template
15
- 3. Add a row to the table above
16
- 4. If the decision affects a work unit's acceptance criteria, link it from the WU
17
- 5. If the decision supersedes a prior one, mark the prior one's status as `superseded` and link forward
13
+ - You're choosing between two reasonable approaches and want the choice to stick
14
+ - You're adopting a constraint future work will need to honour (e.g. "all data stays on-device", "no third-party trackers")
15
+ - You're overriding something previously decided — file the supersede; don't silently shift
16
+ - You're committing to a technology, a deployment target, a major design principle
18
17
 
19
- ## When to write a decision
18
+ > Example: "D003 All overnight processing happens on the school's own server, never in the cloud."
20
19
 
21
- - An architectural commitment is being made
22
- - Two reasonable approaches are being chosen between
23
- - A constraint is being adopted that future work will need to honour
24
- - A prior decision is being overridden (write the supersede; don't silently shift)
20
+ ## When NOT to file a decision
25
21
 
26
- ## When NOT to write a decision
22
+ - The choice is an implementation detail and easy to reverse
23
+ - It belongs inside a work unit's notes — local to that work unit, not a project-wide commitment
24
+ - The matter is still open and unresolved — file it as an **open question** ([Q-NNN](../open-questions/_index.md)) instead
27
25
 
28
- - The choice is implementation-detail and easy to reverse
29
- - The work unit's notes are sufficient to capture the rationale
30
- - The matter is open and unresolved file it as an open question (Q-NNN), not a decision
26
+ ## What never to do
27
+
28
+ **Never edit an accepted decision file.** The pre-commit hook will block it. If you need to change something material, file a new decision that supersedes the old one — `nuos-catalogue decision supersede D003 --by=D012 --reason="..."`. Typo or link fixes that don't change meaning are the only edits allowed.
29
+
30
+ ## How to file one
31
+
32
+ Easiest way: run `/decision-new` (or `nuos-catalogue decision create`). The AI walks you through the prompts and files the result with a fresh D-NNN handle.
33
+
34
+ The file is short — a one-paragraph context, the decision itself in one sentence, why it was made, and what it commits future work to. It doesn't need to be long. It needs to be unambiguous.
@@ -0,0 +1,57 @@
1
+ # Design System
2
+
3
+ The **design system** is the shared visual and interaction language every part of {{PROJECT_NAME}}'s user-facing experience uses. End-to-end: design tokens (colour, type, spacing, motion) → components (buttons, cards, navigation) → patterns (form layouts, page templates) → voice (microcopy, error messages) → accessibility commitments. Every per-surface file in `ui-ux/` references this register. See [the glossary](../GLOSSARY.md#design-system) for the full definition.
4
+
5
+ ## Why a design system from the start
6
+
7
+ Many projects sprout UI/UX surfaces first and add a design system later as a "consistency pass". By then the surfaces are inconsistent, components are duplicated, and harmonising them takes longer than building them in the first place. This catalogue requires a design system to exist before per-surface files are written. Phase C of planning produces both, in parallel.
8
+
9
+ If a change to a colour, a heading style, a button shape, or an error message tone needs to happen, it happens **here**, once. Every surface that references the design system picks up the change. That's the system's load-bearing job.
10
+
11
+ ## Index
12
+
13
+ | File | What it captures |
14
+ | --- | --- |
15
+ | `tokens-colour.md` | Colour palette, semantic colour roles |
16
+ | `tokens-typography.md` | Type scale, font families, line heights, weights |
17
+ | `tokens-spacing.md` | Spacing scale, layout grid, breakpoints |
18
+ | `tokens-motion.md` | Easing curves, duration scale, motion principles |
19
+ | `tokens-radius-elevation.md` | Border radii, shadow scale, elevation tokens |
20
+ | `components/_index.md` | Index of components with status |
21
+ | `patterns/_index.md` | Index of recurring page-level patterns |
22
+ | `voice.md` | Voice, tone, microcopy principles |
23
+ | `accessibility.md` | Project-wide accessibility commitments |
24
+
25
+ Each section is filled in during the UI/UX + Design System phase of planning (phase C).
26
+
27
+ ## What status means for design system pieces
28
+
29
+ - 🔵 **proposed** — drafted, not yet adopted across surfaces
30
+ - 🟡 **in flight** — being refined; surfaces may reference older + newer simultaneously
31
+ - 🟢 **active** — in use; the canonical version
32
+ - ⚫ **deprecated** — kept for reference but no new surfaces should use it; existing surfaces should migrate
33
+
34
+ ## How design system pieces connect to everything else
35
+
36
+ - Every UI/UX surface in `ui-ux/` references design-system pieces by name
37
+ - Architecture modules that involve UI reference the surfaces (and thereby the design system)
38
+ - Decisions that materially change a token, component, or voice principle are filed in `decisions/`
39
+ - Work units that ship UI either consume the design system (most cases) or extend it (when a new component or pattern is needed)
40
+
41
+ ## When the design system gets populated
42
+
43
+ During Phase C of planning (UI/UX + Design System). The AI walks you through:
44
+
45
+ 1. **Voice and tone first** — how does {{PROJECT_NAME}} sound when it speaks?
46
+ 2. **Tokens** — colour, type, spacing, motion. The atomic units.
47
+ 3. **Components** — the buttons, cards, navigation, forms. Each with variants, states, and accessibility commitments.
48
+ 4. **Patterns** — how components combine into recurring page-level layouts.
49
+ 5. **Accessibility commitments** — what the project promises end-to-end.
50
+
51
+ You don't need to design every component upfront. The first pass establishes the language; components get added as work units need them. But the **language exists from the start** — every surface references it from day one.
52
+
53
+ ## How to add a design system piece
54
+
55
+ During planning: the AI walks you through it.
56
+
57
+ Outside planning: each piece is a standalone file with its own template (see the relevant subdirectory). For a new component, copy `components/_template.md` to `components/<name>.md`. For a new pattern, copy `patterns/_template.md`. Tokens are edited directly in the `tokens-*.md` files.