Ui design system

From try-works/role-model · View interactive version

Ui design system is an AI agent skill from the GitHub repository try-works/role-model. React UI component systems with TailwindCSS + Radix + shadcn/ui. Stack: TailwindCSS (styling), Radix UI (primitives), shadcn/ui (components), React/Next.js. Capabilities: design system architecture, accessible components, responsive layouts, theming, dark mode, component composition. Actions: review

How to use this skill

Skill file

UI/UX Design & Development Expert

Comprehensive UI/UX design, review, and improvement for modern web applications.

Production-ready implementations with TailwindCSS + Radix UI + shadcn/ui and modern React patterns.

Stack Architecture

The Three Pillars

Layer 1: TailwindCSS (Styling Foundation)

Layer 2: Radix UI (Behavior & Accessibility)

Layer 3: shadcn/ui (Beautiful Components)

Architecture Hierarchy

Application Layer
    ↓
shadcn/ui Components (Beautiful defaults, ready-to-use)
    ↓
Radix UI Primitives (Accessible behavior, unstyled)
    ↓
TailwindCSS Utilities (Design system, styling)

Key Principle: Each layer enhances the one below. Start with Tailwind for styling, add Radix for accessible behavior, use shadcn/ui for complete components.

Core Capabilities

UI/UX Review & Audit

Systematic evaluation of existing interfaces:

UI/UX Design

Creating production-ready interface designs:

UI/UX Improvement

Enhancing existing implementations:

Styling Integration

Framework-agnostic styling approaches:

When to Use Each Layer

Use TailwindCSS Directly When:

Example scenarios: Hero sections, grid layouts, cards without interaction, text styling

Use Radix UI Primitives When:

Example scenarios: Custom date picker, unique navigation pattern, specialized modal behavior

Use shadcn/ui Components When:

Example scenarios: Admin dashboards, CRUD applications, settings pages, data tables

Critical Design Principles

1. Progressive Enhancement

Start simple, enhance as needed:

  1. Tailwind utilities for basic styling
  2. Add Radix primitives for interaction
  3. Use shadcn/ui for complete solutions
  4. Customize components in your codebase

2. Composition Over Complexity

Build complex UIs from simple, reusable components:

3. Accessibility First

Radix UI handles accessibility automatically:

Never override accessibility features - enhance them.

4. Design Token Consistency

Use Tailwind's design system consistently:

5. Mobile-First Responsive

Always design mobile-first, scale up:

Setup Strategy

Installation Order

  1. TailwindCSS - Foundation
  2. shadcn/ui CLI - Includes Radix dependencies
  3. Add components - Install only what you need
  4. Configure theme - CSS variables + Tailwind config
  5. Setup dark mode - Theme provider + toggle

Configuration Best Practices

Tailwind Config:

CSS Variables (Three-Tier System):

:root {
  /* Tier 1: Primitives (immutable) */
  --gray-50: 250 250 250;
  --gray-900: 24 24 27;
  --blue-500: oklch(0.55 0.22 264);

  /* Tier 2: Semantics (theme-aware) */
  --background: var(--gray-50);
  --foreground: var(--gray-900);
  --primary: var(--blue-500);

  /* Tier 3: Components */
  --button-height: 2.5rem;
  --card-padding: 1.5rem;
}

.dark {
  /* Only semantic tokens change */
  --background: var(--gray-900);
  --foreground: var(--gray-50);
}

Color Space Recommendation:

Token Storage:

Path Aliases:

Integration Patterns

Pattern 1: shadcn/ui + Custom Tailwind

Use shadcn/ui components as base, customize with Tailwind classes:

Pattern 2: Radix Primitives + Tailwind

Build custom components from scratch:

Pattern 3: Hybrid Approach

Modify shadcn/ui components in your codebase:

Pattern 4: Component Composition

Combine multiple primitives for complex UIs:

Design Token Architecture

Use three-tier token system for scalable, maintainable design systems:

Modern Color: Use OKLCH color space for perceptual uniformity and better accessibility calculations.

📖 See DESIGN_TOKENS.md for:

Responsive Design Strategy

Mobile-first approach: Start with mobile (0-639px), scale up through sm/md/lg/xl/2xl breakpoints.

Key patterns: Layout shifts (column→row), component switching (Dialog→Drawer), container queries for modular responsiveness.

📖 See RESPONSIVE_PATTERNS.md for:

Form Architecture

Strategy: React Hook Form + Zod for schema-first validation with type inference and accessible error handling.

📖 See CUSTOMIZATION.md for:

Performance Best Practices

Core strategies: Code splitting (React.lazy), Tailwind optimization (accurate content paths), virtualization (@tanstack/react-virtual for long lists).

📖 See PERFORMANCE_OPTIMIZATION.md for:

Component Customization & Dark Mode

Customization Strategies

  1. Direct Modification: Edit shadcn/ui files in your codebase
  2. Variant Extension: Use CVA for type-safe variants
  3. Wrapper Components: Add custom logic around base components
  4. Theme Customization: Modify CSS variables globally

Dark Mode Setup

  1. ThemeProvider with next-themes
  2. Class strategy (class, not media query)
  3. CSS variables in .dark class
  4. Accessible toggle component

📖 See CUSTOMIZATION.md for:

Accessibility Standards

Radix UI Built-In Guarantees

WCAG Contrast Requirements (Critical)

WCAG 2.1 Level AA (Legal Minimum):

WCAG Level AAA (Enhanced):

Measurement:

OKLCH Advantage:

Perceptually uniform color space makes contrast calculations more reliable and predictable compared to HSL.

Implementation Checklist

Testing Strategy

  1. Automated: Use contrast checkers during design
  2. Manual: Tab through entire interface
  3. Screen readers: Test with at least one screen reader
  4. Real users: Include users with disabilities in testing

Common Pitfalls

Avoid these frequent issues:

  1. Dynamic classes: Tailwind doesn't generate at runtime → use conditionals
  2. Content config: Verify paths include all component files
  3. Import paths: Check tsconfig.json aliases
  4. Dark mode: Ensure ThemeProvider setup and CSS variables
  5. Accessibility: Never remove ARIA attributes

📖 See PERFORMANCE_OPTIMIZATION.md for complete troubleshooting guide with 10+ common issues and solutions.

Resources

Official Documentation

Authoritative Design System Sources

Reference Files (Detailed Guides & Patterns)

Core Concepts:

Implementation References:

Triggers & Use Cases

Activate for: UI/UX review/audit | Design system architecture | Accessibility audit (WCAG) | Design tokens (3-tier system) | Color systems (OKLCH) | Typography systems | Spacing/layout design | Tailwind/Radix/shadcn/ui setup | Responsive design patterns | Dark mode theming | Component library design

Do NOT activate for: React/Next.js architecture (use react-nextjs-expert) | State management | Server Components | Backend APIs | Database design | Infrastructure/DevOps

Behavioral Traits

Core Philosophy: User-centric | Performance-aware (Core Web Vitals) | Accessibility-first (WCAG AA) | Evidence-based | Maintainable | Type-safe

Design Principles: Progressive enhancement | Mobile-first | Atomic design | Consistent tokens (3-tier) | Semantic HTML | Comprehensive error handling

Code Quality: Component composition | Single responsibility | Proper hooks usage | Optimized rendering | Comprehensive testing

Response Approach

Review: Understand context → Systematic audit → Identify issues → Provide evidence → Recommend solutions → Prioritize

Design: Gather requirements → Choose architecture → Design tokens → Component structure → Implement accessibly → Include states → Responsive → Document

Improve: Analyze current state → Identify bottlenecks → Plan improvements → Implement incrementally → Measure impact → Document → Test

Integration: Verify compatibility → Follow official patterns → Best practices → Type safety → Performance budget → Error boundaries

Implementation Checklist

Setup: Install Tailwind + shadcn/ui | Configure three-tier tokens | Set up dark mode | Create cn() helper

Development: Apply mobile-first design | Implement dark mode | Test accessibility | Verify WCAG AA contrast

Production: Validate Tailwind purging | Test all states | Cross-browser testing | Performance audit

📖 Detailed checklists available in:

Best Practices Summary

Design Tokens: Three-tier system | OKLCH color space | Purpose-driven naming

Accessibility: WCAG AA minimum (4.5:1 text, 3:1 UI) | Keyboard navigation | Screen readers

Performance: Code splitting | Virtualization | Tailwind optimization

Maintenance: Modular components | Documentation | Version control tokens

Skill Summary

Primary Functions:

  1. Review: Audit UI/UX for accessibility, performance, and design system consistency
  2. Design: Create production-ready interfaces with modern React and styling systems
  3. Improve: Enhance existing implementations for better UX, performance, and maintainability

Technology Focus:

Activation Triggers:

Boundaries:

✅ Design systems, styling, accessibility, design tokens, UI patterns

❌ React architecture (react-nextjs-expert), state management, backend APIs, infrastructure


Skill Version: 2.1.0

Last Updated: 2025-11-15

Enhanced With: UI/UX review capabilities, design system architecture, framework-agnostic patterns

Authoritative Sources: WCAG 2.1/2.2, OKLCH color science, industry design systems (USWDS, Carbon, Polaris)

Progressive Disclosure: Reference files for detailed guides ✅

Scope: Design systems, styling, accessibility, UI/UX patterns (framework-agnostic)

Companion Skills: react-nextjs-expert (for React/Next.js architecture and state management)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.