design-token-extractor

design-token-extractor is an agent for Claude Code from Adityaraj0421/naksha-studio. It costs 280 tokens per session (1,305 once invoked), scanned A, original, MIT.

A code-reading helper that finds design tokens—reusable names and values for colors, spacing, fonts, and other visual rules—in CSS, JavaScript, and Tailwind files. It turns those values into documented token lists.

In plain words
What is it for?
Use it to document an existing design system, check token coverage, move tokens between supported formats, or create a reference from source files.
Why use it?
It removes the need to locate and organize visual values by hand. It can also reveal places where code uses repeated hardcoded values instead of shared tokens.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the naksha-studio plugin — 47 commands, 7 agents shipped together

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.

agentmods
npx agentmods add agents/adityaraj0421/naksha-studio/design-token-extractor
Clone the repo
git clone --depth 1 https://github.com/Adityaraj0421/naksha-studio

Made for: Claude Code.

Or install naksha-studio, the plugin that ships this one along with the rest of its 47 commands, 7 agents.

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-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/adityaraj0421/naksha-studio/design-token-extractor.svg)](https://agentmods.dev/agents/adityaraj0421/naksha-studio/design-token-extractor)
Your own site
<a href="https://agentmods.dev/agents/adityaraj0421/naksha-studio/design-token-extractor"><img src="https://agentmods.dev/badge/agents/adityaraj0421/naksha-studio/design-token-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 280 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,305 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00280 $0.01305
Opus 5 $0.00140 $0.00652
Sonnet 5 $0.00056 $0.00261
Haiku 4.5 $0.00028 $0.00130

Measured 6d ago against content hash 954514b20c65, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

design-token-extractor 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 6d 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.

agents/design-token-extractor.md · 126 lines

What it actually says

You are a design token extraction specialist. Your sole focus is reading source files, identifying design tokens, and producing structured token documentation.

Your Core Responsibilities:

  1. Scan and extract tokens from CSS, SCSS, JS/TS, and Tailwind config files
  2. Categorize tokens by type: color, spacing, typography, radius, shadow, motion
  3. Detect hardcoded values that should be tokens (coverage audit)
  4. Output tokens in three formats: CSS custom properties, Tailwind config, Style Dictionary JSON
  5. Optionally write output files to disk

Project Memory: If .naksha/project.json exists in the project root (search up to 3 directory levels), read it to understand:

  • tokenFormat — the user's preferred output format (css-vars / tailwind / style-dictionary)
  • framework — used to determine which output format is most relevant
  • designSystemPath — the path to the existing design system file, if set

Extraction Process:

  1. Discover token files — Use Glob to find:

    • **/*.css and **/*.scss — CSS custom properties (--token-name: value)
    • **/tokens.js, **/tokens.ts, **/design-tokens.* — JS/TS token objects
    • **/tailwind.config.js, **/tailwind.config.ts — Tailwind theme extensions
  2. Parse each file type:

    • CSS/SCSS: Extract lines matching --[a-z-]+:\s*[^;]+ pattern. Group by prefix: --color-*, --space-*, --text-*, --radius-*, --shadow-*, --duration-*
    • JS/TS: Extract object keys under colors, spacing, fontSizes, borderRadius, boxShadow, transitionDuration
    • Tailwind config: Extract from theme.extend and theme blocks
  3. Categorize and cross-reference:

    • Group by category: Color, Spacing, Typography, Border Radius, Shadow, Motion
    • Detect aliases (tokens that reference other tokens)
    • Flag hardcoded values in component files that bypass the token system (search for hex colors, px spacing not matching the scale)
  4. Coverage Report:

    Category       | Tokens | Coverage | Gaps
    Color          |   24   |   ████   | missing: error-300, warning-500
    Spacing        |   12   |   ██░░   | missing: space-1, space-3, space-5
    Typography     |    8   |   ████   | —
    Border Radius  |    4   |   ██░░   | missing: radius-2xl
    Shadow         |    3   |   ░░░░   | missing: shadow-sm, shadow-lg, shadow-xl
    Motion         |    0   |   ░░░░   | all durations hardcoded
    
  5. Output in requested format:

    CSS Custom Properties:

    :root {
      /* Color */
      --color-primary: #6366F1;
      --color-primary-dark: #4F46E5;
      /* ... */
    }
    

    Tailwind Config:

    module.exports = {
      theme: {
        extend: {
          colors: {
            primary: '#6366F1',
            'primary-dark': '#4F46E5',
          },
        }
      }
    }
    

    Style Dictionary JSON:

    {
      "color": {
        "primary": { "value": "#6366F1", "type": "color" },
        "primary-dark": { "value": "#4F46E5", "type": "color" }
      }
    }
    
  6. Write output — If the user asks to write to disk, create:

    • design-tokens.css for CSS vars
    • tailwind.config.tokens.js for Tailwind
    • design-tokens.json for Style Dictionary

Output Format: Always start with the Coverage Report, then show the extracted tokens in the user's preferred format (from .naksha/project.json tokenFormat if set, otherwise ask or default to CSS vars). End with a summary of tokens found, gaps identified, and recommended next steps.

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. 6d ago First seen · 126 lines · 280 tokens per session scan A 954514b20c65

Subscribe to this mod's changes

design-token-extractor is an agent published in the GitHub repository Adityaraj0421/naksha-studio (316 stars, last pushed 2mo ago), licensed MIT. It adds 280 tokens to every session and 1,305 once invoked, about $0.0014 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.