From throughline
Orchestrates 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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/throughline:retrofit-plannerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sequences a brownfield retrofit through the safe seven-phase order (with `docs` inserted
Sequences a brownfield retrofit through the safe seven-phase order (with docs inserted
as a gated Phase 6.5), gating each phase on a
human confirmation. Like component-pipeline, this skill holds zero domain logic of
its own — it is a sequencer that invokes the real skills and the phase work, and only
updates the manifest fields it owns (retrofit.*, completedSkills). All the
actual work lives in the skills it calls, so this orchestrator doesn't rot when they
improve.
Before anything, read ${CLAUDE_PLUGIN_ROOT}/references/brownfield-retrofit.md —
the read discipline, the 7 guardrails, the safe sequence, and the verification triad
are the rules this skill enforces as gates.
Use this for a complete retrofit, especially across multiple sessions. For a single isolated step (just the audit, just the crosswalk), run that skill directly. This is the "converge my mature system onto tokens, end to end, without breaking the live app" flow.
Read user.codingLevel (${CLAUDE_PLUGIN_ROOT}/references/coding-level.md). A retrofit
touches Figma, tokens, code, CI, and a live app — for new users explain each phase and
why its ordering matters the first time; for comfortable users be terse. The phases and
gates are identical across levels.
Read the manifest. This orchestrator assumes a brownfield situation
(tokens.intakeMode: "retrofit", or workspace.origin is an existing repo/monorepo). If
the audit hasn't run yet (audit.ranAt is null), start at the audit phase below. If
none of the brownfield markers are set, this is probably greenfield — point the user to
the normal build skills instead.
At the start of a retrofit, offer to scaffold a decision journal at docs/design-system/
with specs/ plans/ spikes/ findings/ decisions/ handoffs/. Recommend yes —
retrofits are multi-session and the journal is the human decision trail (complementary to
the manifest's machine state) — but allow the user to decline. Record the choice in
retrofit.journalScaffolded. This is the only artifact this skill creates directly.
Before running phases that shell out (sync, baseline, code, cleanup), detect what the
repo actually uses — read its package.json scripts for the real type-check, build,
visual-test, and token commands. The case study used Chromatic + build-storybook +
tokens:sync/tokens:validate; a real repo may differ. Map each phase onto the repo's
actual commands, or degrade gracefully and say what's missing — never assert a command
that doesn't exist.
Set retrofit.phase to the current phase as you enter it, so a later session can resume
exactly here. Confirm the goal first, then walk the phases. Each gate is a hard stop:
do not advance without explicit confirmation — the gates are what keep the live app
intact and make the retrofit resumable.
audit (invoke design-system-audit)Invoke design-system-audit: size the code surface, inventory the Figma file with
verified per-class reads, compute percentSemantic. Gate: show the audit results and
the right-sizing read ("~90% semantic → renames + cleanup, not a rewrite"). Confirm before
continuing. Capture the rollback baseline (Figma version checkpoint / token export) now if
figma-environment-setup didn't already. On first entry, set retrofit.startedAt to the
current ISO timestamp if it is unset.
refine (invoke token-builder brownfield branch)Invoke token-builder's refine-in-place branch: rename/realign variables in place,
preserving IDs, with a binding-survival audit before and after each rename (guardrail 3).
Gate: show the before/after binding counts are equal (no bindings severed) and the
refined variable names. Confirm before continuing. Never delete-and-recreate.
rebindReconcile components onto the refined variables, preserving their Figma IDs. There is no
dedicated skill for this — drive it directly here: verify components still reference the
(renamed, same-id) variables, and fix any that drifted. Gate: confirm components still
render bound. This is also the natural point to build the crosswalk if not yet done —
offer token-crosswalk-builder (it reads the audit section to seed rows and wires
tokens:validate).
sync (invoke token-sync-layer brownfield branch)Invoke token-sync-layer with the brownfield transforms (channel alpha, opacity
0–100→0–1, float32 rounding at the export boundary, /opacity→color-mix). It lands a
reviewable PR per its own rules. Gate: confirm the sync PR before continuing.
baseline (invoke storybook-chromatic-builder)Capture a Chromatic baseline before any code retrofit, so intended drift-fixes are distinguishable from regressions. Gate: confirm the baseline is green and captured. This ordering is not optional — baseline after the code change throws away the signal.
code (dual output)Retrofit the codebase with dual output: new and old tokens coexist during the
transition, so nothing breaks mid-migration. Use the crosswalk reverse index
(tokens:reverse-index) to semi-automate the SCSS/Tailwind swaps. Run the verification
triad as you go — check-types, build-storybook + Chromatic, and run the actual app
docs (adopt existing documentation, then fill gaps)Set retrofit.phase = "docs". Bring the documentation layer onto the system's
components adopt-first, so no existing human-written doc is lost:
component-builder): read existing code JSDoc/MDX/README and Figma
description, seed the canonical .doc.json marked provenance: imported, and
stamp fingerprints. This first pass claims existing content — it is not a
re-render and must not overwrite it.storybook-chromatic-builder), run docs:digest, and run docs:check — it
should pass (surfaces just rendered) with Figma surfaces edit-unverified.Confirm with the user before writing, consistent with every other phase. On a large
system, size the batch from audit.docSurface and adopt in reviewable chunks.
cleanupRemove the old token outputs only after the repo-wide token-removal guard returns
zero references (guard-token-removal.mjs) — deleted Tailwind utilities are silent
no-ops that tsc/build won't catch (guardrail 4). Gate: show the guard reporting zero
references, then confirm removal. Re-run the verification triad after removal.
When cleanup is verified, set retrofit.phase: "done" and retrofit.completedAt, and
append retrofit-planner to completedSkills.
Because each phase is gated and retrofit.phase is written on entry, a stop at any point
leaves a clean resume point. figma-environment-setup reads retrofit.phase on the next
/start and routes back here at the right phase. Never silently restart from the top —
resume where the manifest says.
retrofit.* and
completedSkills. The audit owns audit.*; the crosswalk owns tokenCrosswalk.npx claudepluginhub jrpease/throughline --plugin throughlineBuilds 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.
Automates design system construction from repository analysis: extracts patterns, builds OKLCH token hierarchies, implements accessible components with tests, verifies via multi-reviewer panels.
Provides architecture for design systems: three-tier tokens, light/dark themes, Figma-to-code pipelines via Style Dictionary, component APIs, Storybook integration, versioning.