design-system-enforcement
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.
What this skill does
# 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
## Core Design Principles (MANDATORY)
### 1. Typography: 4 Sizes, 2 Weights ONLY
**STRICTLY 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:**
- More than 4 font sizes
- Additional font weights (bold, light, etc.)
- Inconsistent size application
### 2. 8pt Grid System
**STRICTLY ENFORCED:**
- ALL spacing MUST be divisible by 8 or 4
- ✅ Allowed: 8, 16, 24, 32, 40, 48, 56, 64px
- ❌ Forbidden: 25, 11, 7, 13, 15, 19px
**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)
```
### 3. 60/30/10 Color Rule
**STRICTLY ENFORCED:**
- 60% Neutral (`bg-background`) - White/dark backgrounds
- 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:
```bash
# 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:
```bash
# 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:**
```bash
# 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:**
```markdown
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):**
```markdown
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
```
### Color Configuration
**Template (OKLCH format):**
```css
:root {
--background: {{BACKGROUND_OKLCH}};
--foreground: {{FOREGROUND_OKLCH}};
--primary: {{PRIMARY_OKLCH}};
--primary-foreground: {{PRIMARY_FOREGROUND_OKLCH}};
}
```
**After Setup:**
```css
: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);
}
```
## Agent Enforcement Rules
### Before Generating ANY UI Code
**MANDATORY CHECKLIST:**
1. [ ] Read `design-system.md` file
2. [ ] Understand font size constraints (4 only)
3. [ ] Understand font weight constraints (2 only)
4. [ ] Understand spacing constraints (divisible by 8/4)
5. [ ] Understand color distribution (60/30/10)
6. [ ] Know OKLCH color variables
7. [ ] Use only shadcn/ui components
### During Code Generation
**ENFORCE:**
- Use only configured font sizes
- Use only Semibold or Regular weights
- All spacing values divisible by 8 or 4
- 60% `bg-background`, 30% `text-foreground`, 10% `bg-primary`
- OKLCH colors from globals.css
- shadcn/ui components from `@/components/ui/`
- Proper accessibility (ARIA labels, keyboard nav)
### After Code Generation
**VALIDATE:**
```bash
# 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:**
- More than 4 font sizes
- Font weights other than Semibold/Regular
- Spacing not divisible by 4 or 8
- Accent color usage > 10%
- Custom CSS instead of Tailwind
- Non-shadcn/ui components
## Example Component (Compliant)
```tsx
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:**
- ✅ Typography: 2 sizes (text-2xl, text-base), 2 weights (semibold, normal)
- ✅ Spacing: All divisible by 8 (p-6=24px, mb-4=16px, space-y-4=16px, gap-4=16px)
- ✅ Colors: 60% bg-background, 30% text-foreground, 10% bg-primary
- ✅ Components: shadcn/ui Button and Card
- ✅ No custom CSS
- ✅ Accessible: Proper semantic HTML
## Integration with Commands
### add-page.md Integration
```markdown
Phase 1: Parse Arguments
Actions:
- **FIRST**: Read design system: !{bash cat design-system.md}
- Parse page name from $ARGUMENTS
Phase 4Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.