⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v1.0.1

playwright-browser

andyshiu@andyshiu⭐ 50 stars· last commit 1mo ago· 0 open issues

Headless, reproducible browser automation with Playwright for any project — screenshots of web pages or local dev servers (desktop/tablet/mobile, full page or one element, single page or every page/menu of an app in one batch), frontend audits (console errors, failed requests, broken images/links, responsive overflow, axe accessibility, LCP/CLS performance), before/after visual comparison, scripted E2E flows (log in, click, fill, page through, assert), and logged-in pages via saved sessions. Use this whenever the user wants to screenshot or visually check a site, find frontend bugs, see how a page looks on mobile, compare the UI before and after a CSS/code change, reproduce a bug from an issue or ticket and capture evidence images for it, verify a UI flow works, or run/write a browser test — even if they never say "Playwright" or "browser". If Claude in Chrome could also do the job, briefly ask which to use (with a recommendation) instead of silently picking.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐ 50 on GitHubGitHub ↗

Growing

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

claude-skill-playwright-browser

English | 繁體中文

License: MIT Release Node.js ≥18 Playwright 1.63 Platforms Claude Code skill

Gives Claude Code a browser that runs in the background. Ask in plain language — "screenshot the homepage on mobile", "why does the Submit button do nothing on this page?", "health-check the checkout page" — and Claude opens a browser, clicks around, takes screenshots, runs checks, and hands you the results and files. It never touches the browser you're using, and it works in any project (frontend, backend, even non-Node projects).


What it does

FeatureDetails
📸 ScreenshotsDesktop / tablet / mobile, full page or a single element, many pages in one batch
🩺 Frontend health checkConsole errors, failed API calls (4xx/5xx), broken images, broken links, mobile layout overflow (and which element causes it), accessibility issues (axe), performance (LCP / CLS)
🔍 Visual comparisonSave a baseline before a CSS change, compare afterwards, get a diff image with changes highlighted in red
🧭 UI flowsLog in, click through menus, fill forms, page through lists, assert results — with a screenshot at each step and an automatic screenshot on failure
🔐 Sites that need loginYou log in once yourself; Claude then reuses that session in the background (your password is never stored)
🧪 Real testsWhen you want it, turn a flow into a Playwright Test in your project and run it in CI

See it in action

Screenshots on every screen size

Frontend health check

Before / after visual comparison

All images were produced by this skill against a small demo site.

Examples

Just talk to Claude — no need to mention "Playwright":

Take mobile and desktop screenshots of the homepage at localhost:5173
A customer says our site scrolls sideways on iPhone — find the element that's too wide
Health-check the new checkout page before we ship it
I changed the header CSS — compare before and after
On the admin "Orders" page, does going to page 2 actually load different data?
This issue says "Submit" does nothing — reproduce it on dev and capture screenshots
Screenshot every page in the admin menu and save them to my Desktop

Claude sticks to what you asked: ask for a screenshot and you get a screenshot; ask about one bug and it deals with that bug. A full check with a list of recommendations only happens when you ask for a review or a health check.

Claude in Chrome or this skill?

Better with Claude in ChromeBetter with this skill
Uses the tab you have open right now, in your logged-in browserRuns in the background, doesn't touch your browser
You want to watch it workMust be repeatable with consistent results
A quick one-off lookSeveral sizes or many pages in one batch
Health checks, reports, before/after comparisons, tests

When both would work, Claude asks which one you prefer and suggests one.

Head-to-head test

Same task for both, run by two fresh Claude agents: "take mobile screenshots of these 3 report pages" on a logged-in internal admin app (URLs given).

Claude in ChromeThis skill
Tokens48,04548,853
Time93 s47 s
Tool calls97
Mobile size500×667 — Chrome windows can't go narrower than 500 px390×844 (real iPhone size, 3× scale)
OutputJPEG in a temp folder, had to be movedPNG saved where you asked
Full-page captureNot availableAvailable
LoginYour Chrome's existing loginSession saved earlier with this skill

Takeaways: tokens were a wash for a small job like this — most of both totals is each agent's fixed overhead. The skill was twice as fast and produced true phone-width screenshots; Chrome can't emulate widths below ~500 px, so layout bugs that only appear at 390 px are out of its reach. One run each with URLs provided — tasks with more pages or steps should favour the skill further, but that part hasn't been measured.


Install

Requirements: Claude Code, Node.js 18+ (node -v), macOS / Linux / Windows, about 150 MB of disk for Chromium.

1. Clone into a skills directory (the folder must be named playwright-browser)

# Just for you, available in every project
git clone https://github.com/AndyShiu/claude-skill-playwright-browser.git ~/.claude/skills/playwright-browser

# Or for a single project (commit it with the project to share with your team)
git clone https://github.com/AndyShiu/claude-skill-playwright-browser.git <project>/.claude/skills/playwright-browser

On Windows the personal location is %USERPROFILE%\.claude\skills\playwright-browser.

Windows / Git Bash: Claude Code on Windows uses Git Bash by default, which rewrites arguments that start with / into Windows paths (--until-url /dashboard becomes C:/Program Files/Git/dashboard). The skill undoes this for its own options automatically. If you run other commands by hand and hit the same thing, drop the leading / (e.g. --until-url dashboard), prefix the command with MSYS_NO_PATHCONV=1, or use PowerShell / cmd.

2. That's it. The first time Claude uses the skill it notices the runtime isn't installed, tells you, and runs the one-time setup. To install up front instead:

node ~/.claude/skills/playwright-browser/scripts/setup.mjs                  # Chromium only
node ~/.claude/skills/playwright-browser/scripts/setup.mjs firefox webkit   # also Firefox and WebKit (Safari's engine)

npm packages go into node_modules/ inside the skill folder (git-ignored); browsers go into Playwright's shared cache, so every project and every copy of the skill shares one download. Your projects are never touched.


Sites that need login

  1. Tell Claude you want to work on a site that needs login — it opens a browser window for you
  2. Log in yourself in that window (only you type your credentials; they're never stored)
  3. Close the window when you're done — or Claude sets it to save and close automatically once you reach a given page

From then on Claude can use that session in the background. After every run, any tokens the site refreshed are saved back, so a session you keep using stays logged in. If it sits idle past the site's login lifetime, Claude detects the redirect to the login page and asks you to log in again — it will never hand you a login screen as the result.


Where files go

The skill folder contains no personal data, so it's safe to share or commit.

WhatWhereNotes
Login sessions~/.claude/playwright/sessions/<project>/Contain cookies / tokens, readable only by you. Never commit or share them
Visual baselines~/.claude/playwright/baselines/<project>/Reference screenshots for before/after comparisons
Screenshots & reportsclaude-playwright/ in the system temp dirDeleted after 7 days; Claude asks where to save anything you want to keep

Token usage

Rough extra cost of one use inside an existing conversation:

TaskApprox. tokens
One screenshot5k–7k
Three screen sizes8k–10k
Full health check of one page12k–18k
Investigating one

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md7.9 KBupstream ↗
    ---
    name: playwright-browser
    description: Headless, reproducible browser automation with Playwright for any project — screenshots of web pages or local dev servers (desktop/tablet/mobile, full page or one element, single page or every page/menu of an app in one batch), frontend audits (console errors, failed requests, broken images/links, responsive overflow, axe accessibility, LCP/CLS performance), before/after visual comparison, scripted E2E flows (log in, click, fill, page through, assert), and logged-in pages via saved sessions. Use this whenever the user wants to screenshot or visually check a site, find frontend bugs, see how a page looks on mobile, compare the UI before and after a CSS/code change, reproduce a bug from an issue or ticket and capture evidence images for it, verify a UI flow works, or run/write a browser test — even if they never say "Playwright" or "browser". If Claude in Chrome could also do the job, briefly ask which to use (with a recommendation) instead of silently picking.
    ---
    
    # Playwright Browser
    
    Background browser automation that runs locally and produces files (PNG, JSON, Markdown) the user can keep or reuse. The runtime lives in this skill directory and is shared by every project; per-project scripts, sessions and baselines are kept separate.
    
    Respond in the user's language.
    
    **Paths.** `<skill-dir>` means the directory that contains this SKILL.md — Claude Code reports it as the skill's base directory when the skill loads. It may be `~/.claude/skills/playwright-browser`, a project's `.claude/skills/…`, or a plugin folder, so never assume a fixed location. Call the CLI as `node "<skill-dir>/scripts/pw.mjs" <command> …` with the real absolute path substituted; that form works in zsh, bash, PowerShell and cmd (forward slashes are fine on Windows). Below, `pw` is shorthand for exactly that.
    
    ## 0. Choose the tool first
    
    This skill does not replace Claude in Chrome. They overlap, so decide deliberately:
    
    | Prefer **Claude in Chrome** | Prefer **Playwright (this skill)** |
    |---|---|
    | Needs the user's real, already-logged-in browser (SSO, 2FA, extensions) | Runs in the background without touching the user's browser |
    | User wants to watch or step in while it operates | Must be reproducible (same script, same result) |
    | One quick look at a page | Several viewports / pages in one batch |
    | Interacting with something open in a tab right now | Tests, audits, reports, before/after visual diff |
    
    If the request clearly fits one column, just proceed. If both fit (e.g. "take a screenshot of our site"), ask one short question naming both options and recommending one with a reason — e.g. "Use Playwright (background, can do desktop+mobile in one go) or Chrome (your logged-in tab)? I'd suggest Playwright." Don't ask again for follow-up tasks in the same thread unless the situation changes.
    
    ## Match the output to the request
    
    Do what was asked, at the size it was asked. "Screenshot the pricing page" → take the shot, check it looks right, hand it over; no audit, no improvement list. "Why does the save button do nothing?" → reproduce and diagnose that button, fix it if you're in the project; don't append unrelated findings from a full audit. Only run `audit` and give a prioritized list of recommendations when the user asks for a review, a health check, or "find problems". If you happen to notice something serious outside the request (a crash, a security issue), mention it in one line — nothing more.
    
    ## 1. Make sure the runtime exists
    
    ```bash
    node "<skill-dir>/scripts/pw.mjs" clean     # cheap check; prints JSON
    ```
    If it returns an `error` with a `hint` about setup, the runtime isn't installed on this machine yet (normal right after someone shares or clones the skill). Tell the user it's a one-time download (~150 MB for Chromium, needs Node.js 18+), then run `node "<skill-dir>/scripts/setup.mjs"`. For other engines: `node "<skill-dir>/scripts/setup.mjs" firefox webkit`. Setup installs npm packages into the skill directory and browsers into Playwright's shared per-user cache, so it never touches the user's projects.
    
    ## 2. Commands
    
    Every command prints one compact JSON object on stdout (progress goes to stderr, so use `2>/dev/null` when parsing); long lists are trimmed to 20 items plus a `truncated` count, and `audit` keeps the full data in `report.json`. Output files go to a fresh temp run dir (`$TMPDIR/claude-playwright/<timestamp>_<cmd>/`) unless `--out <dir>` is given — `--out` dirs are yours and are never auto-deleted.
    
    ```bash
    # pw = node "<skill-dir>/scripts/pw.mjs"
    pw inspect --url <url> [--click "<visible text>" ...] [--shot]
    pw shot  --url <url> [--viewport desktop,mobile|all|1366x768] [--full] [--selector "<css>"] [--name <label>]
    pw audit --url <url> [--viewport ...] [--skip links,axe,perf,visual,layout,images,console,network]
              [--external-links] [--max-links 100] [--update-baseline] [--name <label>]
    pw run   --script <file.mjs> [--url <start-url>] [--viewport mobile] [--full] [--trace]   # one viewport per call
    pw login --session <name> --url <login-url> [--until-url <path-substring>]
    pw diff  <baseline.png> <current.png>
    pw sessions [--delete <name>]
    pw clean [--days 7]
    ```
    
    Options shared by page commands: `--mask "<css>"` (blank out dynamic regions such as clocks or carousels in screenshots — use it for visual diffs), `--session <name>` (reuse a login), `--browser chromium|firefox|webkit`, `--headed` (show the window, useful for debugging), `--wait-for "<css>"`, `--wait <ms>`, `--timeout <ms>`, `--insecure` (self-signed HTTPS on intranet hosts), `--header "Name: value"`, `--locale zh-TW`, `--project <slug>` (defaults to the git repo name of the cwd).
    
    Viewport presets: `desktop` 1440×900, `laptop` 1280×800, `tablet` 768×1024 (touch), `mobile` 390×844 (touch, 3x). `audit` defaults to desktop + tablet + mobile; `shot` and `run` default to desktop.
    
    ## 3. Finding your way around: `inspect`
    
    Before writing a `run` script or guessing selectors, run `inspect`. It returns a text outline of the page — headings, navigation (including menu items that are buttons, not links), buttons with their disabled state, form fields with labels and required flags, tables with their columns and row counts, tabs, dialogs, alerts and pagination text — plus error counts and login/loading warnings. `--click` (repeatable, in order) clicks elements by their visible text first, so `--click Settings --click "User management"` walks a menu. It costs a few hundred tokens where a screenshot costs ~1.5k and a trial-and-error discovery script costs several round trips; use screenshots when you need to judge how something *looks*, `inspect` when you need to know what's *there*.
    
    ## 4. Screenshots
    
    Decide the spec from the request — full page vs viewport vs one element, which sizes — and ask only if it genuinely matters and isn't inferable. Each image you open costs roughly 1.5–2k tokens, so capture only the sizes that were asked for and prefer an element or viewport shot when that answers the question.
    
    Before handing screenshots over, make sure they show the real page. For a few shots, **look at each image** (Read the PNG) so you can describe what's there and catch a blank page, cookie banner, login wall or spinner. For a batch (roughly more than 5), rely on the `warnings` in the JSON, open every shot that has one plus a couple of samples, and tell the user which ones you actually looked at. If the page wasn't ready, retry with `--wait-for "<selector>"` or `--wait 1500` rather than handing over a bad shot.
    
    Then tell the user where the files are — and be accurate about retention: only the default run dir (`$TMPDIR/claude-playwright/…`) is auto-deleted after 7 days; anything written with `--out` or copied elsewhere stays until someone deletes it — and ask where they want them saved (or whether the temp copy is enough for the next step, e.g. attaching to an issue). Copy with `cp`; never move files into the project without being asked.
    
    ## 5. Au
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/andyshiu-claude-skill-playwright-browser.md

// REPO STATS

50 stars
0 open issues
Last commit: 1mo ago