本文へ移動
cccskills
無料GitHub で公開日本語紹介

shadcn-ui

ReactとTailwind CSSの画面を、プロジェクトの設定やデザインシステムに合わせて追加・変更し、コンポーネントやテーマの整合性も確認できます。

原文原文の説明を見る

Project-aware shadcn/ui components, registry MCP, theming, and design-system lint feedback. Use when adding or changing React/Tailwind UI, a primitive, theme, registry, or component contract in an Agent-Native app.

BuilderIO/agent-nativeスター 7,527(GitHub 7,527 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 既存アプリにUI部品を追加したいとき
  • テーマや部品の見た目を調整したいとき
  • フォームやダイアログを整えたいとき
  • 社内デザインシステムに部品を合わせたいとき

日本語での紹介

できること

ReactとTailwind CSSを使うアプリで、既存の設定やデザインシステムを確認しながらUIを追加・変更します。components.jsonやshadcn infoで実際のエイリアス、保存先、導入済みコンポーネントを調べ、必要に応じてshadcnのレジストリやCLIから部品を探します。既存部品の上書き前には差分を確認し、生成されたコードのインポートや組み合わせも点検します。テーマトークンや部品のvariantを使ったスタイル調整、フォームやダイアログのアクセシビリティ、デザインシステムのルールに沿ったLint結果の確認も扱います。アプリに登録済みの社内デザインシステムがある場合は、その部品を優先します。

こんなときに便利

既存アプリへUI部品を追加したいときや、テーマ、フォーム、部品の見た目を調整したいときに向いています。プロジェクトごとの設定を踏まえて作業し、アプリ内の部品の使い方をそろえたい開発者にも役立ちます。

使い方の例

  • 「このアプリの設定を確認して、必要なshadcnの部品を追加してください」
  • 「フォームの選択肢を追加し、アクセシビリティも確認してください」
  • 「この画面の色をテーマトークンに合わせて修正してください」

注意点

作業対象アプリのルートで実行します。レジストリ操作にはshadcn MCP、または代替としてpnpm dlx shadcn@latestを使います。@shadcn/lintの確認は、対象ワークスペースに設定されている場合に限られます。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md11.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

shadcn/ui

This skill keeps shadcn/ui work project-aware. Components are source files in the app, so always inspect the local project before adding, importing, or rewriting them. When @shadcn/lint is configured, treat its feedback as implementation guidance, not cosmetic noise. The framework repository runs it through the root Oxlint configuration; generated workspaces carry this skill and the MCP workflow, but do not automatically inherit that repository-only lint setup.

First Steps

  1. Work from the app root that owns components.json. In this monorepo, that is the selected app/template directory (usually under templates/), not the repository root.
  2. In an Agent-Native app, inspect app/design-system.ts and ToolkitProvider before choosing a primitive. A registered company design system takes precedence over the default shadcn adapter.
  3. Run pnpm dlx shadcn@latest info --json when you need current project context: framework, Tailwind version, aliases, icon library, installed components, and resolved paths.
  4. Use the actual aliases from components.json or shadcn info; do not assume @/components/ui if the project says otherwise.
  5. Check app/components/ui/ or the resolved ui path before importing a component.
  6. For unfamiliar components, run pnpm dlx shadcn@latest docs <component> and read the returned docs or examples before coding.

MCP Registry Workflow

Each first-party app keeps the official shadcn MCP configuration in .mcp.json next to its components.json. Start the agent from that app root so the MCP server resolves the correct aliases, local UI directory, and Tailwind theme. Do not add a single repository-root server: the root is a workspace, not a shadcn project, and would make installs target the wrong project.

  • Use the shadcn MCP to search, inspect, and install registry items when it is connected. Prefer the app's configured registries over copied source.
  • Use pnpm dlx shadcn@latest info --json for project context; the MCP has no equivalent project-info tool.
  • If the MCP is unavailable, use the equivalent pnpm dlx shadcn@latest command from the same app root and continue following this skill.
  • Keep registry URLs and aliases in that app's components.json. Never put registry credentials in MCP config or checked-in source.

Design-System Lint Feedback

In the framework repository, pnpm lint runs Oxlint with @shadcn/lint for the scoped template UI paths. Run it after UI changes and fix every shadcn/* finding before handing off. Template packages use the workspace lint configuration; do not create a second local lint configuration just for one app.

Before claiming that shadcn lint ran in another workspace, inspect its root package.json and .oxlintrc.json. The generic generated workspace currently exposes pnpm lint as formatting-only and does not ship @shadcn/lint or the framework repository's Oxlint config. In that scaffold, use this skill plus the connected shadcn MCP (or the CLI fallback) for design-system guidance, and do not report shadcn/* checks as having run. If the workspace owner adopts the linter, add the dependency, scoped config, and lint script together.

The Plan template is intentionally excluded from this rollout. Its files remain under templates/plan/**, but the root Oxlint ignore list keeps them out of the shadcn checks until that template has a separate lint baseline.

  • no-restyle: use the component's variant, size, and semantic props; put layout on a parent and add a component variant only when the design system genuinely needs a new treatment.
  • no-raw-colors: use the theme tokens in the app's global.css, not raw Tailwind palette classes or hard-coded color attributes.
  • no-arbitrary-values: use the theme scale or a declared token instead of one-off bracket values.
  • no-inline-styles: use classes or CSS custom properties for dynamic layout; keep intentional editor/export exceptions scoped to their owning subsystem.
  • no-unknown-classes and require-static-classes: use classes Tailwind can generate and keep class strings statically discoverable.

The local primitive source is the contract boundary. Product code should consume its props and variants; update packages/toolkit/src/ui/ or an app's components/ui/ only when the design-system contract itself changes.

Agent-Native Adapter Rule

Pages, routes, and domain components import controls through the app's local UI adapter layer. Never import @agent-native/toolkit/ui/* directly in app product code. Direct imports bypass app/design-system.ts and make Toolkit/Core surfaces use different controls from the app.

When shadcn is the app's adapter, add or update the local primitive and keep product code on that local import. When a company design system is registered, adapt its components to the semantic contracts from @agent-native/toolkit/design-system; do not recreate a parallel shadcn surface. The semantic API is styling-runtime agnostic, so do not require Tailwind, CVA, or className in customer adapters.

For shared Toolkit features, customize presentation through semantic components, a feature-level controller, and product-level render slots. Keep the same controller for default and custom views. Use the conformance kit for behavior components whose focus, portal, keyboard, dismissal, or stacking behavior comes from the company design system.

Adding Or Updating Components

  • Add missing primitives with pnpm dlx shadcn@latest add <component> from the app root.
  • Before overwriting an existing component, use pnpm dlx shadcn@latest add <component> --dry-run and --diff to inspect the change.
  • After adding registry code, read the generated files. Fix import aliases, icon imports, missing subcomponents, and composition issues before using the component.
  • Do not fetch raw component files manually from GitHub when the shadcn CLI can resolve the registry item.
  • If a user asks to add a third-party block but does not name a registry, ask which registry to use instead of guessing.

Component Composition

  • Use existing primitives before custom markup: Alert for callouts, Badge for small status labels, Separator for dividers, Skeleton for placeholders, Table for tabular data, and Card for framed content.
  • Compose cards from CardHeader, CardTitle, CardContent, and CardFooter. Leave CardDescription out: a card gets a title or a description, never both. See frontend-design → Default Surface Density.
  • Dialog, Sheet, Drawer, and AlertDialog content must include an accessible title. Use visually hidden titles only when the visible UI already communicates the title.
  • Put items inside their group components: SelectItem in SelectGroup, DropdownMenuItem in DropdownMenuGroup, CommandItem in CommandGroup, and equivalent menu groups.
  • TabsTrigger belongs inside TabsList.
  • Avatar always needs AvatarFallback.
  • Buttons do not have magic loading props. Compose loading with disabled, Spinner, and clear text.

Forms And Inputs

  • Use the app's shadcn form primitives instead of raw div stacks.
  • If Field, FieldGroup, FieldSet, or InputGroup are installed or worth adding, use them for form layout, grouped fields, and input add-ons.
  • Do not place buttons inside inputs with absolute positioning. Use InputGroup and InputGroupAddon when available.
  • Use ToggleGroup for small option sets, RadioGroup for one-of-many choices, Checkbox for multi-select, Switch for settings toggles, Select or Combobox for predefined choices, and Slider or numeric input for numeric values.
  • Validation must be accessible: pair visual invalid states with aria-invalid, and connect descriptions/errors to controls.

Styling And Theming

  • Use semantic tokens (bg-background, text-foreground, text-muted-foreground, bg-primary, border-border, text-destructive) instead of raw colors for reusable app UI.
  • Prefer built-in variants and sizes before custom classes.
  • Use className mostly for layout and spacing; avoid overriding component colors and typography unless the component is intentionally being extended.
  • Use gap-* instead of space-x-* / space-y-*.
  • Use size-* when width and height are equal.
  • Use truncate for single-line clipping.
  • Use cn() for conditional classes.
  • Do not add manual z-index to overlay primitives unless you are fixing a verified stacking bug.
  • Add custom colors as CSS variables in the existing Tailwind CSS file reported by shadcn info. For Tailwind v4, register variables with @theme inline.

Transitions And Motion

shadcn's built-in component animations are the right level of polish — keep them. The goal is a snappy, clean UI, not a motionless one. Match shadcn's motion vocabulary; don't strip it and don't pile on decorative custom animation.

  • Never remove or override a shadcn component's default animation. data-[state=open]:animate-in, data-[state=closed]:animate-out, fade-in/out, zoom-in/out, slide-in-from-*, accordion height, the tailwindcss-animate utilities — these ship for a reason. Leave them as-is.
  • Custom transitions are fine when they communicate a state change and match shadcn's feel. Reuse the same vocabulary: short durations (~120–200ms), ease-out, opacity/transform only, gated on data-[state=...]. Examples that are good and welcome:
    • A portaled custom popover/tooltip/sheet that fades + scales/slides in on data-[state=delayed-open] / data-[state=closed], mirroring Radix's own content animation.
    • A list row or toast that fades/slides in on mount and out on dismiss.
    • A chevron/caret rotate on expand, a subtle opacity/color hover on an icon button, skeleton shimmer, a progress/height transition on a collapsible.
    • Continuous, product-defining motion where it is the experience (e.g. a multi-stage booking flow's stage transitions) — fine, and framer-motion is acceptable there.
  • Avoid decorative, attention-seeking, or slow motion: hand-rolled duration-700 hero fade-ins, parallax, bouncing/spring entrances on ordinary content, animated gradients, staggered cascades on long lists, anything that delays the user seeing or acting on content. If an animation makes the UI feel slower, cut it.
  • Rule of thumb: if the motion clarifies what just changed and is over in well under a quarter-second, it's polish; if it's there to look impressive, it's bloat.

Icons

  • Agent-Native apps use @tabler/icons-react. Do not add lucide-react because a registry example used it.
  • If registry code imports a different icon package, replace those imports with Tabler equivalents before finishing.
  • Let shadcn components size icons through their CSS. Avoid manual icon sizing inside buttons, menus, alerts, and sidebars unless the local component API requires it.

Base-Specific APIs

Check the project context before using trigger composition APIs:

  • Radix-based components use asChild for custom triggers.
  • Base UI components may use render and sometimes nativeButton={false}.

Do not wrap triggers in extra divs just to place a Button or Link inside them.

Related Skills

  • frontend-design — Product UX, visual direction, responsive polish, and verification
  • customizing-agent-native — Registered design systems, controllers, slots, conformance, and ejection
  • actions — Data fetching and mutation patterns for agent-native apps
  • security — User data, forms, external input, and action safety

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

a2a-assets

無料概要あり

複数のアプリやMCPホストからブランド画像・動画を生成、調整、書き出し、挿入する作業を支援します。ライブラリ選択や修正依頼も扱います。

  • スライド用のブランド画像を作りたいとき
  • 既存素材をフィードバックに合わせて直したいとき
  • 動画素材を生成して書き出したいとき
BuilderIO/agent-native7,5272026年10月26日 更新

account-health

無料概要あり

特定の顧客企業について、契約と製品利用の数値を照らし合わせ、根拠や不足情報を明記した健全性レポートをまとめます。

  • 顧客の健全性を確認したいとき
  • 契約席数と実利用を比べたいとき
  • 更新前に利用状況を整理したいとき
BuilderIO/agent-native7,5272026年10月26日 更新

actions

無料概要あり

アプリの操作をエージェントと画面の両方から呼び出せるアクションとして実装し、API連携や画面のデータ取得を一貫した形で追加するスキルです。

  • 新しいアプリ操作を追加したいとき
  • 外部APIと連携したいとき
  • 画面からデータを取得したいとき
BuilderIO/agent-native7,5272026年10月26日 更新

adding-a-feature

無料概要あり

新機能をUI・エージェント用アクション・説明資料・画面状態の4領域でそろえ、利用者とエージェントのどちらからも一貫して使えるようにするチェックリストです。

  • 新機能追加の作業範囲を整理したいとき
  • UIとエージェント操作をそろえたいとき
  • 画面状態の同期漏れを防ぎたいとき
BuilderIO/agent-native7,5272026年10月26日 更新

adhoc-analysis

無料概要あり

複数のデータソースを照合して、傾向や指標、根拠をまとめた分析結果を作成します。必要に応じて、再実行できるダッシュボードとして保存できます。

  • 商談と通話記録を照合したいとき
  • 顧客の利用状況を横断して調べたいとき
  • 繰り返し更新できる分析を保存したいとき
BuilderIO/agent-native7,5272026年10月26日 更新

admin-surfaces

無料概要あり

Analyticsの管理画面で、機能フラグの状態確認と切り替え、ダッシュボード利用状況の調査、接続先アプリのデータベース管理を行います。

  • アプリごとの機能フラグを確認・変更したいとき
  • ダッシュボードの所有者や利用状況を調べたいとき
  • 接続済みアプリのテーブルを管理したいとき
BuilderIO/agent-native7,5272026年10月26日 更新

BuilderIO のスキルをすべて見る

このスキルの問題を報告する