Agent skill
playwriter
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.
Install this agent skill to your Project
npx add-skill https://github.com/brianlovin/agent-config/tree/main/skills/playwriter
SKILL.md
Playwriter
Use this skill to drive the user's active Chrome tab via Playwriter.
Full documentation is available here: https://playwriter.dev/
Quick Start
- Ensure the Playwriter extension is enabled (green) on the target tab.
- Ensure CLI is available:
playwriter --version || npx -y playwriter --version
- Create/attach a session:
playwriter session new
- Run commands against that session:
playwriter -s 1 -e "console.log(await page.url())"
Core Workflow
- Confirm connection and correct tab:
playwriter -s <session> -e "console.log(await page.url()); console.log(await page.title());"
- Collect page structure when needed:
playwriter -s <session> -e "console.log(await accessibilitySnapshot({ page }))"
- Execute targeted actions (click/type/hover/fetch/evaluate).
- Pull logs and structured state via
page.evaluate. - Summarize findings with exact IDs, timestamps, and observed state transitions.
Useful Commands
Get list rows/options from current app UI:
playwriter -s <session> -e "const rows = await page.getByRole('option').all(); console.log(rows.length);"
Read popup/hover content:
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:
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
playwritercommand is missing, usenpx -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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
bun
Use Bun instead of Node.js, npm, pnpm, or vite. Provides command mappings, Bun-specific APIs, and development patterns.
tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
fix-sentry-issues
Use Sentry MCP to discover, triage, and fix production issues with root-cause analysis. Use when asked to fix Sentry issues, triage production errors, investigate error spikes, or clean up Sentry noise. Requires Sentry MCP server. Triggers on "fix sentry", "triage errors", "production bugs", "sentry issues".
workflow
Workflow orchestration for complex coding tasks. Use for ANY non-trivial task (3+ steps or architectural decisions) to enforce planning, subagent strategy, self-improvement, verification, elegance, and autonomous bug fixing. Triggers: multi-step implementation, bug fixes, refactoring, architectural changes, or any task requiring structured execution.
react-doctor
Diagnose and fix React codebase health issues. Use when reviewing React code, fixing performance problems, auditing security, or improving code quality.
deslop
Remove AI-generated code slop from the current branch. Use after writing code to clean up unnecessary comments, defensive checks, and inconsistent style.
Didn't find tool you were looking for?