Playwriter

by brianlovin1a9819ebf3feNo license376 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 6 months ago

Control the user's currently open Chrome tab through the Playwriter CLI (no new browser launch). Use when you need to inspect live UI state, run scripted browser actions, capture console output, or reproduce frontend issues directly in the user's tab.

Instructions onlySoftware Development
AI-generated overview

Drives the user's currently open Chrome tab through the Playwriter CLI to inspect UI state and run browser actions.

What it does
This skill instructs an agent to attach to the user's active Chrome tab using the Playwriter CLI rather than launching a new browser. It covers creating a session, verifying the connected tab, collecting page structure through accessibility snapshots, and running targeted actions such as click, type, hover, fetch, and evaluate. It also gathers console output and structured page state, then summarizes findings with exact IDs, timestamps, and observed state transitions.
When to use it
Use it when you need to inspect live UI state in the user's own tab, run scripted browser actions, capture console output, or reproduce frontend issues directly in that tab. It suits debugging and inspection of an already-open page rather than starting a fresh browser session.
Requirements
Requires the Playwriter browser extension enabled on the target tab and the Playwriter CLI available locally or via npx. Network access is needed to fetch the CLI through npx. The skill ships no scripts; it is instructions only.

Playwriter

Use this skill to drive the user's active Chrome tab via Playwriter.

Full documentation is available here: https://playwriter.dev/

Quick Start

  1. Ensure the Playwriter extension is enabled (green) on the target tab.
  2. Ensure CLI is available:
bash
playwriter --version || npx -y playwriter --version
  1. Create/attach a session:
bash
playwriter session new
  1. Run commands against that session:
bash
playwriter -s 1 -e "console.log(await page.url())"

Core Workflow

  1. Confirm connection and correct tab:
bash
playwriter -s <session> -e "console.log(await page.url()); console.log(await page.title());"
  1. Collect page structure when needed:
bash
playwriter -s <session> -e "console.log(await accessibilitySnapshot({ page }))"
  1. Execute targeted actions (click/type/hover/fetch/evaluate).
  2. Pull logs and structured state via page.evaluate.
  3. Summarize findings with exact IDs, timestamps, and observed state transitions.

Useful Commands

Get list rows/options from current app UI:

bash
playwriter -s <session> -e "const rows = await page.getByRole('option').all(); console.log(rows.length);"

Read popup/hover content:

bash
playwriter -s <session> -e "const row = page.getByRole('option').nth(0); await row.hover(); await page.waitForTimeout(700); console.log(await page.locator('[data-side]').first().innerText());"

Run arbitrary in-page debug code:

bash
playwriter -s <session> -e "const out = await page.evaluate(() => ({ href: location.href })); console.log(out);"

Troubleshooting

  • If the session attaches to the wrong tab, click the extension icon on the intended tab and re-run playwriter session new.
  • If playwriter command is missing, use npx -y playwriter ... or install globally.
  • If execution errors suggest stale connection, create a fresh session.

Guardrails

  • Prefer read-only inspection unless the task requires mutation.
  • Announce destructive UI actions before running them.
  • When capturing logs, redact sensitive tokens/user data in summaries.

Source and attribution

Source:brianlovin/agent-configinskills/playwriterat commit1a9819e

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal