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

playwright

Skill4 starsChanged 7 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

55 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use doc, web-perf and 5 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.
  • JetBrainsSkill

    doc

    Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.

    Also in 5 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 4 projects that use this

  • CloudflareSkill

    turnstile-spin

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    Also in 3 projects that use this

  • CloudflareSkill

    cloudflare-one

    Design, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors.

    Also in 3 projects that use this

  • OpenAISkill

    durable-objects

    Create and review Cloudflare Durable Objects. Use when building stateful coordination (chat rooms, multiplayer games, booking systems), implementing RPC methods, SQLite storage, alarms, WebSockets, or reviewing DO code for best practices. Covers Workers integration, wrangler config, and testing with Vitest. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

    Also in 3 projects that use this

  • +2 more from openai

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 50 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 50 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.