Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By conorluddyv1.0.1MITIn 1 marketplace
Reverse-engineer a SwiftUI app's design system into DTCG tokens, brand-narrative DESIGN.md, and an audit report.
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
swiftui, design-tokens, dtcg, design-system, ios, extraction, audit
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Reverse-engineer a SwiftUI app's design system into DTCG tokens, brand-narrative DESIGN.md, and an audit report.
Every major token platform — Specify, Supernova, Tokens Studio, Penpot — flows from Figma to code. Tokextract runs the opposite direction: Swift source is the source of truth, and it recovers the implicit design system already living there.
Given a --path to any SwiftUI repo, Tokextract emits three artifacts:
| Artifact | Format | Purpose |
|---|---|---|
tokens.json | W3C DTCG 2025.10 | Machine-readable canonical token inventory. Pipe directly into Style Dictionary. |
DESIGN.md | Google @google/design.md alpha | LLM-readable brand narrative. Lives next to CLAUDE.md; feeds brand context to AI coding sessions. |
audit.md | Markdown | Drift report: magic numbers, near-duplicate color clusters, off-scale spacing, Liquid Glass violations, harmonization suggestions. |
All 9 token categories are extracted in a single run: color, typography, spacing, corner radius, shadow, animation, components, Liquid Glass materials, and theme injection patterns.
Tokextract is a Claude Code plugin in the conorluddy marketplace. End users install via:
/plugin marketplace add conorluddy/tokextract
/plugin install tokextract@tokextract
For local development on the plugin source (Node 20+):
cd plugins/tokextract
npm install
npm run build # tsc + copy schemas to dist/
npm test # 246 vitest tests
npx biome check . # lint
After modifying source, refresh the installed plugin: /plugin marketplace update tokextract.
Run from inside a Claude Code session:
/tokextract --path <swift-repo> [--output <dir>]
This triggers the 8-step pipeline. Steps 2, 3, 4, 6, and 7 spawn subagents (Haiku for normalize, Sonnet for harmonize/narrate). LLM mode produces semantic token names and the full brand-narrative DESIGN.md.
Default output directory: <swift-repo>/.tokextract-out/
--no-llm mode (CI / deterministic)Safe for automated pipelines. LLM steps are skipped; token names are mechanical (e.g. color-1A1C1E); DESIGN.md is a stub. Steps 1, 5, and 8 still run.
node dist/extract.js parse --path <repo> --output <out> --no-llm
node dist/extract.js emit --output <out> --no-llm
node dist/extract.js finalize --output <out> --no-llm
All flags apply to the parse subcommand unless noted.
| Flag | Default | Description |
|---|---|---|
--path <dir> | (required) | Swift repo root |
--output <dir> | <path>/.tokextract-out | Output directory |
--no-llm | false | Skip LLM passes |
--max-files <n> | 2000 | Hard limit on .swift files scanned |
--delta-e-threshold <n> | 2.5 | CIEDE2000 distance used for near-duplicate color clustering |
--skip <category,...> | (none) | Comma-separated categories to skip (e.g. animation,shadow) |
--force-color-space {srgb|display-p3|oklch} | (auto) | Override output color space |
--target-os <ver> | (auto-detect) | Target iOS version; gates Liquid Glass (26) and @Entry (18) extraction |
--vendor-namespace <s> | (from Info.plist) | Override the $extensions vendor key (default: derived from CFBundleIdentifier) |
--model-normalize <id> | claude-haiku-4-5-20251001 | Model for normalize pass |
--model-harmonize <id> | claude-sonnet-4-6 | Model for harmonize pass |
--model-narrate <id> | claude-sonnet-4-6 | Model for narrate pass |
--self-critique | false | Run a self-critique pass after narrate; appends fragment to audit.md |
--verbose | false | Per-category counts and timing |
<output-dir>/
├── tokens.json # W3C DTCG 2025.10 — all 9 categories, Ajv-validated
├── DESIGN.md # Brand narrative (stub in --no-llm mode)
├── audit.md # Drift report: 7 sections
└── .tokextract/ # Internal state — delete to force a clean re-run
├── findings.raw.json
├── clusters.json
├── numericClusters.json
├── drift.json
├── meta.json
├── llm-tasks.json
├── prompts/
│ ├── normalize-color-1.md
│ ├── harmonize.md
│ └── narrate.md
├── llm-out/
│ ├── mapping.color.1.json
│ └── mapping.harmonize.json
└── previous/
└── tokens.json # Snapshot for diff on next run
Delete .tokextract/ to force a full re-parse. Subsequent runs diff tokens.json against previous/tokens.json and append a "Changes since last extraction" section to audit.md.
Direct Variables REST API push requires an Enterprise Figma plan (v2 scope). The manual path works today:
tokens.json.tokens.json into Figma via the TokensBrücke or Tokens Studio plugin.Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub conorluddy/tokextract --plugin tokextractPlugins from other owners that cover similar ground