agentleFS
UwayxtUwayxt/agent-skills/.agents/skills/design-tokens/SKILL.md

design-tokens

Skill4 starsChanged 3 months agoMITView on GitHub

Define color, spacing, shadow, and radius tokens as single source of truth. Use when design tokens, color palette, spacing scale, create a design system, consistent styling, or at the start of any new UI project.

35 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use brief-to-tasks, design-flow and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • julianoczkowskiSkill

    brief-to-tasks

    Break a design brief into an ordered checklist of independently buildable tasks using vertical slices. Saves as a markdown checklist. Use when user wants to break down work, create tasks from a brief, plan implementation order, or mentions "tasks" or "breakdown".

    Also in 7 projects that use this

  • julianoczkowskiSkill

    design-flow

    Run the full design-to-build workflow as a guided sequence. Orchestrates all designer skills in order, from grilling through review. Use when user wants to go through the complete design process, start a project from scratch, run the full flow, or mentions "design flow" or "full workflow".

    Also in 6 projects that use this

  • nandanosqlSkill

    design-brief

    Create a design brief that clearly communicates the product context, user needs, constraints, and success criteria to the design team — bridging PM requirements and design execution.

    Also in 8 projects that use this

  • solinkzSkill

    micro-interactions

    Expert micro-interaction architect for mobile apps, web applications, and responsive websites. Use this skill when the user asks to add, build, fix, audit, or consult on micro-interactions, animations, transitions, motion design, gesture feedback, haptics, loading states, skeleton screens, pull-to-refresh, swipe actions, scroll animations, button states, form validation feedback, toast notifications, modals, dropdowns, toggles, progress indicators, shared element transitions, spring physics, easing curves, motion tokens, or any interaction that provides visual/haptic/auditory feedback to user actions. Triggers on: "micro-interaction", "animation", "transition", "motion", "easing", "spring", "gesture", "haptic", "feedback", "loading state", "skeleton", "shimmer", "pull to refresh", "swipe", "drag", "hover effect", "press state", "focus ring", "scroll animation", "parallax", "stagger", "orchestration", "reduced motion", "View Transitions", "layout animation", "shared element", "hero animation", "morphing", "Framer Motion", "GSAP", "Lottie", "Rive", "React Spring", "anime.js", or any request to make an interface "feel better", "feel alive", "feel snappy", "feel responsive", or "feel polished".

    Also in 3 projects that use this

  • jpoindexterSkill

    design-system-audit

    Audit code for design system violations - grid spacing, tokens, existing components

    Also in 3 projects that use this

  • dillonluiSkill

    design-review

    Review a view or flow for UX and UI issues. Provides severity-ranked, actionable findings grounded in established design heuristics. Use when the user asks for design feedback, UX review, or UI critique.

    Also in 12 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 32 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If style-extraction.json is present (from visual-style-extractor), ingest extracted colors, typography, spacing, and radius directly …

    line 9
  2. Distinctive:

    If creating from scratch, establish the token hierarchy defined below.

    line 10
  3. Distinctive:

    Every margin, padding, and layout gap MUST reference a token.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 32 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

A design token is a single source of truth for a visual decision. Raw hex codes, pixel values, and shadow strings in component files are not decisions — they are accidents waiting to diverge. Tokens make visual decisions explicit, named, and enforceable.

Upstream Integration

  • If style-extraction.json is present (from visual-style-extractor), ingest extracted colors, typography, spacing, and radius directly instead of authoring tokens from scratch.
  • If creating from scratch, establish the token hierarchy defined below.

1. Color tokens (Primitives vs. Semantics)

Define the palette in strict tiers:

  • Primitives: Named raw values (blue-500: #3B82F6, gray-900: #111827).
  • Semantic Tokens (Light Theme Contract): Role-based aliases (color-primary: blue-500, color-surface: #FFFFFF, color-text-primary: gray-900).
  • Components MUST reference semantic tokens, never primitives.

2. Dark mode semantic extension

For every semantic surface, text, and border token, define its dark mode counterpart (feeds into dark-mode-theming-system):

  • color-surface -> Light: #FFFFFF / Dark: #16181D
  • color-surface-ground -> Light: #F8F9FA / Dark: #0D0E11
  • color-text-primary -> Light: #111827 / Dark: #F3F4F6

3. Spacing tokens (4pt / 8pt Scale)

Pick a single base unit (4px or 8px). Build an immutable scale:

  • space-1: 4px | space-2: 8px | space-3: 12px | space-4: 16px | space-6: 24px | space-8: 32px | space-12: 48px | space-16: 64px Every margin, padding, and layout gap MUST reference a token.

4. Border radius tokens

Scale: radius-none: 0px, radius-sm: 4px, radius-md: 8px, radius-lg: 12px, radius-xl: 16px, radius-full: 9999px.

5. Elevation & shadow tokens

Layered elevation model:

  • shadow-sm: Subtle border/container accent (0 1px 3px rgba(0,0,0,0.1))
  • shadow-md: Standard card elevation (0 4px 12px rgba(0,0,0,0.08))
  • shadow-lg: Modals and dropdowns (0 8px 24px rgba(0,0,0,0.12))
  • In dark mode, drop shadows are complemented or replaced by surface lightness adjustments (color-surface-elevated).

6. Responsive breakpoint tokens

Name by viewport intent: breakpoint-sm: 640px, breakpoint-md: 768px, breakpoint-lg: 1024px, breakpoint-xl: 1280px.

7. Output the token file & CSS Custom Properties

Generate design-tokens.json structured by category with ready-to-use :root and [data-theme="dark"] CSS variable blocks.

Output

  • design-tokens.json (Structured JSON tokens)
  • tokens.css (CSS custom properties with light and dark mode mappings)
  • Reference TOKEN-SCHEMA.md for naming taxonomy.

Completion Criteria

  • Every visual decision (colors, spacing, radius, shadow, breakpoints) mapped to semantic tokens
  • Dual-theme (Light/Dark) mapping defined for all surface, text, and border tokens
  • Zero raw hex or magic pixel values in generated component CSS
  • If extracted from image, style-extraction.json values faithfully mapped

Anti-patterns

  • Defining 47 shades of gray with no semantic assignment.
  • Hardcoding hex values inside component styles ("just for this one button").
  • Skipping the semantic layer and pointing components directly to raw primitives.
  • Inverting shadow values in dark mode without adjusting surface elevation luminance.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.