Skip to content

About

Playwright browser utility and skill for Claude Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

BrowserUtility

A Playwright browser for Claude Code, packaged as a skill.

  • bin/pw (bin/pw.cmd on Windows shells) wraps Microsoft's @playwright/cli. It gives you a live, named browser session that you drive one command at a time (open, snapshot, click, fill, screenshot, console, requests, …). It's pinned to the repo's bundled Chromium, and its output goes to .out/.
  • bin/run.mjs is a one-shot script runner. A script default-exports async ({ page, context, browser, playwright, args, out }) => result. The runner launches the browser, runs the script, prints the result as JSON and closes the browser. Scripts don't import Playwright, so they can live anywhere.
  • bin/ytdl (bin/ytdl.cmd on Windows shells) wraps a standalone yt-dlp build in vendor/ for downloading video and audio. Downloads go to .out/downloads/. It needs ffmpeg on PATH for merging and converting (winget install ffmpeg / brew install ffmpeg).
  • skills/browser/ is the Claude Code skill. It explains when to use each tool and includes Microsoft's official playwright-cli docs in reference/.

Setup

npm run setup          # npm ci + download the CLI's Chromium build + sync reference docs + download yt-dlp
npm run install-skill  # junction skills/browser -> ~/.claude/skills/browser
npm run smoke          # end-to-end check via run.mjs

Requires Node 18+. The skill's paths assume the repo lives at D:/BrowserUtility.

Upgrading Playwright

playwright is pinned to the exact version @playwright/cli depends on, so only one Playwright install and one Chromium build are needed. To upgrade:

npm view @playwright/cli dependencies   # find its playwright version
npm install --save-exact @playwright/cli@<new> playwright@<matching>
npm run setup

Prior art

  • microsoft/playwright-cli: the official agent CLI and skill. The pw tool here builds on it.
  • lackeyjb/playwright-skill: a skill where the agent writes Playwright scripts and runs them through run.js. It inspired run.mjs.
  • microsoft/playwright-mcp: an MCP server for the same features. The CLI and skill approach uses fewer tokens, because snapshots are saved to files instead of being included in every response.

About

Playwright browser utility and skill for Claude Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages