agentsclimarketplace

Visual regression

Skill Syo-M/fable-frontend-skills/.claude/skills/visual-regression

Visual regression testing — Storybook-based VRT, Playwright screenshot comparison, determinism/flake control, baseline review workflow. Use when setting up or maintaining visual tests, screenshot diffs, Chromatic, or investigating "the screenshot test broke" failures. 日本語の依頼例:「スクショテスト導入」「ビジュアルリグレッション」「見た目の差分テスト」「スクリーンショットが毎回変わる」「Chromatic」。From its SKILL.md

Install
npx -y skills add Syo-M/fable-frontend-skills --skill visual-regression

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.5 KB, 890 tokens by cl100k_base, as published. Nobody here has run it

Visual Regression Testing

VRT catches what DOM assertions can't: layout breaks, token regressions, theme bugs, overflow. It complements — never replaces — behavioral tests. If a DOM assertion can express the check (text content, element presence), use that; VRT is for how things look.

Stories are the VRT surface

  • Component-level VRT runs over Storybook stories (Chromatic, or a Playwright/Vitest screenshot run against the built Storybook). Every visual state already has a story per the storybook skill — that catalog IS the snapshot suite. Don't build a parallel page-screenshot harness for component states.
  • Runner precedence: if a vendor service (Chromatic) is already configured, add the story and stop — it's covered. Otherwise default to Playwright toHaveScreenshot against the built Storybook, baselines committed alongside the spec and (re)generated only in the CI container.
  • Page-level VRT: expect(page).toHaveScreenshot() in Playwright for a handful of critical pages/themes only, as its own Playwright project running on fixture data — never bolt toHaveScreenshot onto a real-backend functional E2E spec (those follow testing-playwright). Full-page screenshots of every route is a flake farm, not coverage.

Determinism — every flake source must be pinned

A VRT suite that cries wolf gets ignored; eliminate nondeterminism at the source:

  • Time: mock the clock (page.clock / fake timers); seed any randomized data. Relative dates ("3 minutes ago") in fixtures, never real Date.now().
  • Network: all data via MSW/fixtures (same handlers as the test suites). No real API in VRT.
  • Fonts & images: wait for document.fonts.ready AND for in-view images to finish decoding before capture — a half-loaded image is a diff. Self-hosted fonts only (a CDN hiccup is a diff).
  • Animation: disable it — toHaveScreenshot({ animations: 'disabled' }) is the primary mechanism. Emulating prefers-reduced-motion alone is insufficient: per motion, state-conveying animations reduce to a quick fade, which can still be captured mid-fade. Never screenshot mid-animation.
  • Environment: baselines are generated in the SAME environment that compares them — the CI container (one OS, one browser, pinned versions, pinned TZ=UTC + locale, since Intl output differs per environment). Local-macOS baselines vs Linux CI = permanent font-rendering diffs. Use --update-snapshots in the CI container (or the vendor cloud) to (re)baseline (the bare flag updates only changed snapshots; pass all to force everything).
  • Scrollbars & caret: content-dependent scrollbars and a blinking text caret cause intermittent diffs — size stories to their content and keep the caret hidden (Playwright's toHaveScreenshot does this by default).
  • Leftovers: fixed viewport sizes; mask genuinely dynamic regions (avatars, maps) rather than widening thresholds.

Thresholds & scope

  • Keep maxDiffPixelRatio strict (≤ 0.01); a loose threshold silently approves real regressions. If a region forces looseness, mask that region instead.
  • Screenshot the component/element under test, not the whole page, when the subject is a component — smaller surface, fewer false positives.
  • Cover both themes and the key breakpoints for layout-critical pieces; don't multiply every story × every viewport × every browser reflexively (cost grows multiplicatively, signal doesn't).

Baseline review — diffs are code review artifacts

  • A visual diff is either a regression (fix the code) or an intended change (approve the new baseline in the PR). Never auto-accept baselines, never regenerate-and-commit without looking at the diff — that converts the suite into a rubber stamp.
  • Baseline updates ship in the same PR as the change that caused them, so the reviewer sees code and pixels together.
  • Recurring flake in one snapshot = fix the determinism cause or delete the snapshot; regenerating or re-running until the diff happens to pass is banned — same retried-pass-is-a-flake-report policy as testing-playwright.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most e2e browser skills give in 890 tokens

Counted across 499 of the 513 authors here whose files we hold, read 2026-09-06

  • Capture screenshots, videos, and traces on failurein 32 of 499, across 23 files
  • Close the browser when donein 22 of 499
  • Interact with elements using snapshot refsin 21 of 499, across 20 files
  • Wait for specific network responses instead of fixed timeoutsin 20 of 499, across 10 files
  • Keep tests independent with no shared statein 19 of 499, across 17 files
  • Use Page Object Model classes to encapsulate page interactionsin 19 of 499, across 9 files
  • Locate elements with data-testid attributesin 19 of 499, across 10 files
  • Quarantine flaky tests with fixme or skipin 17 of 499, across 7 files
  • Upload test artifacts after every CI runin 17 of 499, across 8 files
  • Wait on conditions instead of using fixed sleepsin 17 of 499, across 13 files
  • Clean up test data after each testin 17 of 499, across 16 files
  • Test user-visible behavior, not implementation detailsin 16 of 499, across 10 files

Said here and by no other author read

  • Run component VRT over Storybook stories
  • Use Playwright toHaveScreenshot when no vendor service is configured
  • Mock the clock and seed randomized data
  • Serve all VRT data through MSW or fixtures
  • Wait for fonts and images before capture
  • Keep maxDiffPixelRatio at or below 0.01

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.