shadcn-agents-cva-validator
shadcn ui Agent : cva Variant API Validator
This skill is the deterministic checklist a code-review or pre-commit agent uses to verify that any cva-driven shadcn component is shaped correctly. It is a VALIDATOR, not a tutorial. For the underlying cva theory, ALWAYS read shadcn-syntax-variant-cva first. For debugging a className override that does not visually win, ALWAYS read shadcn-errors-styling-conflicts.
The validator answers exactly one question per checkpoint : PASS or FAIL. It does not propose creative refactors. When a check fails, the verdict cites the failing line and points to the canonical fix.
Quick Reference
Validator workflow (top of every review)
- Locate the cva call (search for
cva(in the diff or file). - Run the 7-point checklist from top to bottom in declared order.
- Stop at the first FAIL and emit the verdict with line reference.
- If all 7 pass, emit
VERDICT: PASSplus a one-line summary. - When called on a multi-file diff, repeat per component file independently.
The 7 checks are ordered by failure frequency observed in real shadcn projects : base, variants shape, compoundVariants order, defaultVariants, VariantProps export, cn() merge, asChild Slot. The first three catch over half of every cva regression seen in shadcn-ui/ui issues.