/nextjs-frontend:design-system-enforcementfrom nextjs-frontend
Mandatory design system enforcement for shadcn/ui with Tailwind v4. Enforces 4 font sizes, 2 weights, 8pt grid, 60/30/10 color rule, OKLCH colors, and accessibility standards. Validate before generating UI code.
Ships in nextjs-frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Purpose: Enforce consistent, accessible, and beautiful UI across all Next.js projects using shadcn/ui with Tailwind v4.
Activation Triggers:
Key Resources:
scripts/setup-design-system.sh - Interactive design system configurationscripts/validate-design-system.sh - Validate code against design systemtemplates/design-system-template.md - Template with placeholdersexamples/taskflow-ai-example.md - Complete example configurationSTRICTLY ENFORCED:
✅ Size 1: Large headings
✅ Size 2: Subheadings
✅ Size 3: Body text
✅ Size 4: Small text/labels
✅ Semibold: Headings and emphasis
✅ Regular: Body text and UI
❌ FORBIDDEN:
STRICTLY ENFORCED:
Tailwind Classes:
p-2 (8px) | m-2 (8px) | gap-2 (8px)
p-4 (16px) | m-4 (16px) | gap-4 (16px)
p-6 (24px) | m-6 (24px) | gap-6 (24px)
p-8 (32px) | m-8 (32px) | gap-8 (32px)
STRICTLY ENFORCED:
bg-background) - White/dark backgroundstext-foreground) - Text and iconsbg-primary) - CTAs and highlights only❌ FORBIDDEN:
REQUIRED:
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:
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
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
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
Template (OKLCH format):
:root {
--background: {{BACKGROUND_OKLCH}};
--foreground: {{FOREGROUND_OKLCH}};
--primary: {{PRIMARY_OKLCH}};
--primary-foreground: {{PRIMARY_FOREGROUND_OKLCH}};
}
After Setup:
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--primary: oklch(0.549 0.175 252.417);
--primary-foreground: oklch(0.985 0 0);
}
@theme {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
}
MANDATORY CHECKLIST:
design-system.md fileENFORCE:
bg-background, 30% text-foreground, 10% bg-primary@/components/ui/VALIDATE:
# Self-validation
./scripts/validate-design-system.sh path/to/component.tsx
# Must pass all checks before completion:
# ✅ Typography constraints
# ✅ Spacing constraints
# ✅ Color distribution
# ✅ No custom CSS
# ✅ Accessibility
❌ AUTOMATIC REJECTION:
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
export function ExampleComponent() {
return (
<Card className="p-6 bg-background">
{' '}
{/* 24px padding - ✅ divisible by 8 */}
<CardHeader className="mb-4">
{' '}
{/* 16px margin - ✅ divisible by 8 */}
<CardTitle className="text-2xl font-semibold">
{' '}
{/* ✅ Size 1, Semibold */}
Welcome to TaskFlow
</CardTitle>
</CardHeader>
<CardContent className="space-y-4">
{' '}
{/* 16px gap - ✅ divisible by 8 */}
<p className="text-base font-normal text-foreground">
{' '}
{/* ✅ Size 3, Regular, 60% */}
Manage your tasks efficiently with AI-powered workflows.
</p>
<div className="flex gap-4">
{' '}
{/* 16px gap - ✅ divisible by 8 */}
<Button className="bg-primary text-primary-foreground">
{' '}
{/* ✅ 10% accent */}
Get Started
</Button>
<Button variant="outline" className="text-foreground">
{' '}
{/* ✅ 30% complementary */}
Learn More
</Button>
</div>
</CardContent>
</Card>
);
}
Validation:
Phase 1: Parse Arguments
Actions:
- **FIRST**: Read design system: !{bash cat design-system.md}
- Parse page name from $ARGUMENTS
Phase 4: Page Generation
- Agent MUST validate against design system before completion
Phase 1: Parse Arguments
Actions:
- **FIRST**: Read design system: !{bash cat design-system.md}
- Parse component name from $ARGUMENTS
Phase 4: Implementation
- Agent MUST enforce all design system constraints
- Self-validate before returning component
Error:
❌ Found 6 font sizes: text-xs, text-sm, text-base, text-lg, text-xl, text-2xl
Expected: 4 font sizes only
Fix:
design-system.mdError:
❌ Found spacing not divisible by 8/4:
- padding: 15px (line 42)
- margin: 25px (line 58)
Fix:
// ❌ Before
<div className="p-[15px] mb-[25px]">
// ✅ After
<div className="p-4 mb-6"> {/* 16px and 24px */}
Error:
❌ Accent color usage: 18% (exceeds 10% limit)
Found 12 instances of bg-primary
Fix:
bg-background and text-foreground for majorityScripts: scripts/ directory:
setup-design-system.sh - Interactive configurationvalidate-design-system.sh - Code validationupdate-colors.sh - Batch color updatescheck-typography.sh - Typography auditTemplates: templates/ directory:
design-system-template.md - Base template with placeholdersglobals-css-template.css - Color variable templatecomponents-json-template.json - shadcn/ui configExamples: examples/ directory:
taskflow-ai-example.md - Complete configured examplee-commerce-example.md - E-commerce design systemdashboard-example.md - Admin dashboard design systemFramework: Next.js 13+ with App Router UI Library: shadcn/ui (Radix UI + Tailwind CSS v4) Color Format: OKLCH Enforcement: Mandatory for all agents Version: 1.0.0
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
design-system, shadcn-ui, tailwindcss, ui-enforcement, accessibility, spacing
npx claudepluginhub vanman2024/ai-dev-marketplace --plugin nextjs-frontend4 skills in this plugin
/deployment-configVercel deployment configuration and optimization for Next.js applications including vercel.json setup, environment variables, build optimization, edge functions, and deployment troubleshooting. Use when deploying to Vercel, configuring deployment settings, optimizing build performance, setting up environment variables, configuring edge functions, or when user mentions Vercel deployment, production setup, build errors, or deployment optimization./seo-2025-patterns2025 SEO best practices for Next.js including Core Web Vitals (INP replaces FID), E-E-A-T signals, Schema markup, AI content guidelines, and technical SEO. Use when optimizing pages for search engines, implementing metadata, adding structured data, or improving page speed./tailwind-shadcn-setupSetup Tailwind CSS and shadcn/ui component library for Next.js projects. Use when configuring Tailwind CSS, installing shadcn/ui, setting up design tokens, configuring dark mode, initializing component library, or when user mentions Tailwind setup, shadcn/ui installation, component system, design system, or theming.Other plugins' skills for the same job