design-token-generation

design-token-generation is a skill for Claude Code from alvinindra/figma-mcp-rust. It costs 60 tokens per session (1,088 once invoked), scanned A, original, MIT.

A process for extracting colors, text sizes, spacing, and corner radii from an existing Figma design and organizing them as reusable design tokens.

In plain words
What is it for?
Use it to inspect a finished Figma design, create variable collections and named styles, and connect design elements to those shared values.
Why use it?
It turns repeated visual values into named variables and styles, making the design easier to keep consistent.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the figma-mcp-rust plugin — 13 skills, 1 MCP server shipped together

Good fit Use it to inspect a finished Figma design, create variable collections and named styles, and connect design elements to those shared values.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alvinindra/figma-mcp-rust/design-token-generation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alvinindra/figma-mcp-rust --skill design-token-generation
Clone the repo
git clone --depth 1 https://github.com/alvinindra/figma-mcp-rust

Made for: Claude Code.

Or install figma-mcp-rust, the plugin that ships this one along with the rest of its 13 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-token-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/alvinindra/figma-mcp-rust/design-token-generation/github.svg)](https://agentmods.dev/skills/alvinindra/figma-mcp-rust/design-token-generation)
Your own site
<a href="https://agentmods.dev/skills/alvinindra/figma-mcp-rust/design-token-generation"><img src="https://agentmods.dev/badge/skills/alvinindra/figma-mcp-rust/design-token-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for design-token-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/alvinindra/figma-mcp-rust/design-token-generation"><img src="https://agentmods.dev/badge/skills/alvinindra/figma-mcp-rust/design-token-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,088 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01088
Opus 5 $0.00030 $0.00544
Sonnet 5 $0.00012 $0.00218
Haiku 4.5 $0.00006 $0.00109

Measured 11d ago against content hash 67be64193953, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

design-token-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/design-token-generation/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design Token Generation Strategy

Scan an existing design to discover all unique colors, font sizes, spacing values, and radii, then create a structured variable collection and named styles, and finally link nodes to them.

Steps

Phase 1: Discovery

  1. Call get_styles() to check what styles already exist (avoid duplicating them).
  2. Call get_variable_defs() to check existing variables.
  3. Call get_design_context(detail="compact") to scan the full node tree.
  4. Collect unique values:
    • Colors: all unique hex fills and stroke colors across nodes.
    • Font sizes: all unique fontSize values on TEXT nodes.
    • Spacing: all unique itemSpacing, paddingTop/Right/Bottom/Left values on FRAME nodes.
    • Radii: all unique cornerRadius values.

Phase 2: Token naming

Map discovered values to semantic token names. Use this hierarchy:

Colors (variable collection "Primitives"):

  • Sort colors by hue/lightness.
  • Assign names like "Blue/100", "Blue/200", ... "Blue/900", "Neutral/50", "Neutral/900", etc.
  • Also create a "Semantic" collection with aliases: "Color/Primary", "Color/Background", "Color/Text", etc.

Spacing (variable collection "Spacing"):

  • Name by scale: "Spacing/0" (0), "Spacing/1" (4px), "Spacing/2" (8px), "Spacing/3" (12px), ...

Radius (variable collection "Radius"):

  • Name: "Radius/None" (0), "Radius/SM" (4), "Radius/MD" (8), "Radius/LG" (16), "Radius/Full" (9999)

Typography (local text styles):

  • Name: "Heading/H1", "Heading/H2", "Body/Regular", "Body/Small", "Label/Medium", etc.

Present the full token plan to the user for approval before creating anything.

Phase 3: Creation

For each approved token:

  • COLOR variables: create_variable_collection(), then create_variable(type="COLOR"), then set_variable_value()
  • FLOAT variables: create_variable_collection(), then create_variable(type="FLOAT"), then set_variable_value()
  • Text styles: create_text_style() with name, fontFamily, fontSize, lineHeight, letterSpacing
  • Paint styles: create_paint_style() with name, color

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 94 lines · 60 tokens per session scan A 67be64193953

Subscribe to this mod's changes

design-token-generation is a skill published in the GitHub repository alvinindra/figma-mcp-rust (38 stars, last pushed 6d ago), licensed MIT. It adds 60 tokens to every session and 1,088 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

clean-interface-design

Design clean, calm, uncluttered interfaces that don't read as templated AI output. Use when building or restyling any UI (web, iOS, Android, macOS) and it needs visual hierarchy, restraint, spacing discipline, one clear primary action, and a cohesive look. Covers accent color, whitespace, corner radius, type scale…

HalidSaglam/saglitzdesign-mcp · 95 tokens

landing-page-conversion

Build or improve landing pages and marketing sites that convert, not just look good. Use when writing a hero, structuring a page, choosing a CTA, adding social proof, or diagnosing why a page isn't converting. Covers positioning, copy-first workflow, the above-the-fold contract, page narrative, CTAs, trust, and…

HalidSaglam/saglitzdesign-mcp · 86 tokens

ship-quality-gate

Run the deterministic auditors over a real project before it ships — design drift, security headers, generated-default tells, SEO/GEO signals, delivery signals, Apple and Android project configuration — and read the results correctly, disclosure list included. Use when someone asks "audit this", "is this ready to…

HalidSaglam/saglitzdesign-mcp · 86 tokens

apple-platform-design

Design iOS, iPadOS, and macOS apps that feel native, in the Liquid Glass era. Use when building or reviewing Apple-platform UI — navigation, controls, sheets, materials, typography, haptics — or deciding what must change when porting from web/Android. Covers Apple's HIG, the Liquid Glass design language (iOS 26 /…

HalidSaglam/saglitzdesign-mcp · 95 tokens

design-system-audit

Find out whether a codebase actually has a design system or is re-deciding the basics on every screen — count the distinct colors, sizes, radii, shadows and spacings, collapse the near-duplicates, and migrate onto tokens. Use when inheriting a codebase, before a redesign, when a UI "feels inconsistent but I can't say…

HalidSaglam/saglitzdesign-mcp · 93 tokens

motion-and-animation

Add motion and animation that feels great, not like slop. Use when animating any UI — transitions, hovers, presses, sheets, drawers, modals, page transitions, gestures — or when an animation feels "off". Covers the easing rules agents get wrong (ease-out for enter, ease-in for exit), springs, interruptibility…

HalidSaglam/saglitzdesign-mcp · 104 tokens