variant-consistency-checker
[Design System] Validate UI component usage against design system specifications. Use when (1) checking component variants/sizes are valid, (2) verifying required props are present, (3) detecting deprecated component usage, (4) finding disallowed prop combinations, (5) user asks to 'check component usage', 'validate variants', 'audit design system compliance', or 'find component inconsistencies'.
When & Why to Use This Skill
The Variant Consistency Checker is a specialized Claude skill designed to automate the validation of UI components against design system specifications. It performs static analysis on frontend codebases (like React/JSX) to ensure every component adheres to defined variants, sizes, and property requirements. By detecting deprecated usage and invalid prop combinations, it helps maintain design integrity, reduces visual regressions, and streamlines the technical audit process for design system compliance.
Use Cases
- Design System Auditing: Automatically scan large-scale repositories to identify UI components that deviate from the official design specification.
- Migration & Refactoring: Detect and flag deprecated components or props during design system version upgrades to ensure a smooth transition to new standards.
- Prop Validation: Verify that all required props are present and identify disallowed prop combinations that could lead to layout breaks or functional errors.
- Consistency Enforcement: Ensure developers use only approved variants and sizes, preventing 'design debt' and maintaining a unified user interface across different product modules.
| name | variant-consistency-checker |
|---|---|
| description | "[Design System] Validate UI component usage against design system specifications. Use when (1) checking component variants/sizes are valid, (2) verifying required props are present, (3) detecting deprecated component usage, (4) finding disallowed prop combinations, (5) user asks to 'check component usage', 'validate variants', 'audit design system compliance', or 'find component inconsistencies'." |
Variant Consistency Checker
Validate UI component usage against design system specifications.
Quick Start
python3 scripts/check_variants.py --spec components-spec.yml --source src/
Issue Types
| Type | Description |
|---|---|
unknown-variant |
Variant not in spec |
unknown-size |
Size not in spec |
missing-prop |
Required prop absent |
deprecated |
Using deprecated component |
disallowed-combination |
Invalid prop combination |
unknown-component |
Component not in spec |
unknown-prop |
Prop not defined (strict mode) |
Detection Examples
React/JSX
// Issues detected:
<Button variant="outline" size="xl" />
// ↑ unknown-variant ↑ unknown-size
<Button variant="primary" />
// ↑ missing-prop: children