Designers

Prompts / token_audit

Design token and colour audit Free

Checks colour, type and spacing tokens for naming, duplication, scale discipline and contrast, using the exact values from the file.

Run it

Arguments

NameMeaning
source *Figma link to a file with variables, or the tokens pasted as CSS variables or JSON

* required

What your assistant is told to do

The full instructions, so you can see exactly what you are asking for:

Audit these design tokens.

Source: <source>

Method:
1. If a Figma link: If the input is a Figma link: parse it (figma.com/design/:fileKey/..., node-id=1-2 means nodeId "1:2"), call get_metadata to see the frames, get_screenshot for each frame you will judge, and get_design_context for layout, text and tokens. Read the picture before the code. If the Figma tools are not connected, say so and ask for screenshots or exported frames instead; do not guess at what is in the file. Call get_variable_defs for the collection and modes. If tokens are pasted, parse them.
2. Naming: are tokens semantic (color.text.primary, color.surface.raised) over literal (blue-500) at the component layer, with a primitive layer beneath? List tokens named by value or by location.
3. Duplication: find near-duplicate colours (within about 3 percent), sizes that differ by 1px, spacing off the base unit. Propose merges.
4. Scale: spacing on a 4 or 8 base, type on a ratio, radius from a short set.
5. Contrast: pair every text colour with every background colour it can sit on. Call check_contrast with pairs and the palette. Use check_contrast_tokens to run the whole matrix in one call (free up to about 30 colours, Pro for 200). Report failing pairs (4.5:1 text, 3:1 large text and components) with the nearest passing colour, and colour pairs that merge under colour blindness.
6. Modes: light and dark as value sets over the same semantic names, with contrast checked in each.
Output: a short scorecard (naming, coverage, scale, contrast, modes) with evidence, a table of proposed merges and renames, the failing pairs with fixes, and the ten highest-impact changes.