本文へスキップ
Skillpedia
テスト75k · #3080

visual-regression

できること

このスキルは、ページやコンポーネントのスクリーンショットを時間をかけて比べる視覚のテストを設定します。公開前に予期しないデザインの変更を見つけたいチーム向けです。

使う場面

  • ✓CSSの変更で、ユニットテストが確認しないレイアウトが壊れるおそれがあるとき。
  • ✓プロジェクトの継続的インテグレーションに視覚的なチェックがないとき。
  • ✓主要なコンポーネントに、安定した視覚的な基準が必要なとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/visual-regression/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/visual-regression/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“CSSを変更したら、ページの一部がおかしく見えますが、テストは通っています。視覚的なチェックを追加してもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは主要なページやコンポーネントを特定し、基準となるスクリーンショットを撮ります。以降の実行では、新しいスクリーンショットを基準と比べ、設定した閾値を超える違いを指摘します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Use visual regression testing

Functional tests verify behavior but don't see your page. A CSS refactor might pass all unit and integration tests while completely breaking the layout — text overlapping images, buttons invisible, wrong colors. Visual regression testing acts as a safety net that reviews your actual rendered output, catching changes that no amount of JavaScript testing can detect.

Quick Reference

  • Visual regression tests catch CSS regressions that functional tests miss
  • Run screenshot comparisons in CI to block merges that break visual appearance
  • Use component-level (Storybook) tests for focused, fast visual coverage
  • Set pixel difference thresholds to avoid flaky tests from sub-pixel rendering

Check

Does this project have visual regression testing? What critical components or pages would benefit most from visual baselines?

Fix

Set up visual regression tests for the key components using Playwright's screenshot comparison or a tool like Chromatic.

Explain

Explain visual regression testing, how it differs from functional tests, and how to set up screenshot comparison in a CI pipeline.

Code Review

Review tests, CI workflows, and enforcement points related to Use visual regression testing. Flag exact gaps where the rule is not automatically verified or where failures do not block regressions.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/visual-regression

よくある質問

どんなツールでこれができますか?

このスキルは、Playwrightのスクリーンショット比較とChromaticを選択肢として挙げています。

違いの閾値を設定するのはなぜですか?

わずかな描画の違いでテストが不安定になることがあるため、閾値があると小さな変更で失敗しなくなるからです。

視覚的なテストはCIで実行すべきですか?

はい。このスキルは、見た目を壊すマージを防ぐため、スクリーンショットの比較をCIで実行することを勧めています。

詳細

作者による元の説明

Use when reviewing CI coverage, automated checks, or test strategy related to Use visual regression testing. Focus on whether the rule is continuously verified, not just documented.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3080
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル