agentleFS
RoentekRoentek/Claude_Code_Boilerplate_Framework/.claude/skills/playwright/SKILL.md

playwright

Skill4 starsChanged 6 months agoMITView on GitHub

Browser automation via Playwright CLI — screenshots, scraping JS-rendered pages, PDF generation, link extraction. Runs directly via Bash (no MCP server, no token overhead).

  • Installs packages

94 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use develop-web-game, msw and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • hebertzhuSkill

    develop-web-game

    Use when building or iterating on a web game and you need a tight implement-test-observe loop; prefer the bundled Playwright client, inspect screenshots and text state, and validate every meaningful change before moving on.

    Also in 4 projects that use this

  • thongdn-itSkill

    msw

    MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.

    Also in 3 projects that use this

  • SupabaseSkill

    react-hook-form

    Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,

    Also in 3 projects that use this

  • thongdn-itSkill

    tailwind

    Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.

    Also in 5 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 6 projects that use this

  • OpenAISkill

    web-perf

    Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

    Also in 5 projects that use this

  • +1 more from thongdn-it

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 81 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run node tools/playwright.js directly via Bash.

    line 8
  2. Distinctive:

    All commands write JSON to stdout.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 81 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Playwright Browser Automation

Run node tools/playwright.js directly via Bash. All commands output JSON. No MCP server required.

Prerequisites (run once per machine)

npm install

Uses your system Chrome or Edge — no separate browser download needed. Falls back to Playwright's bundled Chromium automatically if neither is found (e.g. CI).

Decision: Which Tool to Use

NeedTool
Screenshot any URLnode tools/playwright.js screenshot
Scrape JS-rendered pagenode tools/playwright.js scrape
Generate PDF from URLnode tools/playwright.js pdf
Extract all page linksnode tools/playwright.js links
Quick one-off screenshot (no install)npx playwright screenshot <url> <file>
Large-scale scraping (1000+ pages)Apify MCP
Static HTML / REST API contentTavily MCP or curl
localhost screenshots (frontend dev)node screenshot.mjs (see frontend-instructions.md)

Commands

screenshot

node tools/playwright.js screenshot <url> [output-path] [--fullpage] [--headed] [--wait-for <selector>] [--timeout <ms>]
  • Default output: .tmp/screenshot.png
  • --fullpage — capture full scrollable page, not just viewport
  • --wait-for — wait for a CSS selector to appear before capturing
node tools/playwright.js screenshot https://example.com .tmp/example.png
node tools/playwright.js screenshot https://example.com .tmp/full.png --fullpage
node tools/playwright.js screenshot https://app.example.com .tmp/app.png --wait-for "#dashboard"

scrape

node tools/playwright.js scrape <url> [--selector <css>] [--headed] [--wait-for <selector>] [--timeout <ms>]
  • Without --selector: returns { title, url, text, metaDescription } for the whole page
  • With --selector: returns array of { text, html, href } per matched element
# Full page text
node tools/playwright.js scrape https://example.com

# Specific elements
node tools/playwright.js scrape https://example.com --selector "h2"
node tools/playwright.js scrape https://store.example.com --selector ".product-name" --wait-for ".product-name"

pdf

node tools/playwright.js pdf <url> [output-path] [--format <A4|Letter>] [--headed] [--timeout <ms>]
  • Default output: .tmp/output.pdf
node tools/playwright.js pdf https://example.com .tmp/report.pdf
node tools/playwright.js pdf https://example.com .tmp/report.pdf --format Letter

links

node tools/playwright.js links <url> [--headed] [--timeout <ms>]

Returns array of { text, href } for all external links on the page.

node tools/playwright.js links https://example.com

Output Handling

All commands write JSON to stdout. Save or inspect:

# Save to file
node tools/playwright.js scrape https://example.com > .tmp/data.json

# Pretty-print
node tools/playwright.js scrape https://example.com | python -m json.tool

Screenshots: after saving, use the Read tool to visually inspect the PNG.

Quick CLI (no npm install needed)

npx playwright screenshot https://example.com .tmp/screenshot.png
npx playwright screenshot --full-page https://example.com .tmp/full.png
npx playwright pdf https://example.com .tmp/output.pdf

Error Handling

ErrorFix
Cannot find module 'playwright'Run npm install
Executable doesn't exist (after fallback)Run npx playwright install chromium (CI / no system Chrome)
net::ERR_NAME_NOT_RESOLVEDURL typo or site is down
TimeoutIncrease --timeout 60000 or add --wait-for

WAT Integration

For multi-step automation tasks, follow workflows/browser-automation.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.