Open source · Design Systems

Design Token Drift Auditor

Find hardcoded colors, spacing and type values that bypass declared tokens.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

Find the places a stylesheet stopped using the design system and started repeating it.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+.

Run the checked-in example

# Clean: every governed declaration reads the token it means.
node bin/design-token-drift-auditor.mjs \
  --tokens examples/tokens.json \
  --config examples/config.json \
  --root . \
  examples/styles/clean.css
# -> "7 of 7 governed declaration(s) ... status pass."   exit 0

# Drift: literals where a token already says the same thing.
node bin/design-token-drift-auditor.mjs \
  --tokens examples/tokens.json \
  --config examples/config.json \
  --root . \
  examples/styles/drift.css
# -> hardcoded-value x4, value-off-scale, unknown-token-reference   exit 1

# Unknown: a computed value this tool does not evaluate.
node bin/design-token-drift-auditor.mjs \
  --tokens examples/tokens.json \
  --config examples/config.json \
  --root . \
  examples/styles/computed.css
# -> value-undetermined, status incomplete   exit 2

Read the result

Add --json to put the machine-readable report on stdout instead of the human summary, and --out report.json to write that report to a file as well.

Scope

Every bound is enforced where it can be exceeded — never a silent truncation and never a pass. Override any of them under limits in the configuration; an unknown limit name is refused.