/token-compliance
Check a codebase or implementation for token compliance — finding hardcoded values, wrong-tier token references, and inconsistent token application in consuming code. This checks how tokens are used in code, NOT how the tokens themselves are defined or structured. Trigger when
$ npx -y skills add murphytrueman/design-system-ops --skill token-compliance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/token-compliance
Context preview
The summary Claude sees to decide when to auto-load this skill.
Check a codebase or implementation for token compliance — finding hardcoded values, wrong-tier token references, and inconsistent token application in consuming code. This checks how tokens are used in code, NOT how the tokens themselves are defined or structured. Trigger when
SKILL.md
token-compliance.SKILL.mdname: token-compliance
description: "Check a codebase or implementation for token compliance — finding hardcoded values, wrong-tier token references, and inconsistent token application in consuming code. This checks how tokens are used in code, NOT how the tokens themselves are defined or structured. Trigger when someone says: are we using tokens correctly, find hardcoded values, token compliance check, find raw values, token misuse, are there any hex values in the code, checking token usage, or anything about whether tokens are being used consistently and correctly. Do NOT trigger for auditing the token definitions themselves — use token-audit for that."
references:
- ../../knowledge-notes/token-architecture.md
- ../../knowledge-notes/output-discipline.md
Token compliance
A skill for identifying token compliance violations in a codebase or implementation: hardcoded raw values where tokens should be used, wrong-tier token references, and inconsistent token application. Produces a violation report with file references and remediation guidance.
Context
Token compliance problems compound quietly. A single hardcoded hex value does not break anything. Two hundred of them, distributed across a codebase by dozens of contributors over two years, mean that a brand refresh or a dark mode implementation becomes a manual find-and-replace operation through thousands of files rather than a token update.
The compliance check exists to catch violations before they accumulate, and to understand the pattern of violations when they already have. The pattern matters: if hardcoded values are concentrated in one product area or one team's contribution, the response is different than if they are evenly distributed.
---
Configuration
Before producing output, check for a `.ds-ops-config.yml` file in the project root. If present, load:
- `severity.*` — overrides for violation severity. Especially: `hardcoded_color`, `wrong_tier_reference`, `tier_leakage`
- `system.theming` — if true, elevate hardcoded colour violations to the configured severity (typically `critical`)
- `system.styling` — pre-selects the detection approach
- `integrations.github` — if enabled, auto-search for violations across the repo (see below)
- `integrations.style_dictionary` — if enabled, use the parsed token tree as the reference for what tokens exist and their correct tiers
- `gates.*` — if running as part of `component-to-release`, these determine which violations block release
Auto-pull integrations
**GitHub** (`integrations.github.enabled: true`):
- Before running the manual compliance checks, do a broad search of `integrations.github.repo` for hardcoded values:
- `gh api search/code -q "repo:[repo] language:css #[0-9a-fA-F]{6}"` — hex colours in CSS
- `gh api search/code -q "repo:[repo] language:scss #[0-9a-fA-F]{6}"` — hex colours in SCSS
- Search for `px` values in styling files as a spacing compliance signal
- Use the results to quantify scope before the detailed audit — "approximately 340 hardcoded hex values across 47 files" is a useful framing for the report summary
**Style Dictionary v4** (`integrations.style_dictionary.enabled: true`):
- Parse the token tree to build a complete map of available tokens per tier
- Use this as the authoritative "what token should this reference?" lookup when flagging violations
- If a hardcoded value exactly matches a known token's resolved value, include the token name in the remediation guidance automatically
**Figma MCP** (`integrations.figma.enabled: true`):
- Pull Figma variable definitions as a cross-reference — if a colour is defined as a Figma variable but hardcoded in code, that is a compliance violation with a known correct token
If an integration fails, log it and proceed with manual input.
Step 0b: Messy codebase protocol
Token compliance has the most value on messy codebases — the ones with years of accumulated hardcoded values, inconsistent styling approaches, and multiple token migration attempts. For these codebases, apply the extended detection protocol:
**Indicators of a messy codebase:**
- Multiple styling approaches in the same project (CSS custom properties AND SCSS variables AND inline styles)
- Token files exist but significant portions of the codebase pre-date them
- Multiple naming conventions visible in style files (camelCase, kebab-case, BEM — mixed)
- Legacy colour palettes coexisting with current tokens
- Inline `style=` attributes in component templates
**Extended detection for messy codebases:**
1. **Legacy value mapping.** Before flagging violations, build a map of legacy values to current tokens. Many hardcoded values in legacy code were correct at the time they were written — they pre-date the token system. Map `#0066CC` to `var(--color-action-primary)` so remediation guidance is specific, not just "use a token."
2. **Violation age estimation.** Use git blame or file modification dates to estimate when violations were introduced. Group violations by era:
- **Pre-token era** (before the token system existed) — these are expected debt, not compliance failures
- **Migration era** (during token adoption) — partially migrated files where some values use tokens and others do not
- **Post-token era** (after tokens were established) — these are genuine compliance failures and should be higher severity
3. **Hotspot detection.** Identify the 5–10 files with the most violations. These are the high-value remediation targets — fixing them reduces the violation count disproportionately. Present as:
Compliance hotspots:
1. src/legacy/checkout/styles.scss — 47 hardcoded values (pre-token era)
2. src/components/Card/Card.styles.ts — 23 hardcoded values (migration era)
3. src/pages/Dashboard/index.tsx — 19 inline styles (post-token era — PRIORITY)
4. **Intentional override detection.** Not every hardcoded value is a violation. Look for patterns that indicate intentional overrides:
- Comments
Read more
name: token-compliance description: "Check a codebase or implementation for token compliance — finding hardcoded values, wrong-tier token references, and inconsistent token application in consuming code. This checks how tokens are used in code, NOT how the tokens themselves are defined or structured. Trigger when someone says: are we using tokens correctly, find hardcoded values, token compliance check, find raw values, token misuse, are there any hex values in the code, checking token usage, or anything about whether tokens are being used consistently and correctly. Do NOT trigger for auditing the token definitions themselves — use token-audit for that." references: - ../../knowledge-notes/token-architecture.md - ../../knowledge-notes/output-discipline.md
Token compliance
A skill for identifying token compliance violations in a codebase or implementation: hardcoded raw values where tokens should be used, wrong-tier token references, and inconsistent token application. Produces a violation report with file references and remediation guidance.
Context
Token compliance problems compound quietly. A single hardcoded hex value does not break anything. Two hundred of them, distributed across a codebase by dozens of contributors over two years, mean that a brand refresh or a dark mode implementation becomes a manual find-and-replace operation through thousands of files rather than a token update.
The compliance check exists to catch violations before they accumulate, and to understand the pattern of violations when they already have. The pattern matters: if hardcoded values are concentrated in one product area or one team's contribution, the response is different than if they are evenly distributed.
---
Configuration
Before producing output, check for a `.ds-ops-config.yml` file in the project root. If present, load:
- `severity.*` — overrides for violation severity. Especially: `hardcoded_color`, `wrong_tier_reference`, `tier_leakage`
- `system.theming` — if true, elevate hardcoded colour violations to the configured severity (typically `critical`)
- `system.styling` — pre-selects the detection approach
- `integrations.github` — if enabled, auto-search for violations across the repo (see below)
- `integrations.style_dictionary` — if enabled, use the parsed token tree as the reference for what tokens exist and their correct tiers
- `gates.*` — if running as part of `component-to-release`, these determine which violations block release
Auto-pull integrations
**GitHub** (`integrations.github.enabled: true`):
- Before running the manual compliance checks, do a broad search of `integrations.github.repo` for hardcoded values:
- `gh api search/code -q "repo:[repo] language:css #[0-9a-fA-F]{6}"` — hex colours in CSS
- `gh api search/code -q "repo:[repo] language:scss #[0-9a-fA-F]{6}"` — hex colours in SCSS
- Search for `px` values in styling files as a spacing compliance signal
- Use the results to quantify scope before the detailed audit — "approximately 340 hardcoded hex values across 47 files" is a useful framing for the report summary
**Style Dictionary v4** (`integrations.style_dictionary.enabled: true`):
- Parse the token tree to build a complete map of available tokens per tier
- Use this as the authoritative "what token should this reference?" lookup when flagging violations
- If a hardcoded value exactly matches a known token's resolved value, include the token name in the remediation guidance automatically
**Figma MCP** (`integrations.figma.enabled: true`):
- Pull Figma variable definitions as a cross-reference — if a colour is defined as a Figma variable but hardcoded in code, that is a compliance violation with a known correct token
If an integration fails, log it and proceed with manual input.
Step 0b: Messy codebase protocol
Token compliance has the most value on messy codebases — the ones with years of accumulated hardcoded values, inconsistent styling approaches, and multiple token migration attempts. For these codebases, apply the extended detection protocol:
**Indicators of a messy codebase:**
- Multiple styling approaches in the same project (CSS custom properties AND SCSS variables AND inline styles)
- Token files exist but significant portions of the codebase pre-date them
- Multiple naming conventions visible in style files (camelCase, kebab-case, BEM — mixed)
- Legacy colour palettes coexisting with current tokens
- Inline `style=` attributes in component templates
**Extended detection for messy codebases:**
1. **Legacy value mapping.** Before flagging violations, build a map of legacy values to current tokens. Many hardcoded values in legacy code were correct at the time they were written — they pre-date the token system. Map `#0066CC` to `var(--color-action-primary)` so remediation guidance is specific, not just "use a token."
2. **Violation age estimation.** Use git blame or file modification dates to estimate when violations were introduced. Group violations by era:
- **Pre-token era** (before the token system existed) — these are expected debt, not compliance failures
- **Migration era** (during token adoption) — partially migrated files where some values use tokens and others do not
- **Post-token era** (after tokens were established) — these are genuine compliance failures and should be higher severity
3. **Hotspot detection.** Identify the 5–10 files with the most violations. These are the high-value remediation targets — fixing them reduces the violation count disproportionately. Present as:
Compliance hotspots: 1. src/legacy/checkout/styles.scss — 47 hardcoded values (pre-token era) 2. src/components/Card/Card.styles.ts — 23 hardcoded values (migration era) 3. src/pages/Dashboard/index.tsx — 19 inline styles (post-token era — PRIORITY)
4. **Intentional override detection.** Not every hardcoded value is a violation. Look for patterns that indicate intentional overrides:
- Comments
Showing the first part of this file.
Claude Code skills for the work that keeps a design system alive.
Repo: murphytrueman/design-system-ops
Other skills on design-system-ops.
- /accessibility-per-component
Run an accessibility audit on a specific design system component. Trigger when someone says: accessibility check, a11y audit, WCAG compliance, is this accessible, check accessibility, does this meet WCAG, screen reader support, keyboard navigation check, or anything about
Open skill - /adoption-report
Produce a design system adoption report separating coverage from actual adoption, with trend direction and risk flags. Trigger when someone says: adoption report, how much is the system being used, usage metrics, adoption status, coverage report, which teams are using the
Open skill - /ai-component-description
Generate AI-optimised text descriptions for components, formatted for Figma's MCP server and LLM consumption. This produces prose descriptions in a six-section format (purpose, props, anti-patterns, composition, accessibility, examples), NOT JSON schemas or structured data
Open skill - /backlog-generator
Transform audit findings into sprint-ready work items with effort estimates, acceptance criteria, and stakeholder-friendly rationale. This converts existing findings into tickets, NOT the process for contributing new components to the system. Trigger when someone says: generate
Open skill - /change-communication
Produce a communication package for a design system change — release notes, migration guide, and team announcement. This produces communication artefacts for changes that have already been decided, NOT the deprecation lifecycle itself. Trigger when someone says: communicate this
Open skill - /cicd-integration
Generate CI/CD pipeline configurations that automate design system quality checks — token validation, component linting, visual regression, accessibility scanning, and release gating. Produces ready-to-use pipeline files for GitHub Actions, GitLab CI, CircleCI, or Bitbucket
Open skill

