Vois tokens

From ommakes/Skills · View interactive version

Vois tokens is an AI agent skill from the GitHub repository ommakes/Skills. Rules and patterns for building UI with shadcn/ui, Tailwind v4 or StyleX, and Motion against a Vois design token set. Use when building components, pages, or any UI that should conform to the workspace design system. Covers spacing, typography, color tokens, component architecture, animation, access

How to use this skill

Skill file

Vois Tokens Skill

You are building UI for a design system that uses shadcn/ui, Tailwind v4 or StyleX, and Motion. This skill defines the rules, constraints, and patterns you must follow. Deviation from these rules produces inconsistent, unmaintainable UI.

Determine the styling engine before applying implementation-layer rules. Check package.json for tailwindcss vs @stylexjs/stylex, or look for existing stylex.create() usage; ask if genuinely ambiguous. Everything in this skill except references/tailwind-v4.md and references/stylex.md (and the handful of rules tagged engines in data/vois-rules.json) applies identically regardless of engine.

This SKILL.md is the entry point. Detailed rules for each topic live in references/ — read only the file(s) relevant to what you're building, not all of them every time.

Automated checks: a deterministic detector (scripts/detect.mjs) covers the mechanically-verifiable subset of the Pre-Submit Checklist below, plus ten lookalike checks from vois-components, and can run as a per-edit hook in Claude Code, Cursor, or Codex. The hook only nudges; scripts/check.mjs runs the same checks as a CI gate that fails a pull request on new findings, and eslint-plugin/index.mjs shows them in the editor as ESLint rules. See references/hooks.md for setup and which rules are covered.


Taste dials

If vois-router loaded VOIS.md, you'll be handed three 1-10 dials —

VARIANCE (layout asymmetry), MOTION (animation richness), DENSITY

(information per screen). They tune choices you'd otherwise make by default:

reaches for the tighter end of the 4/8 scale, low density the looser end.

feedback only; high motion means richer entrance/transition choreography.

is welcome. VARIANCE also gates DS-SLOP-001 (centered-hero default fires

above 4).

Dials never override hard rules. Every guardrail still applies at every dial

value: animations stay under the 300/500ms caps and honor prefers-reduced-motion

even at MOTION 10; contrast, touch targets, and spacing-on-the-4/8-scale hold

even at DENSITY 10. Dials choose within the allowed range; they never widen it.

If no dials were passed, assume the mid defaults (V/M/D = 5/4/5).


Before You Write Anything

  1. Check the component manifest. If a component exists for what you need, use it. Do not build a new one.
  2. Use the Vois token's name from Figma: its Web code syntax, in four layers (Global, Base, System, Component). The naming rules and the shadcn/ui mapping are in references/figma-variables.md [DS-TOKEN-002]. Check data/tokens.json for the value you need (spacing, type scale, color, elevation, icon size, breakpoints). If a token exists, use it. Do not hardcode anything. For a project that installs it, the registry's vois-tokens item (in the ommakes/Skills repo at registry/vois/tokens/vois-tokens.css) seeds defaults for the tokens that are Figma variables: colors in light and dark, radius, spacing, size, the grid and panel widths, and the five shadows. It does not hold type, motion, z-index or the other data/tokens.json values. If a vois_get_tokens tool is available, it serves your workspace's live values: prefer those.
  3. If neither exists, flag it — don't invent values or components.
  4. If a vois_record_rule_usage tool is available, call it after completing any UI work with the rule IDs you applied — this feeds the self-improving design system. If you violated a rule or found a rule unclear, include it with violated: true or ambiguous: true. If the tool isn't available, this step is optional telemetry — skip it and move on.

Reference Files

**Structured lookups — query these instead of scanning a whole reference file

when you already know the rule ID, category, or token you need:**

below, keyed by id, with category for filtering. Covers spacing,

typography, color, components/modals, css-architecture, elevation,

iconography, layout/responsive, surfaces, tailwind-v4, stylex, accessibility,

animation, grid and panels, data tables, marketing type and spacing, and

token layers and names. Query by id for a specific rule or by category for a whole

topic — don't read a references/*.md file just to re-derive a rule statement

that's already indexed here. Rules scoped to one styling engine carry an

engines field (["tailwind"] or ["stylex"]); no field means the rule

applies under either.

easing curves, elevation shadow tiers, icon sizes, breakpoints, contrast

minimums, touch target minimum). Rules are constraints; this file is values

— they're deliberately separate.

**Full reference files — read these when you need the accompanying code

examples, tsx/CSS snippets, and "why" explanation for a topic you're

building fresh, not just the bare rule text:**

| File | Read this when you're working on... | Rule prefix |

|---|---|---|

| references/figma-variables.md | Token names and layers (Global, Base, System, Component), where tokens live in CSS, brand slots, shadcn/ui variable mapping | [DS-TOKEN] |

| references/spacing.md | Any padding, margin, or gap value | [DS-SPACING] |

| references/typography.md | Headings, body text, type scale, fonts, copy punctuation | [DS-TYPOGRAPHY] |

| references/color.md | Color tokens, OKLCH, dark mode, light-dark() | [DS-COLOR] |

| references/components.md | Component variants, cva, modals/dialogs, accordions | [DS-COMPONENT] [DS-MODAL] |

| references/shape.md | Choosing corner shape: shape roles before numbers, fixed vs proportional vs elliptical vs capsule, large visual surfaces, continuous corners | [DS-SHAPE] |

| references/surfaces.md | Border radius, optical alignment, shadows vs. borders, image outlines, enter/exit choreography, icon transitions | [DS-SURFACE] |

| references/elevation.md | Shadow/elevation tiers, layers, state changes, dark mode, docked panels, modal scrim, z-index pairing. The element map is data/elevation-map.json | [DS-ELEVATION] |

| references/glass.md | Frosted glass (opt-in): where it goes, the three tiers, the -webkit- twin, blur tokens, fallback first, worst-case contrast, Figma setup, edge fade (tapering blur under sticky chrome) | [DS-GLASS] |

| references/iconography.md | Icon sizing, stroke width | [DS-ICON] |

| references/layout-and-responsive.md | Viewport height units, content-visibility, breakpoints, form, field, dialog widths, auto-growing textareas | [DS-LAYOUT] [DS-RESPONSIVE] [DS-LAYOUT-WIDTH] [DS-LAYOUT-FIELD] |

| references/grid.md | Grid classes, margins and gutters, how many columns a card grid holds, push and overlay side panels, the same on web, Flutter and native | [DS-GRID] [DS-PANEL] |

| references/data-tables.md | Table scroll owner, sticky header and first column, scrollbar styling, one-axis wheel lock, responsive table layout, scroll-region accessibility | [DS-TABLE] |

| references/tailwind-v4.md | Tailwind v3→v4 migration, container queries, arbitrary values | [DS-TAILWIND] |

| references/stylex.md | Projects using StyleX instead of Tailwind — build setup, defineVars/createTheme, variant composition | [DS-STYLEX] |

| references/animation.md | Timing, easing, reduced motion, Motion library usage, motion tokens | [DS-ANIMATION] [DS-MOTION-001] [DS-MOTION-002] [DS-MOTION-003] [DS-MOTION-004] [DS-MOTION-005] [DS-MOTION-006] [DS-MOTION-007]. For when to morph, see vois-patterns/references/motion.md; for morph specs, see vois-components/references/motion-morphs.md |

| references/accessibility.md | Touch targets, focus states, contrast, semantic HTML, what the code using a component must supply (tooltip, select, field errors, tabs, table, toast, switch, menu, loading) | [DS-A11Y] |

| references/overlays.md | Dialog structure, bottom sheets and full-screen forms on phones, dialog accessibility (name, first focus, return focus, Escape, dragging) | [DS-MODAL-004] to [DS-MODAL-007] [DS-RESPONSIVE-008] to [DS-RESPONSIVE-010] [DS-A11Y-019] to [DS-A11Y-023] |

| references/questionnaire-ui.md | Respondent-facing questionnaires: required labels, focus per question, reduced motion, sticky bar and keyboard, 56px option rows, poll and quiz results | [DS-A11Y-024] to [DS-A11Y-028] [DS-RESPONSIVE-011] to [DS-RESPONSIVE-013] |

| references/css-architecture.md | @theme setup, selector specificity, media queries | [DS-CSS] |

| references/marketing-type-and-spacing.md | Type scale and spacing for marketing surfaces only (display and h2 face, 56ch body, section gap ratios, gaps above 128px). Ratios are rules, pixel values are starting points | [DS-MKT] |

| references/anti-slop.md | Generic "AI-looking" layout/styling defaults (centered hero, AI gradient, three-card grids, eyebrow overuse, em dashes) — judgment-only, not indexed in data/vois-rules.json by design; read the file | [DS-SLOP] |

| references/hooks.md | Setting up the automated per-edit checker, managing ignores | [DS-HOOKS] |

Scoped loading: if you only need one or two rules (e.g. vois-router sent you here for a single component decision), query data/vois-rules.json for those rule IDs, or read only the matching reference file plus this SKILL.md if you need the examples too. You don't need the full set for a scoped task.

Source of truth: data/vois-rules.json is canonical for rule statements, severity, enforcement, and verification (how the rule can be checked: detector, spec, rendered or judgment; a detector rule also names the check in scripts/registry.mjs; a rendered rule needs the page open in a browser). references/*.md may restate a rule for readability and carries the code examples and rationale JSON doesn't — but if the two ever disagree, the JSON wins. scripts/check-rule-sync.mjs (repo root) checks in CI that every [DS-*] tag cited in references/*.md resolves to a real entry in vois-rules.json and vice versa, and scripts/check-verification.py checks that every detector named in the JSON exists in scripts/registry.mjs and every detector in the registry is named by a rule, so the two can't silently drift out of sync.


Pre-Submit Checklist

Run this regardless of which reference files you read — it's the universal gate before calling anything done.

Spacing

Typography

Color

Components

Surfaces

Animation

Glass (only when asked for)

Accessibility

Layout

Data tables (details in references/data-tables.md)

CSS

Marketing surfaces (only; see references/marketing-type-and-spacing.md)

Anti-slop (see references/anti-slop.md — read it before flagging; several are dial-gated)


Quick Reference

| Situation | What to do | Full detail |

|-----------|------------|---|

| Need a component | Check manifest first | references/components.md |

| Nesting rounded elements | outerRadius = innerRadius + padding | references/surfaces.md |

| Icon or button looks off-center | Align optically, not geometrically | references/surfaces.md |

| Card/container needs depth | Layered box-shadow, not a border | references/surfaces.md |

| Image needs a subtle edge | 1px outline, pure black/white at 0.1 opacity | references/surfaces.md |

| Page or section entering | Split into chunks, stagger ~100ms | references/surfaces.md |

| Icon swapping state (play/pause, like) | scale 0.25→1 + opacity + blur, exact values | references/surfaces.md |

| Asked for frosted glass | One of three tiers, opaque fallback first, -webkit- twin, chrome only | references/glass.md |

| Icon-only button | icon-sm / icon / icon-lg, one step up on touch, gap so targets never overlap, aria-label names the action; ghost or soft | references/iconography.md |

| Need a color value | Check data/tokens.json (color) first | references/color.md |

| Need a spacing value | Round to nearest 4 or 8 — see data/tokens.json (spacing_scale) | references/spacing.md |

| Need a font size | Use the type scale in data/tokens.json (type_scale) | references/typography.md |

| Need full-screen height | svh not vh | references/layout-and-responsive.md |

| Layout doesn't fit at a breakpoint | Reflow, then collapse, then hide — shrinking type is the last resort | references/layout-and-responsive.md |

| Text container width | max-width: 65ch (DS-TYPOGRAPHY-008) | references/typography.md |

| Two colors switching with theme | light-dark() | references/color.md |

| Animating accordion height | interpolate-size: allow-keywords | references/components.md |

| Building a modal | inert + overscroll-behavior + scrollbar-gutter | references/components.md |

| Value doesn't exist in tokens | Flag it, don't invent it | — |

| Animation feels off | Check transform-origin and slow it down | references/animation.md |

| Hover on mobile | Guard with @media (hover: hover) and (pointer: fine) | references/animation.md |

| Unsure about contrast | Measure it. 4.5:1 minimum for normal text — see data/tokens.json (contrast_minimums) | references/accessibility.md |

| Space between two adjacent elements | gap on the parent, not padding-bottom on the first child | references/layout-and-responsive.md |

| Flex child text overflowing or not truncating | Add min-width: 0 to the flex child | references/layout-and-responsive.md |

| Fixed-size image looks stretched | Add object-fit: cover or object-fit: contain | references/layout-and-responsive.md |

| 16:9 or other ratio container | aspect-ratio: 16 / 9, not padding-top hack | references/layout-and-responsive.md |

| Textarea that grows with content | field-sizing: content, explicit width, lh min and max | references/layout-and-responsive.md |

| Control smaller than its click area | Extend the hit area to var(--hit-area-min) | references/accessibility.md |

| Form, field, or dialog width | Use the widths tokens in data/tokens.json | references/layout-and-responsive.md |

| Sticky table header does not stick | A table has one scroll owner. overflow-x: auto on the wrapper makes it the owner. Bound its height or remove the overflow | references/data-tables.md |

| Table scrolls diagonally | Wheel lock on complex tables: scroll only the dominant axis | references/data-tables.md |

| Group of radio or checkbox inputs | Wrap in <fieldset> with <legend> | references/accessibility.md |

| Date or time in content | <time datetime="..."> | references/accessibility.md |

| Hand-authoring a media query | Use em not px for the breakpoint value | references/css-architecture.md |

| Project uses StyleX instead of Tailwind | Confirm the build plugin is wired up first, then use defineVars/createTheme/stylex.create | references/stylex.md |

| Selector getting hard to override | You've gone too deep — add a class instead | references/css-architecture.md |

| Layout keeps landing on a centered hero | Above VARIANCE 4, break it — split/asymmetric/offset | references/anti-slop.md |

| Reaching for a purple→blue gradient | Stop — that's the AI-slop signature; use accent tokens | references/anti-slop.md |

| Three identical feature cards in a row | Vary sizes or use a bento/asymmetric grid | references/anti-slop.md |

| Every section has an uppercase eyebrow | Cap at ~1 per 3 sections | references/anti-slop.md |

| Done with UI work | Call vois_record_rule_usage with rule IDs applied, if that tool is available | — |


Reviewing Existing UI

This section applies only when the task is reviewing, auditing, or polishing existing code against this design system — not when building something new from scratch. If you're asked to "review this component," "make this feel better," or "audit this screen for design system alignment," follow this output format.

No-silent-changes contract

When you're editing existing UI (a redesign, refactor, or polish pass — not a

greenfield build), some things are load-bearing outside the visual layer and

must never be changed silently as a side effect of restyling:

These carry meaning that other systems (bookmarks, backends, dashboards, tests,

muscle memory) depend on. If a redesign needs to change one, surface it as an

explicit proposed change with the reason — don't fold it into a styling diff.

Restyle freely; rewrite these only on purpose and out loud.

Before editing, classify the scope of change you're making:

Output Format

Present every change as a markdown table with Before and After columns, grouped under a heading per rule or category. Don't list findings as loose "Before:" / "After:" prose lines outside a table — they're harder to scan and easy to skim past.

Example

#### Concentric border radius `[DS-SURFACE-001]`
| Before | After |
| --- | --- |
| `rounded-xl` on card + `rounded-xl` on inner button (`p-2`) | `rounded-2xl` on card (`12 + 8`), `rounded-lg` on inner button |

#### Tabular numbers `[DS-TYPOGRAPHY-003]`
| Before | After |
| --- | --- |
| `<span>{count}</span>` on animated counter | `<span className="tabular-nums">{count}</span>` |

#### Scale on press `[DS-ANIMATION-008]`
| Before | After |
| --- | --- |
| `scale(0.9)` on button press | Raised to `scale(0.96)` — below `0.95` reads as exaggerated |

Review Checklist

Run this for any review/audit task, regardless of which reference files the underlying build touched:

This checklist is deliberately a cross-section of the full pre-submit checklist above — it's what's most likely to be wrong in code that predates this design system, not an exhaustive re-walk of every rule. For a from-scratch build, use the full pre-submit checklist instead.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.