Repository navigation
DESIGN.MD imports and pitfalls #8842
debuggerpk
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Open Design Brands — field report for new design system builds
1. The mental model
The Brands pipeline is one-directional and regeneration-happy:
brandToDesignMd(brand). A fact that isn't in the rendered output does not exist for them.2. What the engine owns vs. what you own
Engine-owned — rewritten on every finalize, never hand-edit:
DESIGN.md,guide.md,system/seed.json,system/variables*.css,system/tokens.*.json,system/theme.json,system/BRAND-SYSTEM.md,system/artifacts/*, the store body.You-owned — finalize never touches:
brand.json(it derives from this),BRAND.md(authored record; the engine reads it when regenerating guide.md — the pipeline's only authored preference),preview/*,ui_kits/*,colors_and_type.css, plans/READMEs.3. What the system overrides (the wipe list — all verified)
tokensmirror)seedSEED_FIELD_TYPESwhitelists exactly 20 antd fields (colorPrimary…motion); proven with a probe keycolors[]roles (primitive,staterows)The one slot everyone assumes is an escape hatch —
brand.json.seed— is not. BRAND-SYSTEM.md calls it "persistent overrides"; that's true only for the 20 whitelisted antd fields.4. The sanctioned carriers (survive finalize and reach downstream)
brand.json.description— the load-bearing channel. The parser passes it through verbatim (isStr(o.description) ? o.description : ""— no trim, no newline collapsing, no length cap) and the generator renders it as markdown at the top of the body, before the five derived sections. This carries the rule sections (Context / Components / Motion / Anti-patterns) and the full token architecture (## Token scales: color architecture table, spacing, radius/icons/controls, type scale, elevation, opacity ramp).typography[].notes— rendered verbatim per font slot (weights, mono + tabular-nums rules).layout.postureRules— rendered as posture lines (radius, card-first, runtime axes, rem rule).seed— the 20 antd fields only; the sanctioned home for engine-level re-theme values (primary color, radii, fonts). This is why re-themes are durable.colors[]— keep exactly 7 canonical roles; scales/architecture do not go here (filtered), they go in description.Rule of thumb: if knowledge must survive finalize and reach another session, it must sit inside one of these five carriers. Anything else is session memory and evaporates.
5. Hidden limitations & the Claude Design alignment
brandToDesignMd(brand)hardcodes exactly five##sections (Color Palette, Typography, Voice & Tone, Imagery, Layout). No brand field exceptdescriptioncan add a heading.tools connectors design-system-package-audit --path .) runsvalidateDesignRules, which requires##-level headings matching eight groups — context/product, color/palette, typography/type, spacing/layout, component, motion/interaction, voice/brand, anti-pattern (substring, lowercase;###doesn't count) — plus an 800-byte floor. Out of the box the generator cannot emit four of those headings. The audit's own code calls this a "Claude Design-style package" check: it expects a rich authored rules document, while the extractor emits a thin spec. That mismatch is engine-internal; authoring the four rule sections intodescriptionis the sanctioned bridge. Every new brand hits this — plan for it.finalizeitself re-registers the store. Don't build separate store-push machinery — a hand-rolled push fails withWORKSPACE_CONTEXT_REQUIRED; finalize already carries the authority.user:<name>) is exactly one markdown file. No CSS, no component files, no assets travel with a design system. A new project that gets "only the system" gets a specification, not a kit — components get rebuilt from spec, not picked. To make picking literal: seed the new project's Design Files with the token sheet + preview cards, or attach the repo as a linked code folder.6. Pitfalls (so you don't repeat them)
seedpasses anything through. Tested: unknown keys vanish; only 20 fields survive.row.sveltehid a 151-line subsystem) — and prefer the live app over stories (stories referenced icon names absent from the icon registry).color-schemeon<html>, Comfortable/Dense →data-density, localStorage applied pre-paint, tokens remap at:root, zero per-component dark logic. Insert idempotently with a marker comment; files-with-marker must equal files-in-scope (43/43 in the Rexun case).2px, express0.125rem. All CSS values in rem; semantic aliases only; raw hex never leaves:root.7. The playbook for a new client design system
brand.json— canonical fields only (description, colors[] ×7, typography + notes, layout + postureRules, seed ≤ 20 antd fields).descriptionimmediately as the complete markdown spec: the four audit-required rule sections (Context, Components, Motion, Anti-patterns) +## Token scaleswith the full architecture (color architecture table, spacing, radius/icons/controls, type scale with line-heights, elevation, opacity ramp). This one field is what makes the system un-mistakeable downstream.od brand finalize <brand-id>— DESIGN.md, guide.md, system/, store all derive.rgthe derived DESIGN.md for every authored heading; spot-diff derived tables against the source token sheet (zero drift).tools connectors design-system-package-audit --path .with fail-on-warnings; must beok:true, 0 errors, 0 warnings. Re-run after every mutation.preview/components-<family>-<name>.html), built from full component source, repo-exact tokens/geometry/a11y, <200 lines, rem everywhere, registry icons only.8. Known gaps — stop re-litigating these
showcase-plan.mdFeat/support star us #5). Until then:description.colors[]role whitelist blocks primitive/state rows. Until then: color architecture table indescription.description.All reactions