Back to home

Nook · AI Design System · 2026

Why production Vibe Coding cannot skip a Design System

Building Nook from 0 to 1 with AI agents taught me that a design system is no longer just a Figma library for designers—it is the guardrail and contract that keeps human–agent collaboration consistent past PR #100.

My role
Design system & front-end contracts
Timeline
2026 · Ongoing
Architecture
Upstream spec repo & guarded sync
Nook’s live design system site—pairing foundational color scales on the left with state-bound component contracts on the right.

01 / Origin

Impressing on the first 3 screens is easy. Holding together at PR #100 is not.

Building an evolving product with AI feels magical for the first three screens, yet by PR #100 the UI quietly slips into “AI slop”—invented grays, modal radii on book paper, and five disabled button styles. As Nathan Curtis notes, LLMs are probabilistic guessers; a design system is the deterministic contract that keeps output coherent.

In the AI era, a design system is no longer just a Figma library—it is the guardrail and contract that keeps human–agent collaboration consistent.

Production Vibe Coding is about sustained consistency, not a flashy first demo. Nook has locked down its style foundations and sync pipeline while keeping components lean—proving the contract on Button and Input before expanding on demand.

02 / Basic styles

One predictable naming grammar across color, type, border, radius, and space

The hard part of basic styles is never picking colors—it is letting teammates and AI deduce exact token names without memorizing docs. Adapted from Atlassian’s Foundation → Property → Modifier grammar, Nook ships an AI-ready basic styles system—click any tab, property, or token below to inspect its structure and base mapping:

Global formula
--nook · Foundation · Property · Modifiers (Role / Prominence / State)
background tokens 16
--nook-color-background-neutral-bold-hovered

Four naming rules for AI agents: why “human-readable” isn’t enough

Traditional design systems assume a human reader who can rely on visual context to resolve ambiguity. Coding agents only see DOM markup and token patterns. These four rules grew out of real Nook iterations, each paired with its underlying mechanism and practical boundary:

01

Align semantics to code, not canvas metaphors

Divider → border

In CSS, dividers are almost always rendered via border-top or border-bottom. Once an agent outputs border-bottom: 1px solid var(--nook-color-, the adjacent "border" token strongly biases completion toward border-* variables. Maintaining a separate divider group forces an extra conceptual hop and invites inconsistent mixing across long sessions.

LimitAgents can still follow a separate divider token when given full context or lint checks; merging simply lowers reasoning friction and default error rates.

02

Keep semantic roles mutually exclusive with no same-size gray zones

body vs label · 10px caption only

During code generation, agents only see DOM tags and copy—not rendered layout. When body-small and caption share 12px and differ only by visual feel, choices drift between screens. Splitting strictly by HTML role (static prose in body vs. interactive controls in label) and reserving caption exclusively for 10px corner metadata turns guesswork into a deterministic rule.

LimitA handful of edge-case labels can still be debatable, but the surface area for ambiguity shrinks dramatically.

03

Ban component-specific exceptions to stop pattern extrapolation

border-input → border-bold

LLMs are aggressive pattern extrapolators. Once a single exception like --nook-color-border-input exists, agents writing selects or cards naturally invent nonexistent tokens like --nook-color-border-select or --nook-color-border-card. Worse, referencing an undefined CSS custom property in var() fails silently at runtime instead of throwing a build error.

LimitA Stylelint unknown-custom-property rule can catch invented tokens in CI, but eliminating exceptions in the naming layer prevents the drift and rework at the source.

04

Omit default states to match pretraining priors

omit -default / -rest

Across public frontend codebases (plain CSS, Radix, Atlassian), default states overwhelmingly use the shortest form (e.g., --color-text) rather than fully expanded suffixes like --color-text-neutral-default-rest. As context decays in long sessions, models regress toward that prior and drop redundant suffixes. Omitting defaults consistently keeps names concise and aligned with natural model output.

LimitThis only works when omission is applied uniformly across the whole system—never omitting in some tokens while requiring -default in others. Its value is reducing drift in long sessions, not guaranteeing zero mistakes.

Reusable Prompt · Bootstrap your own AI-ready basic styles & token grammar
You are my Design System Architect. Help me design and scaffold a lean, AI-ready Basic Styles & Design Token system for my product.

Before generating files, ask me for: (1) my product CSS variable prefix (e.g. --app), (2) visual mood & neutral tint (warm / cool / pure), and (3) primary frontend stack.

Follow these strict naming and taxonomy rules:
1. Global Formula:
   --<prefix>-<foundation>-<property>-[role]-[prominence]-[state]
   - Two tiers only: Base scale (--<prefix>-ref-*) → Semantic token. Stop at the semantic layer; do not invent component-specific token layers prematurely.
   - Implicit default rule: omit default prominence, resting state, and neutral role where unambiguous. Never output a "-default" or "-rest" suffix.
   - Zero component leakage: never put component names (such as input, button, placeholder, card) into semantic roles or modifiers.

2. Five Core Foundations:
   - Color:
     * 5 Properties: text, icon, surface (non-interactive pages, modals & containers), background (interactive controls & local fills), border (shared by borders & dividers).
     * 6 Semantic Roles: neutral (default, omitted when unambiguous), inverse, information, success, warning, danger.
     * Prominence / Depth: subtlest, subtle, [default omitted], bold (use border-bold for crisp resting control borders instead of border-input); plus sunken for recessed surfaces (surface-sunken). Never borrow font-weight terms like semibold for colors.
     * States: [rest omitted], hovered, pressed, disabled, focused, selected. Keep background-disabled as a single unified token.
   - Typography: 4 non-overlapping semantic roles on a unified 3-step scale (large / [default omitted] / small) — heading (narrative serif), body (400 sans), label (500 sans for buttons & controls), caption (10px metadata only, zero overlap with body-small). Each composite token internally nests atomic font-family (narrative/interface) and font-weight (regular/medium/semibold) tokens.
   - Border: stroke width tokens (none 0px, [default] 1px, bold 2px focus ring); reuse color-border-* for all border and divider colors.
   - Radius: discrete scale grouped into Sharp & Subtle (none 0px, xsmall 2px, small 4px, medium 6px) and Surface & Pill (large 8px, xlarge 12px, xxlarge 16px, full 999px), with explicit rules on which surfaces lock to radius-none.
   - Space: 8px base grid (space-100 = 8px, positive 0 through 1000, optional negative offsets -025 through -400); forbid arbitrary pixel spacing.

3. Deliverables:
   - Output tokens.css with Base scales mapped cleanly to Semantic tokens.
   - Output a concise DESIGN-TOKENS.md documenting allowed mappings and explicit "do-not-use" prohibitions for AI coding agents.

03 / Core controls

Keep the component library lean: inspect a real Nook Button

Nook’s component library is intentionally small. Instead of wrapping dozens of speculative widgets, I proved the full standard on our highest-frequency control—Button—by wiring design rules, semantic tokens, and clean source together. Try switching variants and states below, or open the tabs to inspect the real rules, CSS tokens, and source code.

For humans — Interactive canvas & Token Inspector

Test real states, or switch to Inspect to float container & label tokens.

Default
Loading
Disabled
Focus

For AI Agents — Structured contract & source

Rules, strict enums, semantic CSS, and real source ready to import directly.

AI-ready contract
  • 7 styles only, with plain sealedConsolidated into 7 variants. Plain wraps covers and paper swatches while keeping focus/disabled unified—and is banned as a shortcut for regular buttons.
  • Dedicated disabled colors, no opacity hackDisabled reads neutral-disabled tokens instead of fading opacity, keeping contrast clean over warm paper and photos.
  • Clear 9-state priorityDisabled and Loading always win, blocking hover, clicks, and Enter/Space; Error overrides normal Focus.
  • Crisp on desktop, 44px on touchCompact 24/32px for mouse pointers, auto-expanded to 44px touch targets on mobile; instant state response without sluggish fades.

Input follows the same lean blueprint—split cleanly into standard forms, in-place album caption editing (preserving book typography while sharing focus and error states), and native file/checkbox handling.

04 / Spec-to-code sync

Bridge spec to code with guarded sync and incremental migration

A polished specification means nothing if updating a token still relies on copying and pasting CSS by hand. After a few iterations, docs and production code inevitably diverge. While an AI agent implemented the sync script itself, I set two strict engineering boundaries for the pipeline.

Upstream token sync & guardrail pipeline

7-step human-in-the-loop sync · Clear ownership at every node
Human action Automated check Automated step
Who
01Human · Designer
02Human · Trigger
03Auto · Decision
04Auto · Script
05Auto · CI & Preview
06Auto · Delivery
07Human · Sign-off
Action

Edit & confirm spec

Adjust colors or fonts in the design system, check them on the preview site, then merge to design system main.

Trigger sync on demand

No blind auto-push on every edit. Click the manual sync action on the Token page (or run locally) when ready.

Hash & risk check

Compare content hash and safety rules: skip copy-only edits; stop on deleted colors, font swaps, or hand edits.

Export CSS & open Issue

Generate Web App CSS tokens and lockfile, then automatically create (or reuse) a tracked Design Sync Issue.

Submit PR & Preview

Push the stylesheet to a PR targeting staging, run automated checks, and spin up a Preview deployment.

Deploy to Staging

After checks and Preview pass, merge into the fixed Staging environment and move the Issue to Review.

Verify Staging & release

Inspect affected screens on Staging in person; only after explicit approval is it released to Production.

Output
Approved spec (main)
Locked spec version
Safe diff → proceed
Stylesheet + Issue
Checks & Preview pass
Staging ready for review
Live in Production

Version locking + automatic safety stops

Design specs live in a dedicated upstream repo, while the product repo tracks the exact version and content fingerprint it consumes. Copy-only upstream edits are skipped automatically. Any removed token, manually edited output file, or font-family change halts the sync for manual review—preventing a font rename from shipping without its font files and silently falling back to system fonts.

Incremental migration, never a full CSS rewrite

I set one non-negotiable rule: never rewrite the entire project’s CSS just to adopt a new design spec. Each migration scopes tightly to a concrete Issue (such as the bookshelf home and creation modal first), backed by visual baselines and rollback paths, while untouched screens keep running safely on legacy mappings.

05 / Evolution & restraint

Benchmarking AI-era best practices: where Nook stands and what comes next

While building Nook’s system, I studied Atlassian Design System (ADS) closely alongside DESIGN.md, shadcn/ui, and GitHub Primer. Measured against an AI Context Engine architecture, Nook’s foundation is already solid (semantic tokens, reverse bans, version-locked sync, copy/icon rules, and the Button/Input templates). The highest-leverage next step is not churning out forty components, but filling three prioritized gaps:

Priority Focus area Concrete implementation
P0 · Next From manual checks to automated lint & lean rules Use automated lint checks before commit to block raw hex colors, unapproved scales, and hand-rolled buttons—ending pixel-by-pixel manual reviews; distill visual rules, anti-patterns, and micro-interaction craft (inspired by Emil Kowalski) into DESIGN.md and a concise UI guide for AI.
P1 · Scale Base layout helpers & high-frequency overlays Adopt Atlassian-style lightweight spacing and surface helpers (Stack / Inline / Surface) to lock layout rhythm; follow shadcn’s transparent source pattern to ship Toast, Dialog, and Popover on demand while migrating older screens.
P2 · Maturity Automated a11y checks & design-code binding Add automated contrast and keyboard accessibility checks to tests, then connect Figma Code Connect for 1:1 mapping between Figma components and code properties as the library grows.

06 / Closing note

Everything is an experiment, you win or learn.

A favorite line from Silicon Valley Growth Hacking Notes. In the era of Vibe Coding, building an AI-ready design system has no ready-made playbook. Nook’s system is still exploring—starting with style foundations, safe sync, and lean Button/Input contracts rather than chasing perfection on day one. Every boundary we lock down leaves the product steadier than yesterday; there is quiet joy in every step forward.

Nook AI Design System image