ui-visual-parity/SKILL.md
Compare a UI implementation against one or more reference screenshots using automatic target discovery or an explicitly paired live URL, route, page, or component file. Use when auditing visual parity, fixing layout/token drift, or aligning implemented UI with screenshot references across any frontend project. Enforces component-first, token-first visual fixes before page-level style overrides.
npx skillsauth add harrychuang/cursor-skills ui-visual-parityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to compare a reference UI screenshot with the current implementation, then apply focused visual fixes. It is intentionally project-agnostic: discover the repository's screenshot locations, routing conventions, component structure, styling system, and design tokens before changing code.
Treat visual repair as a design-system exercise: trace the UI back to its tokens, theme, shared primitives, and composed components before editing the screen. Do not patch visual differences with one-off CSS unless the difference is truly unique to the selected screen and no shared abstraction owns it.
The reference can be paired with:
http://localhost:3000/dashboard;/dashboard;src/pages/Dashboard.tsx;Dashboard.tsx or Dashboard.stories.tsx;Accept any of these target forms from the user message:
screen-2, screen-2.png, reference/screen-2.png, designs/dashboard.png.screen-2.png http://localhost:3000/dashboard.screen-2.png /dashboard.screen-2.png src/pages/Dashboard.tsx.http://localhost:3000/dashboard, /dashboard.src/pages/Dashboard.tsx, Dashboard.tsx, Dashboard.stories.tsx.Treat a screenshot + URL/file pair as the strongest signal. Do not override an explicit pair with auto-discovery unless the target cannot be found or loaded.
Support both manual and automatic target selection:
For automatic discovery, produce a short ranked candidate list when more than one plausible pairing exists. Proceed without asking only when there is a clear best match; otherwise ask the user to choose before applying fixes.
Before comparing or editing, discover project conventions:
reference/, references/, screenshots/, design/, designs/, mockups/, spec/, specs/, and public/.src/pages/, src/screens/, src/app/, app/, pages/, src/routes/, src/components/, components/, and Storybook stories.README.md, CLAUDE.md, AGENTS.md, .cursor/rules/, theme files, token files, Storybook docs, or component documentation.Resolve targets in this order:
If the screenshot or implementation target is ambiguous, list the likely candidates and ask the user to choose before applying fixes.
For each selected screen:
Use this report format:
| Block | Expected (reference) | Actual (implementation) | Difference | Owner | Fix |
Make visual repair as measurable as practical before editing:
font-size, line-height, font-weight, color, background, padding, margin, gap, width, height, border, border-radius, box-shadow, and relevant layout properties.Do not rely only on subjective visual judgment when computed styles, token values, screenshots, or region measurements are available.
For each planned fix, cite the evidence that justifies it: reference screenshot observation, rendered screenshot, computed style, token/theme value, component source, story, or representative call site. Do not make visual changes from intuition alone when stronger evidence is available.
Prefer the same layered repair model used by mature design systems such as Material Design 3:
Before changing code, confirm whether each visual mismatch is owned by a design token, theme value, shared primitive, component variant, composition API, or the selected screen itself. Start at the most reusable owner and move toward the page only when earlier layers do not own the mismatch.
Before editing, state which layer owns each planned fix. If ownership is ambiguous, inspect nearby stories, docs, component call sites, and token/theme files before choosing. Only directly modify the screen's style definitions when the screen has no corresponding reusable component or token owner, or when the mismatch is inherently page-specific.
When changing tokens, themes, primitives, component variants, or shared components, inspect representative call sites or stories before and after the change. If changing a shared default would unintentionally affect unrelated screens, prefer a variant, prop, slot, or composition-level adjustment.
Keep public component APIs stable unless the user asks for a broader refactor. Avoid product behavior, copy, data flow, accessibility semantics, or interaction changes when the task is visual parity.
Stop and ask the user before editing when the reference is too ambiguous, the implementation target cannot be rendered, required auth/data is unavailable, multiple target matches are equally plausible, or the fix would require changing product behavior, copy, data, accessibility semantics, or shared component defaults with unclear blast radius.
development
Build or update token-backed Storybook foundations, shared UI components, and stories from an extracted design-system package. Use after design-system-extractor, or when Codex must read design-system Markdown and token files, automatically trace original design sources such as Figma URLs/nodes, UI images, rendered routes, and frontend folders, infer component dependency order so core primitives are built before composed components, map component specs into a product repo, create or update Storybook docs, plan component batches, and verify implementation with the bundled Figma export addon without bypassing tokens.
development
Extract a reusable design-system specification from UI screenshots/images, Figma URLs or exports, Figma Variables, existing app/project folders, or prototype code. Use when Codex must produce evidence-backed design principles, design elements, token architecture, component inventory, component token specs, anti-AI style constraints, static HTML documentation for developers, cross-agent handoff guidance for Claude Code/Cursor/Codex, and a checkpoint before any product implementation.
development
Create, apply, audit, and understand Variables in Figma using Google Material Design's three-tier token inheritance (Ref → Sys → Comp). Use when: creating Variables for components or screens, applying existing Variables to nodes, auditing token naming and structure for compliance, or having AI read existing Variables to reverse-engineer design components. Triggers: create Variables, apply Variables, Figma variables, M3 token, design token, token inheritance, token audit, audit variables, design component from variables, three-tier token.
tools
Turn screenshots or Figma exports into token-backed Storybook components and composed product screens.