Skip to content
Back to skills

Token Extraction Mastery

ASecurity

Enforce standards for deconstructing complex UI designs into reusable design tokens. This skill focuses on identifies recurring patterns in colors, typography, and spacing to automate the creation of a consistent configuration (e.g., `tailwind.config.js` or CSS variables).

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 24, 2026
design

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 24, 2026

npx -y skills add iDorgham/Workspace-Factory --skill token-extraction-mastery --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Extraction Mastery?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Token Extraction Mastery
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/idorgham-token-extraction-mastery/badge)](https://www.skillsdirectory.com/skills/idorgham-token-extraction-mastery)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
type: Skill
subagents: [core-validator, integrity-bot]
agents: [master-guide, swarm-router]
dependencies: [core-orchestration, global-sync]
version: 1.0.0
---



# πŸ“ Design System Extraction (Tokens)

## Purpose
Enforce standards for deconstructing complex UI designs into reusable design tokens. This skill focuses on identifies recurring patterns in colors, typography, and spacing to automate the creation of a consistent configuration (e.g., `tailwind.config.js` or CSS variables).

---

## Technique 1 β€” Pattern Recognition (Visual Audit)
- **Rule**: Before coding, perform a visual audit of the high-fidelity design to identify the "Base Tokens."
- **Protocol**: 
    1. Extract the 5 primary brand colors (Primary, Secondary, Accent, Neutral, Surface).
    2. Define the typography scale (H1-H6, Body, Label).
    3. Isolate recurring spacing units (4px, 8px, 12px, 16px, 24px, 32px).
    4. Group these into a `tokens.json` manifest.

---

## Technique 2 β€” Syncing Truth (Code Generation)
- **Rule**: Design tokens in code must be the "Single Source of Truth."
- **Protocol**: 
    1. Generate Tailwind-compatible JSON from the token manifest.
    2. Inject JSON into the configuration layer.
    3. Use the mapping to ensure every component uses `@theme` or utility-safe values.

---

## πŸ›‘οΈ Critical Failure Modes (Anti-Patterns)
| Anti-Pattern | Result | Correction |
| :--- | :--- | :--- |
| **Magic Numbers** | Inconsistent spacing | Replace all arbitrary values (e.g., `padding: 17px`) with the nearest token (e.g., `p-4` or `16px`). |
| **Shadow Divergence** | Inconsistent depth | Define 3 elevations (Sm, Md, Lg) and use them exclusively. |
| **Isolated Styles** | Maintenance nightmare | Every new component MUST inherit from existing tokens; never declare local `:root` variables in component CSS. |

---

## Success Criteria (Extraction QA)
- [ ] 0 Hard-coded hex values in the application logic.
- [ ] Token manifest matches the Figma/Design handoff exactly.
- [ ] Changing a single token (e.g., `--primary`) updates the entire application UI.
- [ ] Arabic typography tokens are specifically defined for RTL readability.

Files in this skill

  • SKILL.md2.1 KB
  • core.py457 B
  • manifest.yaml213 B
  • tests/test_core.py332 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design β†’

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.