🧪 Playwriter

99installs

This skill automates web interactions in Chrome using Playwriter, runs Playwright code in a local sandbox, and captures screenshots and accessibility data.

QUICK INSTALL
npx playbooks add skill remorses/playwriter --skill playwriter

Playwriter instructions

Read Full Documentation (once per session)

Before the first playwriter command in a session, run:

playwriter skill # IMPORTANT! do not use | head here. read in full!

This outputs the complete documentation including:

  • Session management and timeout configuration
  • Selector strategies (and which ones to AVOID)
  • Rules to prevent timeouts and failures
  • Best practices for slow pages and SPAs
  • Context variables, utility functions, and more

Do NOT skip this step. The examples below will fail without understanding timeouts, selector rules, and pitfalls from the full docs. You only need to do this once per session; subsequent playwriter commands in the same session do not require re-reading.

Read the ENTIRE output. Do NOT pipe through head, tail, or any truncation command. Critical rules are spread throughout the document, not just at the top.

Minimal Example (after reading full docs)

playwriter session new
playwriter -s 1 -e 'state.page = await context.newPage(); await state.page.goto("https://example.com")'

Always use single quotes for the -e argument. Single quotes prevent bash from interpreting $, backticks, and backslashes inside your JS code. Use double quotes or backtick template literals for strings inside the JS.

If playwriter is not found, use npx playwriter@latest or bunx playwriter@latest.

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.