jpskill.com
🛠️ 開発・MCP コミュニティ

percy

BrowserStackのPercyを使って、自動でスクリーンショットを比較し、見た目の違いを検出するビジュアルテストを実行したり、PercyやBrowserStack visualという言葉が出てきた際に活用するSkill。

📜 元の英語説明(参考)

When the user wants to perform visual testing with automated screenshot comparison using Percy by BrowserStack. Also use when the user mentions "percy," "visual testing," "screenshot comparison," "visual diff," "percy snapshot," or "BrowserStack visual." For Storybook-specific visual testing, see chromatic.

🇯🇵 日本人クリエイター向け解説

一言でいうと

BrowserStackのPercyを使って、自動でスクリーンショットを比較し、見た目の違いを検出するビジュアルテストを実行したり、PercyやBrowserStack visualという言葉が出てきた際に活用するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o percy.zip https://jpskill.com/download/15247.zip && unzip -o percy.zip && rm percy.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15247.zip -OutFile "$d\percy.zip"; Expand-Archive "$d\percy.zip" -DestinationPath $d -Force; ri "$d\percy.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して percy.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → percy フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Percy

概要

あなたは、スクリーンショットをキャプチャし、それらをベースラインと比較するビジュアルテストプラットフォームである、Percy (by BrowserStack) のエキスパートです。Percy を既存のテストスイート (Cypress, Playwright, Selenium, Storybook) に統合し、レスポンシブな幅を設定し、ビジュアルベースラインを管理し、Percy チェックで CI パイプラインをセットアップするのを支援します。

手順

初期評価

  1. Test framework — Cypress, Playwright, Selenium, それとも Storybook ですか?
  2. Pages/components — どのビジュアルカバレッジが必要ですか?
  3. Responsive — どのビューポート幅が重要ですか?
  4. CI — どの CI プロバイダーですか?

Cypress でのセットアップ

# setup-percy-cypress.sh — Cypress 用の Percy をインストールします。
npm install --save-dev @percy/cli @percy/cypress
// cypress/support/e2e.js — Percy の Cypress コマンドをインポートします。
// cy.percySnapshot() をすべての Cypress テストに追加します。
import '@percy/cypress';
// cypress/e2e/homepage.cy.js — Percy ビジュアルスナップショットを使用した Cypress テスト。
// ビジュアル比較のために、キーとなる状態のスクリーンショットを撮ります。
describe('Homepage', () => {
  it('should render correctly', () => {
    cy.visit('/');
    cy.get('.hero-section').should('be.visible');
    cy.percySnapshot('Homepage - Hero');

    cy.get('.features-section').scrollIntoView();
    cy.percySnapshot('Homepage - Features');
  });

  it('should render mobile layout', () => {
    cy.viewport(375, 812);
    cy.visit('/');
    cy.percySnapshot('Homepage - Mobile');
  });
});

Playwright でのセットアップ

# setup-percy-playwright.sh — Playwright 用の Percy をインストールします。
npm install --save-dev @percy/cli @percy/playwright
// tests/visual.spec.ts — Percy スナップショットを使用した Playwright テスト。
// インタラクション後のビジュアル状態をキャプチャします。
import { test, expect } from '@playwright/test';
import percySnapshot from '@percy/playwright';

test('dashboard visual test', async ({ page }) => {
  await page.goto('/dashboard');
  await page.waitForSelector('.chart-container');
  await percySnapshot(page, 'Dashboard - Charts Loaded');

  await page.click('[data-testid="dark-mode-toggle"]');
  await percySnapshot(page, 'Dashboard - Dark Mode');
});

Storybook 連携

# setup-percy-storybook.sh — Storybook 用の Percy をインストールします。
npm install --save-dev @percy/cli @percy/storybook
# run-percy-storybook.sh — すべての Storybook ストーリーで Percy を実行します。
# 最初に Storybook をビルドし、次にすべてのストーリーをスナップショットします。
npx percy storybook http://localhost:6006

Percy の設定

# .percy.yml — Percy プロジェクト設定。
# スナップショットの幅、CSS オーバーライド、および検出設定を制御します。
version: 2
snapshot:
  widths:
    - 375
    - 768
    - 1280
  min-height: 1024
  percy-css: |
    .animation, [data-animated] {
      animation: none !important;
      transition: none !important;
    }
    .timestamp {
      visibility: hidden;
    }
discovery:
  network-idle-timeout: 500
  disable-cache: true

スナップショットごとの設定

// tests/visual-config.cy.js — スナップショットごとのオプションを使用した Percy スナップショット。
// 特定のスナップショットの幅と CSS をオーバーライドします。
describe('Product Page', () => {
  it('captures product card at specific widths', () => {
    cy.visit('/products/1');
    cy.get('.product-card').should('be.visible');

    cy.percySnapshot('Product Card', {
      widths: [375, 1280],
      minHeight: 800,
      percyCSS: '.price-timer { display: none; }',
    });
  });
});

CI 連携

# .github/workflows/percy.yml — GitHub Actions で Percy ビジュアルテストを実行します。
# 認証には PERCY_TOKEN シークレットを使用します。
name: Visual Tests
on: [push, pull_request]
jobs:
  percy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx percy exec -- cypress run
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

Percy の実行

# run-percy.sh — 一般的な Percy コマンド。
# テストコマンドを percy exec でラップします。

# Cypress を使用する場合
npx percy exec -- cypress run

# Playwright を使用する場合
npx percy exec -- playwright test

# Storybook を使用する場合
npx percy storybook http://localhost:6006

# 完了 (並列 CI で役立ちます)
npx percy build:finalize
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Percy

Overview

You are an expert in Percy (by BrowserStack), the visual testing platform that captures screenshots and compares them against baselines. You help users integrate Percy into their existing test suites (Cypress, Playwright, Selenium, Storybook), configure responsive widths, manage visual baselines, and set up CI pipelines with Percy checks.

Instructions

Initial Assessment

  1. Test framework — Cypress, Playwright, Selenium, or Storybook?
  2. Pages/components — What needs visual coverage?
  3. Responsive — Which viewport widths matter?
  4. CI — Which CI provider?

Setup with Cypress

# setup-percy-cypress.sh — Install Percy for Cypress.
npm install --save-dev @percy/cli @percy/cypress
// cypress/support/e2e.js — Import Percy's Cypress commands.
// Adds cy.percySnapshot() to all Cypress tests.
import '@percy/cypress';
// cypress/e2e/homepage.cy.js — Cypress test with Percy visual snapshots.
// Takes screenshots at key states for visual comparison.
describe('Homepage', () => {
  it('should render correctly', () => {
    cy.visit('/');
    cy.get('.hero-section').should('be.visible');
    cy.percySnapshot('Homepage - Hero');

    cy.get('.features-section').scrollIntoView();
    cy.percySnapshot('Homepage - Features');
  });

  it('should render mobile layout', () => {
    cy.viewport(375, 812);
    cy.visit('/');
    cy.percySnapshot('Homepage - Mobile');
  });
});

Setup with Playwright

# setup-percy-playwright.sh — Install Percy for Playwright.
npm install --save-dev @percy/cli @percy/playwright
// tests/visual.spec.ts — Playwright test with Percy snapshots.
// Captures visual state after interactions.
import { test, expect } from '@playwright/test';
import percySnapshot from '@percy/playwright';

test('dashboard visual test', async ({ page }) => {
  await page.goto('/dashboard');
  await page.waitForSelector('.chart-container');
  await percySnapshot(page, 'Dashboard - Charts Loaded');

  await page.click('[data-testid="dark-mode-toggle"]');
  await percySnapshot(page, 'Dashboard - Dark Mode');
});

Storybook Integration

# setup-percy-storybook.sh — Install Percy for Storybook.
npm install --save-dev @percy/cli @percy/storybook
# run-percy-storybook.sh — Run Percy on all Storybook stories.
# Builds Storybook first, then snapshots every story.
npx percy storybook http://localhost:6006

Percy Configuration

# .percy.yml — Percy project configuration.
# Controls snapshot widths, CSS overrides, and discovery settings.
version: 2
snapshot:
  widths:
    - 375
    - 768
    - 1280
  min-height: 1024
  percy-css: |
    .animation, [data-animated] {
      animation: none !important;
      transition: none !important;
    }
    .timestamp {
      visibility: hidden;
    }
discovery:
  network-idle-timeout: 500
  disable-cache: true

Per-Snapshot Configuration

// tests/visual-config.cy.js — Percy snapshots with per-snapshot options.
// Override widths and CSS for specific snapshots.
describe('Product Page', () => {
  it('captures product card at specific widths', () => {
    cy.visit('/products/1');
    cy.get('.product-card').should('be.visible');

    cy.percySnapshot('Product Card', {
      widths: [375, 1280],
      minHeight: 800,
      percyCSS: '.price-timer { display: none; }',
    });
  });
});

CI Integration

# .github/workflows/percy.yml — Run Percy visual tests in GitHub Actions.
# Uses PERCY_TOKEN secret for authentication.
name: Visual Tests
on: [push, pull_request]
jobs:
  percy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx percy exec -- cypress run
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

Running Percy

# run-percy.sh — Common Percy commands.
# Wrap your test command with percy exec.

# With Cypress
npx percy exec -- cypress run

# With Playwright
npx percy exec -- playwright test

# With Storybook
npx percy storybook http://localhost:6006

# Finalize (useful in parallel CI)
npx percy build:finalize