visual-regression
/visual-regression
Detect unintended UI changes with reproducible rendered screenshots and reviewed baselines. Use when adding screenshot checks or investigating layout/theme regressions; do not approve a changed image merely to make the test green.
- Author
- wrongstack ↗
- Repository
- wrongstack ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 2
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Detect unintended UI changes with reproducible rendered screenshots and reviewed baselines. Use when adding screenshot checks or investigating layout/theme regressions; do not approve a changed image merely to make the test green.
Original author description
Detect unintended UI changes with reproducible rendered screenshots and reviewed baselines. Use when adding screenshot checks or investigating layout/theme regressions; do not approve a changed image merely to make the test green.
How it works
- Selection card
- Overview
- Rules
- Core Patterns & Pitfalls
- Workflow
- Before returning
- Sources
- Skills in scope
SKILL.md preview
---
name: visual-regression
description: "Detect unintended UI changes with reproducible rendered screenshots and reviewed baselines. Use when adding screenshot checks or investigating layout/theme regressions; do not approve a changed image merely to make the test green."
trigger: "Detect unintended UI changes with reproducible rendered screenshots and reviewed baselines. Use when adding screenshot checks or investigating layout/theme regressions; do not approve a changed image merely to make the test green."
version: 1.0.2
required-capabilities: [filesystem.read]
required-tools: []
optional-capabilities: [filesystem.write, execution.shell, verification.run, web.research]
metadata:
routing-group: design
domain: "design"
---
# Visual Regression
## Selection card
- Task: Compare rendered UI states against screenshot baselines.
- Start: Identify the target surface, reference, user task and existing tokens.
- Finish: apply the acceptance checks below; report observed results and unresolved constraints.
## Overview
Visual regression testing catches unintended layout shifts, token drift, clipping, z-index collisions, and dark/light theme regressions by comparing rendered component or page screenshots against reviewed baselines. Reliable visual diffs require deterministic rendering conditions (pinned fonts, frozen clock/random seeds, disabled animations, stable network fixtures) and disciplined baseline review.
Current checked targets: Playwright 1.64.1 and Storybook React 10.6.3 (2026-10-23). Refresh registry and browser/tool compatibility before installation.
## Rules
1. Pin viewport dimensions, browser engine, device scale factor, locale, color scheme, web fonts, clock, and fixture data.
2. Wait for actual visual readiness: `document.fonts.ready`, image decode completion, network/skeleton resolution, and `animations: 'disabled'`. Arbitrary sleeps produce flaky baselines.
3. Mask only intentionally dynamic regions (live video, third-party embeds) with a documented reason; masking the component under test defeats the check.
4. Separate cross-OS font rasterization noise (solve via containerized/CI Linux runners) from real geometry, color, spacing, or state regressions.
5. Inspect every actual/expected/diff image triplet against the user's requested change before updating a baseline (`--update-snapshots`).
6. Keep screenshot assertions paired with semantic/behavioral checks; matching pixels alone do not prove keyboard focus or ARIA states work.
## Core Patterns & Pitfalls
- **Deterministic Playwright Snapshot**: Freeze time (`page.clock.setFixedTime(...)`), await locator stability, and call `await expect(locator).toHaveScreenshot('name.png', { animations: 'disabled' })` scoped to the target component or full viewport as appropriate.
- **State Matrix Coverage**: Capture high-risk visual states—default, hover/focus-visible, validation error, empty state, long-text overflow, and dark mode—at both desktop (1280–1440px) and narrow mobile (375–390px) widths.
- **Anti-pattern — Blind `--update-snapshots`**: Never regenerate baselines to silence a failing CI check without inspecting the diff image and confirming every pixel change is intentional.
## Workflow
1. Choose representative routes/components and the states most likely to regress.
2. Capture a deterministic baseline through the configured browser/story workflow.
3. Inspect the diff image and trace the owning component/theme change.
4. Fix the source or accept an intended baseline change with evidence.
5. Rerun the same conditions, then the affected interaction tests.
## Before returning
- [ ] Viewport, theme, font loading, clock, and animation state pinned deterministically
- [ ] Actual, expected, and diff images inspected for every modified snapshot
- [ ] Any masked locators or pixel thresholds justified and scoped narrowly
- [ ] Unintended visual regressions fixed in source rather than baked into updated baselines
- [ ] Behavioral and accessibility assertions verified alongside screenshot checks
## Sources
Versioned facts checked 2026-10-23; refresh authoritative sources before new installs/upgrades.
[Playwright snapshots](https://playwright.dev/docs/test-snapshots), [Storybook visual testing](https://storybook.js.org/docs/writing-tests/visual-testing).
## Skills in scope
- testing — combine visual snapshot assertions with behavioral and edge-case functional tests.
- design-critique — evaluate visual hierarchy, spacing rhythm, and token adherence when reviewing diffs.
- accessibility — verify focus indicators, contrast ratios, and zoom/reflow behavior alongside visual snapshots.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · wrongstack/wrongstack | 90 | MIT |
| DnsQueen/orcinus-skills | 100 | MIT |
| thedaviddias/front-end-checklist | 100 | MIT |
| aks-builds/quality-skills | 100 | MIT |
| alekspetrov/navigator | 95 | MIT |
Database snapshot: 13.11.2026 · package version 9646764e277e (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100visual-regression-testing
Catch unintended UI changes by diffing rendered screenshots against approved baselines with tuned thresholds and flake control. Use when protecting a component or page from visual drift across code changes. - 100testing-visual-regression
Detect visual changes in UI components using screenshot comparison. Use when detecting unintended UI changes or pixel differences. Trigger with phrases like "test visual changes", "compare screenshots", or "detect UI regressions". - 100testing-visual-regression
Detect visual changes in UI components using screenshot comparison. Use when detecting unintended UI changes or pixel differences. Trigger with phrases like "test visual changes", "compare screenshots", or "detect UI regressions". - 100doncheli-visual-test
Run visual regression tests by comparing UI screenshots against baselines. Activate when user mentions "visual test", "screenshot", "UI regression", "visual diff", "pixel diff", "visual snapshot". - 100test-visual-regression
Set up Playwright screenshot baselines and CI diffing so UI changes fail pixel by pixel instead of by eye. Use when "add visual regression tests" or "catch UI regressions". Functional clicks → test-playwright. - 100visual-regression-testing-playwright-percy
Use this skill when detecting unintended UI visual regressions and pixel shifts across browser viewports automatically.