What problem does it solve?
React components accumulate loose prop types, redundant props, and scattered className or style overrides over time, making them hard to maintain and audit. This Skill performs a structured, non-breaking cleanup of a React component with commit-by-commit traceability.
Core Features & Use Cases
- Interface Tightening: Removes unused props, freezes string props into literal unions, converts optional props to required, and combines dependent props into discriminated unions.
- Variant Consolidation: Moves color and size related classes from className/style props into cva-style variants with exhaustive lookup tables, avoiding specificity conflicts.
- Callsite Migration: Uses the sweepy CLI to freeze, replace, and lift prop values across all callsites, with lint/format checks and commits after each step.
- Use Case: You have a Button component with a free-form className prop and redundant size flags. Run this Skill to tighten its interface, migrate all callsites, add a Storybook story, and receive a final audit report.
Quick Start
Ask the AI to clean up a specific React component using the react-component-cleaner skill and follow its guided todolist.