bundles/frontend/skills/shadcn-setup/SKILL.md
Sets up shadcn/ui with Tailwind CSS v4 CSS-first configuration — installs packages, generates globals.css with @theme tokens, creates components.json, and adds the cn() utility. Use when starting a new Next.js or React project that needs a shadcn component library, or migrating from shadcn + Tailwind v3.
npx skillsauth add shipshitdev/library shadcn-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Sets up shadcn/ui with the modern CSS-first Tailwind v4 setup, not the deprecated v3 approach.
Inputs:
Outputs:
globals.css with @import "tailwindcss" and full @theme token block.components.json with CSS-first shadcn config.src/lib/utils.ts with cn() helper.class-variance-authority, clsx, tailwind-merge, lucide-react, tailwindcss, @tailwindcss/postcss.Creates/Modifies:
src/app/globals.css (created or overwritten).components.json (created or overwritten).src/lib/utils.ts (created).package.json (dependencies updated via bun add).postcss.config.mjs (created if absent).External Side Effects:
bun add to install packages.bunx shadcn@latest add for any specified components.Confirmation Required:
Delegates To:
bunx shadcn@latest add for individual component installation.IMPORTANT: shadcn/ui CLI and AI assistants often generate Tailwind v3 configs by default. This skill ensures:
@theme block with shadcn color tokenstailwind.config.js files# Install core dependencies
bun add class-variance-authority clsx tailwind-merge lucide-react
bun add -D tailwindcss @tailwindcss/postcss
# Initialize shadcn (CSS-first, no tailwind.config)
bunx shadcn@latest init
# Install specific components
bunx shadcn@latest add button card input dialog
# Or install an essential starter set
bunx shadcn@latest add button card input label dialog dropdown-menu toast
See references/examples.md (§ Dependency Versions Example) for the full dependency block.
See references/examples.md (§ Generated File Structure) for the full tree.
The skill generates a CSS-first configuration using @import "tailwindcss" and an @theme block with all shadcn color tokens and border-radius variables.
See ${CLAUDE_SKILL_DIR}/references/shadcn-theme-tokens.md for the full token block (load when constructing the globals.css file).
| Theme | Description |
|-------|-------------|
| default | shadcn default (neutral grays) |
| zinc | Zinc-based neutral |
| slate | Slate-based cool neutral |
| stone | Stone-based warm neutral |
| gray | Pure gray |
| neutral | True neutral |
| red | Red primary |
| rose | Rose primary |
| orange | Orange primary |
| green | Green primary |
| blue | Blue primary |
| yellow | Yellow primary |
| violet | Violet primary |
Install commonly used components:
# Essential set
bunx shadcn@latest add button card input label dialog dropdown-menu toast
# Form-focused
bunx shadcn@latest add form input label select checkbox radio-group switch textarea
# Dashboard
bunx shadcn@latest add card table tabs badge avatar dropdown-menu sheet sidebar
See references/examples.md (§ components.json Full Example) for the full config. The tailwind.config field stays empty because setup uses CSS-first configuration in v4.
// src/lib/utils.ts
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
# Using bunx (recommended with bun)
bunx shadcn@latest add button
# Multiple components
bunx shadcn@latest add card dialog dropdown-menu
See references/examples.md (§ Using Components Example) for a sample composition.
The CSS uses prefers-color-scheme by default. For manual toggle, see references/examples.md (§ Dark Mode — Manual Toggle Provider) for the provider component and class-based CSS override.
Delete it. The CLI sometimes generates v3 configs. Run:
rm tailwind.config.js tailwind.config.ts
globals.css is imported in your layout@import "tailwindcss" is at the top@theme block contains all required variablesRun:
bun add -D @types/react @types/react-dom
Create src/lib/utils.ts:
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
After setup, verify no v3 patterns were introduced:
# Should return nothing (no v3 tailwind.config files)
find . -name "tailwind.config.*" -not -path "*/node_modules/*"
# Should return nothing (no @apply directives)
grep -r "@apply" src/ --include="*.css" 2>/dev/null
# Verify the @import directive is present
grep "@import \"tailwindcss\"" src/app/globals.css
development
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.