Coding agents and CLI
The Colore skill lets you ask your coding agent for color changes in plain words. The agent uses the colore-js CLI to inspect your theme, compute colors, and check contrast in each theme mode. It can also move hard-coded component colors onto theme tokens so they follow the theme.
Install the skill
npx colore-js init
This copies the skill into .agents/skills/colore (read by Cursor, Codex and other Agent Skills clients) and
.claude/skills/colore (Claude Code). With the skills CLI you can also run
npx skills add mallikcheripally/colore-js.
Try one of these requests in your coding agent.
- "Rebrand the app to our logo" (attach or point to
logo.svg/logo.png) - "Add dark mode" or "add chart colors"
- "The gray text is hard to read"
- "Make it feel warmer", "more premium", "less like every other AI app"
- "Make the primary exactly #0f766e"
For larger edits, the skill asks the agent to generate a before-and-after preview before writing changes. The agent finishes by running a contrast audit and reporting what changed and any issues that remain.
CLI
Run the same commands yourself or in CI. Commands that edit a stylesheet leave it on disk as-is until you pass
--write.
npx colore-js inspect
npx colore-js theme "#0f766e" --apply app/globals.css --add --preview preview.html
npx colore-js theme "#0f766e" --apply app/globals.css --add --write
npx colore-js adjust app/globals.css --groups surfaces --hue 70 --chroma 0.008 --write
npx colore-js audit app/globals.css
theme --apply --addcan add a missing dark block,chart-1throughchart-5, and destructive tokens. Use--only statuswith--addto add success and warning tokens.adjust --groupssupportssurfaces,text,brand,accent,borders,status,chartsandother.theme --formatsupportsshadcn(the default, in OKLCH),shadcn-hex,shadcn-hsl(v3 bare HSL channels),css,tailwind,jsonanddtcg.check --intentsupportstext,largeText,uiandfocus. Select--algorithm wcag2or--algorithm apca, then use--level aa,--level aaa, or--target <ratio or Lc>.
Every command accepts --json for machine-readable output. Edit commands (theme --apply, adjust, set) repair
contrast by default, accept --no-fix to skip repair, and can write a before-and-after page with --preview <file.html>.
The brand color stays the brand color
theme keeps your brand color exactly as --primary when it meets the contrast target with white or black text,
and picks a readable foreground. In a dark theme, the brand also needs enough contrast against dark surfaces.
When Colore needs an accessible shade, it selects one from the generated scale. Use --no-preserve-seed to use
the generated scale regardless of the seed's contrast. See generateSystem for details.
Minimal-change fixes
Fixes keep hue and move lightness only as far as needed:
$ npx colore-js check "#3b82f6" "#fff"
#3b82f6 on #ffffff: 3.68:1 FAIL (text needs 4.5:1)
Nearest passing: #2c72e5 (4.52:1)
When a foreground is paired with several backgrounds (for example --muted-foreground on both --muted and --background),
the suggestion must pass on all of them. If no single value can, the audit says which backgrounds conflict instead of guessing.
How audit reads CSS
- Values may be hex,
rgb(),hsl(),oklch(), any CSS Color 4 format, or shadcn/ui v3 bare HSL channels (222.2 84% 4.9%). var()references are resolved where they are declared, like the browser: an inherited--card: var(--background)keeps the:rootvalue inside.dark.- Foregrounds that are
var()references or only inherited are reported as not auto-fixable, with a note.
Docs for agents
- llms.txt: an index of every current page, with the conventions that differ from other color libraries.
- llms-full.txt: every page as Markdown in one file.
- Any docs page is also served as Markdown at its URL plus
.md, for examplehttps://colorejs.dev/docs/agents.md.
Library equivalents
import {
generateSystem, auditCssVariables, fixCssVariables, ensureContrast,
inspectCssTheme, applyThemeToCss, adjustCssVariables,
} from 'colore-js';
const globalsCss = generateSystem('#7c3aed').toShadcnCss({ format: 'oklch' });
// The report describes the theme type, color format, modes, brand, and missing parts.
const theme = inspectCssTheme(globalsCss);
const rebranded = applyThemeToCss(globalsCss, generateSystem('#0f766e'), { add: true }).css;
const warmer = adjustCssVariables(globalsCss, { groups: ['surfaces'], hue: 70, chroma: 0.008 }).css;
const report = auditCssVariables(globalsCss, { level: 'aa' });
const { css: fixed, changes } = fixCssVariables(globalsCss);
const { color } = ensureContrast('#777777', '#ffffff');
console.log(color.hex()); // #767676
See inspectCssTheme, applyThemeToCss and adjustCssVariables for the theme-file API references.