Agent skill

Playwright Skill

by lackeyjb in lackeyjb/playwright-skill

Complete browser automation with Playwright. An agent skill from lackeyjb/playwright-skill.

MITAuto-check passedTesting & QA

Install Playwright Skill

skills CLI
$ npx skills add lackeyjb/playwright-skill --skill playwright-skill -a claude-code

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

GitHub CLI
$ gh skill install lackeyjb/playwright-skill playwright-skill --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/lackeyjb/playwright-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/playwright-skill .claude/skills/playwright-skill && 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-skill
GitHub stars
3.2k
Token cost
~1.9k tokens
SKILL.md length
513 words
Files
6
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Complete browser automation with Playwright. An agent skill from lackeyjb/playwright-skill.

  • Works in 6 steps: For localhost work, detect running… → Write reusable scripts to… → Use a visible browser by default. Use… → …
  • The user wants to test a website
  • SKILL.md covers Path resolution, Workflow, Setup and Minimal example, plus 4 more sections
  • Runs JavaScript scripts from its folder; calls node and npm; needs TEST_PASSWORD

What it does

Playwright Skill is an agent skill from lackeyjb/playwright-skill. 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.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `API_REFERENCE.md`, `lib/helpers.js` and `package-lock.json`). Compatibility notes: Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium.

It sits in Testing & QA, covering Browser testing, Browser automation and Authentication. It works with Playwright. The repository describes itself as: General-purpose Playwright automation for coding agents. The licence is MIT.

When your agent uses it

  • The user wants to test a website
  • Automate browser interactions
  • Validate web functionality
  • Perform browser-based testing

Example prompts

  • “/playwright-skill”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium.
  • Pre-approved tools (allowed-tools): Bash(node:*), Bash(npm:*), Read, Write

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. For localhost work, detect running servers before writing a URL
  2. Write reusable scripts to $TMP_DIR/playwright-test-*.js unless the user
  3. Use a visible browser by default. Use headless: true only when requested
  4. Put the target URL in a constant or environment variable.
  5. Run scripts with node "$SKILL_DIR/run.js" .
  6. Report actions, failures, and artifact paths. Do not claim success without

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(node:*)
    • Bash(npm:*)
    • Read
    • Write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • npm

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

  • Network

    No URLs in SKILL.md. Its commands use npm, 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 these keys or tokens, usually read from environment variables:

    • TEST_PASSWORD

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

  • Compatibility

    Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium.

    From compatibility in the SKILL.md frontmatter.

Context cost

Playwright Skill loads about 1.9k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 513 words of instructions outside code blocks.

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

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 lackeyjb/playwright-skill at commit dd47a6a, republished under its MIT licence (© lackeyjb). 513 words, ~1,936 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-skill/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
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.
allowed-tools
Bash(node:*), Bash(npm:*), Read, Write
compatibility
Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium.
license
MIT
metadata.author
lackeyjb
metadata.version
5.0.0

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:

bash
cd "$SKILL_DIR" && npm run setup

This installs Playwright and Chromium. Use cd "$SKILL_DIR" && npm run install-all-browsers when Firefox or WebKit is required.

Minimal example

javascript
const os = require('node:os');
const path = require('node:path');
const { chromium } = require('playwright');

const targetUrl = process.env.TARGET_URL || 'http://localhost:3000';
const artifactDir = process.env.PW_ARTIFACT_DIR || os.tmpdir();

(async () => {
  const browser = await chromium.launch({ headless: false });
  try {
    const page = await browser.newPage();
    await page.goto(targetUrl);
    console.log('Page loaded:', await page.title());
    await page.screenshot({ path: path.join(artifactDir, 'page.png'), fullPage: true });
  } finally {
    await browser.close();
  }
})();

Run it:

bash
node "$SKILL_DIR/run.js" "$TMP_DIR/playwright-test-page.js"

For short one-off tasks, use inline execution:

bash
node "$SKILL_DIR/run.js" -e "const browser = await chromium.launch({headless: false}); try { const page = await browser.newPage(); await page.goto('https://example.com'); console.log(await page.title()); } finally { await browser.close(); }"

The -e process exits as soon as the snippet settles, so close the browser inside the snippet.

Current Playwright patterns

Prefer locators that describe what a user sees, in this order:

  1. page.getByRole() with an accessible name
  2. page.getByLabel() for form controls
  3. page.getByText() for visible content
  4. page.getByTestId() when the application provides a test contract

Actions auto-wait for actionability. Use web-first assertions or a locator's waitFor() instead of waitForSelector(), fixed sleeps, or networkidle.

javascript
await page.getByLabel('Email').fill('test@example.com');
await page.getByRole('button', { name: 'Sign in' }).click();
await page.waitForURL('**/dashboard');
await page.getByRole('heading', { name: 'Dashboard' }).waitFor();
Show full SKILL.md (204 more words)Show less

Common tasks

Responsive checks
javascript
{
  const os = require('node:os');
  const path = require('node:path');

  const artifactDir = process.env.PW_ARTIFACT_DIR || os.tmpdir();
  const viewports = [
    { name: 'desktop', width: 1440, height: 900 },
    { name: 'mobile', width: 390, height: 844 },
  ];

  for (const viewport of viewports) {
    await page.setViewportSize(viewport);
    await page.goto(targetUrl);
    await page.screenshot({ path: path.join(artifactDir, `${viewport.name}.png`), fullPage: true });
  }
}
Login flow

Use test credentials supplied by the user. Never invent or expose real credentials. Verify both the navigation and a post-login element.

javascript
await page.goto(`${targetUrl}/login`);
await page.getByLabel('Email').fill(process.env.TEST_EMAIL);
await page.getByLabel('Password').fill(process.env.TEST_PASSWORD);
await page.getByRole('button', { name: /sign in|log in/i }).click();
await page.waitForURL('**/dashboard');
await page.getByRole('heading', { name: /dashboard/i }).waitFor();
Save scripts and artifacts
bash
PW_SCRIPT_DIR=./playwright-tests node "$SKILL_DIR/run.js" "$TMP_DIR/playwright-test-login.js"
PW_ARTIFACT_DIR=./playwright-artifacts node "$SKILL_DIR/run.js" "$TMP_DIR/playwright-test-page.js"

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:

javascript
const browser = await chromium.connectOverCDP('http://127.0.0.1:9222');
const page = browser.contexts()[0].pages()[0];

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.

Helpers

javascript
const helpers = require(`${process.env.PW_SKILL_DIR}/lib/helpers`);

const servers = await helpers.detectDevServers();
const browser = await helpers.launchBrowser('chromium');
const context = await helpers.createContext(browser);
const page = await context.newPage();
await helpers.handleCookieBanner(page);
await helpers.takeScreenshot(page, 'result');

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_EXECUTABLE_PATH: explicit browser executable path.
  • 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.

© lackeyjb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in skills/playwright-skill of lackeyjb/playwright-skill.

  • SKILL.md
  • API_REFERENCE.md
  • lib/helpers.js
  • package-lock.json
  • package.json
  • run.js

Open the folder on GitHubat commit dd47a6a

Compare with similar skills

Playwright Skill 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 Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Skill this skilllackeyjb/playwright-skill3.2k—~1.9kAutomated safety check: PassMIT
Playwright Skilltech-leads-club/agent-skills7k—~3.6kAutomated safety check: PassCustom licence
Open BrowserJasonHonKL/Openbrowser114—~1.6kAutomated safety check: PassMIT
Playwright CLIfugazi/test-automation-skills-agents247—~2.2kAutomated safety check: PassMIT
Sap Browser Automationsecondsky/sap-skills460—~3.3kAutomated safety check: PassGPL-3.0
Playwright Testingaehrc/pathling137—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Playwright Skill

    tech-leads-club/agent-skills

    Complete browser automation with Playwright. An agent skill from tech-leads-club/agent-skills.

    7k GitHub stars~3.6k tokensUpdated 17 days ago
    Testing & QAAuto-check passed
  • Open Browser

    JasonHonKL/Openbrowser

    A skill your agent uses whenever the task involves browsing web pages, extracting page content, clicking forms, or completing web workflows.

    114 GitHub stars~1.6k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Playwright CLI

    fugazi/test-automation-skills-agents

    Drive a live browser from the CLI with playwright-cli to navigate, interact, snapshot, and capture evidence.

    247 GitHub stars~2.2k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Sap Browser Automation

    secondsky/sap-skills

    A skill your agent uses when an agent must inspect or operate an authenticated SAP web UI through an in-app Browser, Microsoft Edge CDP, or an existing Playwright client, especially when SAP SSO…

    460 GitHub stars~3.3k tokensUpdated 2 days ago
    Productivity & AutomationAuto-check passed
  • Playwright Testing

    aehrc/pathling

    Expert guidance for writing end-to-end tests with Playwright Test framework.

    137 GitHub stars~1.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Playwright

    secondsky/claude-skills

    Browser automation and E2E testing with Playwright. An agent skill from secondsky/claude-skills.

    227 GitHub stars~3.7k tokensUpdated 9 days ago
    Testing & QAAuto-check: notes

Works with

Questions about Playwright Skill

What does Playwright Skill do?

Complete browser automation with Playwright. An agent skill from lackeyjb/playwright-skill. Playwright Skill is an agent skill from lackeyjb/playwright-skill. Complete browser automation with Playwright.

When should I use Playwright Skill?

Playwright Skill fits situations like: the user wants to test a website; automate browser interactions; validate web functionality; perform browser-based testing.

How do I install Playwright Skill in Claude Code?

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

How do I install Playwright Skill in Codex?

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

Can I use Playwright Skill 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 lackeyjb/playwright-skill --skill playwright-skill -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-skill, .gemini/skills/playwright-skill, .github/skills/playwright-skill and .opencode/skills/playwright-skill in your project.

What does Playwright Skill need to run?

Going by SKILL.md and its folder, Playwright Skill needs JavaScript for the scripts in its folder, the command-line tools its instructions call (node and npm) and credentials named TEST_PASSWORD. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Bash(node:*), Bash(npm:*), Read, Write. Compatibility (from SKILL.md): Requires Node.js 20+, npm, and network access on first setup to install Playwright and Chromium..

Does Playwright Skill access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Playwright Skill 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 Skill use?

Playwright Skill is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Skill use?

About 1.9k tokens (SKILL.md is roughly 7.7k 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 Skill?

Skills that share tags, products or a category with Playwright Skill: Playwright Skill (tech-leads-club/agent-skills, 7k stars), Open Browser (JasonHonKL/Openbrowser, 114 stars), Playwright CLI (fugazi/test-automation-skills-agents, 247 stars) and Sap Browser Automation (secondsky/sap-skills, 460 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Skill?

lackeyjb (a GitHub user) maintains it in lackeyjb/playwright-skill, which has 3,174 GitHub stars. The repository was last updated on October 1, 2026.

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