Playwright Skill
A skill that lets an agent write and run Playwright scripts: page tests, forms, screenshots and link checks
Install
npx skills add lackeyjb/playwright-skill --skill playwright-skill --global --yes
npm run setupRun npm run setup inside the installed skill directory
This is third-party code. Review the repository files before installing.
What it does
The agent writes custom Playwright code for the task and runs it through the run.js executor, which handles module resolution. The browser is visible by default, and results come back with console output and screenshots. The skill detects running dev servers and ships helper functions, while the full API reference loads only when needed.
Who it is for. Developers and QA engineers who need browser automation straight from the agent.
Good fit when
- You need to test a signup form or checkout flow
- You need page screenshots at mobile and desktop widths
- You need a reusable script with loops, network interception or multiple contexts
- You are checking broken links and image loading
Not a fit when
- You just need interactive browsing: the author recommends @playwright/cli
- You want tool-based control with accessibility snapshots: use playwright-mcp
Example request
Check that the contact form on localhost:3000 submits and take screenshots at mobile and desktop widthsLimitations
Requires Node.js 20+, npm and network access on first setup to download Playwright and Chromium. After installation you must run npm run setup in the skill directory.
How to disable. Remove the playwright-skill plugin in Claude Code or delete the playwright-skill folder from your skills directory.
Security check
- The agent generates and executes arbitrary Node.js code
- Setup downloads Playwright and Chromium binaries
README in short
Playwright Skill is an Agent Skill with a Claude Code plugin wrapper, MIT licensed. The README explains when to choose it over the official @playwright/cli or playwright-mcp. It covers four install methods, setup via npm run setup, example prompts and defaults including SLOW_MO and PW_ARTIFACT_DIR.
SKILL.md
---
name: playwright-skill
description: Complete browser automation with Playwright. Auto-detects dev servers, writes reusable test scripts, and supports screenshots, responsive checks, UX validation, login flows, link checks, and arbitrary browser automation. Use when the user wants to test a website, automate browser interactions, validate web functionality, or perform browser-based testing.
license: MIT
compatibility: Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium.
metadata:
author: lackeyjb
version: "5.0.0"
allowed-tools: Bash(node:*) Bash(npm:*) Read Write
---
# Playwright Browser Automation
Write and execute focused Playwright scripts for the user's request. Prefer the
skill's executor and helpers, but use the full Playwright API when needed.
## Path resolution
This skill can be installed in several locations, so resolve its directory
first. Set `SKILL_DIR` to the directory containing this SKILL.md file, then run
the commands below as written:
```bash
export SKILL_DIR=<absolute path of the directory containing this SKILL.md>
export TMP_DIR="$(node -p 'require("node:os").tmpdir()')"
```
If shell state does not persist between commands, substitute the literal paths
for `$SKILL_DIR` and `$TMP_DIR` in each command instead.
Common installation paths:
- Plugin system: `~/.claude/plugins/marketplaces/playwright-skill/skills/playwright-skill`
- Manual global: `~/.claude/skills/playwright-skill`
- Project-specific: `<project>/.claude/skills/playwright-skill`
## Workflow
1. For localhost work, detect running servers before writing a URL:
```bash
node -e "require('$SKILL_DIR/lib/helpers').detectDevServers().then(s => console.log(JSON.stringify(s)))"
```
Use the only result automatically. Ask which URL to use when there are
multiple results. Ask for a URL or offer to start a server when none exist.
2. Write reusable scripts to `$TMP_DIR/playwright-test-*.js` unless the user
asks to save them in the project. Use `PW_SCRIPT_DIR` to preserve scripts.
3. Use a visible browser by default. Use `headless: true` only when requested
or when the environment has no display.
4. Put the target URL in a constant or environment variable.
5. Run scripts with `node "$SKILL_DIR/run.js" <script.js>`.
6. Report actions, failures, and artifact paths. Do not claim success without
checking the resulting page.
## Setup
Run once:
```bashFAQ
How do I run headless?
Headless is off by default. Explicitly ask the agent to run without a visible browser.
I get module not found errors, what now?
Run automation through run.js, which handles module resolution.
Related
Open-source AI agent for pull request review: descriptions, feedback and improvement suggestions on GitHub, GitLab and more
XMPP Debugger
xmpp-debugger-skill
Skill with minimal Python scripts for debugging XMPP bots: connect, send a message and wait for replies