Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

design-system

БесплатноБез исполняемых скриптовНе проверен

Use when building, refactoring, or styling any UI in the ethereum.org Next.js site (`src/components/`, `app/`, `src/styles/`, `public/content/`, or any…

ethereumот ethereum★ 6 005 звёзд на GitHub

Об этом скилле

ethereum.org Design System

Tailwind v4 (CSS-first config, no tailwind.config.ts) + React 19 / Next.js App Router + Radix UI primitives + shadcn-style component layer. Tokens live in CSS. Read this file fully on activation; pull from references/ only when the listed trigger applies.

The Core Habit: Reuse Over Reinvent

The single highest-leverage habit for keeping this codebase consistent: when you need new UI, look for a primitive or variant first, only invent if nothing fits. Most "new component" instincts are actually "new variant" instincts in disguise.

Before you write any UI code, ask:

  • Is there a primitive that already does this? (Card, Button, Alert, Tag, Hero/*)
  • Is the difference small enough to express as a variant on an existing primitive?
  • Can I compose existing primitives instead of inlining a long Tailwind class chain?

If you find yourself writing flex items-center gap-X rounded-Y border bg-... p-Z for a card-like thing, you're reinventing <Card>. If you write <p className="text-4xl font-bold">N</p> for a stat, you're reinventing <BigNumber>. If you write <div className="text-5xl font-bold">Title</div>, you're reinventing <h1> (which is already styled by base.css). Compose, don't inline.

When the existing primitive doesn't quite fit, the answer is usually "add a variant," not "create a new file." See references/variant-vs-new.md.

Top Rules

  1. No raw <a> or <button>. Use <Button>/<ButtonLink> from @/components/ui/buttons/Button and InlineLink/BaseLink/LinkWithArrow from @/components/ui/Link. These primitives handle event tracking, external-link safety, locale routing, and focus rings.
  2. No raw color values. Use semantic tokens (text-body, bg-background, border-border, text-primary). Hex literals and rgb() calls bypass dark mode.
  3. Prefer adding a variant to an existing primitive over creating a new component. Card, Button, Alert, Tag are the most common targets.
  4. Server Components by default. Only "use client" when you need state, effects, browser APIs, or inline event handlers.
  5. All text is translatable. getTranslations from next-intl/server (server) or useTranslations from next-intl (client). One namespace-bound t per namespace -- bind a second function (e.g. const tCommon = useTranslations("common")) to access another namespace. Never hard-code user-facing English. In Route Handlers and Server Actions, pass the locale explicitly (getTranslations({ locale, namespace })) -- next/root-params doesn't reach them yet. Everywhere else it resolves on its own -- see references/i18n-rtl.md.
  6. Logical CSS for direction. Use ms-/me-/ps-/pe-/inset-s-/inset-e-/border-s/border-e/text-start/text-end. The site supports Arabic and Urdu (RTL). Hard-coded left-/right-/ml-/mr-/pl-/pr- breaks RTL.
  7. Locale-aware formatters. numberFormat() from @/lib/utils/numbers, formatDateTime() / formatDate() from @/lib/utils/date (UTC + hydration-safe). Never toLocaleString / Intl.NumberFormat directly.
  8. useRtlFlip() for directional icons (right-pointing arrows/chevrons). Or use ChevronNext/ChevronPrev from @/components/Chevron.
  9. Markdown content goes through MdComponents. The <Card> markdown shortcode is backed by @/components/MarkdownCard (a thin wrapper around the ui/card primitives with an MDX-friendly prop shape). For app code, compose the primitives directly from @/components/ui/card.
  10. Storybook stories ship with new UI components. No automated unit tests; Storybook + Chromatic + types are the verification layer.
  11. Don't add new layouts. There are six canonical layouts (TopicLayout, StaticLayout, DocsLayout, TutorialLayout, ContentLayout, BaseLayout). New sectioned content goes in src/data/topics/<key>.ts as a TopicLayout config -- not a new layout component. See references/layouts.md.

Highest-Value Gotchas (index)

Landmines where the code looks reasonable but the pattern is wrong. One line each; the canonical write-ups live in the named reference.

  • Look-alike imports -- Tooltip (@/components/Tooltip, not ui/tooltip), Modal (ui/dialog-modal vs ui/dialog; don't mix sources within a feature), Card (ui/card for app code, not MarkdownCard), Heroes (named exports of @/components/Hero; title is always the <h1>, no header prop). Decision trees: references/canonical-imports.md.
  • Stale shadcn token names (bg-popover, bg-muted, text-muted-foreground, ...) linger in a few ui/ files but don't resolve in this project's tokens. Don't add new uses. List: references/tokens.md; replacements: references/cleanup-playbook.md.
  • useColorModeValue is a deprecated Chakra leftover -- use dark: + semantic tokens.
  • Card is variant-driven, not className-driven. Padding/spacing/background/radius/text color go through variant/size; a
Полный SKILL.md на GitHub

Установить design-system в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.jsonreferences/a11y.mdreferences/callout-walkthrough.mdreferences/canonical-imports.mdreferences/card-walkthrough.mdreferences/cleanup-playbook.mdreferences/components.mdreferences/gotchas.mdreferences/i18n-rtl.mdreferences/layouts.mdreferences/new-component-checklist.mdreferences/page-hero-walkthrough.mdreferences/server-vs-client.mdreferences/spacing-typography.mdreferences/tokens.mdreferences/variant-vs-new.md

FAQ

Что делает скилл design-system?

Use when building, refactoring, or styling any UI in the ethereum.org Next.js site (`src/components/`, `app/`, `src/styles/`, `public/content/`, or any `.tsx`/`.mdx`/`.css` change that affects the rendered UI). Provides canonical component choices, design tokens, RTL/i18n rules, server/client guidance, and the "use a variant, not a new component" pattern for the project's Tailwind v4 + Radix + shadcn-style design system.

Как установить скилл design-system?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл design-system запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить design-system с