Agent skill UI design
Better Colors
Build coherent color ramps, name tokens by role and check contrast in real UI states.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add jakubkrehel/skills --skill better-colors --agent claude-code --yesCheck 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-colorsSelect 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 manualWhat 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- Repository
jakubkrehel/skills
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
- Trace the actual foreground and surface
- Measure and report each failing pair
- 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.
Trace the actual foreground and surface
Find the semantic role and resolved value in both appearances.
Prompt · Step 1Use 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.Measure and report each failing pair
Use the criterion for the actual text role and state.
Prompt · Step 2Use 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.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 3Use 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.