/engineering-workflow:playwrightfrom engineering-workflow
Everything Playwright in one skill — writing and debugging Playwright tests with @playwright/test (locators, assertions and auto-waiting, fixtures, Page Object Model, flaky tests, tracing, CI/CD, API mocking, authentication, accessibility, visual regression, mobile, Electron, GraphQL, WebSockets) and driving a real browser from the terminal with playwright-cli (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging, sessions, storage state). Use when a task mentions Playwright in either form, or asks to automate, inspect, or test a web page.
Ships in engineering-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
One skill for both halves of Playwright work. Decide which mode the task is in before touching anything:
| The task is | Mode | Start at |
|---|---|---|
| Automate, inspect, or extract from a live page | CLI | Driving a browser, below |
| Write, fix, or debug test files or a suite | Library | Writing tests, below |
| Record a flow, then turn it into a test | CLI, then library | references/cli/test-generation.md |
Mode discipline: browser-driving tasks stay CLI-first. Do not
pivot to writing @playwright/test files unless the user asks
for test files. Test work uses the library and its project
setup, not ad-hoc CLI sessions.
Check the prerequisite first: the CLI and its wrapper need
npx.
command -v npx >/dev/null 2>&1
If npx is missing, the user needs Node.js/npm installed
before anything else. With npx present, two ways to run:
npm install -g @playwright/cli@latest, then call
playwright-cli directly.scripts/playwright_cli.sh in this folder runs
the CLI through npx --package @playwright/cli, so it
works with no global install. Prefer the wrapper unless the
project already standardizes on the global install.Every interaction follows the same loop:
playwright-cli open <url>playwright-cli snapshot — the output lists
elements with stable refs like e15.click e15, fill e5 "text",
type, press Enter.screenshot, pdf,
traces. Close with playwright-cli close.Refs go stale when the page changes. When a command fails on a missing ref, snapshot again instead of guessing a new one. When there is no fresh snapshot, do not invent refs.
eval and run-code; use
them only when no command covers the need.--headed when a visual check would help.playwright-cli open [url] [--browser=chrome|firefox|webkit]
playwright-cli goto <url>
playwright-cli snapshot [--filename=f.yaml] [--depth=n]
playwright-cli find "text" # search a large snapshot
playwright-cli click e3 # also dblclick, hover, drag
playwright-cli fill e5 "[email protected]" --submit
playwright-cli type "query"
playwright-cli press Enter # keydown/keyup for holds
playwright-cli select e9 "value"
playwright-cli upload ./file.pdf
playwright-cli check e12 # uncheck likewise
playwright-cli eval "document.title"
playwright-cli eval "el => el.textContent" e5
playwright-cli screenshot [--filename=f.png]
playwright-cli pdf --filename=f.pdf
playwright-cli tab-list | tab-new [url] | tab-select n
playwright-cli dialog-accept [text] | dialog-dismiss
playwright-cli resize 1920 1080
playwright-cli go-back | go-forward | reload
playwright-cli close | close-all
Targets can also be CSS selectors or Playwright locators
(getByRole('button', { name: 'Submit' }),
getByTestId('x')) when refs are not available.
playwright-cli -s=name open ... isolates
browsers per project or flow; --session name and the
PLAYWRIGHT_CLI_SESSION environment variable do the same.
Persistent profiles come from --persistent or
--profile=<dir>. See references/cli/session-management.md
and references/cli/workflows.md.state-save/state-load for auth state,
cookie and localStorage commands for inspection. See
references/cli/storage-state.md.route "<pattern>" --status=404 or --body=...
mocks responses; requests and request n inspect
traffic. See references/cli/request-mocking.md.console, requests, tracing-start /
tracing-stop, video-start / video-stop,
recording-start / recording-stop (prints Playwright
code), show --annotate (asks the user for UI review on
the live page). See references/cli/tracing.md and
references/cli/video-recording.md.run-code "async page => ..." runs
raw Playwright API code. See
references/cli/running-code.md.--raw returns only the result value for
piping into other tools; --json wraps replies as JSON.gh pr comment --attach takes
screenshots and videos. See
references/cli/pr-attachments.md.generate-locator e5, highlight e5. See
references/cli/element-attributes.md.Full CLI topic files live in references/cli/: element attributes, Playwright tests from the CLI, PR attachments, request mocking, running code, session management, storage state, test generation (plan, generate, heal), tracing, video recording, and workflows (sessions, configuration, troubleshooting).
playwright-cli reads playwright-cli.json from the
current directory, or a file given with --config. It sets
launch options (headless, viewport) and context options.
See the example in references/cli/workflows.md.
getByRole, getByLabel,
getByText, and getByTestId. CSS and XPath selectors
are the fallback, not the default. See
references/testing/core/locators.md.After writing or changing tests, always close the loop:
npx playwright test --reporter=listnpx playwright show-trace) before changing anything.npx playwright test --repeat-each=5.Writing tests:
Debugging failures:
Architecture and frameworks:
Infrastructure:
Read only the reference files the current task needs; this file is the map, not the territory.
evals/evals.json (opens in a new tab)licenses/ATTRIBUTION.md (opens in a new tab)licenses/currents-dev-MIT.txt (opens in a new tab)licenses/microsoft-Apache-2.0.txt (opens in a new tab)licenses/openai-Apache-2.0.txt (opens in a new tab)licenses/openai-NOTICE.txt (opens in a new tab)references/cli/element-attributes.md (opens in a new tab)references/cli/playwright-tests.md (opens in a new tab)references/cli/pr-attachments.md (opens in a new tab)references/cli/request-mocking.md (opens in a new tab)references/cli/running-code.md (opens in a new tab)references/cli/session-management.md (opens in a new tab)references/cli/storage-state.md (opens in a new tab)references/cli/test-generation.md (opens in a new tab)references/cli/tracing.md (opens in a new tab)references/cli/video-recording.md (opens in a new tab)references/cli/workflows.md (opens in a new tab)references/testing/advanced/authentication-flows.md (opens in a new tab)references/testing/advanced/authentication.md (opens in a new tab)references/testing/advanced/clock-mocking.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub frzxw/supercharger --plugin engineering-workflowOther plugins' skills for the same job
20 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation)./diagnosing-superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness./