Analyze design system usage, identify inconsistencies across patterns, generate fixes, and maintain visual coherence with automated style guide generation
This skill ensures all 24 AI design patterns maintain visual and interaction consistency across your application by analyzing design system usage, identifying deviations, and applying fixes automatically.
Claude will automatically invoke this skill when:
Your design system uses Tailwind CSS v4 with custom utilities. This skill checks:
Design System Analysis
āāā Colors
ā āāā Primary blues, secondary grays
ā āāā Accent colors for CTAs
ā āāā Semantic colors (success, error, warning)
ā āāā Dark mode palette
āāā Typography
ā āāā Font sizes (xs, sm, base, lg, xl, 2xl, 3xl)
ā āāā Font weights (regular, medium, semibold, bold)
ā āāā Line heights for readability
ā āāā Letter spacing
āāā Spacing
ā āāā Padding consistency (2, 4, 6, 8, 12, 16, 24, 32)
ā āāā Margin consistency
ā āāā Gap between elements
ā āāā Component margins
āāā Components
ā āāā Button variants (primary, secondary, outline, ghost)
ā āāā Card patterns and shadows
ā āāā Badge styles
ā āāā Input field consistency
ā āāā Navigation patterns
āāā Effects
ā āāā Box shadows (sm, md, lg)
ā āāā Border radius (sm, md, lg)
ā āāā Transitions and animations
ā āāā Hover states
ā āāā Disabled states
āāā Animations
ā āāā Framer motion durations
ā āāā Easing functions
ā āāā Transform values
ā āāā Stagger patterns
āāā Dark Mode
āāā Contrast ratios
āāā Color adjustments
āāā Text readability
āāā Semantic color mapping
npm run design-analyze
Output shows:
npm run design-report
Generates comprehensive report:
š Design Consistency Report
āāā Overall Score: 78/100
āāā Critical Issues: 3
āāā Warnings: 12
āāā Minor Issues: 8
āāā Recommendations: 15
Files Requiring Fixes
āāā src/components/examples/PredictiveAnticipationExample.tsx
ā āāā ā ļø Wrong spacing (p-3 should be p-4)
ā āāā ā ļø Wrong color (text-gray-500 should be text-gray-600)
āāā src/components/examples/AmbientIntelligenceExample.tsx
ā āāā š“ Shadow inconsistency
ā āāā ā ļø Animation duration mismatch
āāā ... more files
npm run design-style-guide
Generates documentation of your design system:
# Style Guide
## Colors
### Primary Palette
- Primary: bg-blue-600 (used for main CTAs)
- Primary Dark: bg-blue-700 (hover state)
- Primary Light: bg-blue-50 (backgrounds)
### Secondary Palette
- Secondary: bg-gray-600 (secondary actions)
- Secondary Dark: bg-gray-700 (hover)
### Semantic Colors
- Success: bg-green-500 (positive feedback)
- Error: bg-red-500 (errors)
- Warning: bg-yellow-500 (warnings)
- Info: bg-blue-500 (information)
### Dark Mode
- Background: dark:bg-gray-900
- Surface: dark:bg-gray-800
- Text: dark:text-gray-100
## Typography
### Font Sizes
- xs: 12px (labels, small text)
- sm: 14px (body text)
- base: 16px (default text)
- lg: 18px (section titles)
- xl: 20px (headings)
### Font Weights
- Regular: font-normal (400)
- Medium: font-medium (500)
- Semibold: font-semibold (600)
- Bold: font-bold (700)
## Spacing
... and more
ā Inconsistent:
<Card className="p-2"> {/* Some cards */}
<Card className="p-4"> {/* Other cards */}
<Card className="p-6"> {/* Yet more */}
ā Consistent:
<Card className="p-6"> {/* All cards use p-6 */}
Fix Command:
npm run design-fix # Fix one issue at a time
# or
npm run design-fix-all # Fix all at once
ā Inconsistent:
<button className="bg-blue-400"> {/* Random blue */}
<button className="bg-blue-600"> {/* Primary blue */}
<button className="bg-blue-800"> {/* Dark blue */}
ā Consistent:
<button className="bg-blue-600"> {/* Primary */}
<button className="bg-blue-600 hover:bg-blue-700"> {/* Primary + hover */}
Tailwind Color System Used:
blue-600 ā Primary colorblue-700 ā Primary hoverblue-50 ā Primary light backgroundgray-600 ā Secondary colorgray-700 ā Secondary hoverā Inconsistent:
<h1 className="text-lg font-semibold"> {/* Should be xl + bold */}
<h1 className="text-2xl font-normal"> {/* Wrong weight */}
<p className="text-base font-bold"> {/* Wrong weight */}
ā Consistent:
<h1 className="text-2xl font-bold"> {/* Page title */}
<h2 className="text-xl font-semibold"> {/* Section title */}
<p className="text-base font-normal"> {/* Body text */}
<span className="text-sm font-medium"> {/* Labels */}
ā Inconsistent:
<div className="space-y-2"> {/* Tight */}
<div className="space-y-8"> {/* Loose */}
<div className="gap-3"> {/* Random */}
ā Consistent:
<div className="space-y-6"> {/* Standard section spacing */}
<div className="flex gap-4"> {/* Component spacing */}
<div className="px-6 py-4"> {/* Card padding */}
ā Inconsistent:
{/* Disabled state - different for each component */}
<button disabled className="opacity-50">
<button disabled className="bg-gray-400">
<button disabled className="cursor-not-allowed">
ā Consistent:
{/* All disabled buttons use same pattern */}
<button disabled className="opacity-50 cursor-not-allowed">
ā Incomplete:
<div className="bg-white text-black">
{/* No dark mode support */}
</div>
ā Complete:
<div className="bg-white dark:bg-gray-900 text-black dark:text-white">
{/* Full dark mode support */}
</div>
npm run design-fix
Prompts you to:
npm run design-fix-all
Automatically:
// Tailwind config provides these utilities
Primary: bg-blue-600, text-blue-600
Primary Alt: bg-blue-700, hover:bg-blue-700
Primary BG: bg-blue-50, dark:bg-blue-900
Secondary: bg-gray-600, text-gray-600
Success: bg-green-500, text-green-500
Error: bg-red-500, text-red-500
Warning: bg-yellow-500, text-yellow-500
// Consistent sizing system
sm: max-w-sm (24rem) {/* Modals, cards */}
md: max-w-md (28rem) {/* Medium containers */}
lg: max-w-lg (32rem) {/* Large sections */}
xl: max-w-xl (36rem) {/* Full-width content */}
2xl: max-w-2xl (42rem) {/* Wide content */}
// Consistent roundness
rounded-sm: 2px {/* Subtle curves */}
rounded: 4px {/* Default buttons */}
rounded-md: 6px {/* Cards, inputs */}
rounded-lg: 8px {/* Large components */}
rounded-full: 9999px {/* Circles, pills */}
// Elevation hierarchy
shadow-sm: 0 1px 2px {/* Subtle */}
shadow: 0 1px 3px {/* Default */}
shadow-md: 0 4px 6px {/* Medium lift */}
shadow-lg: 0 10px 15px {/* High lift */}
When working on patterns (using Pattern Development skill):
Design consistency checks run:
npm test)npm run build)# Analyze design system usage
npm run design-analyze
# Generate design consistency report
npm run design-report
# Generate/update style guide
npm run design-style-guide
# Fix single design issue (interactive)
npm run design-fix
# Fix all design issues automatically
npm run design-fix-all
# View current style guide
cat docs/style-guide.md
Design System Files
āāā Tailwind Config: tailwind.config.mjs
āāā Global Styles: src/app/globals.css
āāā Design Tokens: (in Tailwind config)
āāā Component Examples:
ā āāā src/components/ui/Button.tsx
ā āāā src/components/ui/Card.tsx
ā āāā src/components/ui/Badge.tsx
ā āāā ... more
āāā Generated Style Guide: docs/style-guide.md
āāā Reports: design-consistency-report.json
Track improvement:
| Metric | Baseline | Target | Current |
|---|---|---|---|
| Color Consistency | 65% | 95% | - |
| Typography Consistency | 70% | 95% | - |
| Spacing Consistency | 60% | 95% | - |
| Dark Mode Coverage | 50% | 100% | - |
| Component States | 75% | 100% | - |
Goal: Maintain visual and interaction consistency across all 24 AI design patterns, ensuring a cohesive, professional user experience with systematic design system adherence.