playwriter · mikeyobrien — Claude Code skill: what it does, how to install
Drives your local Chrome browser with Playwright Page scripts while keeping active logins and cookies. Useful for testing authenticated web dashboards.
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a claude-codeWhat playwriter does
The skill runs Playwright Page code directly inside a live Chrome session. Execution scripts receive the page and context instances alongside a state object that retains values between CLI commands. Helper modules can be loaded via require.
It intercepts HTTP requests via page.route, extracts inner text from page elements, and saves labeled accessibility snapshots using screenshotWithAccessibilityLabels. These snapshots speed up finding reliable selectors with getByRole or getByLabel.
Execution will fail immediately if Chrome is not already running with the Playwriter extension active and the CLI installed globally.
What it helps with
- automate authenticated browser flows without repeating login steps
- capture accessibility snapshots to inspect element roles and labels
- mock or inject network responses using
page.route - fill web forms inside an active browser profile with existing cookies
Example prompts for the agent
- Create a new playwriter session and navigate to http://localhost:3000
- Take an accessibility snapshot of the current page with playwriter and save it to /tmp/a11y.png
- Fill the login form on the active page and click the submit button using playwriter
How to install playwriter
1Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a claude-code2Manually: put the files in place
~/.claude/skills/playwriter/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/playwriter/
1Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a codex2Manually: put the files in place
.agents/skills/playwriter/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a cursor2Manually: put the files in place
.cursor/skills/playwriter/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mikeyobrien/ralph-orchestrator playwriter2Manually: put the files in place
.github/skills/playwriter/SKILL.md1Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a gemini-cli2Platform CLI
gemini skills install https://github.com/mikeyobrien/ralph-orchestrator --path .claude/skills/playwriterManually: put the files in place
.devin/skills/playwriter/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about playwriter
How do I install playwriter in Claude Code?
Run npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a claude-code in your terminal.
What does playwriter do?
It runs Playwright automation commands against an active local Chrome session, letting an assistant click elements, extract text, and control tabs without losing stored session state.
What prerequisites does playwriter require?
You need npm i -g playwriter installed globally, the Playwriter Chrome extension enabled, and a running Chrome instance.
Source text
SKILL.md · MIT
---
name: playwriter
description: Browser automation via Playwriter (remorses) using persistent Chrome sessions and the full Playwright Page API.
hats: [developer, qa_tester]
metadata:
internal: true
---
# Playwriter
## Overview
Use Playwriter to run Playwright Page scripts against your local Chrome session. This preserves logins, cookies, and extensions, which is ideal for web dashboard testing and authenticated flows.
## When to Use
- Validating the Ralph web dashboard UI
- Navigating authenticated pages without re-logging in
- Testing flows that require browser extensions or saved state
- Capturing accessibility snapshots for element discovery
## Prerequisites
- Install the CLI:
```bash
npm i -g playwriter
```
- Install the Playwriter Chrome extension (see the Playwriter repo instructions)
- Ensure Chrome is running and the extension is enabled
## Core Workflow
1. Create a session:
```bash
playwriter session new
```
2. List sessions and copy the session id:
```bash
playwriter session list
```
3. Execute Playwright code against that session:
```bash
playwriter -s <session_id> -e "await page.goto('https://example.com')"
```
## Execution Environment
Within `-e`, these are available in scope:
- `page` (Playwright Page)
- `context` (BrowserContext)
- `state` (persistent object across calls in the same session)
- `require` (for loading helper modules)
Example state persistence:
```bash
playwriter -s <session_id> -e "state.lastUrl = page.url()"
playwriter -s <session_id> -e "console.log(state.lastUrl)"
```
## Common Patterns
### Navigate + click
```bash
playwriter -s <session_id> -e "await page.goto('http://localhost:3000'); await page.getByRole('button', { name: 'Run' }).click();"
```
### Fill forms
```bash
playwriter -s <session_id> -e "await page.getByLabel('Email').fill('[email protected]'); await page.getByLabel('Password').fill('secret'); await page.getByRole('button', { name: 'Sign in' }).click();"
```
### Accessibility snapshots (labeled)
```bash
playwriter -s <session_id> -e "const { screenshotWithAccessibilityLabels } = require('playwriter'); await screenshotWithAccessibilityLabels(page, { path: '/tmp/a11y.png' });"
```
### Network interception
```bash
playwriter -s <session_id> -e "await page.route('**/api/**', async route => { const res = await route.fetch(); const body = await res.json(); await route.fulfill({ json: { ...body, injected: true } }); });"
```
### Read page content
```bash
playwriter -s <session_id> -e "const text = await page.locator('main').innerText(); console.log(text);"
```
## Tips
- Prefer `getByRole` and `getByLabel` for stable selectors.
- Use accessibility snapshots to discover reliable roles and labels.
- Keep sessions focused: reset or close them if state becomes messy.
- For multi-step flows, store intermediate data on `state`.
© mikeyobrien · MIT · mikeyobrien/ralph-orchestrator
Similar skills
All skills for Browser and scraping →playwriter by other authors comes first.