Command Palette

Search for a command to run...

Назад к скиллам
скилл № 49068

Check Visual Parity

Hold UI pixel-for-pixel steady through a change: PNG screenshots of listed states before first edit (baseline), then at each green checkpoint counting…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Check Visual Parity в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Check visual parity

Purpose

A change that promises "the UI looks the same" is checked here by counting pixels, not by looking at screenshots. baseline records PNG images of the screens and states to hold, before any code changes. compare records the same screens and states again and reports, per image, how many pixels differ. The count is held to the repository's pixel_tolerance, which is 0 unless the team records a reason for more.

The baseline is the reference the change answers to. This skill never edits, replaces or re-captures it, and never edits a capture harness or the app's styles to make a compare pass.

Arguments

$ARGUMENTS: <baseline|compare> [states].

  • baseline: capture the reference images. Run it before the first edit of the change.
  • compare: capture again and count. Run it at each green checkpoint.
  • [states]: the screens and states to hold, for example invoice list (empty), invoice list (40 rows), invoice editor (validation errors). Without it, read the plan phase's **Parity contract:** line; with neither, ask once which screens and states to hold, and stop when there is no answer.

Step 1: Pick the capture route

  1. The repository's own visual suite first. When the repository already runs a visual-regression suite (a Playwright toHaveScreenshot spec, a Storybook visual test, a screenshot test in its unit runner), run it at each checkpoint and report its verdict as the result for the states it covers. Run it through the repository's own entry point when it has one (its documented test command or runner script), not the test tool directly, and name that command in the report. Capture here only the states it does not cover. A state the run did not compare (the run stopped on a build, install or browser-launch error, or the state has no baseline image) has no verdict: report the environment failure with the last lines of its output, and give that state the gap report (the state, the command, and that it needs that command to run to a verdict). Never move it to another route: the suite holds its baseline, and another renderer's capture would measure the renderer change.
  2. A driver that writes PNG files. Capture each state with /app-control:drive capture --kind screenshot --out <the baseline or after directory> (if enabled), and use the result only when drive reports a non-empty PNG file at that path. Drive names its files for the feature and a step number (checkout-cart-02-screenshot.png), and compare pairs images by filename, so rename or copy each drive PNG to its state name (invoice-list-empty.png) in the baseline or after directory, and record that state name in baseline-routes.txt. When drive reports screenshot as a capability gap, or writes no PNG, fall through to the next choice. When the app-control plugin is not enabled, or drive fell through, capture only through the Playwright CLI (/playwright:playwright (if enabled)) or through the repository's own harness when that harness writes PNG files. Any other driver, including one that returns screenshots only into the conversation, cannot feed a pixel count: stop with the gap report (what to hold, which driver resolved, and that a PNG-writing driver is needed).
  3. One launch path. When drive captures, drive's own launch is the one launch path: do not also start the app the way /testing:run-e2e starts it. For the other routes, start and restart the app through /testing:run-e2e's launch path (its orchestrator rule, the bundled run skill, or the already-running app). Never start a second instance beside the one that path starts.

This step is done when each listed state has a route: the repository's suite, a PNG-writing driver, or the gap report.

Fix the capture settings before the baseline and keep them for every compare, on the drive route too: the browser and its version, the viewport, the device scale factor, and the same seed data, clock and fonts the app renders with. Freeze or hide anything that changes on its own (a clock, a spinner, a caret).

Step 2: Resolve the tolerance

Run, with the repository root as --repo:

bash "${CLAUDE_PLUGIN_ROOT}/skills/check-visual-parity/scripts/visual-compare.sh" config --repo "<repository root>" --user 'pixel_tolerance=${user_config.pixel_tolerance}'

It prints one line, pixel_tolerance=<n> source=<layer> reason=<text>. The team value lives in docs/conventions/testing.yaml as a pixel_tolerance map with pixels and reason, read from origin's default branch:

pixel_tolerance:
  pixels: 2
  reason: "subpixel text: the CI image renders without hinting"

The personal override docs/conventions/testing.local.yaml (source=personal-override) and the plugin option can only lower the team value. The script reports a raise as ignored, and names an invalid layer and drops it. Quote a reason that holds a colon fol

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • scripts/package-lock.json
  • scripts/package.json
  • scripts/visual-compare.mjs
  • scripts/visual-compare.sh
  • scripts/visual-compare.test.sh

FAQ

Что делает скилл Check Visual Parity?

Hold UI pixel-for-pixel steady through a change: PNG screenshots of listed states before first edit (baseline), then at each green checkpoint counting differing pixels vs pixel_tolerance (compare). Never edits baseline. Use when plan phase has Parity contract line, refactor must leave UI unchanged, 'check visual parity', 'did this change the UI'.

Как установить скилл Check Visual Parity?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Check Visual Parity запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить Check Visual Parity с