Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mikeyobrien/ralph-orchestrator --skill playwriter -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/playwriter/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/playwriter/

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.

playwriter remorses This skill controls the user's open Chrome through the Playwriter extension and runs Playwright snippets. Use it on JavaScript-heavy pages or sites that require login. CX Codex +1 5,800installs playwriter brianlovin This skill connects an agent to the Chrome tab you already have open through the Playwriter CLI. Use it to inspect live UI, run page actions, or reproduce a frontend bug. CX Codex +1 2,700installs playwriter akillness Connects agents to a running Chrome session via Playwriter CLI and MCP, keeping existing logins, cookies, and extensions. Useful when auth state matters. CX Codex +1 344installs agent-browser vercel-labs A CLI skill for browser control: it opens pages, fills forms, clicks buttons, and tests web apps. Use it when an agent needs to act inside a website. CX Codex +1 1,200,000installs webapp-testing official anthropics This skill tests local web apps with Playwright, helping agents debug UI behavior, capture screenshots, and inspect browser logs. 186,758installs computer-use stablyai This skill drives a visible app window through orca computer: accessibility tree, clicks, typing, screenshots. Reach for it when the job sits behind a GUI. CX Codex +1 239,600installs browser-use browser-use Hands the agent a real Chrome over CDP: clicks, typing, screenshots, and pages that need JS or your logged-in session. CX Codex +1 98,200installs playwright-cli microsoft A skill that hands your agent a browser: open a page, click elements, grab a snapshot, and work with Playwright tests. CX Codex +1 195,700installs last30days mvanhorn Pulls posts and engagement on any topic from the last 30 days across Reddit, X, YouTube, TikTok, Hacker News, Polymarket, GitHub and the web. Useful when you want what people actually said, not what a blog summarized. CX Codex +1 53,000installs

From the same set16

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor