Agent skill

Playwright Visual Implementation

by bangumi in bangumi/frontend

Use Playwright screenshots to implement or repair a frontend against one or more visual references.

BSD-3-ClauseAuto-check passedTesting & QA

Install Playwright Visual Implementation

skills CLI
$ npx skills add bangumi/frontend --skill playwright-visual-implementation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bangumi/frontend playwright-visual-implementation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bangumi/frontend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/playwright-visual-implementation .claude/skills/playwright-visual-implementation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
playwright-visual-implementation
GitHub stars
127
Token cost
~2.3k tokens
SKILL.md length
1,019 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Use Playwright screenshots to implement or repair a frontend against one or more visual references.

  • Works in 7 steps: Establish The Comparison Contract → Inspect Before Editing → Capture A Controlled Baseline → …
  • A user asks to match a screenshot
  • SKILL.md covers 1. Establish The Comparison…, 2. Inspect Before Editing, 3. Capture A Controlled Baseline and 4. Compare Systematically, plus 3 more sections
  • Calls pnpm

What it does

Playwright Visual Implementation is an agent skill from bangumi/frontend. Use Playwright screenshots to implement or repair a frontend against one or more visual references. Trigger when a user asks to match a screenshot, reproduce an existing page, fix visual differences, perform screenshot-driven UI development, or investigate a visual regression across view modes or viewport sizes.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Browser testing and Visual regression testing. It works with Playwright. The licence is BSD-3-Clause.

When your agent uses it

  • A user asks to match a screenshot
  • Reproduce an existing page
  • Fix visual differences
  • Perform screenshot-driven UI development

Example prompts

  • “/playwright-visual-implementation”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Establish The Comparison Contract
  2. Inspect Before Editing
  3. Capture A Controlled Baseline
  4. Compare Systematically
  5. Implement By Variant
  6. Iterate With Screenshots
  7. Verify Behavior And Quality

What it can do on your machine

Read from SKILL.md and the folder at commit a0ad2aa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Playwright Visual Implementation loads about 2.3k tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 1,019 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bangumi/frontend at commit a0ad2aa, republished under its BSD-3-Clause licence (© bangumi). 1,019 words, ~2,255 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-visual-implementation/SKILL.md (or your agent's skills folder).
name
playwright-visual-implementation
description
Use Playwright screenshots to implement or repair a frontend against one or more visual references. Trigger when a user asks to match a screenshot, reproduce an existing page, fix visual differences, perform screenshot-driven UI development, or investigate a visual regression across view modes or viewport sizes.

Playwright Visual Implementation

Implement against rendered evidence, not memory. Iterate through controlled screenshots until the requested state matches the reference without regressing adjacent states.

1. Establish The Comparison Contract

Identify before editing:

  • Which image is current and which is expected.
  • Exact route, viewport, device scale factor, and whether either image is cropped.
  • Required UI state: selected tab, view mode, filters, expanded panels, scroll position, and responsive breakpoint.
  • Persistent inputs such as local storage, cookies, feature flags, and server preferences.
  • Data assumptions that affect layout: item count, title lengths, missing images, progress values, and loading/error states.

Do not compare screenshots from different states. Reproduce the reference state first. If the state is persisted, set or preserve the real persistence mechanism rather than hard-coding a component default.

2. Inspect Before Editing

Read the page component, styles, shared components, route, fixtures, tests, and relevant generated types. Check the dirty worktree and preserve unrelated changes.

Determine whether the difference comes from:

  1. Wrong structure or view variant.
  2. Wrong content source or state.
  3. Wrong asset or aspect ratio.
  4. Wrong dimensions, spacing, typography, color, or borders.

Fix in that order. CSS cannot repair the wrong component structure or data state.

3. Capture A Controlled Baseline

Use the repository's Playwright installation. Capture to /tmp unless the project has an established visual-test artifact directory.

Build the website first, then use the screenshot CLI. The CLI starts a temporary Vite preview server for the built dist assets, applies the configured /p1 API proxy, selects an unused local port, and closes the server after capture. Do not ask the user to start or keep a Vite dev server running for visual work.

Prefer the repository's screenshot CLI, pnpm website screenshot (packages/website/scripts/screenshot.mjs):

bash
pnpm run build
pnpm website screenshot <route> <output> [options]

Useful options:

  • --width / --height: viewport size (default 1440×900)
  • --device-scale-factor <n>: device scale factor (default 1)
  • --quality <0-100>: JPEG quality (default 60); output must end in .jpg/.jpeg, PNG is not supported
  • --full-page: capture the full scrollable page
  • --element <selector>: capture only the element matching a CSS selector (e.g. #user-avatar) at its natural size instead of the whole page; mutually exclusive with --full-page. Use it to screenshot a single UI component in isolation
  • --wait-until <state>: commit, domcontentloaded, load, or networkidle (default domcontentloaded)
  • --wait-for <selector>: wait for a selector to become visible
  • --wait-ms <ms>: additional delay after loading (default 1000)
  • --local-storage key=value: set local storage before navigation (repeatable)
  • --storage-state <path>: Playwright storage-state JSON for authentication

Examples:

bash
pnpm run build
pnpm website screenshot /user/sai /tmp/user.jpg --full-page
pnpm website screenshot /user/sai /tmp/avatar.jpg --element '#user-avatar'
pnpm website screenshot --wait-for main --local-storage view=grid

Pass a route such as /anime, rather than the address of a manually started server. The CLI accepts a legacy loopback URL by extracting its route, but new commands should use a route. Use the same --mode for the build and screenshot command when a non-default Vite mode is required.

Extend packages/website/scripts/screenshot.mjs when the CLI options cannot express the needed state — for example clicks, form input, or waiting for an element to appear or disappear. It is the repository's capture tool and is meant to be modified as needed: add the extra steps (such as a repeatable --click <selector> option) to the capture flow, then run it with pnpm website screenshot as usual. It starts a temporary Vite preview server for the built assets; do not point it at a dev server, and build the website first (pnpm run build).

Write a separate temporary Playwright script only if extending the CLI is impractical. Place it inside packages/website/ (e.g. packages/website/scripts/) and run it with pnpm website run <script>; do not run it from the repo root, where @playwright/test is not resolvable in this pnpm workspace (ERR_MODULE_NOT_FOUND). Follow screenshot.mjs: derive the website directory from import.meta.dirname instead of a cwd-relative path, because the runner sets cwd to the package directory:

js
import path from 'node:path';
import { preview } from 'vite';
import { chromium } from '@playwright/test';

const websiteDirectory = path.resolve(import.meta.dirname, '..');
const previewServer = await preview({
  root: websiteDirectory,
  mode: 'production',
  preview: { host: '127.0.0.1', port: 0, strictPort: true },
});
const { port } = previewServer.httpServer.address();
const browser = await chromium.launch();
const context = await browser.newContext({ viewport: { width: 1280, height: 900 } });
const page = await context.newPage();

try {
  await page.route('**/api/page-data', (route) =>
    route.fulfill({ status: 200, contentType: 'application/json', body: fixture }),
  );

  await page.goto(`http://127.0.0.1:${port}/target-route`, { waitUntil: 'networkidle' });
  await page.getByRole('button', { name: 'Show details' }).click();
  await page.locator('[data-ready]').waitFor();
  await page.screenshot({ path: output, fullPage: true });
} finally {
  await context.close();
  await browser.close();
  await previewServer.close();
}

Use authentication storage supplied by the project or intercept APIs with existing fixtures. Never place credentials or bearer tokens in screenshot scripts. Keep fixture data representative: include long text, odd item counts, future/disabled items, and enough rows to expose the target layout.

Capture at minimum:

  • The exact desktop reference state.
  • Every alternate view mode touched by shared markup or CSS.
  • A mobile viewport when the page is responsive.
Show full SKILL.md (347 more words)Show less

4. Compare Systematically

Open both images and compare from large geometry to small styling:

  1. Page bounds, max width, columns, and major vertical positions.
  2. Component structure, row/column count, overflow, and visible first-viewport content.
  3. Stable element dimensions and media aspect ratios.
  4. Typography: displayed field, font size, weight, line height, and wrapping.
  5. Controls and state styling: active, watched, available, disabled, hover, and focus.
  6. Borders, radii, shadows, separators, and color.

Normalize measurements when image dimensions or device scale factors differ. Use relative positions or element bounding boxes instead of copying raw screenshot pixels blindly.

When useful, collect geometry with locator.boundingBox() and compare exact values. For canvas or 3D output, also verify nonblank pixels.

Write down concrete deltas such as "cover must be square instead of portrait" or "grid cards must not render detail-only metadata." Avoid vague conclusions like "spacing feels off."

5. Implement By Variant

Keep view-specific markup and styles explicit. Shared components may share behavior, but do not let detail-only content or CSS leak into compact/grid variants.

Preserve:

  • Existing interactions and API mutations.
  • Persistence semantics for tabs, view modes, and filters.
  • Semantic HTML and accessible labels/pressed states.
  • Project design tokens, icons, links, and responsive conventions.

Add disabled or unavailable states from real domain data, not visual guesses. Use the repository's preferred date, state, and routing utilities.

6. Iterate With Screenshots

After each meaningful structural or styling pass:

  1. Capture the target state again.
  2. Inspect the image at original resolution.
  3. Capture alternate modes and mobile.
  4. Fix the largest remaining mismatch.

Do not declare success from unit tests alone. Do not declare success from one screenshot when shared code affects multiple modes.

7. Verify Behavior And Quality

Add or update focused tests for behavior changed during visual work, especially:

  • View switching and persistence restoration.
  • Selection changing the detail panel.
  • Disabled/future item states.
  • Existing update or submit actions.

Run the scoped tests, type check, lint, style lint, format check, and build according to the repository instructions. Report pre-existing warnings separately from failures.

Before finishing, confirm the actual URL and summarize the states visually checked.

© bangumi, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/playwright-visual-implementation of bangumi/frontend.

Open the folder on GitHubat commit a0ad2aa

Compare with similar skills

Playwright Visual Implementation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Playwright Visual Implementation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Visual Implementation this skillbangumi/frontend127—~2.3kAutomated safety check: PassBSD-3-Clause
Dozzle Visual Snapshot Updateramir20/dozzle15k—~797Automated safety check: PassMIT
Economical Visual Testsigrlk/storybook-addon-test-codegen1541 repos~1.1kAutomated safety check: PassMIT
Playwright Testingchongdashu/vibejam-starter-pack149—~2.2kAutomated safety check: PassNone
UI Visual DebuggingNangoHQ/nango13k—~1.3kAutomated safety check: PassCustom licence
Playwright Expertcin12211/orca-q223—~1.3kAutomated safety check: PassMIT

Similar skills

  • Regenerates Playwright visual snapshots for Dozzle after an intentional UI change, running them through Docker Compose so filenames match the Linux CI platform.

    15k GitHub stars~797 tokensUpdated today
    Testing & QAAuto-check passed
  • Economical Visual Tests

    igrlk/storybook-addon-test-codegen

    Author economical visual tests — full visual coverage in the fewest billable snapshots.

    154 GitHub starsUsed in 1 repo~1.1k tokens
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.2k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • UI Visual Debugging

    NangoHQ/nango

    A skill your agent uses when modifying or visually debugging Nango frontend UI, including packages/webapp, packages/connect-ui, browser interactions, screenshots, and visual regressions.

    13k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Playwright Expert

    cin12211/orca-q

    Playwright E2E testing expert for browser automation, cross-browser testing, visual regression, network interception, and CI integration.

    223 GitHub stars~1.3k tokensUpdated 16 days ago
    Testing & QAAuto-check passed
  • Testing

    radix-ng/primitives

    Test Radix NG primitives across every layer and pick the RIGHT one for a change: Vitest unit (zoneless), jest-axe a11y, Playwright browser regression (apps/visual-regression), SSR…

    274 GitHub stars~3.3k tokensUpdated 9 days ago
    Testing & QAAuto-check passed

More from bangumi/frontend

  • Panda CSS

    bangumi/frontend

    Implement, migrate, review, or debug Panda CSS styles in the Bangumi frontend.

    127 GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Playwright Visual Implementation

What does Playwright Visual Implementation do?

Use Playwright screenshots to implement or repair a frontend against one or more visual references. Playwright Visual Implementation is an agent skill from bangumi/frontend. Use Playwright screenshots to implement or repair a frontend against one or more visual references.

When should I use Playwright Visual Implementation?

Playwright Visual Implementation fits situations like: A user asks to match a screenshot; reproduce an existing page; fix visual differences; perform screenshot-driven UI development.

How do I install Playwright Visual Implementation in Claude Code?

Run `npx skills add bangumi/frontend --skill playwright-visual-implementation -a claude-code`. Or copy the skill folder (.agents/skills/playwright-visual-implementation in bangumi/frontend) into .claude/skills/playwright-visual-implementation in your project. Claude Code loads it when a task matches its description.

How do I install Playwright Visual Implementation in Codex?

Run `npx skills add bangumi/frontend --skill playwright-visual-implementation -a codex`. Or copy the skill folder (.agents/skills/playwright-visual-implementation in bangumi/frontend) into .agents/skills/playwright-visual-implementation in your project. Codex loads it when a task matches its description.

Can I use Playwright Visual Implementation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bangumi/frontend --skill playwright-visual-implementation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/playwright-visual-implementation, .gemini/skills/playwright-visual-implementation, .github/skills/playwright-visual-implementation and .opencode/skills/playwright-visual-implementation in your project.

What does Playwright Visual Implementation need to run?

Going by SKILL.md and its folder, Playwright Visual Implementation needs the command-line tools its instructions call (pnpm).

Does Playwright Visual Implementation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Playwright Visual Implementation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Playwright Visual Implementation use?

Playwright Visual Implementation is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Visual Implementation use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Playwright Visual Implementation?

Skills that share tags, products or a category with Playwright Visual Implementation: Dozzle Visual Snapshot Updater (amir20/dozzle, 15k stars), Economical Visual Tests (igrlk/storybook-addon-test-codegen, 154 stars), Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars) and UI Visual Debugging (NangoHQ/nango, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Visual Implementation?

bangumi (a GitHub organization) maintains it in bangumi/frontend, which has 127 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 5, 2026.

Source: bangumi/frontend on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.