design-token-contrast
Skill1 starsChanged 7 months agoMITView on GitHub
Check WCAG contrast ratios between color pairs or across your token system semantic foreground/background pairings. Use when the user wants to verify accessibility compliance for specific colors or their entire token palette.
In this repository6 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
If the user provides two specific colors (e.g., "check contrast between #4F46E5 and #FFFFFF"), compute the contrast ratio directly using …
- Distinctive: line 47
If it fails, suggest which direction to adjust (lighter background or darker foreground) and check adjacent ramp steps if the colors come …
- Distinctive: line 51
If the user wants to check all semantic color pairings in their token system, run the full inspect command — it includes contrast analysis:
- Distinctive: line 68
When a pair fails contrast:
- Distinctive: line 71
Check the suggested replacement pair and confirm it passes before recommending
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design Token Contrast Checker
You are helping the user check WCAG 2.1 color contrast compliance.
Two modes
This skill works in two ways depending on what the user needs:
Mode A: Ad-hoc color pair check
If the user provides two specific colors (e.g., "check contrast between #4F46E5 and #FFFFFF"), compute the contrast ratio directly using the project's utility functions.
Run this inline:
node --input-type=module -e '
import { contrastRatio } from "@quieto/tokens";
const fg = "#4F46E5";
const bg = "#FFFFFF";
const ratio = contrastRatio(fg, bg);
const aa = ratio >= 4.5;
const aaLarge = ratio >= 3;
const aaa = ratio >= 7;
const aaaLarge = ratio >= 4.5;
console.log(JSON.stringify({
ratio: ratio.toFixed(2),
"AA normal (>=4.5:1)": aa,
"AA large (>=3:1)": aaLarge,
"AAA normal (>=7:1)": aaa,
"AAA large (>=4.5:1)": aaaLarge
}, null, 2));
'Replace the hex values with the user's colors. Present the results:
- Contrast ratio: X.XX:1
- WCAG AA normal text (>= 4.5:1): Pass/Fail
- WCAG AA large text (>= 3:1): Pass/Fail
- WCAG AAA normal text (>= 7:1): Pass/Fail
- WCAG AAA large text (>= 4.5:1): Pass/Fail
If it fails, suggest which direction to adjust (lighter background or darker foreground) and check adjacent ramp steps if the colors come from the token system.
Mode B: Full system contrast audit
If the user wants to check all semantic color pairings in their token system, run the full inspect command — it includes contrast analysis:
npx quieto-tokens inspectThis command performs the full contrast audit across all semantic foreground/background pairings in every theme.
WCAG thresholds reference
| Level | Normal text | Large text (18pt+ or 14pt+ bold) |
| AA | 4.5:1 | 3:1 |
| AAA | 7:1 | 4.5:1 |
Suggesting fixes
When a pair fails contrast:
- Identify which ramp step each color comes from
- Suggest moving the foreground darker (higher step number) or the background lighter (lower step number)
- Check the suggested replacement pair and confirm it passes before recommending
- Note if the fix would break consistency with other semantic roles — suggest running
/design-token-auditafter any changes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

