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
Install
Use withClaudeCursorCodex
The file stays in the publisher's repository. PlugMCP does not host or rewrite it.
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.
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:
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.
PW_SCRIPT_DIR copies file-based scripts before execution and adds a timestamp
when a filename already exists. PW_ARTIFACT_DIR controls helper screenshot
output; the default is the operating system temporary directory.
Connect to an existing Chrome session
Start Chrome with remote debugging enabled, then connect with Playwright:
This reuses cookies and extensions in that session. Do not use it for secrets
unless the user explicitly asks; a connected browser has the user's access.
Available helpers are detectDevServers, getExtraHeadersFromEnv,
launchBrowser, createContext, handleCookieBanner, and takeScreenshot.
Use Playwright locators and assertions directly for actions, waits, extraction,
authentication, tables, and retries.
Configuration
PW_BROWSER: chromium, firefox, or webkit for launchBrowser().
PW_CHANNEL: installed browser channel such as chrome or msedge.
PW_HEADLESS: true or false; visible mode is the default.
SLOW_MO: action delay in milliseconds.
PW_HEADER_NAME and PW_HEADER_VALUE: one extra HTTP header.
PW_EXTRA_HEADERS: JSON object of extra HTTP headers.
PW_SCRIPT_DIR: directory for preserving file-based scripts.
PW_ARTIFACT_DIR: directory for helper-generated screenshots.
See API_REFERENCE.md for network interception, API mocking,
authentication state, video, visual checks, device emulation, and CI patterns.
How do I install playwright-skill?
Download skills/playwright-skill/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
Where does playwright-skill live?
The publisher keeps it at https://github.com/lackeyjb/playwright-skill.
Which agents can use playwright-skill?
Claude, Cursor, and Codex can read a SKILL.md you add from the publisher's repository.