Mandatory design system guidelines for shadcn/ui with Tailwind v4. Enforces 4 font sizes, 2 weights, 8pt grid spacing, 60/30/10 color rule, OKLCH colors, and accessibility standards. Use when creating components, pages, or any UI elements. ALL agents MUST read and validate against design system before generating code.
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Mandatory design system guidelines for shadcn/ui with Tailwind v4. Enforces 4 font sizes, 2 weights, 8pt grid spacing, 60/30/10 color rule, OKLCH colors, and accessibility standards. Use when creating components, pages, or any UI elements. ALL agents MUST read and validate against design system before generating code.
allowed-tools
Read, Write, Edit, Grep, Glob, Bash
Design System Enforcement
Purpose: Enforce consistent, accessible, and beautiful UI across all Next.js projects using shadcn/ui with Tailwind v4.
Activation Triggers:
Creating new components or pages
Generating UI elements
Styling React components
Setting up project design system
Before ANY UI code generation
Component library initialization
Design system validation needed
Key Resources:
scripts/setup-design-system.sh - Interactive design system configuration
scripts/validate-design-system.sh - Validate code against design system
templates/design-system-template.md - Template with placeholders
examples/taskflow-ai-example.md - Complete example configuration
30% Complementary (text-foreground) - Text and icons
10% Accent (bg-primary) - CTAs and highlights only
❌ FORBIDDEN:
Overusing accent colors (>10%)
Multiple competing accent colors
Insufficient contrast ratios
4. Clean Visual Structure
REQUIRED:
Logical grouping of related elements
Deliberate spacing following 8pt grid
Proper alignment within containers
Simplicity over flashiness
Setup Workflow
1. Initialize Design System
Run setup script during project initialization:
# Interactive setup
./scripts/setup-design-system.sh
# Guided configuration:# 1. Project name and brand color# 2. Typography scale (4 sizes)# 3. Color configuration (OKLCH format)# 4. Dark mode colors# 5. Figma design system URL# Generates: design-system.md in project root
What Gets Configured:
Project-specific brand colors
Font size scale (must be 4 sizes)
OKLCH color values
Dark mode palette
globals.css color variables
Design system metadata
2. Validate Existing Code
Check if existing code follows design system:
# Validate all components
./scripts/validate-design-system.sh
# Checks performed:# - Font size count (must be ≤ 4)# - Font weight usage (must be 2)# - Spacing divisibility (by 8 or 4)# - Color distribution (60/30/10)# - Custom CSS usage (should use Tailwind)# - shadcn/ui component usage# - Accessibility compliance
Validation Output:
✅ Typography: 4 sizes, 2 weights
✅ Spacing: All divisible by 8/4
❌ Colors: Accent usage at 15% (exceeds 10%)
❌ Custom CSS: Found 3 instances, use Tailwind utilities
⚠️ Accessibility: Missing ARIA labels on 2 components
3. Before Creating UI
MANDATORY AGENT WORKFLOW:
# 1. Read design system (REQUIRED)cat design-system.md
# 2. Understand constraints# - Only 4 font sizes from config# - Only 2 font weights# - All spacing divisible by 8/4# - Color distribution 60/30/10# - OKLCH colors only# - shadcn/ui components only# 3. Generate code following design system# 4. Self-validate before completion
./scripts/validate-design-system.sh app/components/MyNewComponent.tsx
Design System Configuration
Typography Configuration
From Template:
Size 1: {{FONT_SIZE_1}} - Large headings
Size 2: {{FONT_SIZE_2}} - Subheadings
Size 3: {{FONT_SIZE_3}} - Body text
Size 4: {{FONT_SIZE_4}} - Small text
After Setup (Example):
Size 1: text-2xl (24px) - Large headings
Size 2: text-lg (18px) - Subheadings
Size 3: text-base (16px) - Body text
Size 4: text-sm (14px) - Small text