Troubleshooting
Organized per skill. Each entry lists the symptom you'll see, the cause (why the skill is behaving that way), and the fix.
/d2c-init issues
"design-tokens.json uses an older schema version"
- Symptom:
d2c-init(or any other skill) stops and asks for confirmation with a message naming a version number or "none". - Cause:
.claude/d2c/design-tokens.jsonwas generated by an olderd2c-initand is missing the currentd2c_schema_versionfield, or has a number below 1. - Fix: Run
/d2c-init --force. That regenerates the file with the current schema. If you had manual edits in the old file, diff the regenerated version against the old one and re-apply your edits before the other skills run.
"framework change detected"
- Symptom: Warning prompt:
Framework change detected: {old} → {new}. - Cause:
d2c-initre-scanned and found a different framework than the one recorded. Usually means the project migrated (e.g. React → Vue) or a new meta-framework config appeared. - Fix: Confirm the new framework if the migration is real. The skill then rewrites framework-specific fields and re-runs library detection. If it was a false positive (e.g. stray Nuxt config), delete the trigger file and re-run.
Tokens got categorized as spacing but they're radii
- Symptom:
d2c-auditflags radius values as "spacing hardcoded";borderssection is empty. - Cause:
d2c-init's Step 2 mis-categorization when the source uses a single scale for both (common with Tailwind before aborderRadiusoverride). - Fix: Move the affected keys from
spacingintobordersindesign-tokens.json. Future runs learn from the corrected file.
Nested token values ("value", "css_var")
- Symptom:
d2c-buildrefuses to emit code, warning about "nested token values (expected flat primitives)". - Cause: The extractor or a hand edit wrote
{ value: "#2563eb", css_var: "--primary" }instead of the flat"#2563eb". - Fix: Flatten — set the key equal to the string value only. See token schema.
/d2c-build issues
"threshold clamped to [50|100]"
- Symptom: Warning on run start; the build uses a different threshold than you passed.
- Cause:
--thresholdmust be between 50 and 100; out-of-range values are clamped. See skill flags. - Fix: Pass a value in-range. Use
--threshold 90to accept 90% match,--threshold 97for stricter acceptance.
"max rounds clamped to [1|10]"
- Symptom: Warning on run start; build caps at 10 rounds.
- Cause: Same shape as threshold clamping; valid range is 1–10.
- Fix: Pass
--max-rounds 6(or similar) within range.
Build never clears the threshold; halts after max rounds
- Symptom: Build finishes with "halted at round N" and a regions summary — component doesn't visually match.
- Cause: Either the design uses primitives your codebase doesn't
have (so
d2c-buildcomposes an approximation and can't close the gap), or the design tokens don't match the design (colors / spacing in the frame aren't indesign-tokens.json). - Fix: Check the regions summary; it names which parts diverged.
If the diff is a color value, run
/d2c-auditto pick up the new value as a suggested token. If a primitive is missing from your components (e.g. no Accordion), either build it in your UI kit first or askd2c-buildto emit a local implementation.
"Schema validation failed" before the build starts
- Symptom: Pre-flight warning listing schema errors.
- Cause:
design-tokens.jsonwas edited by hand into a shape the schema rejects. - Fix: Re-read the error; usually one key moved. Either fix the
shape or run
/d2c-init --forceto regenerate. If the schema file itself can't be found, the skill skips validation — that's silent but safe.
"auto-run /d2c-init" kicks in unexpectedly
- Symptom:
d2c-buildstarts a token scan before the frame fetch, even though tokens exist. - Cause:
.claude/d2c/design-tokens.jsonis missing or unreadable. - Fix: Check file permissions; confirm the path. If the file is
present but
d2c-buildcan't see it, the pre-flight check is at the wrong CWD — run from the repo root.
/d2c-audit issues
"No hardcoded values found, but visually things still drift"
- Symptom: Audit score is 100% but the component looks wrong.
- Cause:
d2c-auditchecks token adherence, not visual match. Hardcoded values are one class of drift; layout drift, wrong primitive choice, or forgotten state variants are orthogonal and audited elsewhere. - Fix: Run
/d2c-buildon the affected component (or the Figma frame it came from). The build loop does visual verification; audit does token verification.
--fix doesn't touch a value you expected
- Symptom: Audit reports a hardcoded value as a violation but
--fixleaves it in place. - Cause:
--fixonly touches definite matches — values that exactly equal a token.undocumentedvalues (close to a token but not exactly, or no match at all) are reported but not auto-fixed because the "right" replacement is ambiguous. - Fix: Either add the value as a new token to
design-tokens.json(if it's a design primitive), or hand-edit the source to the nearest existing token.
--dry-run --fix shows changes you don't want
- Symptom: Preview diff proposes a swap that's technically valid
but loses semantic meaning (e.g.
#000→colors.fgwhen you wantedcolors.neutral-900). - Cause: Multiple tokens map to the same value;
d2c-auditpicks the first match. - Fix: Pick "Selective" from the prompt and deselect the bad
fixes. Then add more specific tokens to
design-tokens.jsonso the ambiguity doesn't recur.
/d2c-guard issues
Guard doesn't fire when I edit a component
- Symptom: You expected
d2c-guardto intercept; it didn't. - Cause: Guard activates on component file extensions inside
src/orapp/, derived from theframeworkfield indesign-tokens.json. Edits outside these dirs, or in files with the wrong extension, don't trigger. - Fix: Check the extension mapping in the
d2c-guard SKILL.md — e.g.
.tsx/.jsxfor react/solid,.vuefor vue,.sveltefor svelte,.component.tsfor angular,.astrofor astro. If yours is right, confirmdesign-tokens.jsonexists (no tokens → no guard).
Guard blocks a legitimate edit
- Symptom: Guard refuses a save with "hardcoded color" or similar.
- Cause: Guard enforces the same non-negotiables as the other skills — no raw color/spacing/typography/shadow/radius values in component files.
- Fix: Add the value to
design-tokens.jsonas a new token (if it's a design primitive), or use an existing token. If the value is temporary (prototype), add a comment explaining why — guard respects opt-out comments the project-level conventions specify.
Guard won't substitute my preferred library
- Symptom: Guard refuses to suggest a library that's installed and, in your view, appropriate.
- Cause: Only libraries in
preferred_libraries.<category>.selectedare allowed. Installed but unselected libraries are treated as noise. - Fix: Either explicitly select the library in
design-tokens.json(run/d2c-initand re-answer the library prompt), or stop using it and uninstall.
General
"I think the skills are reading a stale design-tokens.json"
- Fix: Skills read the file on every invocation; there's no
cache on the skill side. If a change doesn't seem to stick, check
you're editing the same file the skill reads — it's always
.claude/d2c/design-tokens.jsonat the project root, not under~/.claude/.
"The docs site shows a cached pill next to View source"
- Symptom: A reference or skill page shows
cachedinside the "View source" link. - Cause: The docs site couldn't reach GitHub at request time, so
it served the last committed snapshot from
public/snapshots/. - Fix: Nothing on your side. The pill is advisory — the content is correct as of the last nightly snapshot refresh. When GitHub is reachable again, the pill disappears on the next page load.
Still stuck?
File an issue. Attach your
design-tokens.json (redacting API keys) and the full skill output
— the non-negotiables and the clamping warnings are written into the
output for exactly this reason.