/design-system:color-system-builderfrom Design System
Generates a complete color system from a single accent color: 9-step scale, light/dark themes, semantic tokens, and WCAG AA contrast checks using oklch.
Ships in Design System. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Принцип — oklch + ramp. Все цвета одного семейства имеют одинаковую chroma, варьируется lightness. Это даёт визуально согласованные шкалы, которых не получишь подбором HEX'ов.
templates/build-palette.mjs:
node build-palette.mjs "#D97757"
# → palette.css + palette.json
Делает:
import fs from 'node:fs/promises';
import { converter, formatHex, wcagContrast } from 'culori';
const arg = process.argv[2];
if (!arg) { console.error('Usage: node build-palette.mjs <color>'); process.exit(1); }
const oklch = converter('oklch')(arg);
const C = oklch.c, H = oklch.h;
const steps = [98, 95, 90, 82, 72, 62, 52, 42, 32, 20];
const names = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
function ramp(hue, chroma) {
const out = {};
steps.forEach((L, i) => {
out[names[i]] = formatHex({ mode: 'oklch', l: L/100, c: chroma, h: hue });
});
return out;
}
const palette = {
primary: ramp(H, C),
neutral: ramp(H, 0.01), // тонированный серый, не «компьютерный»
success: ramp(145, C),
warning: ramp(80, C),
danger: ramp(25, C),
info: ramp(245, C),
};
// Светлая и тёмная тема — semantic mappings
const tokens = {
light: {
bg: palette.neutral[50],
fg: palette.neutral[900],
muted: palette.neutral[600],
rule: palette.neutral[200],
primary: palette.primary[500],
'primary-fg': palette.primary[50],
},
dark: {
bg: palette.neutral[900],
fg: palette.neutral[50],
muted: palette.neutral[400],
rule: palette.neutral[800],
primary: palette.primary[400],
'primary-fg': palette.primary[900],
},
};
// Контраст
function check(fg, bg) {
const c = wcagContrast(fg, bg);
return { ratio: c.toFixed(2), passAA: c >= 4.5, passLarge: c >= 3 };
}
const audit = {
'light fg/bg': check(tokens.light.fg, tokens.light.bg),
'light muted/bg': check(tokens.light.muted, tokens.light.bg),
'light primary-fg/primary': check(tokens.light['primary-fg'], tokens.light.primary),
'dark fg/bg': check(tokens.dark.fg, tokens.dark.bg),
'dark muted/bg': check(tokens.dark.muted, tokens.dark.bg),
};
await fs.writeFile('palette.json', JSON.stringify({ palette, tokens, audit }, null, 2));
let css = ':root {\n';
for (const [k, v] of Object.entries(tokens.light)) css += ` --${k}: ${v};\n`;
css += '}\n[data-theme="dark"] {\n';
for (const [k, v] of Object.entries(tokens.dark)) css += ` --${k}: ${v};\n`;
css += '}\n\n';
for (const [name, ramp] of Object.entries(palette)) {
for (const [step, hex] of Object.entries(ramp)) {
css += `:root { --${name}-${step}: ${hex}; }\n`;
}
}
await fs.writeFile('palette.css', css);
console.log('✓ palette.css + palette.json');
console.table(audit);
Зависимость: npm i culori.
palette.css подключай в проект первым.palette.json отдай разработчику или используй в dev-handoff.audit есть passAA: false для основных пар — палитра плохая, поправь L-значения.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jhamidun/claude-code-config-pack --plugin design-system12 skills in this plugin
/brand-extractorВытащить цвета, шрифты, копирайт из сайта по URL (headless Playwright). Триггеры: «сделай в стиле нашего сайта», «вытащи цвета с сайта». НЕ чужие продукты→content-policy./brand-guidelinesОфициальные цвета и шрифты бренда Anthropic (палитра + Poppins/Lora) для артефактов и .pptx. Триггеры: «стиль Anthropic». НЕ бренд пользователя/клиента→design-md-brands./dark-mode-addДобавить dark mode к light-дизайну: продуманные dark-токены, не инверт. Триггеры: «тёмная тема к дизайну», «dark theme tokens».Other plugins' skills for the same job