playwright-browser skill

A skill giving Claude Code a background browser: screenshots at three sizes, frontend audits, before and after diffs, login flows.

  • 50 ★ on the repository
  • Last commit
  • MIT
Skill

Extended access

Why this level

  • The skill runs a browser, visits sites and keeps sessions with login state in `~/.claude/playwright/`.
All reasons and checks

andyshiu/claude-skill-playwright-browser

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add skills/playwright-browser

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The skill runs a browser, visits sites and keeps sessions with login state in `~/.claude/playwright/`.

This is third-party code. Review the repository files before installing.

What it does

The skill runs a browser in the background and leaves your open one alone. You ask in plain words: screenshot the homepage on mobile, find why the Submit button does nothing, health-check the checkout page. Claude opens the page, clicks around, takes screenshots and returns PNG, JSON and Markdown files. Features: screenshots for desktop, tablet and mobile of a full page or one element, in batches across all menu pages; a frontend audit with console errors, failed 4xx and 5xx requests, broken images and links, mobile overflow, accessibility through axe and LCP and CLS metrics; baseline comparison with a diff image in red; custom flows; turning a flow into a Playwright Test for CI. The runtime lives in the skill folder and is shared across projects.

Who it is for. Front-end developers and testers who want a reproducible background browser for screenshots, audits and flows without opening windows.

Good fit when

  • A customer says the site scrolls sideways on iPhone and the too-wide element has to be found
  • Before release the checkout page is checked for console errors, requests and accessibility
  • After a header CSS change the page look is compared before and after
  • Screenshots of every admin page are needed in one folder
  • A login and menu flow becomes a Playwright autotest

Not a fit when

  • You need your already open logged-in tab, which suits Claude in Chrome better
  • You want to watch the browser work: the skill runs in the background
  • You do not use Claude Code, which the skill targets

Example request

Take mobile and desktop screenshots of the homepage at localhost:5173 and find the element that causes horizontal scrolling.

Limitations

You need Claude Code, Node.js 18 or newer and about 150 MB of disk for Chromium. On first use the skill sets up its runtime itself. For sites that need login you log in once by hand and the skill reuses the saved session in `~/.claude/playwright/`, so do not keep these files on shared machines. The password is not stored. On Windows Git Bash rewrites arguments starting with `/`, and the skill fixes its own options. To clear the browser cache run `npx playwright uninstall --all` before deleting the folder.

How to disable. Delete the skill folder `~/.claude/skills/playwright-browser` and the `~/.claude/playwright/` directory with sessions. Clear the browser cache with `npx playwright uninstall --all` before deleting the folder.

FAQ

How do I install the skill?

Clone into `~/.claude/skills/playwright-browser` for all projects or `<project>/.claude/skills/playwright-browser` for one. The folder must be named `playwright-browser`.

How does it differ from Claude in Chrome?

Claude in Chrome works in your open tab with your login, and you watch it work. This skill runs in the background, leaves your browser alone and suits repeatable checks and tests.

How do I work with a site behind login?

Log in once yourself with a command like `node "$PW" login --session admin --url ... --until-url dashboard`. The skill saves the session after you reach the target URL and reuses it. It does not store the password.

What checks does the audit include?

Console errors, failed 4xx and 5xx requests, broken images and links, mobile overflow with the offending element, accessibility through axe and LCP and CLS. The report is written to `report.md`.

How do I update the skill?

Run `git pull` in the skill folder. If `package.json` changed, run `node scripts/setup.mjs` again.

Discussion

No questions or reviews yet.

Skills

A skill that lets an agent write and run Playwright scripts: page tests, forms, screenshots and link checks

SkillBroad access3.3KRepository stars

Playwright CLI

playwright-cli

Official

Microsoft's official Playwright CLI with an agent skill: drive a browser through short commands without heavy MCP schemas

CLIExtended access15.2KRepository stars

show-your-work

claude-show-your-work

A plugin that shows images and video in the Claude Code terminal, records Playwright checks and compares before and after

PluginExtended access308Repository stars
Russian stack

A Claude Code skill for driving the 1C web client through Playwright MCP: sessions, navigation, catalogs, documents and test data

SkillBroad access33Repository stars

A community Playwright MCP server: browser automation, screenshots, device emulation and test code generation

MCP serverExtended access5.7KRepository stars

57 reference files on Playwright tests in TypeScript: the agent pulls the one that fits the task, from locators to CI sharding

SkillMinimal access425Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
playwright-browser (this card)no50
Playwright Skillno3,287a skill for writing and running Playwright scripts; this one adds ready commands for shots, audits and comparison
Playwright CLIyes15,167the official Playwright CLI for short browser commands; this adds reports and background sessions

README in short

The README in English and Traditional Chinese shows features in a table, sample prompts, a comparison with Claude in Chrome, installation, run commands, update and uninstall steps and the repository layout.

README badge

Original SKILL.md

---
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>]

Report a problem