
Playwriter
- 225 installs
- 40 repo stars
- Updated August 4, 2026
- akillness/oh-my-skills
Generate and run Playwright-style browser tests from agent sessions to validate UI flows before release.
About
playwriter equips agents to author and execute Playwright-based end-to-end tests for web applications, turning observed UI flows into maintainable regression suites that catch breakage in navigation, forms, and critical paths before shipping.
- Playwright test authoring
- UI regression automation
- Agent-driven flow validation
- Cross-page interaction checks
- Release-ready test scripts
Playwriter by the numbers
- 225 all-time installs (skills.sh)
- Ranked #775 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/akillness/oh-my-skills --skill playwriterAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 225 |
|---|---|
| repo stars | ★ 40 |
| Last updated | August 4, 2026 |
| Repository | akillness/oh-my-skills ↗ |
What it does
Generate and run Playwright-style browser tests from agent sessions to validate UI flows before release.
Files
playwriter
Playwriter is the running-browser browser-automation skill. It connects an agent to Chrome/Chromium that is already part of the user’s real workflow instead of spawning a clean disposable browser. That makes it useful for authenticated flows, extension-dependent pages, and long-lived tab context — but less reproducible than a fresh-session browser tool.
When to use this skill
Use playwriter when the task needs one or more of these:
- the browser the user already has open
- existing logins, cookies, or trusted-device state
- extension-dependent workflows
- passkey / SSO / MFA-heavy flows where manual login handoff is realistic
- live-tab continuity with a human and agent sharing the same browser
- MCP-based browser control for Claude / Codex / Gemini using the running browser
Do not use playwriter by default for:
- CI-style repeatable browser checks
- fresh-session verification that should not touch the user’s real browser profile
- simple scraping or deterministic form checks that fit
browser-harness - tasks that need the strongest isolation or the least user-state coupling
Quick routing rule
| If the job needs... | Use |
|---|---|
| The browser the user already has open | playwriter |
| Existing logins / cookies / extensions | playwriter |
| A clean, reproducible, disposable session | browser-harness |
| Headless verification / screenshot diffs / isolated checks | browser-harness |
| Hosted or cloud browser infrastructure | a provider-specific or cloud-browser skill |
Instructions
Step 1: Pick the right browser runtime
Use playwriter only when running-browser reuse is the requirement. If the task is really about a clean disposable browser or CI-style reproducibility, route to browser-harness instead.
Step 2: Follow the core workflow
Always follow the same loop:
1. Prepare the running-browser bridge 2. Create or select a session 3. Observe first with snapshot({ page }) 4. Act once 5. Observe again before the next action
Step 1: Install the extension and CLI
# install the CLI
npm install -g playwriter
# or use it without global install
npx playwriter@latest --helpInstall the Playwriter Chrome extension, then click the extension icon on the tab you want to control. The tab should show the connected/green state before you assume automation is available.
Step 2: Start browser support and create a session
Use the upstream browser/session flow, not a vague “extension auto-starts everything” assumption:
# start the managed browser/runtime if needed
playwriter browser start
# create a stateful sandbox session
playwriter session new
# inspect current sessions
playwriter session listNotes:
playwriter browser startcan launch Chrome for Testing / Chromium with the Playwriter extension available.playwriter session newcreates a stateful sandbox and returns a session id.- Browser tabs are shared, but session state is isolated.
Step 3: Observe → act → observe
# navigate
playwriter -s 1 -e 'await page.goto("https://example.com")'
# observe current page state
playwriter -s 1 -e 'console.log(await snapshot({ page }))'
# act using a fresh aria-ref from the snapshot
playwriter -s 1 -e 'await page.locator("aria-ref=e5").click()'
# observe again after the action
playwriter -s 1 -e 'console.log(await snapshot({ page }))'Rules:
- Never keep using old
aria-refvalues after navigation or major DOM changes. - Prefer
snapshot({ page })over screenshots when text structure is enough. - Use screenshots or recordings only when visual evidence matters.
High-value command patterns
Navigation and state
playwriter browser start
playwriter session new
playwriter session list
playwriter session reset 1
playwriter session delete 1Execute Playwright code in a session
# basic navigation
playwriter -s 1 -e 'await page.goto("https://github.com")'
# fill + submit
playwriter -s 1 -e 'await page.fill("#search", "playwriter"); await page.keyboard.press("Enter")'
# save reusable state between calls
playwriter -s 1 -e 'state.lastUrl = page.url(); state.heading = await page.textContent("h1")'
playwriter -s 1 -e 'console.log(state.lastUrl, state.heading)'Multiline code safely
playwriter -s 1 -e "$(cat <<'EOF'
const title = await page.title();
state.title = title;
console.log(await snapshot({ page }));
EOF
)"Use heredocs when the JavaScript would become fragile with quoting.
MCP integration
Use Playwriter when a model client needs browser tooling for the running browser, not when it simply needs any browser tool.
Example MCP config
{
"mcpServers": {
"playwriter": {
"command": "npx",
"args": ["-y", "playwriter@latest"]
}
}
}Common uses:
- Claude / Codex / Gemini can call into Playwriter through MCP.
- MCP gives the agent a transport layer; Playwriter still owns the browser/session behavior.
- Session reuse, browser visibility, and tab consent remain Playwriter concerns, not MCP concerns.
Safety and expectations
playwriteris privileged mode because it can touch the user’s real browser session.- Prefer it only when session reuse is genuinely required.
- Expect lower reproducibility than a clean isolated browser because tabs, extensions, and humans can mutate state.
- Manual login / MFA / CAPTCHA handoff is normal in this lane; don’t pretend full autonomy is guaranteed.
- Detach or reset cleanly; do not assume it is safe to kill the user’s browser.
Troubleshooting
| Issue | What to check |
|---|---|
| Nothing responds | Confirm the extension is installed and enabled on the target tab |
| Wrong tab/page state | Re-run snapshot({ page }) and confirm you are on the expected tab before clicking |
| Stale / broken session | playwriter session reset <id> |
| Quoting breaks JavaScript | Use a heredoc for -e input |
| Need repeatable isolated automation | Route to browser-harness instead |
| Browser state is too messy / human interference | Start a fresh session or use a fresh-session browser tool |
Examples
Example 1: Logged-in SaaS workflow
- Prompt: "Use my already logged-in Chrome to update a Jira ticket without re-authenticating."
- Expected skill behavior: choose
playwriter, mention running-browser reuse, create a session, observe first, then act.
Example 2: Clean browser verification
- Prompt: "Run a repeatable headless checkout test in CI and compare screenshots."
- Expected skill behavior: route away from
playwritertobrowser-harnessor another fresh-session tool because isolation matters more than session reuse.
Example 3: MCP browser bridge
- Prompt: "Connect Codex or Claude to the browser I already have open so it can use my current tabs and cookies."
- Expected skill behavior: choose
playwriter, explain MCP config, and make the running-browser assumption explicit.
Best practices
1. Choose playwriter because the browser state matters, not because the word “browser” appears. 2. Start with snapshot({ page }) before any action that could hit the wrong tab or stale UI state. 3. Re-snapshot after each meaningful action; live browser state drifts faster than isolated automation state. 4. Use heredocs for non-trivial JavaScript to avoid shell-quoting bugs. 5. Treat manual login / MFA / CAPTCHA handoff as normal in this lane. 6. Report why a running browser was necessary and when a fresh-session tool would have been safer.
References
Deep-dive docs in this skill:
- modes-and-routing
- session-workflow
- mcp-integration
Primary sources:
- https://raw.githubusercontent.com/remorses/playwriter/main/README.md
- https://playwright.dev/docs/auth
- https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp
- https://modelcontextprotocol.io/introduction
Output expectations
When using this skill, report:
- why
playwriterwas chosen instead of a fresh-session browser tool - session/runtime assumptions
- key actions taken
- evidence captured (
snapshot, screenshot, recording, logs) - any manual handoff or auth-related limitation encountered
{
"skill_name": "playwriter",
"evals": [
{
"id": 1,
"prompt": "Use my already logged-in Chrome to automate a Jira workflow and keep the same browser session.",
"expected_output": "The skill activates and chooses Playwriter because the running browser, login state, and live session continuity are required.",
"assertions": [
"Response explicitly prefers playwriter for the running-browser lane",
"Response mentions existing logins/cookies/extensions or live browser context",
"Response includes an observe-act-observe or snapshot-first workflow"
]
},
{
"id": 2,
"prompt": "Run a repeatable headless checkout verification in CI and compare screenshots from a clean browser state.",
"expected_output": "The skill should not claim Playwriter is the best default; it should route the user to a fresh-session browser tool such as browser-harness.",
"assertions": [
"Response says playwriter is not the default for clean repeatable CI checks",
"Response routes to browser-harness or another fresh-session browser tool",
"Response explains that reproducibility/isolation matter more than session reuse here"
]
},
{
"id": 3,
"prompt": "Connect Claude or Codex to the browser I already have open so it can use my current tabs and cookies.",
"expected_output": "The skill activates and explains MCP integration plus the constraint that Playwriter is for a running browser, not generic browser automation.",
"assertions": [
"Response mentions MCP integration",
"Response mentions the running browser or current Chrome session",
"Response does not frame Playwriter as the default for every browser task"
]
}
]
}
Playwriter MCP integration
What MCP does here
MCP is the transport/integration layer that lets a model client expose Playwriter as a tool server.
It does not replace Playwriter’s runtime decisions:
- running browser vs fresh browser
- session reuse vs isolated session
- artifact capture
- auth handoff expectations
Minimal MCP config
{
"mcpServers": {
"playwriter": {
"command": "npx",
"args": ["-y", "playwriter@latest"]
}
}
}Good trigger examples
Use Playwriter over a generic browser server when the prompt sounds like:
- “use the browser I already have open”
- “don’t make me log in again”
- “work in my current Chrome session”
- “keep my extensions and tabs”
Bad trigger examples
Route elsewhere when the task sounds like:
- “run this browser test in CI”
- “verify a flow from a clean state”
- “take isolated repeatable snapshots across environments”
Playwriter modes and routing
Use Playwriter for the running-browser lane
Choose playwriter when the task depends on one or more of these:
- the browser the user already has open
- existing cookies or trusted-device session state
- installed extensions
- passkey / SSO / MFA flows where manual login is expected
- live-tab continuity with a human using the same browser
Route away from Playwriter when these matter more
Choose browser-harness or another fresh-session browser tool when the task needs:
- disposable isolation
- CI-style reproducibility
- deterministic verification against a clean state
- automation that should not touch the user’s real browser profile
Why the boundary matters
playwriter is valuable because it solves a different runtime problem than a fresh browser:
- Running-browser reuse trades determinism for access to the real browser state.
- Fresh-session automation trades local continuity for reproducibility and isolation.
Do not flatten both into “browser automation.” The trigger quality of the skill depends on making this boundary explicit.
Playwriter session workflow
Upstream-oriented flow
playwriter browser start
playwriter session new
playwriter -s 1 -e 'await page.goto("https://example.com")'
playwriter -s 1 -e 'console.log(await snapshot({ page }))'Observe → act → observe
1. Create or pick a session. 2. Observe current state with snapshot({ page }). 3. Take one action. 4. Observe again before the next action.
This is the safest pattern for live-browser work because the browser state can change outside the agent’s control.
Useful commands
playwriter session list
playwriter session reset 1
playwriter session delete 1Failure recovery
- If the wrong tab appears active, observe again before acting.
- If the connection feels stale, use
playwriter session reset <id>. - If quoting breaks your
-ecode, switch to a heredoc. - If the browser state is too messy, restart with a fresh session or route to a fresh-session browser tool.
N:playwriter
D:Reuse a running Chrome session for browser automation via Playwriter CLI + MCP. Use when the task depends on the browser the user already has open — existing logins, cookies, extensions, passkey-friendly flows, or live-tab continuity. Route repeatable fresh-browser or CI-style checks to `browser-harness` instead.
G:playwriter playwright browser-automation chrome-extension mcp authenticated stateful session-reuse running-browser existing-logins live-browser
U[5]:
Reuse a logged-in Chrome session instead of launching a fresh browser
Automate extension-dependent or trusted-device browser workflows
Let Claude/Codex/Gemini control the running browser through MCP
Continue a human+agent workflow in the same live browser tab set
Handle login-heavy flows where manual auth handoff is realistic
S[6]{n,action,details}:
1,Choose runtime,Pick `playwriter` only when the running browser matters; route clean repeatable checks to `browser-harness`
2,Install,Install Playwriter CLI and extension; enable the extension on the target tab
3,Start runtime,Run `playwriter browser start` when needed and `playwriter session new` to get a session id
4,Observe,Use `playwriter -s <id> -e 'console.log(await snapshot({ page }))'` before each action
5,Act,Perform one Playwright action at a time using fresh `aria-ref` values or stable selectors, then observe again
6,Integrate,Add Playwriter as an MCP server when a model client needs the running browser rather than just any browser tool
R[5]:
Treat running-browser attach as privileged mode because it touches the user's real browser state
Always use Observe→Act→Observe and refresh refs after navigation or major DOM changes
Prefer snapshot() for text/state inspection and screenshots only when visual evidence matters
Expect manual MFA/CAPTCHA handoff and lower determinism than fresh-session browser tools
Reset stale sessions with `playwriter session reset <id>` instead of guessing
E[3]{desc,in,out}:
"Logged-in Jira browser task","Use my already logged-in Chrome to update a Jira issue and keep the same browser context","Chooses playwriter, enables extension/session workflow, and explains why running-browser reuse matters"
"Repeatable CI browser test","Run a disposable headless checkout flow in CI and compare evidence","Routes away from playwriter to browser-harness because fresh-session determinism matters more"
"MCP browser bridge","Connect Codex or Claude to the browser I already have open","Explains MCP config plus session/runtime expectations for a running browser"