Skip to content
Skill

Design token guard

Blocks inline styles and hardcoded colors that bypass a project's design tokens

Design token guard is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript, Python
Platforms
Claude Code, Codex, Cursor
GitHub stars
12
Last commit
License
MIT
Listing updated

Similar skills

About Design token guard

Design Token Guard is a source-level check for frontend code. Render reviews and screenshots cannot tell a hardcoded hex value from the token it should have used, so this skill scans the source itself. A bundled Python checker discovers the project's token definitions from CSS custom properties, SCSS or Less variables, JS theme objects, or design-token JSON, then maps each color literal to the matching token and reports the exact replacement.

The skill can also wire the check into a repository so it runs on every commit and in CI. It covers writing a config file, adding a lint script, installing a pre-commit hook, merging an optional ESLint subset for editor feedback, and adding a CI step. It also describes a stricter layout-only profile and a bootstrap path for solo frontend builds that sets up layout and duplication policies with a full-source runner.

The checker needs Python 3.9 or newer and uses only the standard library. The skill also allows an agent to fall back to manual grep scanning when no shell is available, and it treats any check that could not run as blocked rather than passed. Git is needed for staged-file scans.

When your agent uses it

Source-level gate that stops inline styles and hardcoded colors from bypassing a project's design tokens. Framework-agnostic; auto-discovers the tokens. Use when frontend work touches colors or themes, before calling a UI task done, or as a wave gate. Render reviews can't see a hardcoded color. Trigger on "inline styles", "hardcoded colors", "hardcoded hex", "design tokens", "token drift".

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 10 files (68 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the skill-madness plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness

Or copy only this skill to ~/.claude/skills/design-token-guard:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/design-token-guard &&
cp -R "$tmp/skills/workflows/design-token-guard" ~/.claude/skills/design-token-guard &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/design-token-guard inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/design-token-guard to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/design-token-guard &&
cp -R "$tmp/skills/workflows/design-token-guard" ~/.agents/skills/design-token-guard &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/design-token-guard inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/design-token-guard to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/design-token-guard &&
cp -R "$tmp/skills/workflows/design-token-guard" ~/.cursor/skills/design-token-guard &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/design-token-guard inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/workflows/design-token-guard

Or copy the folder to ~/.gemini/skills/design-token-guard yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/design-token-guard:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/design-token-guard &&
cp -R "$tmp/skills/workflows/design-token-guard" ~/.copilot/skills/design-token-guard &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/design-token-guard inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git

Then copy Skill-Madness/skills/workflows/design-token-guard into your agent's skills folder as design-token-guard. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Hardcoded color detection
Flags hex, rgb, hsl and similar color literals in styles, SVG attributes and Tailwind arbitrary values.
Automatic token discovery
Reads CSS custom properties, SCSS or Less variables, JS theme objects and design-token JSON to build a value-to-token map.
Inline style checks
Warns on inline style attributes that carry hardcoded literals across React, Vue, Svelte, Angular and HTML.
Repository enforcement setup
Adds a config file, lint script, pre-commit hook, optional ESLint rules and a CI step.
Optional project rules
Off-by-default rules for SVG utility classes, border radius limits, forbidden colors and arbitrary Tailwind values.
Wave gate for agents
Lets an orchestrator or frontend agent run the full-source check before declaring a UI task done.

Good for

  • Check my React components for hardcoded hex colors before I commit
  • Replace inline background colors with the project's existing theme tokens
  • Set up a pre-commit hook that blocks new hardcoded colors
  • Audit a Vue app for inline styles that bypass its design system
  • Add a lint:tokens script and CI step to enforce design tokens

Design token guard FAQ

What does the checker need to run?

Python 3.9 or newer. It uses only the standard library, and an optional ESLint step is available for editor feedback.

Does Design token guard need a configuration file?

No, it auto-discovers token sources for a first pass. A .design-guard.json file can set token sources explicitly so results are deterministic in CI.

Are inline styles always rejected?

No. By default, inline styles whose values are dynamic, such as var() references or JS expressions, are allowed. A strict mode bans inline style attributes outright.

What happens when a color is not in the token list?

The finding is reported as a color that was never tokenized, so the developer either adds a named token or switches to the nearest existing one.

How do I install Design token guard in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/design-token-guard to use it in all your projects, or to .claude/skills/design-token-guard in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

Does Design token guard run scripts?

Yes. It runs JavaScript and Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Design token guard?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Design token guard?

The closest alternatives to Design token guard are Design system, UI design system, Class extraction guard, Design system and Design review.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ivy00johns/Skill-Madness

  1. Finds merged and stale git branches, then deletes them only after your confirmation

    • Open source
    • 12 GitHub stars
    • Developer tools
  2. Finds and removes git worktrees whose changes are already merged into main

    • Open source
    • 12 GitHub stars
    • Developer tools
  3. Bulk-scans a skill ecosystem for consistency, quality gaps and ownership conflicts

    • Open source
    • 12 GitHub stars
    • Developer tools
  4. Runs a single-skill quality review covering structure, triggering and output checks

    • Open source
    • 12 GitHub stars
    • Developer tools
  5. Turns skill review or audit reports into a prioritized list of concrete SKILL.md fixes

    • Open source
    • 12 GitHub stars
    • Developer tools
  6. Applies planned edits to SKILL.md files, validates them, and offers to sync

    • Open source
    • 12 GitHub stars
    • Developer tools