К основному содержанию
скилл CX Codex

playwriter · akillness — скилл для Claude Code: что делает и как установить

Автоматизирует открытый Chrome через Playwriter CLI и MCP, сохраняя текущие куки, расширения и активные сессии. Подойдёт, когда нельзя терять авторизацию.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add akillness/jeo-skills --skill playwriter -a claude-code
Открыть на GitHub

Что делает playwriter

Скилл подключает агента к уже запущенному браузеру Chrome или Chromium вместо создания чистого временного профиля. Это даёт работать со страницами, где пользователь уже вошёл через SSO, passkey или двухфакторную аутентификацию, а также запускать сценарии с установленными расширениями. Для изолированных тестов или задач в CI автор рекомендует переключаться на browser-harness.

Внутри процесс опирается на связку расширения Playwriter и консольной утилиты playwriter. Управление строится по циклу: сначала вызов snapshot({ page }) для получения структуры и атрибутов aria-ref, затем целевое действие через Playwright API, после чего следует повторный снимок. Сессии создаются командой playwriter session new, а для запуска окружения используется playwriter browser start.

Без установленного расширения Playwriter в Chrome и зелёного индикатора подключения на нужной вкладке агент не сможет взаимодействовать со страницей.

Какие задачи решает

  • выполнять действия на сайтах с активной авторизацией и сохранёнными куками
  • передавать агенту управление вкладками без повторного прохождения MFA или SSO
  • взаимодействовать со страницами, требующими установленных расширений Chrome
  • исследовать DOM через snapshot с получением свежих ссылок aria-ref

Примеры запросов агенту

  • Подключись к открытой вкладке через Playwriter и найди кнопку оформления заказа
  • Сделай snapshot текущей страницы в сессии 1 и кликни по элементу с aria-ref=e5
  • Создай новую сессию Playwriter и перейди на https://github.com

Как установить playwriter

1Через Skills CLI (Vercel)

npx skills add akillness/jeo-skills --skill playwriter -a claude-code

2Вручную: положить файлы

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

Папка скилла целиком; для одного проекта — .claude/skills/playwriter/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о playwriter

Как установить playwriter в Claude Code?

Выполните команду npx skills add akillness/jeo-skills --skill playwriter -a claude-code. Конфигурация запишется в файл ~/.claude/skills/playwriter/SKILL.md.

Что нужно подготовить перед запуском playwriter?

Требуются Chrome или Chromium, утилита npm install -g playwriter и установленное расширение Playwriter. Перед началом автоматизации нужно кликнуть по иконке расширения на вкладке и дождаться зелёного статуса.

Чем playwriter отличается от browser-harness?

playwriter работает с текущей сессией и реальным профилем пользователя, сохраняя логины и куки. Для воспроизводимых тестов в изолированном чистом браузере или в CI документация предписывает использовать browser-harness.

Исходный текст

SKILL.md · MIT
---
name: playwriter
description: "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."
license: MIT
compatibility: Requires Chrome/Chromium plus the Playwriter extension and CLI (`npm install -g playwriter` or `npx playwriter@latest`). Works best for local headed browser workflows where reusing the current browser session matters more than CI-grade determinism.
metadata:
  version: 1.1.0
  source: remorses/playwriter
  tags: playwriter, playwright, browser-automation, chrome-extension, mcp, authenticated, stateful, session-reuse
allowed-tools: Read Write Bash Grep Glob
---

# 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

```bash
# install the CLI
npm install -g playwriter
# or use it without global install
npx playwriter@latest --help
```

Install 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:

```bash
# start the managed browser/runtime if needed
playwriter browser start

# create a stateful sandbox session
playwriter session new

# inspect current sessions
playwriter session list
```

Notes:
- `playwriter browser start` can launch Chrome for Testing / Chromium with the Playwriter extension available.
- `playwriter session new` creates a **stateful sandbox** and returns a session id.
- Browser tabs are shared, but session state is isolated.

### Step 3: Observe → act → observe

```bash
# 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-ref` values 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

```bash
playwriter browser start
playwriter session new
playwriter session list
playwriter session reset 1
playwriter session delete 1
```

### Execute Playwright code in a session

```bash
# 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

```bash
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

```json
{
  "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

- `playwriter` is **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 `playwriter` to `browser-harness` or 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](./references/modes-and-routing.md)
- [session-workflow](./references/session-workflow.md)
- [mcp-integration](./references/mcp-integration.md)

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 `playwriter` was 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

© akillness · MIT · akillness/jeo-skills

Похожие скиллы

Все скиллы по теме «Браузер и парсинг» →

Сначала — playwriter от других авторов.

playwriter remorses Скилл управляет открытым Chrome через расширение Playwriter и код Playwright. Пригодится для сайтов с JavaScript, авторизацией и подгружаемым содержимым. CX Codex +1 5 800установок playwriter brianlovin Скилл подключает агента к уже открытому окну Chrome через Playwriter CLI. С ним можно изучать интерфейс, выполнять действия на странице и разбирать ошибки фронтенда. CX Codex +1 2 700установок agent-browser vercel-labs Скилл управляет браузером через CLI: открывает страницы, заполняет формы, нажимает кнопки и проверяет веб-приложения. Подходит для задач, где агенту нужно действовать в интерфейсе. CX Codex +1 1 200 000установок webapp-testing официальный anthropics Скилл запускает проверки локальных веб-приложений через Playwright: помогает отлаживать UI, делать скриншоты и смотреть логи браузера. 186 758установок computer-use stablyai Скилл ведёт видимое окно приложения через orca computer: читает дерево доступности, кликает, печатает и снимает скриншоты. Нужен, когда задача упирается в интерфейс. CX Codex +1 239 600установок browser-use browser-use Даёт агенту живой Chrome через CDP: клики, ввод, скриншоты и страницы, которым нужен JS или ваша логин-сессия. CX Codex +1 98 200установок playwright-cli microsoft Скилл, который даёт агенту браузер: открыть страницу, кликнуть по элементу, снять снимок и разобрать тесты Playwright. CX Codex +1 195 700установок last30days mvanhorn Собирает посты и реакции по любой теме за последние 30 дней из Reddit, X, YouTube, TikTok, Hacker News, Polymarket, GitHub и веба. Пригодится, когда нужно понять, что реально говорят люди, а не что пишут в обзорах. CX Codex +1 53 000установок

Из того же набора65

genkit Помогает спроектировать интеграцию Firebase AI: выбрать прямой клиентский SDK или вынести логику в серверные цепочки Genkit. CX Codex +1 347установок vercel-deploy Скилл управляет деплоем проектов в Vercel: создаёт preview, публикует production, настраивает домены и помогает откатить неудачный релиз. CX Codex +1 347установок game-performance-profiler Разбирает жалобы на время кадра в Unity и Unreal: какой пакет данных доверять, где узкое место и какой замер сделать следующим. CX Codex +1 345установок react-grab Скилл учит агента забирать контекст выбранного React-элемента из живого браузера: имя компонента, файл, строку и HTML. Пригодится, когда правку нужно делать по реальному DOM, а не по догадкам. CX Codex +1 344установок fabric Скилл для запуска повторяемых именованных преобразований текста через Fabric CLI: саммари, извлечение идей, объяснение кода. Пригодится, когда один и тот же прогон нужен снова и снова. CX Codex +1 342установок steam-store-launch-ops Скилл помогает инди-разработчикам структурировать подготовку к релизу в Steam, аудит страницы и участие в Next Fest. Превращает хаос перед запуском в краткий план действий. CX Codex +1 337установок scrapling Направляет задачи парсинга сайтов по самому легковесному пути: от разбора сырого HTML до эмуляции браузера и обхода защиты. Помогает экономить ресурсы агента при веб-скрейпинге. CX Codex +1 335установок bmad Разбирает текущее состояние проекта и подсказывает, какой артефакт или фаза BMAD идут следующими. Полезен, когда непонятно, что делать после заметок, PRD или черновика архитектуры. CX Codex +1 334установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой