with one click
with one click
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | sf-audit-design-tokens |
| description | Deep design-token system audit. |
| disable-model-invocation | true |
| argument-hint | [file-path | "global"] (omit for full project) |
Before resolving any ShipFlow-owned file, load $SHIPFLOW_ROOT/skills/references/canonical-paths.md ($SHIPFLOW_ROOT defaults to $HOME/shipflow). ShipFlow tools, shared references, skill-local references/*, templates, workflow docs, and internal scripts must resolve from $SHIPFLOW_ROOT, not from the project repo where the skill is running. Project artifacts and source files still resolve from the current project root unless explicitly stated otherwise.
Trace category: conditionnel.
Process role: source-de-chantier.
Before producing the final report, load $SHIPFLOW_ROOT/skills/references/chantier-tracking.md when this run is attached to a spec-first chantier. If exactly one active specs/*.md chantier is identified, append the current run to Skill Run History, update Current Chantier Flow when the run changes the chantier state, and include a final Chantier block. If no unique chantier is identified, do not write to any spec; report Chantier: non applicable or Chantier: non trace with the reason.
Because this skill has process role source-de-chantier, evaluate the standard threshold from $SHIPFLOW_ROOT/skills/references/chantier-tracking.md before the final report. If the findings reveal non-trivial future work and no unique chantier owns it, do not write to an existing spec; add a Chantier potentiel block with oui, non, or incertain, a proposed title, reason, severity, scope, evidence, recommended /sf-spec ... command, and next step. If the work is only a direct local fix or already belongs to the current chantier, state Chantier potentiel: non with the concrete reason.
Before producing the final report, load $SHIPFLOW_ROOT/skills/references/reporting-contract.md.
Default to report=user: concise, findings-first, and focused on top issues, proof gaps, chantier potential, and the next real action. Use report=agent, handoff, verbose, or full-report for the detailed audit matrix, domain checklist output, command evidence, assumptions, confidence limits, and handoff notes.
pwdhead -60 CLAUDE.md 2>/dev/null || echo "no CLAUDE.md"head -40 BRANDING.md 2>/dev/null || echo "no BRANDING.md"cat tailwind.config.* 2>/dev/null | head -100 || echo "no tailwind config"cat src/styles/global.css src/styles/globals.css src/assets/styles/global.css 2>/dev/null | head -150 || echo "no global styles"find . -type f \( -name "tokens*" -o -name "theme*" -o -name "*Theme*" -o -name "design-tokens*" -o -name "palette*" -o -name "_variables*" \) 2>/dev/null | grep -v node_modules | head -20 || echo "none"grep -rh --include="*.{css,scss}" -E '^\s*--[a-z-]+:' src/ 2>/dev/null | sort -u | head -80 || echo "none found"grep -rn --include="*.{css,scss,vue,astro,tsx,jsx}" -E 'font-size:\s*[0-9]' src/ 2>/dev/null | grep -v 'var(--' | grep -v node_modules | wc -l || echo "0"grep -rn --include="*.{css,scss}" -E '(margin|padding|gap):\s*[0-9]+(\.[0-9]+)?(px|rem|em)' src/ 2>/dev/null | grep -v 'var(--' | grep -v node_modules | wc -l || echo "0"grep -rn --include="*.{css,scss}" -E '(transition|animation):\s*' src/ 2>/dev/null | grep -v 'var(--' | grep -v node_modules | wc -l || echo "0"grep -rn --include="*.{astro,vue,tsx,jsx,svelte,dart}" -E '#[0-9a-fA-F]{3,6}\b|rgb\(|rgba\(|oklch\(|Color\(0x' src/ lib/ 2>/dev/null | grep -v node_modules | wc -l || echo "0"grep -rn --include="*.{ts,tsx,js,jsx,vue,astro,svelte,dart}" -E 'ThemeMode|prefers-color-scheme|color-scheme|themeMode|darkMode' src/ lib/ 2>/dev/null | grep -v node_modules | head -10 || echo "none found"grep -rn --include="*.{css,scss,ts,tsx,js,jsx,vue,astro,svelte}" -E 'prefers-reduced-motion' src/ 2>/dev/null | grep -v node_modules | wc -l || echo "0"grep -rln --include="*.{ts,tsx,js,jsx}" -E "(next-auth|@clerk/|better-auth|@auth/|lucia|@supabase/auth|firebase/auth|getServerSession|useSession|useUser|currentUser)" src/ app/ pages/ 2>/dev/null | grep -v node_modules | head -3 || echo "none ā server sync not required"find . -type f -name "tokens.json" -o -name "*.tokens.json" 2>/dev/null | grep -v node_modules | head -5 || echo "none"find src/components src/ui lib/widgets -type f \( -name "*.tsx" -o -name "*.vue" -o -name "*.astro" -o -name "*.svelte" -o -name "*.dart" \) 2>/dev/null | grep -v node_modules | wc -l || echo "0"find . -type f \( -name "tokens*" -o -name "theme*" \) 2>/dev/null | grep -v node_modules | head -3 | xargs -I {} git log --oneline -10 -- {} 2>/dev/null | head -30 || echo "no git history"If no token files detected and no CSS custom properties found ā the project has no design token system. Abort with:
ā No design token system detected.
This skill audits EXISTING design token systems. The project appears to use
literal values throughout (hardcoded hex, font-sizes, spacings).
Next steps:
1. Run /sf-audit-design (standard mode) if the visual direction is unclear
2. Run /sf-design-from-scratch to create the professional token system
3. Run /sf-design-playground once the token system exists
4. Re-run /sf-audit-design-tokens for the deep audit
$ARGUMENTS is "global" ā GLOBAL MODE: audit token systems across ALL projects$ARGUMENTS is a file path ā FILE MODE: audit the token file(s) at that path$ARGUMENTS is empty ā PROJECT MODE: full deep auditRun all 7 phases sequentially. Each phase produces a sub-score (A/B/C/D) and contributes to the final report.
Read the token source files (detected in context block) and build a structured inventory:
COLOR PALETTE
Source(s): [list of files]
Format: [css-vars | tailwind | js-object | DTCG json | hybrid]
Token count: N
Universal semantic socle:
success: [present (light+dark) / missing in dark / missing entirely]
warning: [...]
danger: [...]
info: [...]
neutral: [...]
Surface tokens:
surface-base: [present / missing]
surface-raised: [...]
surface-overlay: [...]
surface-sunken: [...]
Domain-specific intents: [list project-specific tokens beyond the socle]
Hue-based names in components: N violations (list first 10 files)
TYPOGRAPHY
Source(s): [files]
Format: [css-vars | theme object | Flutter TextTheme | hybrid]
Token count: N
Naming strategy: [t-shirt | semantic | MIXED ā violation]
Token bundle:
font-size + line-height + letter-spacing co-located: [yes / partial / no]
Fluid clamp() usage: [all headings / partial / none]
Literal font-sizes outside tokens: N (adaptive severity ā see Phase 7)
SPACING
Source(s): [files]
Format: [css-vars | tailwind scale | theme object | hybrid]
Token count: N
Naming strategy: [t-shirt | semantic | MIXED]
Base unit: [4px | 8px | modular ratio | chaotic]
Fluid spacing (layout-level): [adopted / static-only]
Literal spacing outside tokens: N
MOTION
Source(s): [files]
Format: [css-vars | tailwind | theme object | hybrid]
Duration tokens: N (naming: [semantic | by-value | MIXED])
Easing tokens: N (explicit cubic-bezier / CSS keywords)
Reduced-motion declarations: N (see context block)
Literal transition/animation outside tokens: N
Output this inventory verbatim at the top of the report. Every subsequent phase adds findings.
For each color/surface token, verify that it is defined for every declared theme mode (light, dark, any custom mode like high-contrast).
Generate a matrix:
light dark high-contrast
--color-success ā ā ā
--color-warning ā ā ā ā UNDEFINED
--surface-raised ā ā ā ā UNDEFINED in dark
Any ā = š high severity (theme breaks silently in that mode). Count total gaps and report.
For typography and spacing scales, extract numeric values and compute the ratio between consecutive tokens:
TYPOGRAPHY SCALE
--fs-xs = 0.875rem ratio ā sm: 1.143Ć
--fs-sm = 1.000rem ratio ā base: 1.125Ć
--fs-base = 1.125rem ratio ā lg: 1.111Ć
--fs-lg = 1.250rem ratio ā xl: 1.200Ć
--fs-xl = 1.500rem ratio ā 2xl: 1.333Ć
--fs-2xl = 2.000rem
Coherence assessment:
Same analysis for spacing (4px base: 4, 8, 12, 16, 24, 32, 48, 64 ā each ratio ~1.5Ć or 1.33Ć).
Build a dependency graph of tokens referencing tokens:
--color-button-bg: var(--color-brand)
ā --color-brand: oklch(0.6 0.18 250)
--color-button-hover: color-mix(in oklch, var(--color-brand) 90%, black)
ā --color-brand (same as above)
Report:
--color-error and --color-danger both = oklch(0.55 0.2 25))Run git log --follow --oneline -50 -- <token-files> and git log -p -20 -- <token-files>. Look for:
fix: commits on token files = unstable foundation, the system is being reactively patched instead of deliberately designedOutput a brief timeline of the last 10 changes with assessment.
If the project has a tokens.json or similar (see context block), verify compliance with W3C DTCG spec (first stable version Oct 2025):
$value (mandatory)$type (color, dimension, fontFamily, fontWeight, duration, cubicBezier, etc.)$description present for non-trivial tokens{group.subgroup.token} syntax (curly braces), not $ref (old draft)color.semantic.success > color.blue.500)$extensions or dedicated $schema versionProjects without DTCG file : skip phase, note in report ("not applicable ā no DTCG file").
Deep version of the sf-audit-design #11 Theme System Architecture checklist, with measured verifications instead of yes/no questions:
system, not crash)updateUserPreferences, settings.theme, or equivalent. If absent ā š“ critical (preference doesn't follow the user across devices).<head> or SSR layout for an inline script that sets data-theme before CSS loads. Absent on a client-rendered app = š high (visible flash for dark-mode users on every reload).prefers-color-scheme honored : trace first-render path for users with no stored preference. Must read window.matchMedia('(prefers-color-scheme: dark)') or equivalent.if (isDark) branches in components : grep isDark\|isLight\|theme\s*===\s*['\"]dark in component files. Every hit = violation (mode-switching logic belongs in tokens, not business code).BRANDING.md justification. Absent = violation.Based on the component files count from the context block:
| Project size | Threshold | Default priority for token findings |
|---|---|---|
| Small | < 10 | š” medium unless user impact or brand trust is directly harmed |
| Mid | 10-30 | š high |
| Large | > 30 | š“ critical |
Apply this to all findings. A missing semantic socle in a 5-file demo project is still a professional finding, but usually medium priority. The same missing socle in a 50-file SaaS is critical because drift compounds fast.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
DESIGN TOKENS AUDIT ā [project name]
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
INVENTORY
[full inventory block from Phase 1]
SUBSCORES
Theme Architecture [A/B/C/D]
Typography Tokens [A/B/C/D]
Spacing Tokens [A/B/C/D]
Motion Tokens [A/B/C/D]
Universal Palette Socle [A/B/C/D]
Ratio Coherence [A/B/C/D]
Dependency Health [A/B/C/D]
Historical Drift [A/B/C/D]
DTCG Compliance [A/B/C/D | N/A]
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
OVERALL DESIGN TOKENS [A/B/C/D]
CRITICAL ISSUES (š“)
file:line ā description ā Why: [principle]
HIGH SEVERITY (š )
file:line ā description ā Why: [principle]
PRIORITY IMPROVEMENTS (ā”)
file:line ā description ā Why: [principle]
ā” (if no playground detected) Run /sf-design-playground to scaffold a live token preview page.
ā” (if tokens exist but pages/components still use hardcoded values) Run /sf-design "migrer le site pour consommer les tokens design centralises sans changement visuel volontaire".
Fixed: 0 (this audit is read-only)
Tasks created: X in TASKS.md
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
If $ARGUMENTS is a file path, audit only that token file. Run:
Skip Phase 2 (coverage matrix requires all modes), Phase 4 (dep graph requires cross-file), Phase 5 (git log still applies), Phase 7 (theme architecture is project-wide).
Same pattern as sf-audit-design GLOBAL MODE:
${SHIPFLOW_DATA_DIR:-$HOME/shipflow_data}/PROJECTS.md Domain Applicability table ā identify projects with Design āsubagent_type: "general-purpose", runs this skill's PROJECT MODE, returns the structured reportShared file write protocol for AUDIT_LOG.md and TASKS.md:
After generating the report:
AUDIT_LOG.md : append a row for "Design Tokens" audit with date + overall score + critical countTASKS.md : add/replace a ### Audit: Design Tokens subsection with š“š š” issues as task rows${SHIPFLOW_DATA_DIR:-$HOME/shipflow_data}/TASKS.md : find the project's section, add same subsection, update Dashboard Top Priority if š“ issues foundsf-audit-design in deep mode but can also run standalone via /sf-audit-design-tokensThemeData, TextTheme, ColorScheme) + native (any centralized token approach)ThemeData = theme mode, TextTheme = typography tokens, spacing via EdgeInsets constants, motion via Duration/Curves constants) ā the audit logic is the same, only the vocabulary differs