Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

visual-baseline-gate

БесплатноБез исполняемых скриптовНе проверен

Use when visual diffs are already classified and CI needs one binding go/no-go: blocks on regressions or on intended baseline changes without sign-off from a…

testlandот testland★ 18 звёзд на GitHub

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

visual-baseline-gate

Overview

A typical visual-regression CI run produces an engine-specific verdict (Chromatic exit code, Percy build status, Playwright snapshot pass/fail). That's not enough for a strict gate, because:

  1. Each engine treats "visual changes" differently - Chromatic exits 1 on changes (review needed), Percy returns success but flags the build pending, Playwright fails the test outright.
  2. "The author updated baselines and committed them" is not the same as "a reviewer approved the baseline change." A --update-snapshots commit is a self-approval; for safety-relevant components it should require a sign-off.

This skill defines a build-an-X workflow that consumes both the diff classifier output and an explicit acceptance log to emit a single go/no-go verdict.

When to use

  • The team uses two or more visual engines and wants one CI gate (similar in motivation to data-quality-gate in the qa-data-quality plugin, for data quality).
  • The team wants to enforce a "reviewer approval" rule on baseline updates - i.e. a --update-snapshots commit by the PR author cannot self-approve a baseline change to a critical component.
  • The team wants the classified visual-diff output to become CI-blocking rather than advisory.

If the project uses one engine only and trusts engine-native review (e.g. all changes go through Chromatic UI approval), prefer the engine's native CI integration - see the matching engine's "CI integration" section in its SKILL.md.

How to use

  1. Collect the two inputs - the pre-classified diff JSON (one record per snapshot, category in intentional | incidental | regression) and the reviewer-committed .visual-acceptance.yml (see Inputs).
  2. Run the gate decision rule - regression blocks always; intentional blocks until listed in the acceptance log; incidental warns only (see The gate decision rule).
  3. Enforce author-cannot-self-approve - verify the commit that added .visual-acceptance.yml was authored by someone other than the PR author (see Author cannot self-approve).
  4. Emit the artifact and exit - write the markdown + JSON summary and exit non-zero on a no-go verdict so CI halts. The full artifact template, the runnable CI entrypoint, and the GitHub Actions wiring are in references/artifact-and-ci-wiring.md.

Inputs

The gate consumes two inputs:

  1. Classification artifact - the pre-classified diff JSON, one record per snapshot:

    {
      "snapshot": "dashboard-mobile-375",
      "engine":   "playwright",
      "category": "intentional|incidental|regression",
      "pattern":  "text-truncation|...|null",
      "paired_change": true,
      "diff_url": "playwright-report/data/dashboard-mobile-375-diff.png"
    }
    
  2. Acceptance log - a YAML file at .visual-acceptance.yml committed by reviewers (NOT the PR author) that explicitly accepts each intentional baseline change for the current PR:

    # .visual-acceptance.yml - committed by reviewers in the PR's review pass
    pr: 1234
    accepted_by: reviewer-handle
    accepted_at: 2026-05-04T12:00:00Z
    snapshots:
      - snapshot: dashboard-mobile-375
        reason: "Intentional CTA color change per design spec DS-456"
      - snapshot: pricing-tablet-768
        reason: "Intentional pricing tier rename"
    

The acceptance file lives in the PR branch; merging the PR records the acceptance in git history.

The gate decision rule

def visual_gate(classifications, acceptance_log, *,
                require_reviewer_acceptance=True):
    accepted = {s["snapshot"] for s in acceptance_log.get("snapshots", [])}
    blockers = []
    for c in classifications:
        if c["category"] == "regression":
            blockers.append((c, "regression - blocks unconditionally"))
        elif c["category"] == "intentional" and require_reviewer_acceptance:
            if c["snapshot"] not in accepted:
                blockers.append((c, "intentional - missing reviewer acceptance"))
        elif c["category"] == "incidental":
            # incidental requires investigation but does NOT block by default
            pass

    return {
        "verdict": "no-go" if blockers else "go",
        "blockers": blockers,
        "incidentals": [c for c in classifications if c["category"] == "incidental"],
        "intentional_accepted": [c for c in classifications
                                 if c["category"] == "intentional"
                                 and c["snapshot"] in accepted],
    }

Default behavior:

  • regression -> block (always).
  • intentional -> block UNTIL listed in .visual-acceptance.yml.
  • incidental -> surface as a warning, do not block.

For low-risk projects, set require_reviewer_acceptance=False so intentional changes pass without explicit acceptance - this collapses the gate to "block on regressions only."

Author cann

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

Установить visual-baseline-gate в Claude Code и Claude Desktop

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

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

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

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

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

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

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

.tessl-plugin/plugin.jsonreferences/artifact-and-ci-wiring.md

FAQ

Что делает скилл visual-baseline-gate?

Use when visual diffs are already classified and CI needs one binding go/no-go: blocks on regressions or on intended baseline changes without sign-off from a reviewer who is not the author, fails closed when the classifier did not run, and writes visual-gate.json and .md.

Как установить скилл visual-baseline-gate?

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

Скилл visual-baseline-gate запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить visual-baseline-gate с