Skill library

Agent skill UI design

Better Colors

Build coherent color ramps, name tokens by role and check contrast in real UI states.

  • Color palettes
  • Contrast
  • Design tokens

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add jakubkrehel/skills --skill better-colors --agent claude-code --yes

Check this file in your project.claude/skills/better-colors/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add jakubkrehel/skills --skill better-colors

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use the existing design tokens and a rendered preview for the actual composite color, including any opacity or background image.

View operation manual

What this skill helps with

  • Build palette ramps for surfaces, text, accents and interaction states.
  • Map raw colors to semantic roles and preserve existing token conventions.
  • Measure the contrast of foreground and background combinations.

Good for

  • Light and dark themes
  • Color systems for brand sites
Skill name
better-colors
Workflow
Repair a semantic color pair
Deliverable
A measured pair, role mapping, and confirmed token correction.
Skill name
better-colors

Keep the request tied to one real task

A broad request

Make every gray on the settings page darker.

A separator, disabled control, and secondary text have different roles and may share a current color by coincidence.

A checkable workflow

  1. Trace the actual foreground and surface
  2. Measure and report each failing pair
  3. Apply the approved role correction and remeasure

Better Colors operation manual

Trace and measure muted text on a card before changing its token.

Replace the bracketed details with the component, route, or source you want to use.

  1. Trace the actual foreground and surface

    Find the semantic role and resolved value in both appearances.

    Prompt · Step 1
    Use better-colors to inspect [card and local preview route]. Find the secondary text role, its token alias, and the actual surface beneath it in light and dark. Resolve transparency or layered backgrounds before recording the foreground and background values. If there is no browser, report only the declared pairs and mark rendered contrast unverified.
  2. Measure and report each failing pair

    Use the criterion for the actual text role and state.

    Prompt · Step 2
    Use better-colors and contrast.md to measure [foreground and background] on [card route]. Determine the applicable criterion for the text role and size using better-accessibility guidance. Report actual ratio, threshold, theme, state, and token source. Explain when the wrong role token is responsible. Keep color edits pending until the specific correction is selected.
  3. Apply the approved role correction and remeasure

    Reuse the correct role, then check consumers of any shared change.

    • The measured pair uses the real background and state.
    • Both appearances preserve the intended token role.
    Prompt · Step 3
    Use better-colors to apply [approved token correction] on [card route]. Resolve the old and new token roles and inspect shared consumers before changing a primitive. Preserve project notation and reuse the existing theme switch. Measure the same text and background pairs in both appearances after the change, including states affected by the edit. Report before and after ratios and any unverified state.

Find the relevant rule

Provide the actual target and point to the installed reference.

A border variable is used for textReference
Command or reference
token-naming.md
Examples
Trace the alias and choose the intended semantic text role.
Text sits over a translucent surfaceReference
Command or reference
contrast.md
Examples
Measure the rendered composite pair in both themes.

Better Colors troubleshooting

Should I change all colors to OKLCH?

Use the project’s established notation. OKLCH is a sensible choice for a new system when the project has no preference.