What problem does it solve?
Writing Chromatic visual regression test (VRT) stories for Spectrum Web Components requires many non-obvious conventions: where .vrt.ts files live, how to group permutations into scannable rows, how to force pseudo-states in static snapshots, and how to cover custom properties and forced-colors mode. This Skill encodes those conventions so contributors produce consistent, reviewable VRT coverage.
Core Features & Use Cases
- VRT story authoring patterns: Defines file placement (
test/vrt/*.vrt.ts), story shapes for permutations, global stylesheets, and custom properties, plus shared helpers like createPermutations, groupPermutationsBy, and row.
- Forced pseudo-state snapshots: Explains how
forcePseudoStates applies data-forced-<state> attributes so :hover, :focus-visible, and :active render in static Chromatic captures, including slotted light-DOM children.
- Coverage guidance: Covers forced-colors stories, positioned overlay pitfalls with Floating UI, CJK text rendering, and custom-property reference/override rows verified against
custom-elements.json.
- Use Case: When adding a new 2nd-gen component like a badge, use this Skill to generate a
.vrt.ts story grouping permutations by variant, splitting forced states into labeled rows, and adding a custom-properties coverage story.
Quick Start
Use the vrt-authoring skill to create a Chromatic VRT story file for the 2nd-gen button component covering all sizes, variants, and forced hover and focus-visible states.