К основному содержанию
скилл CX Codex

21st-design-sync — скилл для Claude Code: что делает и как установить

Собирает переменные темы shadcn и Tailwind из CSS-файлов проекта и выгружает их как публичную тему в каталог 21st.dev через CLI.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add 21st-dev/skill --skill 21st-design-sync -a claude-code
Открыть на GitHub

Что делает 21st-design-sync

Скилл находит токены темы в globals.css или index.css. Ему нужны блоки :root и .dark со стандартными переменными shadcn вроде --background, --primary и --radius. Если тёмной темы в проекте нет, скилл собирает её сам на базе светлой, инвертируя яркость с сохранением оттенка.

Выгрузка выполняется через CLI-команду 21st publish-theme. Обычный токен сессии из 21st login здесь не сработает: для публикации темы требуется отдельный API-ключ формата 21st_sk_…. Его передают через флаг --api-key или переменную окружения TWENTYFIRST_TOKEN.

Темы в каталоге всегда становятся общедоступными. Закрытых вариантов нет. Повторный запуск команды создаёт новую тему, а не обновляет существующую, поэтому для смены названия или тегов нужно вызывать 21st edit.

Какие задачи решает

  • опубликовать токены shadcn и Tailwind в каталог 21st.dev
  • собрать CSS-переменные из globals.css в отдельный файл темы
  • сгенерировать недостающую тёмную тему на основе светлых токенов
  • поделиться цветовой схемой проекта по прямой ссылке

Примеры запросов агенту

  • Опубликуй тему нашего проекта на 21st.dev
  • Сделай тему из globals.css и выгрузи её в каталог 21st
  • Залей наш дизайн в библиотеку тем 21st с тегами dark и minimal

Как установить 21st-design-sync

1Через Skills CLI (Vercel)

npx skills add 21st-dev/skill --skill 21st-design-sync -a claude-code

2Вручную: положить файлы

~/.claude/skills/21st-design-sync/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/21st-design-sync/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о 21st-design-sync

Как установить 21st-design-sync в Claude Code?

Выполните команду npx skills add 21st-dev/skill --skill 21st-design-sync -a claude-code или добавьте файл по пути ~/.claude/skills/21st-design-sync/SKILL.md.

Какой API-ключ нужен для публикации темы?

Нужен ключ формата 21st_sk_… со страницы https://21st.dev/mcp или https://21st.dev/settings/api-keys. Сессионный токен от 21st login не подходит.

Можно ли сделать опубликованную тему приватной?

Нет, все темы на 21st.dev сразу публикуются в открытый доступ. Если дизайн нельзя раскрывать, публиковать файл темы нельзя.

Исходный текст

SKILL.md · Apache-2.0
---
name: 21st-design-sync
description: >-
  Look at the current project's design (its shadcn / Tailwind CSS variables and
  color tokens) and publish it to the 21st.dev community as a shareable theme,
  using `21st publish-theme`. Use when the user says "publish my theme",
  "share our design as a 21st theme", "sync my design to 21st", "turn my
  globals.css into a theme", "залей наш дизайн темой", "опубликуй тему". This is
  the 21st equivalent of design-sync: it reads the project's design tokens and
  syncs them into the public theme library.
---

# 21st Design Sync — publish your project's design as a theme

Take the design a project already ships (its light + dark CSS variables) and
publish it to the **public** 21st.dev theme library so anyone can preview,
bookmark, and apply it. Under the hood this is one CLI call:
`21st publish-theme <file.css> --name "…"`.

## Pre-flight (always)

1. **Auth needs a real API key.** `publish-theme` is a management endpoint: it
   accepts a `21st_sk_…` key **only**, not a `21st login` session token. Get one
   at **https://21st.dev/mcp** (or **https://21st.dev/settings/api-keys**) and pass it via
   `--api-key 21st_sk_…` or the `TWENTYFIRST_TOKEN` / `API_KEY_21ST` env var. If
   the user has no key, point them there — don't try to mint one.
2. The CLI is the unified `@21st-dev/cli` (bin `21st`). Use `npx @21st-dev/cli`
   if it isn't installed.
3. **Publishing is public and outward-facing.** A published theme is immediately
   `is_public` in the community library (there is no unlisted/private option for
   themes). Confirm with the user before publishing.

---

## Step 1 — Find the project's design tokens

Locate the file that defines the shadcn/Tailwind theme variables. Check, in order:

- `app/globals.css`, `src/app/globals.css`
- `src/index.css`, `styles/globals.css`, `app/styles/globals.css`

You're looking for a `:root { … }` block of CSS custom properties
(`--background`, `--foreground`, `--card`, `--primary`, `--secondary`,
`--muted`, `--accent`, `--destructive`, `--border`, `--input`, `--ring`, the
`--chart-*` / `--sidebar-*` tokens, `--radius`) and a matching `.dark { … }`
block. Values may be `hsl(...)`, `oklch(...)`, hex, or raw channels — keep them
exactly as the project wrote them.

Tailwind v4 projects usually keep the same `:root` / `.dark` blocks plus an
`@theme inline` mapping; you only need the `:root` and `.dark` token values,
not the `@theme` mapping.

## Step 2 — Assemble a valid theme CSS file

The publish endpoint parses `--name: value;` pairs out of a `:root { … }` block
and a `.dark { … }` block, and **requires both to be non-empty**. So the file
you publish must contain both.

- Copy the project's `:root` and `.dark` blocks into a standalone file
  (e.g. `project-theme.css`). Nothing else is required.
- **If the project has only a light `:root` and no `.dark`** (or an empty one),
  generate a dark variant before publishing — don't ship a theme with an empty
  dark mode. Reuse the `add-dark-mode` / `oklch-skill` approach: invert
  lightness while preserving hue/chroma so the dark set stays on-brand. Keep the
  same token names.
- Keep the token names shadcn-standard so the theme previews correctly on the
  card and applies cleanly for others.

Minimal shape:

```css
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 4%;
  --primary: 240 6% 10%;
  /* …the rest of the project's light tokens… */
  --radius: 0.5rem;
}
.dark {
  --background: 240 10% 4%;
  --foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  /* …the rest of the project's dark tokens… */
}
```

## Step 3 — Name & tag it

- **Name** (required, ≤ 50 chars): infer from the project — the product/brand
  name from `package.json`, the repo, or the site title. Ask the user if it's
  ambiguous.
- **Tags** (optional): a few descriptors that match how people browse themes,
  e.g. `dark`, `minimal`, `neutral`, `vibrant`, `saas`. Pass comma-separated.

## Step 4 — Publish

```bash
21st publish-theme ./project-theme.css \
  --name "Acme" \
  --tags dark,minimal \
  --api-key 21st_sk_…            # or set TWENTYFIRST_TOKEN
```

The command prints the live theme URL (`https://21st.dev/community/themes/<slug>`).
Share it with the user.

## Updating vs re-publishing

- **Each `publish-theme` creates a NEW theme** (there's no upsert-by-slug like
  components have). Running it twice = two themes in the library.
- To change **name/tags/visibility** on an existing theme, edit it in place:
  `21st edit <theme-id> --type theme [--name "…"] [--tags a,b]`.
- To change the **colors**, publish a fresh file and remove the old one:
  `21st delete <theme-id> --type theme --yes` (soft-unpublish, reversible).

## When NOT to use this

- Syncing a component **library** to a Claude Design project → that's the
  built-in `/design-sync` skill, a different destination.
- Publishing a **component** (not a color theme) → use `21st-registry`.

© 21st-dev · Apache-2.0 · 21st-dev/skill

Похожие скиллы

Всё по теме «Фронтенд и UI» →
frontend-design официальный anthropics Скилл задаёт осмысленное визуальное направление для новых интерфейсов и редизайна. Подойдёт, когда стандартный шаблонный UI не устраивает. 1 025 790установок design-taste-frontend Leonxlnx Скилл задаёт арт-дирекцию для публичных страниц и рабочих экранов, а затем проверяет результат в браузере по скриншотам. Нужен, когда интерфейс выглядит шаблонным или недоработанным. CX Codex +1 678 700установок prototype Matt Pocock Создаёт временный прототип, чтобы проверить логику, модель состояния или вид интерфейса до работы над основным кодом. 986 201установок hyperframes heygen-com Скилл задаёт агенту правила рендера HTML-кода в видео через HyperFrames. Помогает собирать проморолики, эксплейнеры и титры прямо в коде проекта. CX Codex +1 1 200 000установок hyperframes-cli heygen-com Управляет проектами HyperFrames через терминал: собирает таймлайн, проверяет контраст кадров, запускает предпросмотр и рендерит видео локально или в облаке. CX Codex +1 1 300 000установок webapp-testing официальный anthropics Скилл запускает проверки локальных веб-приложений через Playwright: помогает отлаживать UI, делать скриншоты и смотреть логи браузера. 186 758установок

Из того же набора7

21st-ai Скилл для генерации и правки UI через CLI 21st: набросать варианты по промпту, посмотреть их в браузере и забрать код в проект. CX Codex +1 2 000установок 21st-cli-use Ищет, скачивает и ставит React- и shadcn-компоненты, темы и SVG-логотипы из каталога 21st.dev через утилиту 21st. Срабатывает при наличии components.json, избавляя от ручной вёрстки. CX Codex +1 2 000установок 21st-registry Публикует React-компоненты, CSS-темы и шаблоны на 21st.dev и управляет уже опубликованным через CLI 21st. CX Codex +1 1 800установок 21st-ui-build Скилл для реализации страниц и компонентов в существующем веб-проекте: сначала читает дизайн-контекст и токены, потом ищет готовое в 21st. CX Codex +1 1 400установок 21st-ui-review Проверяет существующий UI на доступность, адаптивность и расхождения с дизайн-системой проекта. Пригодится перед релизом страницы или после чужого пул-реквеста. CX Codex +1 1 300установок 21st-ui-explore Скилл предлагает несколько разных направлений интерфейса, опираясь на дизайн-систему проекта и подборку референсов из 21st. Пригодится, когда неясно, как должна выглядеть новая страница. CX Codex +1 1 400установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой