design-code — скилл для Claude Code: код компонентов под любой
Генерирует готовый код UI-компонентов на токенах: React+Tailwind, SwiftUI, Vue, Svelte, Flutter и другие. Полезен, когда нужен рабочий экран в конкретном стеке.
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a claude-codeЧто делает design-code
Скилл берёт запрос, определяет целевой фреймворк и способ стилизации, затем читает универсальный контракт adapter-protocol.md и подключает адаптер под стек. Для React+Tailwind, Next.js и SwiftUI есть полные справочники, для Vue, Svelte, Angular, Solid, Web Components/Lit, React Native, Flutter, Jetpack Compose, vanilla CSS и CSS-in-JS — краткие адаптеры. Если файла под нужный фреймворк нет, скилл собирает адаптер по чек-листу из протокола.
Спецификацию компонента он тянет из components/*, ARIA-паттерн — из accessibility/aria-patterns.md, а все значения сводит к токенам из tokens/*.json. На выходе — целые файлы без заглушек, с состояниями, тёмной темой и поддержкой prefers-reduced-motion. Перед тем как объявить работу законченной, скилл прогоняет проверки: lint_hardcodes.py ищет сырые hex, px, ms и палитровые утилиты вроде bg-gray-500, validate_theme_refs.py следит, чтобы каждый var(--…) ссылался на определённый токен, contrast.py считает контраст новых пар цветов, а verify_states.mjs и accuracy_report.mjs проверяют состояния и выдают отчёт.
Важная деталь: скилл читает файлы из набора, а npx skills add ставит только папки скиллов. Если проверка ls ${CLAUDE_SKILL_DIR}/../../../tokens не находит каталог, скилл честно скажет об этом и остановится, не выдумывая содержимое недоступных файлов. Поэтому после установки нужен npx ux-ui-agent-skills init или установка плагина — иначе работать будет нечему.
Какие задачи решает
- сгенерировать кнопку или модалку сразу под нужный фреймворк
- свести цвета и размеры к токенам вместо хардкода
- добавить ARIA и клавиатурную навигацию в интерактивные элементы
- проверить контраст новой пары цветов до релиза
- собрать один переиспользуемый примитив вместо копий разметки по экранам
Примеры запросов агенту
- сделай компонент Button на React+Tailwind с токенами и всеми состояниями
- нужен экран логина на SwiftUI, тёмная тема и reduced motion
- перепиши эту модалку на Vue, добавь focus trap и возврат фокуса
Как установить design-code
1Через Skills CLI (Vercel)
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a claude-code2Вручную: положить файлы
~/.claude/skills/design-code/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/design-code/
1Через Skills CLI (Vercel)
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a codex2Вручную: положить файлы
.agents/skills/design-code/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a cursor2Вручную: положить файлы
.cursor/skills/design-code/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install plugin87/ux-ui-agent-skills design-code2Вручную: положить файлы
.github/skills/design-code/SKILL.md1Через Skills CLI (Vercel)
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a gemini-cli2Командой платформы
gemini skills install https://github.com/plugin87/ux-ui-agent-skills --path .claude/skills/design-codeВручную: положить файлы
.devin/skills/design-code/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add plugin87/ux-ui-agent-skills --skill design-code -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора16
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о design-code
Как установить design-code в Claude?
Выполните npx skills add plugin87/ux-ui-agent-skills --skill design-code -a claude-code. После этого нужен npx ux-ui-agent-skills init или установка плагина, иначе набор токенов и адаптеров не окажется на месте.
Что делает design-code?
Генерирует готовый код UI-компонентов и экранов под выбранный фреймворк, с опорой на токены, ARIA-паттерны и проверку состояний.
Какие фреймворки поддерживаются?
React+Tailwind, Next.js, SwiftUI, Vue, Svelte, Angular, Solid, Web Components/Lit, React Native, Flutter, Jetpack Compose, vanilla CSS и CSS-in-JS. Для фреймворка без готового файла скилл собирает адаптер по протоколу.
Исходный текст
SKILL.md · MIT
---
name: design-code
description: Generate production-ready, accessible, token-driven component code for ANY framework (React+Tailwind, Next.js, SwiftUI, Vue, Svelte, Angular, Solid, Web Components/Lit, React Native, Flutter, Jetpack Compose, vanilla CSS, or CSS-in-JS). Use when the user wants working UI code for a component or screen in a specific stack.
---
# Skill: Design Code
> **Step 0: is the kit here?** This skill reads files from the kit. Check once:
> `ls ${CLAUDE_SKILL_DIR}/../../../tokens >/dev/null 2>&1 && echo KIT_OK || echo KIT_MISSING`
> On `KIT_MISSING` only the skill folders were installed, which is what
> `npx skills add` does. Say so plainly, point the user at
> `npx ux-ui-agent-skills init` or the plugin install, and stop. Do not guess the
> contents of a file you could not open.
Render components into a target framework via the adapter system.
## Steps
1. Identify the **target framework** + styling method from the request (or ask).
2. Read `${CLAUDE_SKILL_DIR}/../../../frameworks/adapter-protocol.md` (the universal contract: token resolution, component contract, styling, dark mode, motion + output rules).
3. Load the concrete adapter:
- Full references: `${CLAUDE_SKILL_DIR}/../../../frameworks/react-tailwind.md`, `${CLAUDE_SKILL_DIR}/../../../frameworks/nextjs.md`, `${CLAUDE_SKILL_DIR}/../../../frameworks/swiftui.md`.
- Concise adapters: `${CLAUDE_SKILL_DIR}/../../../frameworks/adapters/{vue,svelte,angular,solid,web-components-lit,react-native,flutter,jetpack-compose,vanilla-css,css-in-js}.md`.
- **No file for the target?** Generate an adapter on the fly using the protocol's "author a new adapter" checklist.
4. Pull the component spec from `${CLAUDE_SKILL_DIR}/../../../components/*` and the ARIA pattern from `${CLAUDE_SKILL_DIR}/../../../accessibility/aria-patterns.md`.
5. Resolve all values to tokens (`${CLAUDE_SKILL_DIR}/../../../tokens/*.json`); apply aesthetic direction if requested (`apply-aesthetic` skill).
## Output rules (mandatory)
Use tokens (never hardcode) · include a11y on every interactive element · handle all applicable of the 8 states · support dark mode at the semantic layer · mobile-first · honor reduced motion · **deliver complete files, no placeholders** (`${CLAUDE_SKILL_DIR}/../../../workflows/redesign-audit.md` → Output Completeness).
## Verification (mandatory before declaring done)
Code is the highest-stakes output. Self-check every time:
1. **No hardcoded values**: every color/size/radius/shadow/duration/**font** traces to a token (CSS var / theme key / asset). Run `${CLAUDE_SKILL_DIR}/../../../scripts/lint_hardcodes.py` over the output; zero raw hex/px/ms AND zero raw Tailwind palette utilities (`bg-gray-500`, `text-blue-600`). Use semantic utilities/tokens (`bg-surface`, `text-primary`). Run `${CLAUDE_SKILL_DIR}/../../../scripts/validate_theme_refs.py` so every `var(--…)` resolves to a defined theme token (no floating tokens). One allowed exception: 3rd-party theme-config (MUI/Mantine) mapping our tokens INTO their API.
2. **All applicable states present**: Default, Hover, Focus(-visible ring), Active, Disabled, Loading(+`aria-busy`), Error, Selected, or justified N/A.
3. **Accessibility wired**: correct role/ARIA per `${CLAUDE_SKILL_DIR}/../../../accessibility/aria-patterns.md`, keyboard model, focus management, ≥24px target; verify contrast (`${CLAUDE_SKILL_DIR}/../../../scripts/contrast.py`) for any new color pair.
4. **Dark mode + reduced motion + responsive**: semantic tokens swap; motion has a `prefers-reduced-motion` fallback; layout is mobile-first.
5. **Completeness**: full files, no `// ...`; if asked for N, deliver N. If any check fails, fix before returning (run `a11y-audit` if unsure).
6. **Single-theme consistency**: consume the project's ONE shared token theme (the root CSS-var layer); never define a per-page palette or new colors. Across multiple pages/screens, the same semantic tokens must drive every surface so the whole product stays visually identical and themeable from one place (`${CLAUDE_SKILL_DIR}/../../../.claude/rules/tokens-and-color.md` → Single-Theme Consistency).
7. **One shared primitive layer**: build ONE reusable component per atom (`Button`, `Input`, `Modal`, `Badge` via `cva`/equivalent); never repeat utility-class clusters inline across files or hand-roll a div-as-modal per screen. Overlays reuse the single `Modal` primitive: focus trap, `role="dialog"`, `aria-modal="true"`, `aria-labelledby`, Escape, **return focus on close**, backdrop (WCAG 2.4.3 + 2.1.2). See `${CLAUDE_SKILL_DIR}/../../../examples/golden/Button.tsx` + `${CLAUDE_SKILL_DIR}/../../../examples/golden/Modal.tsx`.
8. **Font loading**: NEVER `@import` web fonts in CSS (render-blocking). Use a framework loader (`next/font`) or `<link rel="preconnect">` + `<link rel="preload">` with `font-display: swap`; self-host when possible. Font family comes from a token (`--font-sans`), never a literal.
9. **Semantic token BY INTENT + consistency**: the token's *meaning* must match the action: destructive (Delete/Remove) → `action.destructive` (danger), **never** `action.primary`; secondary = neutral outline/transparent with dark text (**never a colored fill** → no dark-text-on-blue). The SAME action uses the SAME variant **everywhere** (a trigger button and its confirm button must match, not red in one place and blue in another). Gates don't catch this. You must.
10. **No emoji as icons**: use a real icon set (default **lucide**) as inline SVG with `currentColor`; never an emoji, including in JS that swaps a label (swap the `<svg>`, not a text/emoji string). Mentally run `${CLAUDE_SKILL_DIR}/../../../scripts/lint_taste.py` (it flags emoji-as-icon).
11. **Destructive confirmation UX**: irreversible actions (delete account/data, anything stated "cannot be undone") need real friction per WCAG 3.3.4 / 3.3.6: a confirmation dialog whose **confirm button restates the action** ("Delete account", not "Delete"/"OK"/"Yes") and, for high-stakes, a **type-to-confirm** step. See `${CLAUDE_SKILL_DIR}/../../../examples/sample-app/preview.html` and `${CLAUDE_SKILL_DIR}/../../../content/voice-tone.md`.
12. **Taste pre-flight**: run the 12-point aesthetic check in `${CLAUDE_SKILL_DIR}/../../../taste/design-taste.md` and, for any rendered HTML, `DS_REQUIRE_BROWSER=1 node ${CLAUDE_SKILL_DIR}/../../../scripts/taste_audit.mjs <file>` (render-based: flags timid type-scale contrast, uniform repetition, over-wide measure, palette sprawl). Taste is heuristic: treat findings as a strong signal and pair with a real screenshot review; it is NOT auto-provable like correctness.
13. **Run the gates, then report (mandatory).** Before declaring done, RUN `node ${CLAUDE_SKILL_DIR}/../../../scripts/gate.mjs verify_states.mjs <file>` + `--dark` (every element, default/hover/focus) and `node ${CLAUDE_SKILL_DIR}/../../../scripts/accuracy_report.mjs`; report their actual output. Never type a contrast number or "100%" you didn't just measure (CLAUDE.md → Verification Protocol).
© plugin87 · MIT · plugin87/ux-ui-agent-skills