--- name: ui-library-usage-auditor description: This skill should be used when reviewing shadcn/ui component usage to ensure accessibility, consistency, and proper patterns. Applies when auditing UI code, checking component patterns, reviewing layout structure, identifying component extraction opportunities, or ensuring design system compliance. Trigger terms include audit UI, review components, check shadcn, accessibility audit, component review, UI patterns, design system compliance, layout review, refactor components, extract component. allowed-tools: Read, Grep, Glob, Bash --- # UI Library Usage Auditor Review and audit shadcn/ui component usage across the codebase to ensure accessible, consistent, and maintainable UI patterns. This skill identifies issues, suggests improvements, and recommends component extractions or layout optimizations. ## When to Use This Skill Apply this skill when: - Auditing UI components for accessibility compliance - Reviewing shadcn/ui usage patterns for consistency - Identifying opportunities for component extraction - Checking layout structure and responsive design - Ensuring proper ARIA attributes and semantic HTML - Finding duplicate component patterns - Reviewing form implementations - Checking for proper error handling in UI - Validating design system adherence ## Audit Categories ### 1. Accessibility Audit Check for: - Missing ARIA labels and descriptions - Improper heading hierarchy - Missing alt text on images - Insufficient color contrast - Missing keyboard navigation support - Form fields without labels - Non-semantic HTML usage - Missing focus indicators - Improper button vs link usage - Missing skip links for navigation ### 2. Component Consistency Audit Check for: - Inconsistent component variants across pages - Mixed styling approaches (inline vs className) - Duplicate component implementations - Inconsistent spacing patterns - Mixed icon libraries or icon sizes - Inconsistent typography usage - Non-standard button patterns - Inconsistent error message displays - Mixed loading state implementations ### 3. Component Extraction Opportunities Identify: - Repeated component patterns (3+ instances) - Complex inline JSX that could be components - Reusable form field groups - Common layout patterns - Shared modal/dialog content - Repeated table structures - Common card layouts - Shared empty states - Repeated loading skeletons ### 4. Layout and Responsiveness Review: - Responsive breakpoint usage - Container max-width consistency - Grid and flexbox usage patterns - Mobile-first responsive design - Overflow handling - Scroll behavior - Fixed positioning issues - Z-index management ### 5. shadcn/ui Best Practices Verify: - Correct component imports from @/components/ui - Proper use of composition patterns - Correct variant prop usage - Proper form component structure - Correct dialog/modal patterns - Proper toast/notification usage - Appropriate dropdown/select usage - Correct table implementations ## Audit Process ### Step 1: Scan Codebase for Components Use Glob to identify all component files: ```bash # Find all component files Glob: **/*.tsx Glob: app/**/*.tsx Glob: components/**/*.tsx ``` ### Step 2: Grep for Specific Patterns Search for common patterns and potential issues: ```bash # Find form implementations Grep: pattern="