/throughline:design-system-auditfrom ThroughLine
Audits an existing design system across codebase and Figma to size a token retrofit. Measures color usage patterns and Figma variables to determine migration effort.
Ships in ThroughLine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Measures both sides of a pre-existing system so a retrofit can be right-sized,
before anything is built or changed. It is the brownfield analog of
/design-system-status: where status reports a local manifest, this assesses an
external, mature system — a real codebase and an already-populated Figma file.
This is a brownfield skill. Before doing anything, read
${CLAUDE_PLUGIN_ROOT}/references/brownfield-retrofit.md — especially the
read-discipline principle (never assert absence without a verified read) and the
audit phase of the safe sequence. Greenfield builds skip this skill entirely.
Read user.codingLevel (${CLAUDE_PLUGIN_ROOT}/references/coding-level.md) and scale
explanation accordingly. The audit surfaces grep counts and a percentSemantic
number — for new users explain what each means and why it matters (it decides
rename-vs-rewrite); for comfortable users be terse. The measurements are identical
across levels.
Read the manifest. This skill needs Figma connected (figma.connected: true) for the
inventory step, and a repo path for the code-surface step (workspace.localPath). If
Figma isn't connected, offer to run figma-environment-setup first. Before the
inventory, do a cheap liveness read to confirm the connection is actually live right
now; if it fails, offer figma-environment-setup. The code-surface
step works on any repo regardless of workspace.stage.
Measure how many color decisions live in the codebase. Run the color-usage grep scaffold against the user's repo:
node ${CLAUDE_PLUGIN_ROOT}/scripts/grep-color-usage.mjs --root <workspace.localPath>
It counts five categories: SCSS color vars, Tailwind color classes, Colors.* JS
usages, raw hex + rgba() literals, and SVG hardcoded fills — producing the
case-study worklist shape.
Tune the patterns to the actual repo, and say what you assumed (read discipline + §11). The shipped patterns are defaults, not ground truth. Before trusting the counts:
$primary-*, $grey-*, a custom prefix), the Tailwind
color-class names, and whether colors come through a Colors.* object or some other
accessor.--config <patterns.json> of
{ "<category>": { "files": "<regex>", "pattern": "<regex>" } } tuned to this repo
and re-run with it.Don't assume the stack. The categories are color-specific but framework-agnostic; a
repo with no Tailwind simply scores 0 there. Detect what the repo actually uses (is
there a tailwind.config? SCSS? CSS-in-JS?) and explain the counts in those terms.
Inventory existing documentation the same way the code surface is sized — from verified reads, never assumptions. Per component (or per code component when no Figma component exists yet), record whether usage docs already exist and where:
.mdx doc page, a per-component
README.description field.Write the totals to audit.docSurface in the manifest, e.g. { "documented": 12, "undocumented": 34, "sources": { "codeJsdoc": 8, "mdx": 4, "figmaDescription": 6, "readme": 3 } }. This right-sizes the documentation retrofit (how much exists to
adopt vs. author from scratch) so retrofit-planner's docs phase can be planned
against real numbers. See ${CLAUDE_PLUGIN_ROOT}/references/component-doc-schema.md
for what a full record contains.
Variables, text styles, and effect/paint styles are different surfaces — read each
independently and report "none" only for the class whose own read came back empty
(read discipline, fixes B2). Before counting variables, ensure all pages are loaded
(await figma.loadAllPagesAsync()); treat a 0 on first read as suspect and re-read
before reporting (fixes B1).
figma_get_variables (handles dynamic-page, resolves aliases).
Record the count.${CLAUDE_PLUGIN_ROOT}/references/figma-scripting.md to count consuming bindings.
This is the load-bearing number: it's what a careless rename would destroy.figma_get_text_styles. Record the count.figma_get_styles. Record the count.["Light", "Dark"]).Never report a count you didn't read. If a read genuinely returns empty after a
reliable load, that's a real 0; if it's suspect, re-read or ask the user once and
persist — never guess.
From the inventory, estimate how much of the existing system is already semantic
(named by role — text/default, surface/raised) vs. raw/primitive (named by
value — grey-900, or bare hex). Report it as an integer 0–100 (audit.percentSemantic).
This single number right-sizes the retrofit: a largely-semantic system (~90%) is a rename-in-place + cleanup job; a low-semantic one is closer to a rewrite. Surface it early and plainly — "you're ~90% semantic, so this is mostly renames and a cleanup, not a rebuild" — so the user calibrates effort before committing.
Write the audit section (this skill owns it):
codeSurface — the per-category counts from Step 1 (keys vary by what the repo uses;
omit categories that don't apply rather than reporting a misleading 0).figmaInventory — { variables, bindings, textStyles, effectStyles, modes } from
Step 2's verified reads.percentSemantic — the integer from Step 3.ranAt — the current ISO timestamp.Set tokens.intakeMode: "retrofit" (this skill establishes the brownfield path — it
owns this transition). Append design-system-audit to completedSkills.
Then recommend the next step:
audit.docSurface (documented vs.
undocumented) and note that the retrofit's docs phase will adopt existing docs
before authoring the gaps.retrofit-planner
(the orchestrator; recommended for multi-session retrofits).token-crosswalk-builder (it
reads this audit section to seed its rows).token-builder (refine), the retrofit phases, and cleanup.tokenCrosswalk, retrofit.phase).workspace.origin — it is immutable after intake.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
design-system, token-migration, design-audit, figma-audit, color-usage
12 skills in this plugin
/component-builderBuild Figma components — buttons, inputs, cards, badges, chips, modals, and more — with variant matrices (types, sizes, states) and icon/component/content slots bound to the design system's tokens and styles. Use this when the user wants to create components, build a component library, make buttons/inputs/cards/etc. in Figma, or set up the foundational UI kit. Also trigger after tokens and icons exist, when the user is ready to build actual UI components./component-pipelineTake a single new component from Figma to fully-built-and-storied code, end to end — build it in Figma, sync any new tokens it introduced, then build its code component and stories. Orchestrates component-builder, token-sync-layer, and storybook-chromatic-builder with a human confirmation between each stage. Use this when the user wants to add a new component to an existing design system, ship a component end-to-end, or run the full new-component flow. Also trigger on "/new-component" or when someone wants one component built all the way through to code./figma-environment-setupSet up the local working folder and connect Claude to Figma so the design-system skills can read and write variables, styles, and components. Run this BEFORE brainstorming and before any other design-system skill. Invoke it immediately when the user wants to start, set up, or begin building a design system — phrases like 'let's setup my design system', 'let's get started', 'connect Figma', or 'build my design system' should all trigger this skill first, ahead of brainstorming. Also trigger when the user wants to fix a broken Figma connection, or mentions the Figma Console MCP, the desktop bridge plugin, or a Figma access token.npx claudepluginhub jrpease/throughline --plugin throughlineOther plugins' skills for the same job