Updated November 2026.
The Playwright Claude Code skill lets Claude drive a real browser for you. You describe what you want checked (“test the signup form”, “screenshot the dashboard on mobile and desktop”) and Claude writes the Playwright code, runs it, and reports back with console output and screenshots. It is one of the most useful skills for anyone who builds web apps, because it turns end-to-end testing from a chore you keep postponing into a short conversation.
This guide covers what the skill is, how to install it, your first prompts, and when to use it instead of the Playwright MCP server.
What the Playwright Claude Code Skill Is
The skill most people mean by “the Playwright skill” is lackeyjb/playwright-skill, an open-source (MIT) Agent Skill that is also packaged as a Claude Code plugin. It does not ship a fixed set of scripts. Instead, it teaches Claude how to write custom Playwright code for whatever you ask, and gives it a reliable way to run that code.
Each request follows the same loop:
- You describe the browser task in plain English.
- Claude writes a Playwright script for that task.
- The skill’s
run.jsexecutor runs the script, handling module resolution so you don’t hit “module not found” errors. - A browser opens and the automation runs. It is visible by default, so you can watch it work; ask for headless mode if you don’t want the window.
- Claude reads the console output and any screenshots, then tells you what passed, what failed and why.
The skill keeps its main instructions short (SKILL.md) and loads a fuller Playwright API reference only when a task needs it, so it doesn’t fill Claude’s context up front. It also includes optional helper functions and dev-server detection, so it can find the app you are running locally.
Installing the Playwright Claude Code Skill
You need Node.js. The skill’s setup step installs Playwright and Chromium for you.
Option 1: as a Claude Code plugin. This is the recommended route if you only use Claude Code. Inside Claude Code, add the repository as a plugin marketplace and install the plugin:
/plugin marketplace add lackeyjb/playwright-skill
/plugin install playwright-skill@playwright-skill
Then run the one-time setup from the skill’s folder:
cd ~/.claude/plugins/marketplaces/playwright-skill/skills/playwright-skill
npm run setup
Installing as a plugin means you get updates automatically, and a team can share the same setup.
Option 2: with the skills CLI. If you use several coding agents, the skills CLI installs it for Claude Code (and others, such as Cursor or Codex) in one command:
npx skills add lackeyjb/playwright-skill --skill playwright-skill --agent claude-code --global --yes
Leave out --global to install it for the current project only. Then run npm run setup in the folder the skill was installed to. If you want Firefox and WebKit as well as Chromium, run npm run install-all-browsers there too.
Restart Claude Code and run /help to check the skill is listed.
Your First Prompts
Start your app’s dev server, then ask Claude for something concrete. Prompts that work well:
- “Test the homepage and tell me if anything is broken.”
- “Check if the contact form works, including the validation errors.”
- “Take screenshots of the dashboard at mobile and desktop widths.”
- “Fill out the registration form and submit it.”
- “Check every link on the pricing page for broken links.”
Claude writes the script, runs it, and comes back with a short report and any screenshots. If something fails, ask it to fix the app or the script and run it again.
One-off checks vs a permanent test suite. By default the skill writes throwaway scripts: great for “does this still work?” checks while you are coding. When a flow matters enough to protect permanently, ask Claude to turn it into a Playwright Test spec in your repository instead. If your project doesn’t have Playwright Test yet, set it up first:
npm init playwright@latest
From then on, the tests live in your tests/ folder, run in CI, and Claude can add to them as you build. The examples below use that style.
Playwright Skill vs Playwright MCP
Both let Claude control a browser, but they suit different jobs. The skill is code-first: it is best for loops, assertions, several browser contexts, network interception, screenshots, video and scripts you want to keep. For simple, interactive browsing (open a page, click around, read what is there), the skill’s own README points you to Microsoft’s Playwright MCP server or @playwright/cli instead. Plenty of people install both.
What the Skill Is Good For
End-to-end tests from a description – Describe a user journey (“sign up, confirm the email, land on the dashboard”) and Claude writes and runs a test for it, using resilient role-based selectors rather than brittle CSS paths.
Quick page checks – Load a page, check the title, look for console errors, confirm the key elements render. Handy after a deploy or a dependency upgrade.
Responsive screenshots – Capture the same page at several viewport sizes so you can spot layout problems without resizing a browser by hand.
Form automation – Fill and submit forms, handle multi-step flows, and capture the results. Useful for data migration, testing third-party integrations, or automating repetitive admin tasks.
Visual regression testing – Claude generates screenshot comparison tests using Playwright’s built-in snapshot functionality:
await expect(page).toHaveScreenshot('dashboard.png', { threshold: 0.1 });
A catch when Claude reads the screenshots. The pixel comparison is exact, but if you ask Claude to open the diff images and explain a failure, it sees a shrunk copy. Claude downscales any image with a long edge over 1,568 px (2,576 px on Claude 4.7 and later), keeping the aspect ratio, so a tall full-page capture gets squeezed hard. A 2540 x 18410 px page lands at about 216 x 1568 px, and 16 px body text ends up roughly 1.4 px tall. Claude cannot read that, and it may guess at the failure rather than say so.
The example above captures the viewport, which is fine. The problem comes with fullPage: true. When Claude needs to read the result, screenshot the component that failed instead of the whole page:
await expect(page.getByTestId('checkout-summary')).toHaveScreenshot('checkout-summary.png');
Anthropic’s vision documentation lists the exact resize limits, and SlimSnap’s write-up on screenshot downscaling works through the numbers for tall pages.
Testing Use Cases
Critical path coverage – Identify your application’s three to five most important user flows (sign up, purchase, core feature) and ask Claude to generate Playwright tests for each. This is your smoke test suite.
Regression tests for bug fixes – When a bug is reported, describe the reproduction steps and ask Claude to generate a Playwright test that fails on the bug. Fix the bug; the test becomes permanent regression coverage.
Authentication flows – Login, logout, password reset, OAuth flows, MFA. These are tedious to write but critical to test. The skill generates them correctly, including the async timing for redirect-heavy flows.
API and UI integration – Test that your frontend correctly handles API responses: error states, loading states, empty states, pagination. Claude generates the network mocks and UI assertions together.
Tips and Gotchas
Use getByRole first. The skill defaults to role-based selectors, which is correct. If Claude uses a CSS selector, ask it to use a semantic selector instead.
Avoid page.waitForTimeout(). This is the classic Playwright antipattern. The skill knows not to use it; if you see it in generated code, ask Claude to replace it with a proper waitFor assertion.
Keep tests independent. Each test should set up its own state and not depend on test execution order. The skill generates tests this way by default.
Run with --ui for debugging:
npx playwright test --ui
This opens the Playwright UI mode with a live browser, test timeline, and DOM snapshot at each step. Invaluable for understanding why a test is failing.
Check your playwright.config.ts. If Claude sets up a config for you, review it. The baseURL, testDir, and browser list settings should match your project structure.
Common Questions
Is the Playwright skill free?
Yes. The skill is open source under the MIT licence, and Playwright itself is free. You only pay for your normal Claude usage.
Do I need to know Playwright to use it?
No, but it helps when you review what Claude writes. Read the generated tests before you commit them, the same as any other code.
Does it work with agents other than Claude Code?
Yes. It is a standard Agent Skill, and its README lists Cursor, GitHub Copilot, Codex, Gemini CLI and OpenCode as supported alongside Claude Code.
Further Reading
- lackeyjb/playwright-skill on GitHub
- Playwright Official Documentation
- Extend Claude with skills – Official Claude Code Docs
- Top 10 Claude Code Skills Every Builder Should Know in 2026 – Composio
- The Complete Claude Code Power User Guide – DEV Community
- 39 Claude Skills Examples – aiblewmymind Substack
The Playwright Claude Code skill is the difference between “I should write end-to-end tests for this” as an aspirational note at the bottom of your ticket and actually having them. Describe the user flow in English, review the generated test, run it once to confirm it works, and move on. The test is written, it is correct, and it does not rely on brittle CSS selectors that will break next sprint. That is the bar the skill sets – and it clears it consistently.
