Command Palette

Search for a command to run...

Назад к скиллам
скилл № 38328

Playwright

Live browser automation via @playwright/cli against a running app, writing snapshots, screenshots, traces, and video to disk; also maintainer update. Use…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Playwright в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Playwright CLI, live browser automation

Wraps Microsoft's @playwright/cli for token-efficient browser automation. Snapshots and screenshots write to disk; only paths come back into context, a substantial token reduction versus Playwright MCP's in-context payloads.

Requires playwright-cli on PATH (npm install -g @playwright/cli; for the current command, upstream's Installation). If it is missing, tell the user to install it rather than substituting a different automation surface.

Latest release, checked at most once a day: !node "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs" latest "${CLAUDE_PLUGIN_ROOT}" --for skill:playwright --data-dir "${CLAUDE_PLUGIN_DATA}" || echo "not checked (node did not run)"

When that line names a newer release or a missing CLI, tell the user once. Add the update hint after this colon when one is set, and nothing when it is empty or still a placeholder: ${user_config.cli_update_hint}

Quick start (90% of use)

playwright-cli -s=<flow> open <url>                  # named session, headless by default
playwright-cli -s=<flow> snapshot                    # writes YAML with element refs (e1, e2, ...)
playwright-cli -s=<flow> click e42                   # interact by ref
playwright-cli -s=<flow> fill e37 "input" --submit   # fill + press Enter
playwright-cli -s=<flow> screenshot --filename=meaningful-name.png
playwright-cli -s=<flow> console                     # summarize console messages
playwright-cli -s=<flow> close                       # tear down

Read the YAML snapshot file directly to locate element refs. Do not dump it into context.

Logged-in sites

The owner keeps one saved login per site, a file named <site>.json (for example github.json) in:

  • Linux and macOS: ${XDG_STATE_HOME:-~/.local/state}/playwright-cli/
  • Windows: %LOCALAPPDATA%\playwright-cli\ ($LOCALAPPDATA/playwright-cli/ from Git Bash)

When a flow targets such a site, load its file right after open. This is the default, not an opt-in:

playwright-cli -s=<flow> open about:blank
playwright-cli -s=<flow> state-load "${XDG_STATE_HOME:-$HOME/.local/state}/playwright-cli/github.json"
playwright-cli -s=<flow> goto https://github.com/<owner>/<repo>

state-load fails before open. A "no such file" error means no saved login: carry on logged out, or ask the owner to save one. Each session loads the file into its own isolated browser, so any number of agents run logged in at once, acting as the owner on that site.

Never run state-save for a shared login, and never read, print, or copy the file, into a repo, a brief, or context: it is the owner's login. To answer "is my saved login still good", load the file in a session and look at the page: a sign-in page means it expired. Never inspect the file for that, cookie names or expiry included. The owner saves and refreshes it with the commands in reference/storage-and-auth.md.

Secret fills

A command that carries a password, token or other secret runs with its output discarded, so the secret never reaches context or a log. What the CLI prints for each command is in the pointer after the helper. Report a failure from its exit status, never from that output. Never put a secret inline in a command you run or print; read it from an environment variable the owner set. For fill, use the helper:

bash "${CLAUDE_SKILL_DIR}/scripts/fill-secret.sh" <flow> e2 E2E_TEST_PASSWORD   # add --submit to press Enter

It reads the named variable, refuses an unset or empty one, discards playwright-cli's output, and passes its exit status through. After a failure, take a snapshot to see the page. A type or run-code that carries a secret gets the same treatment by hand: redirect its stdout and stderr to /dev/null.

Conventions

  • Always use named sessions (-s=<flow>) for multi-step work, with a name unique to this run. Default (unnamed) sessions are hard to isolate when things go sideways, and a shared name collides with another agent driving the same machine
  • close each session the run opened at the end, by name. Don't leave zombie browsers, and don't close sessions the run did not open. close-all and kill-all reach past this run's own sessions, other agents' included (each one's scope: upstream's Sessions), so keep them for recovering from a stuck daemon or socket error (reference/sessions.md)
  • --headed only when the user explicitly wants to observe. On Windows, headed browsers spawn in the backgrou
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Bash(playwright-cli:*)
  2. 02Bash(node "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs" latest "${CLAUDE_PLUGIN_ROOT}" --for skill:playwright --data-dir "${CLAUDE_PLUGIN_DATA}")
  3. 03Bash(node ${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.mjs latest ${CLAUDE_PLUGIN_ROOT} --for skill:playwright --data-dir ${CLAUDE_PLUGIN_DATA})

Вложенные файлы

  • actions/update.md
  • evals/evals.json
  • reference/commands.md
  • reference/network-mocking.md
  • reference/running-code.md
  • reference/sessions.md
  • reference/snapshots-and-refs.md
  • reference/storage-and-auth.md
  • reference/test-generation.md
  • reference/tracing-and-video.md
  • reference/windows-quirks.md
  • scripts/fill-secret.sh
  • scripts/fill-secret.test.sh
  • scripts/force-chrome-foreground.ps1
  • scripts/update.sh
  • scripts/update.test.sh
  • scripts/vendor-update.sh

FAQ

Что делает скилл Playwright?

Live browser automation via @playwright/cli against a running app, writing snapshots, screenshots, traces, and video to disk; also maintainer update. Use when: 'E2E test', 'UI smoke test', 'snapshot the page', console/network checks, mocked responses, or login/auth state files. Not for PR demo videos: /playwright:demo-video.

Как установить скилл Playwright?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Playwright запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить Playwright с