@urbicon-ui/design 6.1.8

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.
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@urbicon-ui/design",
3
+ "version": "6.1.8",
4
+ "description": "The urbicon CLI — version-pinned design validation and design-manifest tooling for projects built with Urbicon UI. Wraps @urbicon-ui/design-engine for editor hooks and CI.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://codeberg.org/urbicon/ui.git",
9
+ "directory": "packages/design"
10
+ },
11
+ "homepage": "https://ui.urbicon.de",
12
+ "bugs": "https://codeberg.org/urbicon/ui/issues",
13
+ "keywords": [
14
+ "design-system",
15
+ "cli",
16
+ "linter",
17
+ "design-tokens",
18
+ "urbicon-ui",
19
+ "ai"
20
+ ],
21
+ "type": "module",
22
+ "bin": {
23
+ "urbicon": "./dist/cli.js"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "skill",
28
+ "templates",
29
+ "README.md"
30
+ ],
31
+ "sideEffects": false,
32
+ "scripts": {
33
+ "build": "bun build ./src/cli/index.ts --target node --outfile dist/cli.js",
34
+ "dev": "bun run --watch src/cli/index.ts",
35
+ "start": "bun run src/cli/index.ts",
36
+ "check": "tsc --noEmit",
37
+ "test": "vitest",
38
+ "test:run": "vitest run"
39
+ },
40
+ "dependencies": {
41
+ "@urbicon-ui/design-content": "6.1.8",
42
+ "@urbicon-ui/design-engine": "6.1.8"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "^6.0.3",
46
+ "@types/node": "^25.9.3",
47
+ "vitest": "^4.1.9"
48
+ },
49
+ "author": "Urbicon UI Team"
50
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: urbicon-design
3
+ description: Design verbs for projects built on Urbicon UI — onboard, adopt, compose, redesign, polish, critique, fix, retheme, audit, migrate. Each is a recipe over the four design planes (knowledge · judgment · memory · action) that reads the project's design.manifest.md, does the work through the Urbicon tools, and writes the decision back.
4
+ ---
5
+
6
+ # Urbicon design verbs
7
+
8
+ A use-case verb is a **recipe**, not a single tool call: it strings the Urbicon
9
+ knowledge (`get_pattern`, `get_css_reference`, `get_design_principles`), the
10
+ deterministic judgment (`validate_design` / `urbicon validate`, the rubric), and
11
+ the per-project memory (`design.manifest.md`) into one loop so generation does not
12
+ regress to a generic template.
13
+
14
+ **Same recipe text, two ways to run it.** Every verb ships both as an MCP prompt
15
+ (invoke it from any MCP client) and as one of these local recipe files. The body is
16
+ identical; pick whichever your harness exposes. Locally you can also print a recipe
17
+ with `urbicon verb <name>` (and list them with `urbicon verbs`).
18
+
19
+ ## Two invariants, every verb
20
+
21
+ 1. **Read the manifest first.** Start by recovering the project's intent and
22
+ decisions — `urbicon context`, or read `./design.manifest.md` directly: paradigm,
23
+ theme, density, the Product Intent (audience, voice, references, anti-references),
24
+ the Token Overrides, the Pattern Usages, and the recorded ADRs. This is the
25
+ difference between "consistent with *this* product" and merely "generic".
26
+ 2. **Write the decision back.** End by persisting any state you changed — refresh
27
+ the Pattern Usages (`urbicon sync-manifest`), append an ADR for a deliberate
28
+ deviation (`urbicon record-decision`), or update the Product Intent / Token
29
+ Overrides. A choice the next session can't see will be silently undone.
30
+
31
+ ## Router — intent → verb
32
+
33
+ | If the user wants to… | Verb | Gate |
34
+ | --- | --- | --- |
35
+ | Start a greenfield project, set its design identity | `onboard` | — |
36
+ | Bring an existing codebase under the design system | `adopt` | — |
37
+ | Build a new page or component from a brief | `compose` | correctness + slop + rubric |
38
+ | Rework an existing page that feels wrong | `redesign` | correctness + slop + rubric |
39
+ | Tighten a page that is already close | `polish` | slop-floor |
40
+ | Judge a page without changing it | `critique` | (assessment only) |
41
+ | Repair broken tokens / `dark:` / `focus:` / z-index | `fix` | correctness |
42
+ | Rebrand the system (colour, type, density) | `retheme` | correctness over affected files |
43
+ | Check consistency across the whole app | `audit` | (assessment over n pages) |
44
+ | Roll out a pattern or library change everywhere | `migrate` | correctness per file |
45
+
46
+ When the intent is ambiguous, prefer the **narrowest** verb that fits: `polish`
47
+ before `redesign`, `fix` before `compose`. Escalate only if the narrow verb's
48
+ diagnosis shows the problem is bigger than its remit.
49
+
50
+ ## The tools a recipe leans on
51
+
52
+ - **Knowledge** — `find_components`, `get_component`, `get_pattern`, `get_recipe`,
53
+ `get_css_reference`, `find_icons`, `get_design_principles` (add `as="rubric"` for
54
+ the 8-criterion scorer; `topic="theming"` for a paradigm's token profile).
55
+ - **Judgment** — `validate_design(code, extraTokens?)` (remote) or `urbicon validate`
56
+ (local hook/CI): two axes, correctness (the blocking gate) + slop-floor (advisory).
57
+ - **Memory** — `urbicon context` / `record-decision` / `sync-manifest`, or your own
58
+ file tools on `./design.manifest.md` and its `*.history.ndjson` sidecar.
59
+
60
+ Use only real semantic tokens — never invent `bg-status-*`, `text-*-foreground`,
61
+ `bg-card`. When in doubt, `get_css_reference`.
@@ -0,0 +1,33 @@
1
+ # adopt — bring an existing codebase under the design system
2
+
3
+ **When:** a project already has UI but no (or a thin) `design.manifest.md`. Infers
4
+ the de-facto design language from the code and records it, surfacing the drift
5
+ between what the code does and what Urbicon expects.
6
+ **Gate:** none — this verb writes memory and reports; it doesn't rewrite UI.
7
+
8
+ 1. **Read what's already recorded.** `urbicon context`. Anything present (a chosen
9
+ paradigm, a prior ADR) constrains what you infer — don't contradict it silently.
10
+ 2. **Index the patterns.** `urbicon sync-manifest` to scan for
11
+ `data-design-pattern="…"` markers and (re)build the Pattern Usages section. If
12
+ the code has no markers yet, note which page archetypes you recognise and propose
13
+ adding markers (see `get_pattern` for the archetype names).
14
+ 3. **Infer the token reality.** Grep the source for the colour / spacing / radius
15
+ utilities actually in use. Sort them into: real Urbicon semantic tokens; project
16
+ tokens defined on top of Urbicon (→ candidates for `## Token Overrides`); and raw
17
+ palette / hallucinated tokens (→ drift to fix later with `fix`). Cross-check
18
+ names against `get_css_reference`.
19
+ 4. **Infer the intent.** From the components, copy, and density, draft a **Product
20
+ Intent** (audience, voice, references, anti-references) and confirm it with the
21
+ user — inference seeds it, the user ratifies it. Don't invent an audience the
22
+ code doesn't evidence.
23
+ 5. **Measure the drift.** Run `urbicon validate src/ --record` over the tree. The
24
+ correctness score is the gap to close; the slop-floor score is how generic it
25
+ reads today. `--record` writes the first history entry so future runs show the
26
+ trend.
27
+ 6. **Seed the manifest.** Write the inferred `## Product Intent`, the confirmed
28
+ `## Token Overrides`, and the synced `## Pattern Usages`. Append an ADR recording
29
+ that the manifest was *adopted from existing code* on this date (so later readers
30
+ know it's inferred, not designed-first).
31
+ 7. **Report.** Summarise: paradigm, intent, N project tokens, M patterns in use, and
32
+ the top correctness/slop offenders — with `fix` / `retheme` / `audit` as the
33
+ suggested follow-ups.
@@ -0,0 +1,29 @@
1
+ # audit — check design consistency across the whole app
2
+
3
+ **When:** a periodic or pre-release sweep — is the app still coherent, or has it
4
+ drifted? The flagship cross-page verb: it reasons over *many* surfaces via the
5
+ manifest usage-index, which no single-page or system-agnostic tool can do.
6
+ **Gate:** none — assessment over n pages. Change nothing; produce a drift report.
7
+
8
+ 1. **Context + index.** `urbicon context` for the intent and recorded decisions, then
9
+ `urbicon sync-manifest` so the Pattern Usages index reflects the current tree.
10
+ 2. **Validate the tree.** `urbicon validate src/ --json --record` over the whole app.
11
+ `--record` appends a drift entry to the history sidecar; `urbicon context` then
12
+ shows the correctness/slop trend over time — the measure of whether the app is
13
+ getting more or less generic.
14
+ 3. **Check each pattern cohort.** For every pattern in the usage-index, read the files
15
+ listed under it and confirm they actually follow that pattern's rules
16
+ (`get_pattern("<name>")`). A page marked `dashboard` that looks like a form is
17
+ drift.
18
+ 4. **Score a representative sample.** Pick the highest-traffic or most-divergent pages
19
+ and score them with `get_design_principles(as="rubric")`. Look for *spread* — wide
20
+ variance across pages is the consistency problem, even if each page passes alone.
21
+ 5. **Report drift, don't fix it.** Produce: the app-wide correctness/slop scores and
22
+ their trend; per-pattern conformance; the rubric spread; and a ranked list of the
23
+ worst offenders, each tagged with the verb that repairs it (`fix`, `polish`,
24
+ `redesign`, `retheme`).
25
+ 6. **Persist the finding.** Offer to append an ADR summarising the audit (date,
26
+ scores, top drift) so the next audit has a baseline to compare against — the
27
+ history sidecar plus an ADR make drift measurable, not anecdotal.
28
+
29
+ Output: the drift report. Recommend, but do not perform, the repairs.
@@ -0,0 +1,38 @@
1
+ # compose — design a new page or component from a brief
2
+
3
+ **When:** building something new. Runs the full generate → validate → judge →
4
+ synthesise loop so a single-shot answer can't regress to a generic template.
5
+ **Gate:** correctness (blocking) + slop-floor (advisory) + the rubric.
6
+
7
+ Do not skip steps. The value is in the loop, not any one generation.
8
+
9
+ 1. **Context.** `urbicon context` (or read `./design.manifest.md`) — honour the
10
+ paradigm, theme, density, the Product Intent (design *toward* its voice and
11
+ references, *away* from its anti-references), and the recorded ADRs. Then, if a
12
+ composition pattern fits the brief, `get_pattern("<name>")` (settings-page,
13
+ dashboard, form-page, tab-navigation, onboarding-guide, planning-board) and
14
+ follow its layout, component-selection, and behavioural rules.
15
+ 2. **Ground rules.** `get_design_principles` for the heuristics,
16
+ `get_design_principles(topic="theming")` for the paradigm's token profile, and
17
+ `get_css_reference` for the exact token names. `find_components` /
18
+ `suggest_implementation` to pick the right primitives rather than reinventing them.
19
+ 3. **Generate variants.** Produce a few genuinely different implementations (2–5;
20
+ default 3), each a distinct compositional approach *within* the paradigm — vary
21
+ density, hierarchy emphasis, and the one signature moment. Do not let them
22
+ converge. Use only real semantic tokens (no `bg-status-*`, no `*-foreground`, no
23
+ invented names); if the project defines its own, they're in `## Token Overrides`.
24
+ 4. **Validate.** Run `validate_design` (or `urbicon validate`) on every variant. Fix
25
+ each error and warning. A variant that can't reach a clean correctness score is
26
+ disqualified. Note each one's slop-floor score — lower is more generic.
27
+ 5. **Judge.** `get_design_principles(as="rubric")` and score each survivor /40.
28
+ Prefer a panel: judge correctness, hierarchy, paradigm-fidelity, and
29
+ distinctiveness as separate lenses, not one gut number.
30
+ 6. **Synthesise.** Pick the winner, then graft the best ideas from the runners-up.
31
+ Run `validate_design` once more on the merged result — it must come back clean.
32
+ 7. **Record.** If the page follows a pattern, add `data-design-pattern="<name>"` to
33
+ its root and refresh Pattern Usages (`urbicon sync-manifest`). Append an ADR
34
+ (`urbicon record-decision`) for any deliberate deviation from a pattern or
35
+ principle.
36
+
37
+ Output the final code, then a one-line, honest rationale per major choice — name the
38
+ trade-offs.
@@ -0,0 +1,27 @@
1
+ # critique — judge a page without changing it
2
+
3
+ **When:** the user wants an assessment, a review, or a prioritised punch-list — not
4
+ edits. Produces a diagnosis you (or `redesign` / `polish` / `fix`) can act on later.
5
+ **Gate:** none — this verb only assesses. Change nothing.
6
+
7
+ 1. **Context.** `urbicon context` for the paradigm and Product Intent — a critique
8
+ is *against this project's* identity, not a generic best-practices checklist.
9
+ 2. **Run the full stack.** On the page's code:
10
+ - **Correctness** — `validate_design` (or `urbicon validate`): errors and warnings
11
+ are deterministic defects (raw colours, `dark:`/`focus:` misuse, hardcoded
12
+ z-index, broken dynamic classes, hallucinated tokens).
13
+ - **Slop-floor** — the same run's advisory notes: where it reads generic.
14
+ - **Taste** — `get_design_principles(as="rubric")` and score /40 across the eight
15
+ criteria.
16
+ 3. **Prioritise.** Order the findings by impact, not by severity label: a single
17
+ broken hierarchy outranks five cosmetic nits. Tie each to the rubric criterion or
18
+ linter rule it comes from, so the fix is unambiguous.
19
+ 4. **Recommend the verb.** For each cluster, name the right follow-up — `fix` for
20
+ correctness, `polish` for slop, `redesign` for a low rubric score — so the user
21
+ can act in one step.
22
+ 5. **Offer to record.** If the critique surfaces a *systemic* gap (not a one-page
23
+ issue), offer to append an ADR or open it as drift in the manifest. Don't write
24
+ without asking — critique's contract is read-only.
25
+
26
+ Output: the two scores (correctness · slop-floor), the rubric /40 with the two
27
+ weakest criteria called out, and the prioritised fix-list with a verb per item.
@@ -0,0 +1,29 @@
1
+ # fix — repair correctness defects
2
+
3
+ **When:** the linter's blocking gate is red — raw Tailwind colours, `dark:` overrides,
4
+ `focus:` instead of `focus-visible:`, hardcoded z-index, broken dynamic classes, or
5
+ hallucinated tokens. Mechanical, behaviour-preserving corrections.
6
+ **Gate:** correctness — every error and warning must clear.
7
+
8
+ 1. **Context.** `urbicon context` — so a token you're tempted to "fix" that is
9
+ actually a declared project token (in `## Token Overrides`) is left alone. Pass
10
+ those as `extraTokens` to `validate_design`; `urbicon validate` reads them from the
11
+ manifest automatically.
12
+ 2. **Enumerate.** Run `validate_design` (or `urbicon validate`) and list every
13
+ **error** and **warning** with its rule id and location. Ignore the slop-floor
14
+ notes here — that's `polish`.
15
+ 3. **Map each to its correct token.** `get_css_reference` for the real names:
16
+ - raw palette (`bg-red-500`) → the semantic intent (`bg-danger`, `text-on-primary`).
17
+ - `dark:` override → delete it; semantic tokens handle dark mode via `light-dark()`.
18
+ - `focus:` → `focus-visible:`.
19
+ - hardcoded z-index → a `z-[var(--z-*)]` token.
20
+ - hallucinated token (`bg-status-danger`, `text-*-foreground`) → the real one, or a
21
+ `## Token Override` if the project genuinely defines it.
22
+ 4. **Apply and re-validate.** Make the substitutions, change nothing else, and run the
23
+ linter again. Repeat until correctness is clean. Behaviour and layout must be
24
+ identical — this verb does not redesign.
25
+ 5. **Record only a systemic fix.** A scattered cleanup needs no ADR. If you
26
+ discovered the project legitimately needs a token, add it to `## Token Overrides`
27
+ (so it stops being flagged) and note why.
28
+
29
+ Output the diff and confirm a clean correctness score.
@@ -0,0 +1,30 @@
1
+ # migrate — roll out a pattern or library change everywhere
2
+
3
+ **When:** a composition pattern, component API, or library convention changed and
4
+ every site of it must move in lockstep — e.g. "the settings-page pattern now uses
5
+ tabs" or "Card lost its `elevated` prop".
6
+ **Gate:** correctness per file — each migrated file must pass before the next.
7
+
8
+ 1. **Context.** `urbicon context` — the manifest's decisions tell you which
9
+ conventions are deliberate (don't migrate away from a recorded ADR without
10
+ superseding it).
11
+ 2. **Pin the before/after.** State the exact change: old construct → new construct.
12
+ If it's a pattern change, re-read both via `get_pattern`; if a component API change,
13
+ `get_component` for the new contract.
14
+ 3. **Find every site.** `urbicon sync-manifest`, then use the Pattern Usages index
15
+ (for pattern changes) and a grep of the old construct (for API/markup changes) to
16
+ enumerate the files. Report the count up front — a silently partial migration is
17
+ worse than none.
18
+ 4. **Transform file by file.** Apply the change to one file, run `validate_design` /
19
+ `urbicon validate`, and only then move on. Keep each file's diff minimal and
20
+ behaviour-preserving. If a file resists the mechanical transform, flag it for
21
+ manual `redesign` rather than forcing it.
22
+ 5. **Re-index and validate the whole.** `urbicon sync-manifest` again so the index
23
+ reflects the new reality, then `urbicon validate src/ --record` for a clean
24
+ end-state baseline.
25
+ 6. **Record the migration.** Append an ADR: what changed, why, how many files moved,
26
+ and any deliberately skipped (with the reason). The next person needs to know the
27
+ migration is complete and where the exceptions are.
28
+
29
+ Output: the file count, the per-file pass status, and any sites deferred to manual
30
+ follow-up.
@@ -0,0 +1,33 @@
1
+ # onboard — set a greenfield project's design identity
2
+
3
+ **When:** a new project with no `design.manifest.md` yet. Establishes the target
4
+ identity and the enforced intake decisions, so every later verb has an anchor.
5
+ **Gate:** none — this verb writes memory, it doesn't generate UI.
6
+
7
+ Run a short interview, then seed the manifest. Do not skip the interview: a manifest
8
+ with only defaults gives later verbs nothing to be consistent *with*.
9
+
10
+ 1. **Check for an existing manifest.** `urbicon context` (or look for
11
+ `./design.manifest.md`). If one already exists with real intent, stop and suggest
12
+ `adopt` or `audit` instead — onboarding twice overwrites a considered identity.
13
+ 2. **Interview the product intent.** Ask the user — one question at a time, accept
14
+ terse answers — for:
15
+ - **Audience:** who uses this, their context, constraints, expertise.
16
+ - **Voice:** three adjectives (e.g. *calm, precise, trustworthy*).
17
+ - **References:** one or two products whose feel to move toward.
18
+ - **Anti-references:** the generic defaults to avoid (e.g. "Bootstrap admin").
19
+ 3. **Settle the intake decisions.** Pick a **paradigm** (call
20
+ `get_design_principles(topic="theming")` to see the profiles), a **theme**, and a
21
+ **density**. Explain the trade-off in one line each; default to Minimal /
22
+ default / comfortable if the user is unsure.
23
+ 4. **Seed the manifest.** Write `./design.manifest.md`: the frontmatter
24
+ (`paradigm` / `theme` / `density`), and the `## Product Intent` section with the
25
+ interview answers. `urbicon` writes a scaffold on first command, or author the
26
+ file directly — keep the section headings exactly (`## Product Intent`,
27
+ `## Token Overrides`, `## Pattern Usages`, `## Design Decisions`).
28
+ 5. **Record the founding decision.** Append one ADR capturing *why* this paradigm
29
+ and voice (`urbicon record-decision --title "…" --decision "…" --rationale "…"`).
30
+ It is the reference the team — and the next session — argues against.
31
+ 6. **Hand off.** Tell the user the identity is set and point them at `compose` for
32
+ the first page. Confirm the manifest parses: `urbicon context` should echo the
33
+ intent back.
@@ -0,0 +1,25 @@
1
+ # polish — tighten a page that is already close
2
+
3
+ **When:** the structure is right but it reads a little generic — uniform spacing, a
4
+ default font, low-contrast text, a magic-number size. Small targeted fixes, no
5
+ rebuild.
6
+ **Gate:** slop-floor (the advisory "looks generic" axis) — and never regress
7
+ correctness.
8
+
9
+ 1. **Context.** `urbicon context` for the Product Intent — polish moves the page
10
+ *toward* its voice, not toward your taste.
11
+ 2. **Find the slop.** Run `validate_design` (or `urbicon validate`) and read the
12
+ **slop-floor** findings specifically (the advisory notes): generic font, uniform
13
+ spacing/weights, identical cards, grey-on-colour, animated dimensions,
14
+ magic-number sizes, small touch targets, emoji-as-icon, and so on.
15
+ 3. **Fix the smallest things that raise the slop-floor score.** One change at a time;
16
+ keep each reversible. Reach for the design system's real tokens and scale steps —
17
+ `get_css_reference` for names — rather than ad-hoc values. Do **not** restructure;
18
+ if a finding needs structural change, that's `redesign`, not `polish`.
19
+ 4. **Re-validate.** Run the linter again. The correctness score must not drop; the
20
+ slop-floor score should rise. Stop when the remaining findings are deliberate.
21
+ 5. **Record only if it's a rule.** A one-off tweak needs no ADR. If you set a
22
+ repeatable convention (e.g. "stat tiles use `surface-elevated`, not a border"),
23
+ append an ADR so the next page inherits it.
24
+
25
+ Output the diff (or the changed snippets) and the slop-floor score before → after.
@@ -0,0 +1,29 @@
1
+ # redesign — rework an existing page that feels wrong
2
+
3
+ **When:** a page exists but underperforms — flat, generic, off-identity. Diagnoses
4
+ first, then fixes exactly what the diagnosis flags, preserving behaviour.
5
+ **Gate:** correctness (blocking) + slop-floor (advisory) + the rubric.
6
+
7
+ A diagnosis-first loop — resist the urge to rebuild from scratch.
8
+
9
+ 1. **Context.** `urbicon context` (or read `./design.manifest.md`) to recover the
10
+ paradigm, theme, Product Intent, and prior decisions. Read the current
11
+ implementation of the page in question.
12
+ 2. **Diagnose.** Run `validate_design` (or `urbicon validate`) on the current code,
13
+ then `get_design_principles(as="rubric")` and score the page /40. Your revision
14
+ targets are **every linter finding** (correctness *and* slop-floor) plus the
15
+ **two lowest-scoring rubric criteria** — nothing else. Write the targets down.
16
+ 3. **Generate variants.** Produce a few options (2–5; default 3) that fix exactly
17
+ those weaknesses. Preserve the page's behaviour, data flow, and overall structure;
18
+ change only what the diagnosis flagged. Use only real tokens (project tokens are
19
+ in `## Token Overrides`).
20
+ 4. **Validate.** Run the linter on each; fix every error and warning.
21
+ 5. **Judge.** Re-score each variant with the rubric. A redesign that does not beat
22
+ the original on its target criteria is not shippable — say so and iterate.
23
+ 6. **Synthesise.** Merge the best result, then run `validate_design` once more — it
24
+ must come back clean.
25
+ 7. **Record.** Append an ADR for any deliberate deviation (`urbicon record-decision`);
26
+ refresh Pattern Usages (`urbicon sync-manifest`) if pattern usage changed.
27
+
28
+ End with a before/after table of the targeted criteria (old score → new score), then
29
+ the final code and a one-line, honest rationale per major change.
@@ -0,0 +1,29 @@
1
+ # retheme — rebrand the system across every surface
2
+
3
+ **When:** the design language itself changes — new brand colour, type, density, or
4
+ paradigm — and it must propagate everywhere consistently. The flagship verb: only
5
+ possible because there's a real token system plus a manifest usage-index to drive it.
6
+ **Gate:** correctness over every affected file.
7
+
8
+ 1. **Context + scope.** `urbicon context` for the current paradigm, theme, and
9
+ `## Token Overrides`. State precisely what's changing and what's staying — a
10
+ retheme that touches everything is a rewrite, not a rebrand.
11
+ 2. **Decide at the right layer.** `get_design_principles` includes a change-decision
12
+ tree: a colour shift is usually a **semantic-token** remap, not a per-component
13
+ edit. Change the foundation/semantic layer (or the project's `## Token Overrides`),
14
+ not 200 call-sites — that's the whole point of the token architecture.
15
+ 3. **Update the source of truth.** Apply the token changes once at the layer you
16
+ chose, and update `## Token Overrides` in the manifest so `validate` accepts the
17
+ new vocabulary and rejects the old.
18
+ 4. **Find every affected surface.** Use the manifest's Pattern Usages and a grep of
19
+ the changed token names to list the files that actually render them. The
20
+ usage-index is what makes "everywhere" tractable instead of a guess.
21
+ 5. **Propagate and validate per file.** For each affected file, apply the remap and
22
+ run `validate_design` / `urbicon validate`. The gate is per file: none may ship
23
+ with a stale or raw token. `urbicon validate src/ --record` at the end captures the
24
+ post-retheme drift baseline.
25
+ 6. **Record the rebrand.** Append one ADR describing the change, the layer it was made
26
+ at, and the old→new token mapping — the migration note future readers need.
27
+
28
+ Output: the layer-level change, the list of propagated files, and a clean
29
+ correctness score across all of them.
@@ -0,0 +1,84 @@
1
+ <!-- urbicon:start — Urbicon UI agent context. Managed by `urbicon init`: it inserts and
2
+ updates everything between these two markers, so edit *outside* them (or run `init` again
3
+ to refresh). Pasting this by hand? Keep the markers if you want `init` to manage it later;
4
+ delete them if you don't. -->
5
+
6
+ ## Urbicon UI
7
+
8
+ This project builds its UI with [Urbicon UI](https://ui.urbicon.de) — Svelte 5 + Tailwind 4
9
+ components on a token-based design system. **Compose from the system; don't hand-roll UI or
10
+ invent styles.** The `urbicon` CLI (a devDependency, run as `bunx urbicon <command>`) puts the
11
+ design system's knowledge, linter and memory at your fingertips — **version-matched to the
12
+ library this project installed**, so what it tells you is true of the code you actually have.
13
+
14
+ ### Tools — the `urbicon` CLI
15
+
16
+ - **Discover & read components** (before you compose):
17
+ - `urbicon find <query>` — fuzzy-search the catalog, e.g. `urbicon find "date range"`.
18
+ - `urbicon get-component <slug>` — a component's real API: props, variants, examples
19
+ (`--section api|examples|variants|slots|full`).
20
+ - **Validate** what you generate:
21
+ - `urbicon validate <path>` — lint markup against the design rules; fix every error.
22
+ - **Read & record design intent** (the project's memory):
23
+ - `urbicon context` — the design manifest: paradigm, voice, decisions. Read it first.
24
+ - `urbicon record-decision …` — log a deliberate design choice so the next session sees it.
25
+ - `urbicon sync-manifest` — re-index pattern usages from the code.
26
+ - **Whole-task recipes** — `urbicon verbs` / `urbicon verb <name>` (also a `/`-skill,
27
+ `urbicon-design`, if installed).
28
+
29
+ Beyond what the CLI prints, the hosted knowledge lives at <https://ui.urbicon.de> (and the
30
+ `urbicon-ui` MCP server, if your client has it connected). Both serve **latest** — when it
31
+ disagrees with the local CLI, **trust the CLI**: it matches this project's installed version.
32
+
33
+ ### How to work — the design loop
34
+
35
+ 1. **Read the intent** — `urbicon context`. This is what keeps output consistent with *this*
36
+ product instead of generic.
37
+ 2. **Discover** — `urbicon find` / `get-component` for the right component and its real API.
38
+ 3. **Compose** from real components + semantic tokens (rules below).
39
+ 4. **Validate** — `urbicon validate`; fix every correctness error before shipping. (Slop notes
40
+ are advisory — raise them when it's cheap.)
41
+ 5. **Write the decision back** — `urbicon record-decision` for a deliberate deviation. What the
42
+ next session can't see, it will silently undo.
43
+
44
+ For a whole task, pick a **verb** (a recipe over that loop): `compose` (new page) ·
45
+ `redesign` (rework) · `polish` (tighten) · `fix` (repair tokens) · `critique` / `audit` (judge
46
+ without changing) · `retheme` / `migrate` (roll a change out). Prefer the narrowest that fits.
47
+
48
+ ### Hard rules — the linter enforces these
49
+
50
+ **Import from the package root only** — never a deep/internal path:
51
+
52
+ ```ts
53
+ import { Button, Card, Dialog } from '@urbicon-ui/blocks'; // ✓
54
+ // import Button from '@urbicon-ui/blocks/primitives/Button/Button.svelte'; // ✗
55
+ ```
56
+
57
+ **USE semantic tokens** (the canonical set; `urbicon get-component` shows them in context):
58
+
59
+ - Surface — `bg-surface-base` / `-elevated` / `-overlay`
60
+ - Text — `text-text-primary` / `-secondary` / `-tertiary`
61
+ - Border — `border-border-subtle` / `-default`
62
+ - Intent — `bg-primary`, `text-primary`, `bg-primary-subtle` (`primary` `secondary` `success` `warning` `danger` `neutral`)
63
+ - Elevation / motion / layer — `shadow-[var(--blocks-shadow-sm)]`, `duration-[var(--blocks-duration-fast)]`, `z-[var(--z-modal)]`
64
+
65
+ **NEVER:**
66
+
67
+ - `dark:` — semantic tokens already switch via CSS `light-dark()`.
68
+ - Hardcoded colours (`bg-white`, `text-neutral-900`, `bg-blue-500`) or invented tokens (`bg-card`, `text-*-foreground`).
69
+ - `focus:` — always `focus-visible:` (keyboard-only rings).
70
+ - Hardcoded `z-index`, `cubic-bezier`, or duration values.
71
+
72
+ **Off-palette looks** (brand colour, glass, translucent overlay) → register a **preset** at the
73
+ app root and reference it by name; never force colours with inline `!` overrides:
74
+
75
+ ```svelte
76
+ <BlocksProvider presets={{ Button: { brand: { slotClasses: { base: 'bg-[var(--brand)] text-white' } } } }}>
77
+ <Button preset="brand">Go</Button>
78
+ </BlocksProvider>
79
+ ```
80
+
81
+ **Svelte 5** — `$props()` not `export let`; `{#snippet}` / `{@render}` not `<slot>`; callback props
82
+ (`onValueChange`) not `createEventDispatcher`; lowercase DOM events (`onclick`).
83
+
84
+ <!-- urbicon:end -->
@@ -0,0 +1,26 @@
1
+ # Urbicon UI design gate — fail the build when generated/edited markup drifts
2
+ # from the design rules. Copy into .github/workflows/, or merge the `design` job
3
+ # into an existing workflow. Requires @urbicon-ui/design in devDependencies.
4
+ #
5
+ # Using npm/pnpm + Node instead of Bun? Swap the setup-bun step for setup-node +
6
+ # your install, and `bunx` for `npx` — the `urbicon` bin is plain Node-runnable.
7
+ name: Design Gate
8
+
9
+ on:
10
+ pull_request:
11
+ push:
12
+ branches: [main]
13
+
14
+ jobs:
15
+ design:
16
+ name: Design gate
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: oven-sh/setup-bun@v2
21
+ - run: bun install --frozen-lockfile
22
+ # Correctness is the blocking gate — deterministic, false-positive free.
23
+ # Add --slop-floor 40 to also gate the slop axis (a generic-looking page
24
+ # fails below the floor); add --record to append a drift point to the
25
+ # design.manifest.history.ndjson sidecar.
26
+ - run: bunx urbicon validate src/ --json
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Edit|MultiEdit|Write",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "urbicon hook"
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }