T-J04U-design-language-no-raw-palette-check
Status: open/ready · Impact: medium · Complexity: small
Adoption has no ratchet: nothing stops new raw Tailwind palette classes or
dark: variants from landing in determined experiences and adopted
surfaces. A grep-level repo check with a per-directory baseline holds the
line while legacy debt burns down. Per the repo rule, this is repo tooling
in scripts/, not a solutions/ontological gate.
| Location | Role today |
|---|---|
scripts/guard-control-chars.ts | Existing repo-level guard idiom (lefthook + CI wired). |
solutions/determined/experiences/ | Token-disciplined today; nothing enforces it. |
apps/agentpants/src-nuxt/app/ | Largest legacy debt (~2,400 palette classes) — must not block on day one. |
Proposed
Section titled “Proposed”scripts/guard-raw-palette.ts: scans governed directories for raw palette
classes (text-red-500-shape, dark: variants), compares against a
committed per-directory baseline, fails only on growth. Wired into
lefthook pre-commit and CI. S-0010 documents it.
Approach
Section titled “Approach”- Write the guard with a committed baseline (counts per governed dir); growth fails, shrink auto-tightens or warns to re-baseline.
- Wire lefthook pre-commit and the CI workflow, following the
guard-control-charspattern. - Document the check and the governed set in S-0010.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
scripts/guard-raw-palette.ts | new | the guard + baseline |
lefthook.yml | modify | pre-commit wiring |
.github/workflows/ci.yml | modify | CI wiring |
docs/planning/standards/S-0010-design-language-consumption.md | modify | document the check |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A new raw palette class in a governed dir fails the check; the current tree passes at baseline.
- AC-2: Runs in pre-commit and CI.
- AC-3: S-0010 names the check and the governed directories.
Out of scope
Section titled “Out of scope”- Burning down existing debt (T-APNC-design-language-agentpants-palette-burndown).
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”docs/planning/design-language/PLAN.mdverification/governance section.