@nurix/etna 0.20.14 → 0.20.16

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 (41) hide show
  1. package/data/catalog/rules/frontend.md +7 -3
  2. package/data/harness-index.json +1 -1
  3. package/data/harnesses/code/CLAUDE.md +8 -2
  4. package/data/harnesses/code/agents/bookkeeper.md +1 -0
  5. package/data/harnesses/code/agents/polygraph-finder.md +4 -0
  6. package/data/harnesses/code/harness.json +2 -2
  7. package/data/harnesses/code/hooks/awareness.mjs +15 -2
  8. package/data/harnesses/code/hooks/lib/state.mjs +1 -0
  9. package/data/harnesses/code/hooks/lib/sweep.mjs +20 -2
  10. package/data/harnesses/code/rules/frontend.md +7 -3
  11. package/data/harnesses/code/skills/design/SKILL.md +2 -2
  12. package/data/harnesses/code/skills/design/references/compose.md +18 -0
  13. package/data/harnesses/code/skills/design/references/emission.md +34 -8
  14. package/data/harnesses/code/skills/design/references/existing-apps.md +2 -2
  15. package/data/harnesses/code/skills/design/references/foundations.md +3 -3
  16. package/data/harnesses/code/skills/design/references/intake.md +5 -4
  17. package/data/harnesses/code/skills/design/references/ship-gate.md +9 -3
  18. package/data/harnesses/code/skills/design/scripts/validate-design-md.mjs +293 -14
  19. package/data/harnesses/code/skills/documentation/SKILL.md +28 -0
  20. package/data/harnesses/code/skills/documentation/scripts/comment-strip.mjs +339 -0
  21. package/data/harnesses/code/skills/documentation/scripts/doc-lint.mjs +41 -10
  22. package/data/harnesses/code/skills/documentation/scripts/source-lint.mjs +225 -0
  23. package/data/harnesses/code/skills/documentation/templates/behavioral-checklist.md +1 -2
  24. package/data/harnesses/code/skills/documentation/templates/bookkeeping.md +1 -1
  25. package/data/harnesses/code/skills/polygraph/SKILL.md +1 -1
  26. package/data/harnesses/code/skills/testing/SKILL.md +1 -1
  27. package/data/harnesses/delivery/harness.json +2 -2
  28. package/data/harnesses/delivery/skills/documentation/SKILL.md +28 -0
  29. package/data/harnesses/delivery/skills/documentation/scripts/comment-strip.mjs +339 -0
  30. package/data/harnesses/delivery/skills/documentation/scripts/doc-lint.mjs +41 -10
  31. package/data/harnesses/delivery/skills/documentation/scripts/source-lint.mjs +225 -0
  32. package/data/harnesses/delivery/skills/documentation/templates/behavioral-checklist.md +1 -2
  33. package/data/harnesses/delivery/skills/documentation/templates/bookkeeping.md +1 -1
  34. package/data/harnesses/etna/harness.json +2 -2
  35. package/data/harnesses/etna/skills/documentation/SKILL.md +28 -0
  36. package/data/harnesses/etna/skills/documentation/scripts/comment-strip.mjs +339 -0
  37. package/data/harnesses/etna/skills/documentation/scripts/doc-lint.mjs +41 -10
  38. package/data/harnesses/etna/skills/documentation/scripts/source-lint.mjs +225 -0
  39. package/data/harnesses/etna/skills/documentation/templates/behavioral-checklist.md +1 -2
  40. package/data/harnesses/etna/skills/documentation/templates/bookkeeping.md +1 -1
  41. package/package.json +2 -2
@@ -17,11 +17,15 @@ Tailwind v4 + shadcn-based UI conventions for **web** apps — styling, the `@nu
17
17
  - **`@nurix/components`** is the UI library — import by subpath (`@nurix/components/button`). **Never** `npx shadcn add`, no `components.json` scaffold — consume the prebuilt library (`.tsx`, not `.jsx`). *A recorded deviation from canonical shadcn, where primitives are vendored into `components/ui/` and edited in place: this workspace consumes a published library instead, and vendoring would fork it. Deliberate — the design skill does not "converge" it.*
18
18
  - Vite: `@tailwindcss/vite` + `@vitejs/plugin-react-swc`. Pin `react` / `react-dom` / `react/jsx-runtime` / `react/jsx-dev-runtime` to the app's single copy via `resolve.alias` — `@nurix/*` ship nested react, and two copies means two hook dispatchers.
19
19
  - Tailwind v4 is CSS-only — no `tailwind.config.js`, no PostCSS.
20
- - **The CSS entry is whatever the manifest names**, not a fixed filename — `globals.css`, `index.css` and `styles.css` are each conventional in different framework guides, so resolve it rather than grep for one. Imports in order: `@import "./fonts.css"` (`@fontsource` registrations) → the project's `design.tokens.css` (derived from the repo-base `design.md` by the design skill's validator — **never** hand-edited) → `@import "tailwindcss"` → the library's `styles.css` — then `@theme inline {…}` mapping vars to tokens.
21
- - **Dark mode is the `.dark` class on the root element**, bound as `@custom-variant dark (&:is(.dark *))` in the CSS entry — **never** a `data-theme` attribute. `@nurix/components` compiles `.dark` blocks into its distributed CSS and a consumer cannot re-key them, so an app on the attribute renders half-flipped: its own tokens invert, every library surface stays light. The switcher is three parts — a pre-paint inline script in the HTML shell (a mounted provider runs too late and the page flashes), `color-scheme: light dark`, and the persisted-preference module.
20
+ - **The CSS entry is whatever the manifest names**, not a fixed filename — `globals.css`, `index.css` and `styles.css` are each conventional in different framework guides, so resolve it rather than grep for one. Imports in order: `@import "./fonts.css"` (`@fontsource` registrations) → the project's `design.tokens.css` (derived by the design skill's validator from the `design.md` in the design folder — `packages/common/` at the base of a multi-package workspace, `src/common/` in a single-package repo — **never** hand-edited) → `@import "tailwindcss"` → the library's `styles.css` → the project's `personality.css` (the same validator's `--emit-personality`, compiling the `design.md` traits through `@nurix/components`' own compiler — **never** hand-edited) — then `@theme inline {…}` mapping vars to tokens.
21
+ - **Dark mode is the `.dark` class on the root element**, bound as `@custom-variant dark (&:is(.dark *))` in the CSS entry — **never** a `data-theme` attribute. `@nurix/components` keys its `dark:` variants, its theme toggle, and its toaster on that class and a consumer cannot re-key them, so an app on the attribute renders mixed: its own tokens invert, the library's dark-only chrome stays light. The switcher is three parts — a pre-paint inline script in the HTML shell (a mounted provider runs too late and the page flashes), `color-scheme: light dark`, and the persisted-preference module.
22
22
  - Tokens: raw values in `:root:not(.dark)` and `:root.dark` — **both specificity (0,2,0), and that armor is load-bearing.** Tailwind compiles `@theme` into `@layer theme` and any unlayered declaration beats a layered one, so the library's unlayered `:root`/`.dark` defeats an app's `@theme` outright and *ties* a bare `:root`/`.dark`, leaving the winner to import order. Values are then consumed as semantic Tailwind tokens (`bg-card`, `text-foreground`) through an `@theme inline` mapping layer. The library bundles `class-variance-authority`, `clsx`, `tailwind-merge` — don't re-add them.
23
23
  - **Never retune a Tailwind scale key `@nurix/components` consumes** — `--text-xs`, `--text-sm`, `--text-base`, `--text-lg`, `--text-xl`, `--text-2xl`. Its components carry raw scale utilities and its stylesheet declares no `font-size`, so those compile against *this app's* `@theme`: redefining `--text-sm` moves every button, menu item and table cell in the library at once, with nothing to report it. Change type by changing ramp tokens.
24
- - Spacing in 2/4/6/8; `object-cover`; `truncate`; color through tokens — **never** hardcoded hex in components, and **never a literal font size**. The type ramp and the family rules are the design skill's [`references/type-system.md`](../skills/design/references/type-system.md); `text-sm` is a scale step and is fine, `text-[13px]` is a component overruling the system.
24
+ - Spacing in 2/4/6/8; `object-cover`; `clip` / `clip-<n>` / `clip-fade` (the library's — they carry `min-width: 0` and `overflow-wrap: anywhere`; **never** `truncate` / `line-clamp-*`, which leave the flex-child overflow bug open); color through tokens — **never** hardcoded hex in components, and **never a literal font size**. The type ramp and the family rules are the design skill's [`references/type-system.md`](../skills/design/references/type-system.md); `text-sm` is a scale step and is fine, `text-[13px]` is a component overruling the system.
25
+ - **Feel comes from the traits, never from literals on a control or collection surface.** `personality.css` compiles `density` / `pace` / `edge` / `depth` into `--density-*`, `--motion-duration-*`, `--radius-scale`, `--elevation-*`, and every library component reads those. App code stays inside the same reach: scanned surfaces pad and gap through the tokens (`p-(--density-pad-md)`, `gap-(--density-gap-md)`), a `transition-*` utility carries **no** `duration-*` class (the library's default transition duration retimes it from `pace`), a repeated-row container carries `data-mode="inline"`, and app animation reads `var(--motion-duration-base)`. A `p-3`, a `duration-200`, or a `rounded-lg` on such a surface silently opts out of the product's feel.
26
+ - **Every rendered time is `<Timestamp>`** (`@nurix/components/element/timestamp`, `format="auto"`), and a live label ticks through `useNow` (`@nurix/components/lib/time`) — one shared interval, never a `setInterval` per row or a hand-rolled relative formatter.
27
+ - **Status colour is the role.** `success`, `warning`, `info` are declared in `design.md` in both themes; the app's `@theme inline` maps its utilities onto the same roles (`--color-success: var(--success)`), and a status dot is `<Chip prefix="dot" color="var(--tone-success)">` — one hue per meaning on every surface.
28
+ - **`cn()` keeps only one of a type role and a colour merged together** — its tailwind-merge tables class `text-h1` / `text-body` / `text-dense` as colours, so `cn("text-h1", "text-foreground")` and `cn("text-h1 text-foreground")` are both `text-foreground`. Keep a role and a colour in a `className` string that never goes through `cn`, or put the colour on the parent.
25
29
 
26
30
  ## Component Search Order
27
31
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "fingerprint": "7f155d8901ee",
2
+ "fingerprint": "6b7b8d3d3e8f",
3
3
  "harnesses": {
4
4
  "code": {
5
5
  "plugin": "code",
@@ -172,8 +172,14 @@ Defaults — ❌ prohibitions hold unless the user explicitly asks otherwise;
172
172
 
173
173
  ## File Structure
174
174
 
175
- - Add a file-path header comment at the top of each source file, in the file's native comment syntax — `// src/modules/example.js - Module for handling user authentication`. Place it below any shebang line; skip formats with no comment syntax (JSON, lockfiles) and generated files.
176
- - Add a 1-line description above each function whose purpose isn't fully evident from its name and signature: `// Extract JWT token from request based on endpoint type`. No commented-out code — refactor for clarity instead.
175
+ A file's documentation lives in `docs/`. Its comments carry only what a reader needs with the code in front of them, and the budget is deliberately small — a comment is the one artifact nothing audits, so it is where stale claims accumulate.
176
+
177
+ - Add a file-path header comment at the top of each source file, in the file's native comment syntax — `// src/modules/example.js - Module for handling user authentication`. Place it below any shebang line; skip formats with no comment syntax (JSON, lockfiles) and generated files. **The path is repo-relative and names the file's own path**: a header a move left behind is worse than no header, because it reads as current.
178
+ - **Two or three present-tense sentences, six lines at the ceiling** — what the file is, the invariant a reader must not break, and where the fuller account lives, as a `docs/…` path.
179
+ - Add a 1-line description above each function whose purpose isn't fully evident from its name and signature: `// Extract JWT token from request based on endpoint type`. **One sentence, third-person indicative** — `Installs the package`, never `Install the package` — and a second sentence only to carry a named invariant. A field, type member, or constant earns a sentence only where its name and type do not already say it; a member of an enum or a constant map earns none. No commented-out code — refactor for clarity instead.
180
+ - **Design rationale, alternatives weighed, history, ticket and decision-record references, and dated notes are not comments.** They belong to the owning feature doc, and moving the claim there is part of the same change — cutting one out of a comment without landing it is a deletion, not a cleanup (the `documentation` skill § Where a file's documentation lives).
181
+ - **The ceiling is on what a change adds, not on what it inherits: under a quarter of the lines a change adds are comments.** The measured regression that set this number ran at 28% on new files while the tree it joined sat at 14%, so a whole-file average is the wrong instrument — it grades the density somebody else wrote and passes the prose being added right now. `.claude/skills/documentation/scripts/source-lint.mjs --changed` reports it and the detector raises one row per offending file; a comments-only sweep proves itself with `comment-strip.mjs`, which strips both revisions and diffs what is left, so a code change hiding inside a cleanup cannot pass as one.
182
+ - **The one comment that earns a paragraph is a booby trap** — an edit that looks obviously safe and is not. It names the version or the measurement that makes it true and the condition under which it stops being true, so the next reader can retire it instead of trusting it. Everything else that wants a paragraph wants a doc.
177
183
 
178
184
  ---
179
185
 
@@ -19,6 +19,7 @@ Ground every edit in this ladder, in order. Never invent content; a fact you can
19
19
  | --- | --- |
20
20
  | `dead-glob` | read the owning doc, find where the files went (`git log --follow`, glob search), update its `owns:` frontmatter |
21
21
  | `header-missing` | add the file-path header comment in the file's native comment syntax |
22
+ | `source-lint` | run `.claude/skills/documentation/scripts/source-lint.mjs <file>` and clear its BLOCK findings: a stale or absent header path is rewritten to the file's own repo-relative path, and `comment-ratio-added` — over a quarter of the lines the change added are comments — is cleared by moving the rationale into the owning doc and leaving one sentence per symbol. Never clear either with a `source-lint-disable`: the one comment that earns its length is a booby trap, and that one takes the disable with its reason beside it. The file-level `comment-ratio` warning is **not** yours — it grades density somebody else wrote, and rewriting an inherited file is a unit of work with an owner, not a queue drain |
22
23
  | `doc-lint` | fix the finding, or add `<!-- doc-lint-disable: id -->` with a reason beside it when the flagged text is deliberate |
23
24
  | `index-row-missing` | add the doc's row to `docs/README.md` |
24
25
  | `doc-implicated` | read the diff of the named source file (`git diff` / `git log -p`), and update the owning doc **only where the diff contradicts documented behavior**; if nothing documented changed, the row's resolution is deleting it |
@@ -17,6 +17,10 @@ Docs state the target design; code is presumed correct unless a standing decisio
17
17
  2. Read the document once, whole — it is the one file you always read in full. Then check each claim it makes against the code: grep for the mechanism, open the passage with a line range, cite `file:line`.
18
18
  3. Write one row per claim to the partial file, **no header**, exactly ten pipe-separated fields: `id|subject|claim|evidence|counter_evidence|verdict|confidence|depends_on|status|resolution`. A literal `|` becomes `¦`, a newline `; `. Verdicts: `COHERENT` (emit at the unit you audited, so coverage is countable) · `MISDESCRIBED` · `UNDOCUMENTED` · `UNBUILT` · `RESIDUE` · `CONTESTED` · `QUESTION`. `id` is `{doc-stem}-NNN`; `status` is `open`; `resolution` is empty; `confidence` is an honest 0–1.
19
19
  4. Sweep the other direction once: code inside the `owns:` globs that no claim in the document covers is an `UNDOCUMENTED` row — after the precedent test.
20
+ 5. Sweep the comments inside the `owns:` globs once, against the shape in the repo's `CLAUDE.md` § File Structure — the authority, never restated by you. A comment is not a claim about the code, it is a claim *in* the code, and it is the one artifact nothing else audits. Two things come out of this sweep, and a claim worth keeping produces **both**:
21
+ - **The claim, as an `UNDOCUMENTED` row against the document** — design rationale, the alternatives weighed, the measurement behind a constant, the reason an obvious-looking edit is wrong. The applier folds it into the doc, which is what makes cutting the comment safe later. Cite the comment's `file:line` as evidence and state the claim in the document's voice, not the comment's.
22
+ - **The comment itself, as a code-side row** naming the file and the lines — `MISDESCRIBED` where it states something the code does not do, `RESIDUE` where it is history, a ticket or decision-record reference, a dated note, a divider, a per-field block, or a restatement of what the doc now carries. Code-side rows leave as register rows; **you never edit a comment**, whatever the row says.
23
+ Shape breaches are one `RESIDUE` row per file, counted rather than enumerated: no path header, a header naming a path other than its own, a header past three sentences, a function comment past two. **The exception you must not report is the booby trap** — a comment whose subject is a danger on an edit that looks safe, naming the version, measurement, or condition that makes it true. It earns its length where it sits.
20
24
 
21
25
  Rules that bind every row:
22
26
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "harness": "code",
3
3
  "name": "code",
4
- "version": "3.16.2",
4
+ "version": "3.16.4",
5
5
  "files": [
6
6
  ".prettierignore",
7
7
  ".prettierrc.json",
@@ -25,5 +25,5 @@
25
25
  }
26
26
  ],
27
27
  "docsRoot": "docs",
28
- "digest": "f105e8f211b0"
28
+ "digest": "5e98d9973eb1"
29
29
  }
@@ -35,7 +35,7 @@ import {
35
35
  readDecision,
36
36
  } from "./lib/state.mjs";
37
37
  import { readSafe, relIfInside, today, SOURCE_EXT, commandRoot, docsRoot } from "./lib/repo.mjs";
38
- import { sweepResolvedRows, docLint, hasHeaderComment } from "./lib/sweep.mjs";
38
+ import { sweepResolvedRows, docLint, sourceLint, hasHeaderComment } from "./lib/sweep.mjs";
39
39
  import { listPlans, polygraphVerdict } from "./lib/plans.mjs";
40
40
  import { frozenStatusAtHead } from "./lib/frozen.mjs";
41
41
  import { undischargedDocRows } from "./lib/ledger.mjs";
@@ -369,7 +369,20 @@ function detectorForFile(projectDir, rel, meta, rows) {
369
369
  ...meta,
370
370
  kind: "header-missing",
371
371
  description: `${rel} lacks its file-path header comment`,
372
- action: "add the header comment",
372
+ action: "add the header comment naming this file's own repo-relative path",
373
+ })
374
+ );
375
+ }
376
+ // The blocking rest of the source-comment convention as one row per file — in practice the added-line
377
+ // comment ratio, since every other non-header rule only warns. Header findings are excluded because
378
+ // `header-missing` above already carries them, and two rows for one defect are drained twice.
379
+ if (sourceLint(projectDir, rel).some((line) => !/header-missing|header-path-stale/.test(line))) {
380
+ rows.push(
381
+ formatAutoRow({
382
+ ...meta,
383
+ kind: "source-lint",
384
+ description: `${rel} violates the source-comment convention`,
385
+ action: "run .claude/skills/documentation/scripts/source-lint.mjs on it and clear the blocking findings, or source-lint-disable an id with its reason",
373
386
  })
374
387
  );
375
388
  }
@@ -180,6 +180,7 @@ const ROW_PATH_RULES = [
180
180
  /·\s*doc-implicated\s*·\s*(\S+)\s+changed;\s+owning doc\s+(\S+?)\s+may need/,
181
181
  /·\s*doc-lint\s*·\s*(\S+)\s+has\s/,
182
182
  /·\s*header-missing\s*·\s*(\S+)\s+lacks\s/,
183
+ /·\s*source-lint\s*·\s*(\S+)\s+violates\s/,
183
184
  /·\s*index-row-missing\s*·\s*(\S+)\s+is not linked from\s+(\S+)/,
184
185
  /·\s*package-rejected\s*·\s*(\S+)\s+declares\s/,
185
186
  /·\s*frozen-record-edited\s*·\s*(\S+)\s+is a frozen record/,
@@ -33,10 +33,19 @@ export function docLint(projectDir, rel) {
33
33
  return out.split("\n").filter((line) => /:\d+ \[(block|warn)\]/.test(line));
34
34
  }
35
35
 
36
- // True when a source file's first lines carry its repo-relative path (the header-comment rule).
36
+ // True when the first path-shaped token in a source file's opening lines IS its repo-relative path.
37
37
  export function hasHeaderComment(projectDir, rel) {
38
38
  const head = readSafe(path.join(projectDir, rel)).split("\n").slice(0, 5).join("\n");
39
- return head.includes(rel) || head.includes(path.basename(rel));
39
+ const m = /([\w.@-]+(?:\/[\w.@-]+)*\.[A-Za-z]{1,5})\b/.exec(head);
40
+ return m ? m[1] === rel : false;
41
+ }
42
+
43
+ // The installed source-lint's block-severity lines for one file, so warnings advise and blocking rules wall.
44
+ export function sourceLint(projectDir, rel) {
45
+ const script = path.join(projectDir, ".claude", "skills", "documentation", "scripts", "source-lint.mjs");
46
+ if (!fs.existsSync(script)) return [];
47
+ const res = spawnSync("node", [script, rel], { cwd: projectDir, encoding: "utf8", timeout: 5000 });
48
+ return `${res.stdout || ""}`.split("\n").filter((line) => /:\d+ \[block\]/.test(line));
40
49
  }
41
50
 
42
51
  // Verifier keys the detector no longer emits — swept when machine-raised, never taught to authors.
@@ -52,6 +61,15 @@ export const ROW_VERIFIERS = {
52
61
  return hasHeaderComment(projectDir, rel);
53
62
  },
54
63
 
64
+ // "<rel> violates the source-comment convention" — dead once source-lint reports no blocking finding.
65
+ "source-lint": (projectDir, body) => {
66
+ const m = /·\s+source-lint\s+·\s+(\S+)\s+violates/.exec(body);
67
+ if (!m) return false;
68
+ const rel = m[1];
69
+ if (!fs.existsSync(path.join(projectDir, rel))) return true;
70
+ return sourceLint(projectDir, rel).length === 0;
71
+ },
72
+
55
73
  // "owns: glob `<glob>` in <doc> matches no files" — dead once the glob matches something again.
56
74
  "dead-glob": (projectDir, body, ctx) => {
57
75
  const m = /`([^`]+)`/.exec(body);
@@ -17,11 +17,15 @@ Tailwind v4 + shadcn-based UI conventions for **web** apps — styling, the `@nu
17
17
  - **`@nurix/components`** is the UI library — import by subpath (`@nurix/components/button`). **Never** `npx shadcn add`, no `components.json` scaffold — consume the prebuilt library (`.tsx`, not `.jsx`). *A recorded deviation from canonical shadcn, where primitives are vendored into `components/ui/` and edited in place: this workspace consumes a published library instead, and vendoring would fork it. Deliberate — the design skill does not "converge" it.*
18
18
  - Vite: `@tailwindcss/vite` + `@vitejs/plugin-react-swc`. Pin `react` / `react-dom` / `react/jsx-runtime` / `react/jsx-dev-runtime` to the app's single copy via `resolve.alias` — `@nurix/*` ship nested react, and two copies means two hook dispatchers.
19
19
  - Tailwind v4 is CSS-only — no `tailwind.config.js`, no PostCSS.
20
- - **The CSS entry is whatever the manifest names**, not a fixed filename — `globals.css`, `index.css` and `styles.css` are each conventional in different framework guides, so resolve it rather than grep for one. Imports in order: `@import "./fonts.css"` (`@fontsource` registrations) → the project's `design.tokens.css` (derived from the repo-base `design.md` by the design skill's validator — **never** hand-edited) → `@import "tailwindcss"` → the library's `styles.css` — then `@theme inline {…}` mapping vars to tokens.
21
- - **Dark mode is the `.dark` class on the root element**, bound as `@custom-variant dark (&:is(.dark *))` in the CSS entry — **never** a `data-theme` attribute. `@nurix/components` compiles `.dark` blocks into its distributed CSS and a consumer cannot re-key them, so an app on the attribute renders half-flipped: its own tokens invert, every library surface stays light. The switcher is three parts — a pre-paint inline script in the HTML shell (a mounted provider runs too late and the page flashes), `color-scheme: light dark`, and the persisted-preference module.
20
+ - **The CSS entry is whatever the manifest names**, not a fixed filename — `globals.css`, `index.css` and `styles.css` are each conventional in different framework guides, so resolve it rather than grep for one. Imports in order: `@import "./fonts.css"` (`@fontsource` registrations) → the project's `design.tokens.css` (derived by the design skill's validator from the `design.md` in the design folder — `packages/common/` at the base of a multi-package workspace, `src/common/` in a single-package repo — **never** hand-edited) → `@import "tailwindcss"` → the library's `styles.css` → the project's `personality.css` (the same validator's `--emit-personality`, compiling the `design.md` traits through `@nurix/components`' own compiler — **never** hand-edited) — then `@theme inline {…}` mapping vars to tokens.
21
+ - **Dark mode is the `.dark` class on the root element**, bound as `@custom-variant dark (&:is(.dark *))` in the CSS entry — **never** a `data-theme` attribute. `@nurix/components` keys its `dark:` variants, its theme toggle, and its toaster on that class and a consumer cannot re-key them, so an app on the attribute renders mixed: its own tokens invert, the library's dark-only chrome stays light. The switcher is three parts — a pre-paint inline script in the HTML shell (a mounted provider runs too late and the page flashes), `color-scheme: light dark`, and the persisted-preference module.
22
22
  - Tokens: raw values in `:root:not(.dark)` and `:root.dark` — **both specificity (0,2,0), and that armor is load-bearing.** Tailwind compiles `@theme` into `@layer theme` and any unlayered declaration beats a layered one, so the library's unlayered `:root`/`.dark` defeats an app's `@theme` outright and *ties* a bare `:root`/`.dark`, leaving the winner to import order. Values are then consumed as semantic Tailwind tokens (`bg-card`, `text-foreground`) through an `@theme inline` mapping layer. The library bundles `class-variance-authority`, `clsx`, `tailwind-merge` — don't re-add them.
23
23
  - **Never retune a Tailwind scale key `@nurix/components` consumes** — `--text-xs`, `--text-sm`, `--text-base`, `--text-lg`, `--text-xl`, `--text-2xl`. Its components carry raw scale utilities and its stylesheet declares no `font-size`, so those compile against *this app's* `@theme`: redefining `--text-sm` moves every button, menu item and table cell in the library at once, with nothing to report it. Change type by changing ramp tokens.
24
- - Spacing in 2/4/6/8; `object-cover`; `truncate`; color through tokens — **never** hardcoded hex in components, and **never a literal font size**. The type ramp and the family rules are the design skill's [`references/type-system.md`](../skills/design/references/type-system.md); `text-sm` is a scale step and is fine, `text-[13px]` is a component overruling the system.
24
+ - Spacing in 2/4/6/8; `object-cover`; `clip` / `clip-<n>` / `clip-fade` (the library's — they carry `min-width: 0` and `overflow-wrap: anywhere`; **never** `truncate` / `line-clamp-*`, which leave the flex-child overflow bug open); color through tokens — **never** hardcoded hex in components, and **never a literal font size**. The type ramp and the family rules are the design skill's [`references/type-system.md`](../skills/design/references/type-system.md); `text-sm` is a scale step and is fine, `text-[13px]` is a component overruling the system.
25
+ - **Feel comes from the traits, never from literals on a control or collection surface.** `personality.css` compiles `density` / `pace` / `edge` / `depth` into `--density-*`, `--motion-duration-*`, `--radius-scale`, `--elevation-*`, and every library component reads those. App code stays inside the same reach: scanned surfaces pad and gap through the tokens (`p-(--density-pad-md)`, `gap-(--density-gap-md)`), a `transition-*` utility carries **no** `duration-*` class (the library's default transition duration retimes it from `pace`), a repeated-row container carries `data-mode="inline"`, and app animation reads `var(--motion-duration-base)`. A `p-3`, a `duration-200`, or a `rounded-lg` on such a surface silently opts out of the product's feel.
26
+ - **Every rendered time is `<Timestamp>`** (`@nurix/components/element/timestamp`, `format="auto"`), and a live label ticks through `useNow` (`@nurix/components/lib/time`) — one shared interval, never a `setInterval` per row or a hand-rolled relative formatter.
27
+ - **Status colour is the role.** `success`, `warning`, `info` are declared in `design.md` in both themes; the app's `@theme inline` maps its utilities onto the same roles (`--color-success: var(--success)`), and a status dot is `<Chip prefix="dot" color="var(--tone-success)">` — one hue per meaning on every surface.
28
+ - **`cn()` keeps only one of a type role and a colour merged together** — its tailwind-merge tables class `text-h1` / `text-body` / `text-dense` as colours, so `cn("text-h1", "text-foreground")` and `cn("text-h1 text-foreground")` are both `text-foreground`. Keep a role and a colour in a `className` string that never goes through `cn`, or put the colour on the parent.
25
29
 
26
30
  ## Component Search Order
27
31
 
@@ -57,7 +57,7 @@ The component dictionary spans **two provenances**: the internal `@nurix/compone
57
57
 
58
58
  The project repo keeps exactly what a build needs offline and reproducibly — all editable by anyone, no jails; the canonical memory is the workspace's preference rows on the server:
59
59
 
60
- - **`design.md`** (repo base) — the working copy of the workspace's look: the resolved fork of the chosen package with provenance line, brief bindings, the primitives switch, and every recorded deviation with its one-line reason. The token artifact (`design.tokens.css` beside it) is derived from it, never hand-edited. After any local edit that survives the ship gate, push the new text via `record`; at session start compare the repo copy against `get_preferences` — on mismatch, tell the user which is newer and ask; never silently overwrite either.
60
+ - **`design.md`** (in the design folder — `packages/common/` at the base of a multi-package workspace, `src/common/` in a single-package repo) — the working copy of the workspace's look: the resolved fork of the chosen package with provenance line, brief bindings, the primitives switch, and every recorded deviation with its one-line reason. The artifacts beside it (`design.tokens.css`, and `personality.css` under `nurix`) are derived from it, never hand-edited. **Locate it mechanically, never by search:** `node scripts/validate-design-md.mjs --project .` resolves the one path from the repo's shape and fails closed on a copy anywhere else, naming where it belongs; a repo where it resolves to nothing has no fork yet, and first intake writes it at that path. After any local edit that survives the ship gate, push the new text via `record`; at session start compare the repo copy against `get_preferences` — on mismatch, tell the user which is newer and ask; never silently overwrite either.
61
61
  - **`product.md`** — users and jobs, roles, action frequency, risk, accessibility commitments, brand anti-references. Package choice, UX decisions, motion intensity, and demo data all cite it.
62
62
  - **The `workspaceId`** — one committed line (or ambient Apollo context); what binds the repo to its workspace's memory.
63
63
 
@@ -89,7 +89,7 @@ What enters context, when. Nothing loads whole except where this table says so.
89
89
 
90
90
  Two scripts at `scripts/` — ESM, Node ≥ 22, zero dependencies. You drive them; nothing hooks them.
91
91
 
92
- - `validate-design-md.mjs <file|folder> [--mode admission|build|ship] [--json] [--emit]` — the entire mechanical apparatus of the design.md system: schema, coverage, contrast, index integrity fail closed; taste smells warn. `--emit` compiles the token artifact; `--mode ship` runs the drift check. Runs at build on the project's fork before token compilation and at the ship gate.
92
+ - `validate-design-md.mjs (<file|folder> | --project [dir]) [--mode admission|build|ship] [--json] [--emit] [--emit-personality] [--write] [--lib <folder>]` — the entire mechanical apparatus of the design.md system: schema, coverage, contrast, index integrity fail closed; taste smells warn. `--project .` resolves the project's fork from the repo shape; `--emit --write` compiles the token artifact beside it and `--emit-personality --write` the personality artifact; `--mode ship` runs both drift checks. Runs at build on the project's fork before token compilation and at the ship gate.
93
93
  - `select-chart.mjs <signature.json>` — the chart-selection engine: you author the data signature (the judgment half); it computes elimination, scoring, ranking, and refusal (the mechanical half) over the census that ships beside it — engine and census are one designed artifact. One graph question per call; disagreement with its answer is recorded, never silent.
94
94
 
95
95
  ## What this skill never does
@@ -21,3 +21,21 @@ Recipes are starting points, not jails: restyle or extend them in place when the
21
21
  - **No ownership jails.** Any file may be edited at any time, including generated ones and library compositions.
22
22
  - **No paper-trail bureaucracy.** Decision-log lines only, through `record`; attention goes to pixels.
23
23
  - **A finishing pass with authority over everything is part of this step** — walk the whole canvas once at the end: rhythm, alignment, density, identity-consistency across surfaces, the one-accent discipline.
24
+
25
+ ## Library reach — under `primitives: nurix`
26
+
27
+ The library carries behavior stock shadcn does not, and each item below is reachable only when the composition routes to it; a hand-rolled equivalent is a defect, not a style choice.
28
+
29
+ - **Density is the trait.** Control height and padding come from `personality.density` through `--density-control-*`; container padding and gaps on scanned surfaces (cards in a grid, list rows, panel bodies) read `--density-pad-xs|md|lg` and `--density-gap-md` — `p-(--density-pad-md)`, `gap-(--density-gap-md)` — so one trait re-spaces the product. A `p-3` on a data surface is the per-surface mood foundations forbid; structural spacing (a divider, an icon's optical nudge) stays literal.
30
+ - **Motion rides the seam.** A `transition-*` utility with no `duration-*` class inherits `--motion-duration-fast`, which `pace`, the reduced-motion block, and the inline clamp all reach; a `duration-200` opts that element out of all three. App-owned animation reads `var(--motion-duration-base)` and `var(--motion-ease-standard)`, never a literal; the library's `effect/*` primitives already read them, so an identity moment composes from those before a bespoke variant.
31
+ - **Collections are inline.** Any container of repeated rows the operator scans — a table body, a list, a feed, a board column — carries `data-mode="inline"`: every DOM-descendant transition collapses to instant (portaled tooltips escape) while loaders keep breathing on the ambient duration. Only `<Cell mode="inline">` stamps it, on the cell alone; `block/table` and `block/list` stamp nothing on their containers, so the app stamps it on the collection — including ones built on those blocks.
32
+ - **Every time on screen is `<Timestamp>`** (`element/timestamp`): `format="auto"` reads relative inside `thresholdMs` and absolute beyond it, the full absolute stamp sits on the native `title` by default, `live` ticks on one shared interval. A custom live label subscribes through `useNow` (`lib/time`) — one ticker per interval, never a timer per row.
33
+ - **Typing is not saving.** Input (commits on blur), Textarea (blur, Cmd/Ctrl+Enter), NumberInput (blur, Enter, the steppers), Slider (release), Combobox (close), `DatePicker` and `DatePicker.Range` (the pick) carry `onChange` for the draft and `onSave` for the commit; `InlineEdit` carries `onSave` alone. Mutations wire to `onSave`; `onChange` never reaches the server. A form with a Save button is the one exception — a transaction the button commits whole.
34
+ - **Remote and long option lists are the Combobox's** (`compound/combobox`): `onSearch` returns a page for a query (debounced by `debounceMs`), `onLoadMore` appends the next page, `maxSelections` caps a multi-select. A fetch-in-effect feeding a filtered `<Select>` is the pattern this replaces.
35
+ - **Time-range filters are `DatePicker.Range` with `presets`** (`{ label, from, to }`; its preset column shows by default, `DatePicker`'s needs `showPresets`), `weekStartsOn` from the locale decision, `fromYear`/`toYear` where the domain bounds them; a single date in a table cell is `DatePicker` with `inline` and `compact`. A bespoke window picker is a defect.
36
+ - **Uploads reject before they upload.** `FileUpload` (`compound/file-picker`) takes `accept`, `maxSize`, `maxFiles`, and `onFileValidate` (return the rejection message, or nothing to accept); a rejected file never enters the list and `onFileReject(file, message)` receives it. The dropzone only flashes an invalid border — the composition surfaces the message (a field error or a toast).
37
+ - **Shell affordances come from `block/shell-affordances`**: `Freshness` for "as of" (`staleAfterMs`, `onRefresh`), `GateAffordance` for an action a gate blocks, `SystemBanner` for a system-wide notice. A bespoke freshness pill or banner is a defect.
38
+ - **Status colour is the role.** The package's `success` / `warning` / `info` reach the library as `--tone-success|warning|info` (library fallbacks when undeclared): a status dot is `<Chip prefix="dot" color="var(--tone-success)">`, never a raw hue, and app utilities map onto the same roles (`--color-success: var(--success)` in the app's `@theme inline`), so a chart legend and a chip dot never disagree.
39
+ - **Targets under 24px grow through `hit-area-*`** (`hit-area-2` adds 0.5rem of pointer box on every side; `hit-area-x-*` / `-y-*` / `-t-*` / `-b-*` / `-l-*` / `-r-*` where a neighbour would overlap) — the pointer box grows, the paint box does not. `hit-area-debug` shows the box while composing.
40
+ - **Clipping is `clip`.** `clip` for one line, `clip-<n>` for n lines, `clip-fade` where prose is expected to overflow — each carries `min-width: 0` and `overflow-wrap: anywhere`, which Tailwind's `truncate` and `line-clamp-*` lack (the flex-child overflow bug those leave open).
41
+ - **Type roles are utilities** — `text-display`, `text-title`, `text-h1`, `text-body`, `text-dense`, `text-meta`, … from the library's `@theme` — and `cn()` (tailwind-merge tables) classifies `text-<role>` as a colour: a role and a colour passed through `cn`, together or apart, keep only the later one. Keep both in a `className` string that never goes through `cn`, or put the colour on the parent.
@@ -1,21 +1,47 @@
1
- # Package emission — design.md → token artifact
1
+ # Package emission — design.md → the token artifacts
2
2
 
3
- One source, one derivation: the project's `design.md` is canonical; the token artifact is compiled from it and **never hand-edited**. Emit with `node scripts/validate-design-md.mjs <project design.md> --emit > design.tokens.css` (the artifact lives beside `design.md` at the repo base; the app's global stylesheet imports it). Re-emit on every design.md change; the ship gate's drift check byte-compares a fresh emission against the committed artifact.
3
+ One source, two derivations: the project's `design.md` is canonical; the artifacts are compiled from it and **never hand-edited**. Both live beside `design.md` in the design folder — `packages/common/` at the base of a multi-package workspace, `src/common/` in a single-package repo, the path `--project .` resolves and `--write` emits into — and the app's global stylesheet imports both. Re-emit on every design.md change; the ship gate's drift checks byte-compare a fresh emission against each committed artifact.
4
+
5
+ | Artifact | Emit with | Carries | Compiled by |
6
+ | --- | --- | --- | --- |
7
+ | `design.tokens.css` | `node scripts/validate-design-md.mjs --project . --emit --write` | the color roles in both themes, the type ramp, elevation, the motion base, layout | the validator |
8
+ | `personality.css` — `primitives: nurix` only | `node scripts/validate-design-md.mjs --project . --emit-personality --write` | the six traits compiled into the token families every `@nurix/components` component reads: `--density-*`, `--motion-duration-*`, `--radius-scale`, `--elevation-*`, `--texture-*`, `--accent`/`--ring` | `compileToCss` from `@nurix/components/lib/personality`, reached through the validator from the project's own install |
4
9
 
5
10
  ## Coverage
6
11
 
7
- The artifact is complete by construction — the validator fails the design.md before emission otherwise: every one of the 36 color roles in **both** themes, the full type ramp, the elevation system, the motion base, layout dimensions. Composition consumes tokens and never invents values; switching packages re-skins the whole app.
12
+ `design.tokens.css` is complete by construction — the validator fails the design.md before emission otherwise: every one of the 36 color roles in **both** themes, the full type ramp, the elevation system, the motion base, layout dimensions. Composition consumes tokens and never invents values; switching packages re-skins the whole app.
13
+
14
+ ## The personality block
15
+
16
+ `@nurix/components` derives feel — control geometry, spacing, timing, radius, depth, grain, accent — from six traits and reads nothing else for it: a component's transition is `var(--motion-duration-base)`, a control's height is `var(--density-control-height)`. The design.md states the traits once, in its design-values block, and the library derives every value:
17
+
18
+ ```yaml
19
+ personality:
20
+ density: compact # compact | regular | airy — control height and padding, container padding, gaps
21
+ pace: 0.3 # 0 still · 0.5 the library's neutral timing · 1 lively
22
+ edge: sharp # sharp | regular | soft — the radius scale
23
+ depth: flat # flat | layered | elevated — the elevation ladder
24
+ texture: clean # clean | grainy — grain opacity on effect surfaces
25
+ tone: neutral # neutral | expressive — whether the accent re-anchors on the primary
26
+ ```
27
+
28
+ - **§4–§7 are read into the traits, never into pixels.** A §6 of "flat, hairline-separated" is `depth: flat`; a §7 of "utilitarian, nothing animates twice a day" is `pace` at 0.2–0.35; an operator §4 is `density: compact`. Declare only what differs from neutral (regular · 0.5 · regular · layered · grainy · neutral). An absent block ships the library's defaults and the validator warns (`dmw-05`) — a project that never declared its feel is how these families go unused.
29
+ - **`motion.duration` and `motion.easing` are the app's own vocabulary** (`--duration-panel`, `--ease-standard`, read by app-owned animation); the library's components never read them. `pace` is what retimes the library — and, through the library's default transition duration, every plain Tailwind `transition-*` utility in the app. State both from the same §7 reading.
30
+ - **The block is closed-vocabulary and fails closed** (`dmv-12`): an unknown trait, an out-of-range pace, or a block under `primitives: native` (nothing there reads it) fails validation.
31
+ - **The compiler is the project's own install.** `--emit-personality` resolves `@nurix/components` by walking up from the design.md, then one and two levels into the workspace (`packages/<app>`), because a pnpm root hoists nothing. Several installed versions is an ambiguity the app package resolves: `--project . --emit-personality --write --lib packages/<app>`. The artifact's header names the library version that compiled it, so a library upgrade re-emits by drift, never by hand.
32
+ - **The artifact is committed, never injected.** `personality.css` is the product's artifact — inspectable, diffable, drift-checked at the ship gate — imported after the library's `styles.css` so its `:root` wins on order. `<PersonalityStyle>` from the same subpath serves a runtime switch (a density toggle, a preview) and never replaces the artifact.
8
33
 
9
34
  ## Emission constraints
10
35
 
11
36
  Each prevents a known silent-failure class:
12
37
 
13
- - **Specificity armor.** Theme blocks are `:root, :root[data-theme="light"]` and `:root[data-theme="dark"]` — both specificity (0,2,0) — so a component library's later bare `:root` block cannot silently defeat a theme.
14
- - **Font binding by derivation.** Font stacks bind to installed packages under **registered family names** (`"Inter Variable"`, not `"Inter"`), each with its declared fallback stack — otherwise the flagship font silently never renders. Install the font packages the design.md declares (e.g. Fontsource) and verify the name matches what the package registers.
15
- - **Every authored token group reaches a named consumer.** An authored ramp with no emitter vanishes without a trace — wire each group (colors → theme classes/utilities, ramp → text styles, elevation → radius/shadow utilities, motion → duration/easing vars) and let the ship gate's reach check prove it.
38
+ - **Specificity armor.** Theme blocks are `:root:not(.dark)` and `:root.dark` — both specificity (0,2,0) — keyed on the `.dark` class the library compiles into its own stylesheet. A `data-theme` attribute keys none of the library's `dark:` variants, its theme toggle, or its toaster: an app on the attribute inverts its tokens and renders mixed library chrome.
39
+ - **The tone trio.** `success`, `warning`, and `info` reach the library as `--tone-success|warning|info` — what a status dot (`<Chip prefix="dot" color="var(--tone-success)">`) and the copy button's check read, falling back to the library's own hue when a role is absent. Declare all three, in both themes — a missing `info` (`dmw-06`) puts the library's blue beside the package's green and amber.
40
+ - **Font binding by derivation.** Font stacks bind to installed packages under **registered family names** (`"Inter Variable"`, not `"Inter"`), each with its declared fallback stack — otherwise the flagship font silently never renders. Install the font packages the design.md declares (e.g. Fontsource) and verify the name matches what the package registers. The library's `font-sans` / `font-mono` / `font-display` utilities compile to `inherit` on purpose (a ramp, never a face): the app declares its own theme keys in a plain `@theme` pointing at the emitted slots — `--font-body: var(--font-sans)`, `--font-heading: var(--font-display)`, `--font-code: var(--font-mono)` — and sets the ambient face on `body` in `@layer base`.
41
+ - **Every authored token group reaches a named consumer.** An authored ramp with no emitter vanishes without a trace — wire each group (colors → theme classes/utilities, ramp → text styles, elevation → radius/shadow utilities, motion → duration/easing vars) and let the ship gate's reach check prove it. The personality families reach the library by construction; the app's `--duration-*` / `--ease-*` reach app-owned animation code, or they are unused.
16
42
  - **Compile the emitted CSS once per change** — a stray utility string inside a CSS comment can defeat a fully green byte-level check.
17
- - **One linear precedence, later wins:** package defaults → brief bindings → recorded deviations. Values resolve at emission; the runtime cascade carries only contexts (theme, density).
43
+ - **One linear precedence, later wins:** package defaults → brief bindings → recorded deviations. Values resolve at emission; the runtime cascade carries only contexts (theme, density, `data-mode="inline"`).
18
44
 
19
45
  ## Stack neutrality
20
46
 
21
- The artifact is plain CSS custom properties — every stack consumes it. Under `primitives: nurix`, Tailwind maps the properties through the theme config; under `native`, the incumbent styling layer reads the same variables. No emission step is React-specific.
47
+ `design.tokens.css` is plain CSS custom properties — every stack consumes it. Under `primitives: nurix`, Tailwind maps the properties through the theme config; under `native`, the incumbent styling layer reads the same variables. No emission step is React-specific. `personality.css` is the one stack-bound artifact: compiled by and for `@nurix/components`, it does not exist under `native`.
@@ -4,7 +4,7 @@ The same machinery runs on existing UIs, under a preservation contract.
4
4
 
5
5
  ## Judge — a user-invoked service
6
6
 
7
- A critique of an existing UI against the brief, the project's `design.md`, the archetype checklists, and the workspace's taste profile (`get_preferences`), producing a **severity-ranked (never scored) report**. Judge is a service the user asks for — never a self-check the skill runs on its own output. Read the actual rendered state (screenshots the user provides, or captures the user asks for); refuse to critique from source alone when the ask is "does it look right", and never imagine what unrendered code looks like. Each finding: severity, the on-screen element, what's wrong, the exact fix.
7
+ A critique of an existing UI against the brief, the project's `design.md` (the path `--project .` resolves), the archetype checklists, and the workspace's taste profile (`get_preferences`), producing a **severity-ranked (never scored) report**. Judge is a service the user asks for — never a self-check the skill runs on its own output. Read the actual rendered state (screenshots the user provides, or captures the user asks for); refuse to critique from source alone when the ask is "does it look right", and never imagine what unrendered code looks like. Each finding: severity, the on-screen element, what's wrong, the exact fix.
8
8
 
9
9
  ## Improve — judge + the fix pass
10
10
 
@@ -21,7 +21,7 @@ Improve runs then proceed through the standard steps as scoped: intake (against
21
21
  A supported entry path, under **attestation and provenance**:
22
22
 
23
23
  - Record what the source is and whose it is: own product / public reference / third party.
24
- - Extract **structure and system, never pixels or assets**: roles, ramps, spacing, elevation, motion posture — into a `tier: project` design.md in the package schema, validator-checked.
24
+ - Extract **structure and system, never pixels or assets**: roles, ramps, spacing, elevation, motion posture — into a `tier: project` design.md in the package schema at the path `--project .` resolves, validator-checked.
25
25
  - Write a provenance block into the extracted file (`source-package: extracted@<date>` plus the attestation lines).
26
26
  - Record what **is**, never what should be — extraction is documentation, not improvement; the improve pass comes after, separately, if asked.
27
27
  - Admission of an extracted package into the shared roster later requires the provenance check to pass; third-party extractions stay project-local.
@@ -22,11 +22,11 @@ No database — three constraints, values yours: **categorical** series need dis
22
22
 
23
23
  ## Number, date, unit formatting
24
24
 
25
- Tabular figures in tables and KPIs; thousands separators; unit or currency attached to the number; consistent decimals per column; large values truncate meaningfully (`1.2M`, never `1,200,000` in a tile); timestamps show relative when recent and absolute on hover; timezones explicit anywhere ambiguity costs money.
25
+ Tabular figures in tables and KPIs; thousands separators; unit or currency attached to the number; consistent decimals per column; large values truncate meaningfully (`1.2M`, never `1,200,000` in a tile); timestamps show relative when recent and absolute on hover (under `nurix`, that is `<Timestamp format="auto">`, never a hand-rolled formatter); timezones explicit anywhere ambiguity costs money.
26
26
 
27
27
  ## Spacing & density
28
28
 
29
- The 2/4/6/8 scale, period. Operator surfaces default **compact** (data rows 32–36px) with a comfortable mode only when `product.md` says reading, not scanning. Density is a per-project decision made once, not a per-surface mood.
29
+ The 2/4/6/8 scale, period. Density is a per-project decision made once, not a per-surface mood — recorded as the `density` trait: **compact** for operator surfaces that scan (controls and data rows land at 32px), `regular` or `airy` only when `product.md` says reading. Under `nurix` the trait reaches controls and collection surfaces through the library's `--density-*` tokens, never through per-surface `p-*` literals.
30
30
 
31
31
  ## Radius & stroke
32
32
 
@@ -34,7 +34,7 @@ Radius is identity — sharp (0–2px), soft (4–6px), or round (10px+) — cho
34
34
 
35
35
  ## Loading, skeleton, progress
36
36
 
37
- Skeletons for layout-known loads, spinners only for unknowable ones, optimistic updates for high-frequency mutations with undo. Skeletons mirror the real layout's bones (no generic gray blocks). Nothing pulses faster than 1.2s.
37
+ Skeletons for layout-known loads, spinners only for unknowable ones, optimistic updates for high-frequency mutations with undo. Skeletons mirror the real layout's bones (no generic gray blocks). Nothing pulses faster than 1.2s; under `nurix` a status pulse is `<Chip prefix="dot" pulse>`, never `animate-pulse` (a hardcoded keyframe neither `pace` nor the inline clamp can reach), and loaders keep breathing inside inline collections by design.
38
38
 
39
39
  ## Empty states
40
40
 
@@ -2,17 +2,17 @@
2
2
 
3
3
  Read the brief and choose from the menus: one identity package (the design.md system), any axis overrides the brief demands, layout blueprints per surface, and the product domain for content. Every choice is one recorded line.
4
4
 
5
- **Returning workspace first.** If the repo carries a `workspaceId` (or the Apollo context supplies one), open with `get_preferences`: the workspace's `design.md`, `taste.md`, and `product.md` rows are the session's context — then run the drift check (compare the repo's `design.md` against the server row; on mismatch, tell the user which is newer and ask). A workspace with a recorded identity re-enters the steps with that identity already chosen; the rules below are for first intake.
5
+ **Returning workspace first.** If the repo carries a `workspaceId` (or the Apollo context supplies one), open with `get_preferences`: the workspace's `design.md`, `taste.md`, and `product.md` rows are the session's context — then run the drift check (compare the repo's fork — `node scripts/validate-design-md.mjs --project .` resolves its one path from the repo shape and fails closed on a copy anywhere else — against the server row; on mismatch, tell the user which is newer and ask). A workspace with a recorded identity re-enters the steps with that identity already chosen; the rules below are for first intake.
6
6
 
7
7
  ## Rules
8
8
 
9
9
  - **The brief's own words outrank any database default.** "Beautiful" means the ceiling, not the safe row.
10
10
  - **Adjectives become referents.** When the brief speaks in adjectives ("premium", "editorial"), name the 2–3 real products the brief is pointing at and pick the package whose recorded identity sits in that class — unnamed ambition becomes beige.
11
11
  - **Search is a retrieval aid, never a router.** `search_catalog` (family `design_md`) with the brief's segment/keyword resemblance; shortlist 2–3 results by their head metadata (feel, reads-as, keywords), then choose reading the brief. After the choice, `get_entry` **once**: the chosen package's full design.md enters context and **stays in view through step 4**; unchosen candidates are never fetched.
12
- - **The escape hatch fires mechanically.** No catalog hit, plus a recorded one-line reason why the closest package fails → author a one-off project design.md in the package schema, `tier: project` — the validator is the schema authority and checks it like any library entry. This path is expected to be common; flag the file as a curation candidate for the roster.
12
+ - **The escape hatch fires mechanically.** No catalog hit, plus a recorded one-line reason why the closest package fails → author a one-off project design.md in the package schema, `tier: project`, at the path `--project .` resolves — the validator is the schema authority and checks it like any library entry. This path is expected to be common; flag the file as a curation candidate for the roster.
13
13
  - **Record the identity.** First intake ends with `record`: the identity choice as a decision line, and the resolved fork pushed as the workspace's `design.md` preference row. The `workspaceId` is committed to the repo if it is not ambient. Design taste is workspace-level — an app never gets its own.
14
14
  - **Axis overrides fetch or read the single named entry** — color/font/gradient/chart-style overrides `get_entry` their dictionary entry; elevation/motion/iconography overrides read the named local entry under `data/`.
15
- - **Set the primitives switch** — write one `primitives: nurix | native` line into the project's `design.md`. Default by the probe: the project resolves `@nurix/components` (check package.json / lockfile / node_modules) → `nurix`; otherwise — existing apps, foreign stacks, no library access — → `native`. Set once here; nothing downstream re-asks. Also write `source-package: <slug>` (or `authored` for escape-hatch one-offs).
15
+ - **Set the primitives switch** — write one `primitives: nurix | native` line into the project's `design.md` (the path `--project .` resolves; first intake creates the file there). Default by the probe: the project resolves `@nurix/components` (check package.json / lockfile / node_modules) → `nurix`; otherwise — existing apps, foreign stacks, no library access — → `native`. Set once here; nothing downstream re-asks. Also write `source-package: <slug>` (or `authored` for escape-hatch one-offs).
16
16
  - **Write or update `product.md`**: users and their jobs, roles/permissions, action frequency, risk level, accessibility commitments, brand anti-references. Package choice, UX decisions, motion intensity, and demo data all cite it. Push it as a preference row too — Studio shows it.
17
17
  - **The taste profile biases every choice** — `get_preferences` returns the workspace's `taste.md` (per-dimension feel/avoid lines); user reactions to shipped output update it via `record`. No profile yet = no bias, never a block.
18
18
  - **Stated-choice awareness:** if prior package picks are visible in the workspace, name them and say in one line why this pick repeats or differs — awareness, never forced rotation.
@@ -29,12 +29,13 @@ Step 1 ends with a preview block:
29
29
  - domain corpus
30
30
  - surface map with archetypes
31
31
  - planned deviations
32
+ - the personality traits (under `nurix`): the six-trait reading of §4–§7 — density, pace, edge, depth, texture, tone — naming only what differs from neutral, written into the design-values block so the library compiles it
32
33
 
33
34
  When a user is present, pause here **once** for confirm-or-redirect — a wrong pick costs one message now instead of a full build. Autonomous runs proceed. Either way the block goes to workspace memory — `record` it as decision lines heading this run's choices, with the app as context.
34
35
 
35
36
  ## Outputs
36
37
 
37
- - `design.md` (project fork: chosen package + switch line + provenance + brief bindings; deviations accrue as they are recorded) — pushed as the workspace preference row
38
+ - `design.md` in the design folder (`packages/common/` at the base of a multi-package workspace, `src/common/` in a single-package repo) — the project fork: chosen package + switch line + provenance + brief bindings; deviations accrue as they are recorded — pushed as the workspace preference row
38
39
  - `product.md` written/updated and pushed
39
40
  - the identity pin and the preview block recorded
40
41
  - the chosen package's full design.md held in context
@@ -4,25 +4,31 @@ The project ships with its project-local artifacts — `design.md` (the resolved
4
4
 
5
5
  ## Tier 1 — fails closed
6
6
 
7
- Every check a binary predicate. Run the validator (`node scripts/validate-design-md.mjs <project design.md> --mode ship`) plus the build itself; all of these must hold:
7
+ Every check a binary predicate. Run the validator (`node scripts/validate-design-md.mjs --project . --mode ship`) plus the build itself; all of these must hold:
8
8
 
9
9
  - **No placeholder text or scaffold stubs** anywhere (lorem, TODO, "Coming soon", empty `href="#"` walls).
10
10
  - **Data plausibility** against the corpus's declared invariants: aggregates reconcile with their visible rows; legal ranges hold; no degenerate repetition in visible rows (surname clusters, identical amounts).
11
11
  - **Accessibility floor, mechanical**: contrast computed on the emitted token pairs in *both* themes; focus visible on every interactive element; `prefers-reduced-motion` respected.
12
12
  - **Every declared surface reachable** — each surface in the structure doc has a live route/nav path.
13
- - **`design.md` present at the repo base** and the token artifact recompiles from it to a byte-match (the validator's drift check).
13
+ - **The project fork resolves** — `--project .` finds `design.md` at `packages/common/` in a multi-package workspace or `src/common/` in a single-package repo, and a copy anywhere else fails the resolution — and the token artifact recompiles from it to a byte-match (the validator's drift check).
14
14
  - **The pipe checks**:
15
15
  - the token artifact carries 100% coverage and components consume tokens — no raw color/size literals in component code;
16
16
  - fonts bound to installed packages under registered family names (a family that never resolves is a fail);
17
17
  - every authored token group reaches a named consumer — an emitted ramp nobody consumes is a fail;
18
18
  - the emitted CSS actually compiles;
19
19
  - charts and status surfaces consume the package's tokens (a dark dashboard with hardcoded light charts fails here).
20
+ - **The library reach checks** (`primitives: nurix`):
21
+ - `personality.css` recompiles from the design.md's personality block to a byte-match (the validator's `dmv-12`); a design.md with no block fails nothing, and its `dmw-05` warn appears in the ship report;
22
+ - no `data-theme` selector or attribute in app CSS or HTML — the theme is the `.dark` class;
23
+ - no `duration-<n>` utility, no `transition-all`, and no literal `ms` inside a transition or animation declaration in app code — the seam carries timing;
24
+ - no `<time` element outside `<Timestamp>`; no `truncate` or `line-clamp-` utility (the `clip` family replaces them);
25
+ - every interactive element under 24px in either rendered dimension carries a `hit-area` utility.
20
26
 
21
27
  A Tier-1 failure blocks the ship; fix and re-run. Binary phrasing is the contract — anything that would need "use sparingly" grading does not belong in this tier.
22
28
 
23
29
  ## Tier 2 — flags, never gates
24
30
 
25
- Sweep `data/tells.csv` (the operator tell list), at this step only, plus the motion tells (`transition: all`; `ease-in` on an entrance; animation attached to a keyboard-triggered action). Flags cannot fail the build and trigger no in-run judging: each is **fixed or dismissed with one recorded line** through `record`, and every flag appears in the ship report for the human's eyes — numbers point eyes; they do not replace them. The validator may run this sweep warn-only after compose-step edits; nothing new ever fails the build mid-composition.
31
+ Sweep `data/tells.csv` (the operator tell list), at this step only, plus the motion tells (`transition: all`; `ease-in` on an entrance; animation attached to a keyboard-triggered action). Under `nurix`, the reach tells join them: a `p-*` / `gap-*` literal on a collection container; a relative-time formatter in app code; a `fetch` inside an effect feeding a `<Select>`; a repeated-row container without `data-mode="inline"`; a `success` / `warning` / `info` hue declared anywhere but `design.md`. Flags cannot fail the build and trigger no in-run judging: each is **fixed or dismissed with one recorded line** through `record`, and every flag appears in the ship report for the human's eyes — numbers point eyes; they do not replace them. The validator may run this sweep warn-only after compose-step edits; nothing new ever fails the build mid-composition.
26
32
 
27
33
  ## The ship report
28
34