theme-swap — команда для Claude Code: смена темы
Команда theme-swap для Claude Code меняет основной цвет извлечённого сайта, сохраняя нейтральные цвета, типографику, отступы и анимации. Так быстро проверяют новый брендинг.
MIT ★ 5 183 обновлён 2026-10-23
/plugin marketplace add Manavarya09/design-extract
/plugin install designlang@designlangЧто делает theme-swap
Команда принимает URL извлечённого сайта и целевой цвет в HEX через --primary. Палитра поворачивается по оттенку в OKLCH, а светлота цветов сохраняется. Нейтральные и структурные токены, типографика, отступы и motion не меняются.
Результаты появляются в ./design-extract-output/: HTML-превью рядом с исходным вариантом, Markdown-таблица изменений, JSON с дельтами и файл токенов DTCG. Для Tailwind и shadcn эти токены можно забрать в существующий проект. --primary обязателен, а --from позволяет вручную задать исходный основной цвет, если автоопределение ошиблось.
Флаг --open открывает HTML-превью в браузере. Формат и каталог вывода меняются через --format и --out. Без URL и --primary <hex> команда запросит недостающий параметр.
Какие задачи решает
- сменить основной цвет извлечённого сайта
- сравнить исходный и перекрашенный HTML
- получить таблицу изменений палитры
- выгрузить токены для Tailwind или shadcn
Примеры запросов агенту
- Перекрась сайт по адресу
<url>в#ff4800командой/designlang:theme-swap <url> --primary "#ff4800". - Смени основной цвет на
#2563eb, принудительно указав исходный через--from "#111111". - Сделай перекраску и сразу открой HTML-превью:
/designlang:theme-swap <url> --primary "#ff4800" --open.
Как установить theme-swap
1Через маркетплейс плагинов
/plugin marketplace add Manavarya09/design-extract/plugin install designlang@designlang2Вручную: положить файлы
.claude/commands/theme-swap.mdВызов — /theme-swap. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/theme-swap.mdВызов — /prompts:theme-swap. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/theme-swap.prompt.mdВручную: положить файлы
.gemini/commands/theme-swap.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о theme-swap
Как установить theme-swap в Claude Code?
Выполните /plugin marketplace add Manavarya09/design-extract, затем /plugin install designlang@designlang и добавьте файл .claude/commands/theme-swap.md.
Что делает theme-swap?
Команда меняет основной цвет извлечённого сайта через OKLCH и создаёт HTML-превью, отчёт об изменениях и набор токенов.
Зачем нужен флаг --from?
Он задаёт исходный основной цвет вручную, если команда неверно определила его по сайту.
Исходный текст
theme-swap.md · MIT
---
description: Recolour an extracted site's design around a new brand primary. OKLCH hue rotation preserves perceptual lightness — neutrals, type, spacing, and motion stay untouched. Side-by-side HTML preview + recoloured tokens (DTCG, Tailwind, shadcn, Figma).
argument-hint: <url> --primary <hex> [--from <hex>] [--open]
---
Take any extracted site and swap its brand primary to the user-provided hex. The whole palette rotates around that hue while neutrals and structural tokens stay put.
```bash
npx designlang theme-swap $ARGUMENTS
```
If `$ARGUMENTS` doesn't contain both a URL and `--primary <hex>`, ask the user for the missing piece.
After the run completes, all output goes to `./design-extract-output/`:
- `*.themeswap.html` — editorial side-by-side preview (open this)
- `*.themeswap.md` — markdown diff table
- `*.themeswap.json` — structured before→after deltas
- `*.themeswap.tokens.json` — recoloured DTCG token set you can drop into a project
After the command finishes:
1. Read `*.themeswap.md` to summarise the swap (`from → to`, hue shift, count of changed colours).
2. Show the user the verdict line ("X colours changed, neutrals preserved, type/spacing/motion untouched").
3. Offer to open the HTML preview (`--open` does this automatically).
4. Suggest the recoloured token files as drop-ins for an existing Tailwind / shadcn project.
## Useful flags
| Flag | Effect |
|---|---|
| `--primary <hex>` | **required.** Target brand colour (e.g. `"#ff4800"`). |
| `--from <hex>` | Override the auto-detected source primary when the extractor misclassifies (e.g. a neutral got promoted by usage count). |
| `--format html\|md\|json\|tokens\|all` | Pick the output(s). Default `all`. |
| `--out <dir>` | Output directory. Default `./design-extract-output`. |
| `--open` | Open the HTML preview in your default browser. |
## Pairs nicely with
- `/grade <url>` — grade the recoloured site by feeding the same target through `/extract` then `/grade`.
- `/pack <url>` — bundle the recoloured tokens as a downloadable design-system folder.
- `/remix <url> --as <vocab>` — full vocabulary swap (brutalist, art-deco, cyberpunk…) instead of just brand colour.
© Manavarya Singh · MIT · Manavarya09/design-extract