shadcn

shadcn is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 65 tokens per session (1,108 once invoked), scanned A, original, Apache-2.0.

A workflow for installing, changing, and upgrading shadcn/ui components. It treats each component as source code copied into your project, so you can edit it directly.

In plain words
What is it for?
Use it to initialise shadcn/ui, add buttons or dialogs, change colours and corner sizes, create component variants, and fix style conflicts during upgrades.
Why use it?
It clarifies how to manage components, themes, dark mode, and style changes without treating them like a packaged library you cannot control.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to initialise shadcn/ui, add buttons or dialogs, change colours and corner sizes, create component variants, and fix style conflicts during upgrades.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/shadcn
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Morningstar202604/awesome-skillkit --skill shadcn
Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shadcn

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/shadcn/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/shadcn)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/shadcn"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/shadcn/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for shadcn

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/shadcn"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/shadcn.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.01108
Opus 5.5 $0.00026 $0.00443
Sonnet 5.5 $0.00013 $0.00222
Haiku 4.5 $0.00006 $0.00111

Measured 2mo ago against content hash 14465eb52ed0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

shadcn scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

expert-teams/teams/fullstack-web-team/skills/shadcn/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

shadcn/ui 组件管理

本 skill 面向 fullstack-frontend-engineer,规范 shadcn/ui 的安装、定制与升级。

何时使用

  • 项目初始化 shadcn/ui 配置(components.json、主题);
  • 用 CLI 加新组件、改主题色、写自定义 variant;
  • 升级已安装组件、解决样式冲突。

核心认知

  • shadcn/ui 不是 npm 组件库:CLI 把组件源码拷进你仓库,你拥有并可改。
  • 基于 Radix UI(无样式原语)+ Tailwind + CVA(变体)+ cn() 工具函数。
  • 主题靠 CSS 变量(HSL/OKLCH)切换亮色/暗色,不依赖 JS 运行时。

初始化与配置

# 初始化(已配置 tailwind + path alias 后)
npx shadcn@latest init
# 添加组件
npx shadcn@latest add button dialog input table

components.json 关键项:

  • style:默认风格(new-york / default)。
  • tailwind.config / tailwind.css:指向你的配置与全局 CSS。
  • aliases.components / aliases.ui:组件放哪(一般 @/components/ui)。
  • rsc: true:App Router 项目必须开。

主题定制

  • 改 app/globals.css 里的 :root 与 .dark CSS 变量(--primary、--background、--radius 等)。
  • 圆角通过 --radius 全局控制,组件内用 rounded-md 等 token 引用。
  • 新增品牌色:在 @theme inline 里映射 CSS 变量,Tailwind 里直接 bg-brand。

写自定义 variant(CVA)

import { cva, type VariantProps } from "class-variance-authority"

const buttonVariants = cva(
  "inline-flex items-center justify-center rounded-md font-medium transition-colors",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/90",
        danger: "bg-red-600 text-white hover:bg-red-700",
        ghost: "hover:bg-accent",
      },
      size: {
        default: "h-10 px-4",
        sm: "h-8 px-3 text-sm",
        icon: "h-10 w-10",
      },
    },
    defaultVariants: { variant: "default", size: "default" },
  }
)

清单(交付前逐项过)

  • components.json 路径 alias 正确,@/components/ui 可解析。
  • App Router 项目 rsc: true,客户端组件加了 "use client"。
  • 主题只改 CSS 变量,不在组件里硬编码品牌色 hex。
  • 复用 cn()(clsx + tailwind-merge)合并 className,避免覆盖顺序问题。
  • 自定义组件放到 @/components/ui 或业务组件目录,不直接改 shadcn 拷来的文件(要改也清楚改动点,便于后续 upgrade 合并)。
  • 暗色模式两种变量都配齐,无视觉断层。
  • 新增组件用 add CLI 拉取,不手抄源码避免版本漂移。
  • 升级用 npx shadcn@latest update,冲突时人工合并。

易错点

  • 把组件当 npm 库 import { Button } from "shadcn-ui":根本没有这个包,组件就在你本地 @/components/ui/button。
  • 直接改拷来的文件又不记录:下次 update 会被覆盖或冲突;定制尽量用 variant + className 覆盖,少改源码。
  • 硬编码颜色:组件里写 bg-[#ff0000],暗色模式与主题切换全部失效。
  • Tailwind 内容扫描没包含 ui 目录:tailwind.config 的 content 漏了 ./components/ui/**/*.{ts,tsx},样式全丢。
  • 忘记 "use client":Dialog/Dropdown 等用了 Radix 事件的组件在 Server Component 里直接报错。
  • 乱用 cn() 反向覆盖:tailwind-merge 会智能去重,但后写的 !important 前缀仍需谨慎。

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 81 lines · 65 tokens per session scan A 14465eb52ed0

Subscribe to this mod's changes

shadcn is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 65 tokens to every session and 1,108 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-27.

Related

shadcn compared with skills from other repositories

shadcn next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
shadcnMorningstar202604/awesome-skillkitSkill02mo agoApache-2.0A65Claude Code, Codex
claude-designNousResearch/hermes-agentSkill267ktodayMITA16Claude Code, Codex
sketchNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
popular-web-designsNousResearch/hermes-agentSkill267ktodayMITA23Claude Code, Codex
scrollcraftNousResearch/hermes-agentSkill267ktodayMITA13Claude Code, Codex
impeccableNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
auteurNousResearch/hermes-agentSkill267ktodayMITA13Claude Code, Codex