From throughline
Builds a three-way crosswalk.json mapping new tokens to old Figma variables and code identifiers, installs validator scripts, and wires a CI gate for brownfield design system retrofits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/throughline:token-crosswalk-builderThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Builds the **backbone artifact** of a brownfield retrofit: `crosswalk.json`, a
Builds the backbone artifact of a brownfield retrofit: crosswalk.json, a
persistent three-way map of new token ↔ old Figma variable ↔ old code identifier.
It drives the code retrofit and the tokens:validate CI gate. This skill also
installs the canonical scripts into the user's repo and wires the gate.
This is a brownfield skill. Before doing anything, read
${CLAUDE_PLUGIN_ROOT}/references/brownfield-retrofit.md (read discipline, the 7
guardrails, the safe sequence) and
${CLAUDE_PLUGIN_ROOT}/references/crosswalk-schema.md (the exact contract). Greenfield
builds don't need this skill.
Read user.codingLevel (${CLAUDE_PLUGIN_ROOT}/references/coding-level.md) and scale
explanation accordingly. The crosswalk involves JSON, npm scripts, and a CI gate — for
new users explain each plainly the first time; for comfortable users be terse.
Actions are identical across levels.
Read the manifest. This skill needs:
packages/tokens/dtcg/tokens.json — the validator
resolves against it. If it doesn't exist, offer to run token-sync-layer first
(it emits this file). Apply the read discipline: confirm the file exists by
reading it, never assume it's absent without looking.audit manifest section (code surface,
Figma inventory, percentSemantic) populated by design-system-audit. If
audit is present, use it to seed the rows. If it is null (audit hasn't run —
it lands in Plan 3), don't block: ask the user for the old→new mapping inputs
directly (which old Figma variables and code symbols map to which new tokens),
and proceed. Note plainly that running design-system-audit first would
pre-fill this.local-git or github (workspace.stage) so the installed
scripts and package.json changes land as a reviewable diff/PR. If still
folder, offer repository-builder.crosswalk.jsonWrite packages/tokens/crosswalk.json per the contract in
${CLAUDE_PLUGIN_ROOT}/references/crosswalk-schema.md. One row per new token:
newToken — the DTCG dot-path exactly as it appears in
packages/tokens/dtcg/tokens.json (e.g. color.text.primary).newValue — the resolved leaf value (follow {…} aliases to the literal).tier — primitive or semantic.figmaOld — the old Figma variable name/path, or null if newly added.codeTokens[] — the old code identifiers this token replaces ($primary-red,
bg-primary-red, Colors.primaryRed, --primary-red). May be [].status — aligned | renamed | drift-fix | added | mapped-nearest. Assign by:
same name & value → aligned; same value, new name → renamed; value
intentionally changed → drift-fix; brand-new token → added; no exact old
equivalent, mapped to nearest → mapped-nearest.recommendedSemantic — optional semantic target for a raw/primitive usage, else
null.Do not guess values. Every newValue comes from a read of the DTCG source, not an
assumption (read discipline).
tokens:validateCopy these from ${CLAUDE_PLUGIN_ROOT}/scripts/ into the user's repo verbatim
(they are zero-dependency and version with the user's repo so their CI can run them):
lib/crosswalk.mjs → packages/tokens/scripts/lib/crosswalk.mjsvalidate-crosswalk.mjs → packages/tokens/scripts/validate-crosswalk.mjsbuild-reverse-index.mjs → packages/tokens/scripts/build-reverse-index.mjsguard-token-removal.mjs → packages/tokens/scripts/guard-token-removal.mjscrosswalk.schema.json → packages/tokens/crosswalk.schema.json (beside
crosswalk.json, so the $schema pointer resolves)Then add to packages/tokens/package.json scripts (don't clobber existing keys):
"tokens:validate": "node scripts/validate-crosswalk.mjs --crosswalk crosswalk.json --tokens dtcg/tokens.json",
"tokens:reverse-index": "node scripts/build-reverse-index.mjs --crosswalk crosswalk.json --out crosswalk.reverse.json"
See ${CLAUDE_PLUGIN_ROOT}/scripts/README.md for the full install contract.
Run npm run tokens:validate (from packages/tokens/). It must report N/N —
every row's resolved value matches its newValue. If it reports mismatches or
missing tokens, fix the crosswalk (or the token source) and re-run. Never proceed
on a red validator and never edit a generated token file to make it pass — change
the source in Figma and re-sync (guardrail 7). The validator is the source of truth
that the crosswalk and the real tokens agree.
Run npm run tokens:reverse-index. This writes crosswalk.reverse.json
(codeToken → newToken), which the code-retrofit phase uses to semi-automate the
SCSS/Tailwind swaps. If it reports conflicts (one old symbol mapping to two new
tokens), resolve them in the crosswalk before relying on the index.
Write the tokenCrosswalk section only (this skill owns it; never write another
skill's fields):
path — the actual path written ("packages/tokens/crosswalk.json").statusCounts — copy the camelCase object the validator printed
({ aligned, renamed, driftFix, added, mappedNearest }).validatorPassing — true once tokens:validate passes N/N.Append token-crosswalk-builder to completedSkills.
tokens.intakeMode is owned by
design-system-audit).tokens:validate.npx claudepluginhub jrpease/throughline --plugin throughlineOrchestrates a full brownfield design-system retrofit: audit, refine variables, rebind components, capture Chromatic baseline, retrofit code, adopt documentation, and remove old tokens with human gates between phases.
Syncs design tokens between code and Figma variables with drift reporting, mandatory approval before writes, safe delta apply, and persisted reports.
Audits design system token definitions for naming violations, missing semantic tiers, and structural debt in tiered architectures. Generates severity-rated findings and prioritized remediations.