chore(lint): audit:theme-tokens guard against bare --muted / --theme-* drift

Three naming conventions had drifted through the monorepo (--muted, --theme-*,
--color-*). Only the last is defined in the Mana theme; the others silently
fell back to nothing and stopped tracking theme variants. Today's cleanup
migrated ~100 files, but nothing stopped the drift from creeping back.

- scripts/audit-theme-tokens.mjs scans ~3k source files and fails if any
  references a bare shadcn token or a --theme-* prefix, with an allowlist
  for known-literal module brand colors (news-research, agent templates)
- wire into pnpm script and lint-staged (runs once per commit touching
  *.{svelte,css}, ignores per-file args)
- design-ux.md guideline: fix stale --color-destructive entry (Mana uses
  --color-error), add explicit "never bare tokens" warning with examples

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-16 00:58:13 +02:00
parent 8a5d200c84
commit fc028fa8f0
4 changed files with 246 additions and 2 deletions

View file

@ -23,6 +23,7 @@
"audit:coupling": "node scripts/audit-module-coupling.mjs",
"audit:complexity": "node scripts/audit-complexity.mjs",
"audit:map": "node scripts/build-complexity-map.mjs",
"audit:theme-tokens": "node scripts/audit-theme-tokens.mjs",
"generate:dockerfiles": "node scripts/generate-dockerfiles.mjs",
"setup:env": "node scripts/generate-env.mjs",
"setup:secrets": "node scripts/setup-secrets.mjs",