playwright
Skill4 starsChanged 4 months agoMITView on GitHub
Complete browser automation and testing with Playwright. Four modes: CLI tool (playwright-cli commands for interactive browser control), JS script-based automation (write JS to /tmp, execute via run.js with dev server auto-detection), Python automation (with_server.py for server lifecycle management, reconnaissance-then-action pattern), and UI test suites (15 categories, 482 test cases covering forms, a11y, responsive, security, performance, SEO, UX). Use for web testing, form filling, screenshots, data extraction, responsive design validation, accessibility audits, and any browser automation task.
55 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- hmjBill/skillstheir own version, first seen Oct 5, 2026
- fmind/dottheir own version, first seen Oct 5, 2026
- hencter/hencte.toptheir own version, first seen Oct 4, 2026
- HanksChen0110/skillstheir own version, first seen Oct 3, 2026
- hahuyhungdev/ai-coding-configtheir own version, first seen Oct 2, 2026
- Enjoyoer/loadouttheir own version, first seen Sep 30, 2026
Used with
Projects with it also use doc, web-perf 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.
JetBrainsSkilldoc
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
OpenAISkillweb-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
CloudflareSkillturnstile-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
CloudflareSkillcloudflare-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
kayamanSkilledit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Also in 4 projects that use this
OpenAISkilldurable-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
Other versions55 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- bolasblack/claude-skills★ 411% same
Wrote their own version · 54
- openai/openai-agents-python★ 30ksame name
- openai/skills★ 28ksame name
- freestylefly/wesight★ 941same name
- JetBrains/skills★ 360same name
- Mindrally/skills★ 266same name
- alexeykrol/claude-code-starter★ 194same name
- kandada/aacode★ 134same name
- magnus919/agent-skills★ 109same name
- matyasstoch/david-skills★ 59same name
- letitbk/claude-academic-setup★ 46same name
44 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository162 other files it gives its agents.
- agents/AGENTS.mdAGENTS.md
- skills/compound-engineering/AGENTS.mdAGENTS.md
- skills/trailofbits-security/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
- skills/compound-engineering/CLAUDE.mdCLAUDE.md
- skills/trailofbits-security/CLAUDE.mdCLAUDE.md
- app-store-reviewSkill
- advanced-javascriptSkill
- ai-native-uiSkill
- anime-jsSkill
- app-l100Skill
- barba-jsSkill
- brand-guidelinesSkill
- cinematic-web-engineSkill
- codebase-knowledge-graphSkill
- crossplatform-monorepoSkill
- css-first-uiSkill
- design-auditSkill
- design-critiqueSkill
- dev-cycleSkill
- device-hardware-bridgeSkill
- discovery-docSkill
- docxSkill
- edge-intelligenceSkill
- graph-aware-reviewSkill
- linkedin-posterSkill
- local-first-architectureSkill
- modern-build-pipelineSkill
- motion-nativeSkill
- nano-bananaSkill
- pptxSkill
- project-initSkill
- remotionSkill
- sensory-nativeSkill
- spline-3dSkill
- streaming-cacheSkill
- tanstack-ecosystemSkill
- design-taste-frontendSkill
- tauri-desktopSkill
- threejsSkill
- transition-nativeSkill
- ui-design-stackSkill
- visual-nativeSkill
- web-l100Skill
- web-platform-apisSkill
- xlsxSkill
- better-authSkill
- claude-real-videoSkill
- clone-websiteSkill
- css-keyframe-animationsSkill
- design-checkSkill
- design-dnaSkill
- design-polishSkill
- drizzle-neonSkill
- fastlaneSkill
- angular-architectSkill
- api-designerSkill
- architecture-designerSkill
- atlassian-mcpSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 131
After each command, playwright-cli provides a page state snapshot (YAML).
- Very specific: line 149
Write custom Playwright scripts, execute via run.js.
- Distinctive: line 259
Write native Python Playwright scripts for testing local web applications.
- Very specific: line 323
Common pitfall: Don't inspect DOM before networkidle on dynamic apps.
- Very specific: line 371
All results saved to test-results/<skill-name>/<timestamp>/:
“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.
Files
Playwright — Browser Automation & Testing
Four complementary modes for browser automation: CLI commands, JS scripts, Python automation, and UI test suites.
Table of Contents
- CLI Commands (playwright-cli)
- Script-Based Automation (JS)
- Python Automation
- UI Test Suites
CLI Commands
Interactive browser control via playwright-cli.
Quick Start
playwright-cli open
playwright-cli goto https://playwright.dev
playwright-cli click e15
playwright-cli type "page.click"
playwright-cli press Enter
playwright-cli screenshot
playwright-cli closeCore Commands
playwright-cli open [url] # Open browser (optionally navigate)
playwright-cli goto <url> # Navigate to URL
playwright-cli click e3 # Click element by ref
playwright-cli dblclick e7 # Double-click
playwright-cli fill e5 "text" # Fill input field
playwright-cli type "text" # Type text
playwright-cli select e9 "value" # Select option
playwright-cli upload ./file.pdf # Upload file
playwright-cli check e12 # Check checkbox
playwright-cli uncheck e12 # Uncheck checkbox
playwright-cli hover e4 # Hover element
playwright-cli drag e2 e8 # Drag and drop
playwright-cli snapshot # Capture page state
playwright-cli eval "document.title" # Execute JS
playwright-cli close # Close browserNavigation & Keyboard
playwright-cli go-back | go-forward | reload
playwright-cli press Enter | ArrowDown | Tab
playwright-cli keydown Shift | keyup ShiftMouse
playwright-cli mousemove 150 300 | mousedown | mouseup
playwright-cli mousewheel 0 100Screenshots & PDF
playwright-cli screenshot [element-ref] [--filename=page.png]
playwright-cli pdf --filename=page.pdfTabs
playwright-cli tab-list | tab-new [url] | tab-close [index] | tab-select <index>Storage (Cookies, LocalStorage, SessionStorage)
# Cookies
playwright-cli cookie-list [--domain=] | cookie-get <name> | cookie-set <name> <value> | cookie-delete <name> | cookie-clear
# LocalStorage
playwright-cli localstorage-list | localstorage-get <key> | localstorage-set <key> <value> | localstorage-delete <key> | localstorage-clear
# SessionStorage
playwright-cli sessionstorage-list | sessionstorage-get <key> | sessionstorage-set <key> <value> | sessionstorage-delete <key> | sessionstorage-clear
# State save/load
playwright-cli state-save [file.json] | state-load <file.json>Network Mocking
playwright-cli route "**/*.jpg" --status=404
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
playwright-cli route-list | unroute [pattern]DevTools
playwright-cli console [level] | network
playwright-cli run-code "async page => ..."
playwright-cli tracing-start | tracing-stop
playwright-cli video-start | video-stop <file.webm>Browser Sessions
playwright-cli open --browser=chrome|firefox|webkit|msedge
playwright-cli open --persistent | --profile=/path
playwright-cli -s=mysession open url --persistent
playwright-cli list | close-all | kill-allSnapshots
After each command, playwright-cli provides a page state snapshot (YAML). Use --filename= for workflow artifacts.
CLI References
| Topic | File |
| Request Mocking | references/request-mocking.md |
| Running Code | references/running-code.md |
| Session Management | references/session-management.md |
| Storage State | references/storage-state.md |
| Test Generation | references/test-generation.md |
| Tracing | references/tracing.md |
| Video Recording | references/video-recording.md |
Script-Based Automation
Write custom Playwright scripts, execute via run.js. Auto-detects dev servers.
Path: This skill directory is $SKILL_DIR (e.g., ~/.claude/skills/playwright).
Critical Workflow
- Auto-detect dev servers FIRST (for localhost testing):
cd $SKILL_DIR && node -e "require('./lib/helpers').detectDevServers().then(s => console.log(JSON.stringify(s)))" - Write scripts to
/tmp— NEVER to skill directory or project - Use visible browser by default —
headless: false - Parameterize URLs —
const TARGET_URL = 'http://localhost:3001';
Setup (First Time)
cd $SKILL_DIR && npm run setupExecution Pattern
# Write script to /tmp, then execute:
cd $SKILL_DIR && node run.js /tmp/playwright-test-page.js
# Inline execution for quick tasks:
cd $SKILL_DIR && node run.js "
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
await page.goto('http://localhost:3001');
await page.screenshot({ path: '/tmp/screenshot.png', fullPage: true });
await browser.close();
"Common Patterns
Responsive test:
// /tmp/playwright-test-responsive.js
const { chromium } = require('playwright');
const TARGET_URL = 'http://localhost:3001';
(async () => {
const browser = await chromium.launch({ headless: false, slowMo: 100 });
const page = await browser.newPage();
const viewports = [
{ name: 'Desktop', width: 1920, height: 1080 },
{ name: 'Tablet', width: 768, height: 1024 },
{ name: 'Mobile', width: 375, height: 667 },
];
for (const vp of viewports) {
await page.setViewportSize({ width: vp.width, height: vp.height });
await page.goto(TARGET_URL);
await page.screenshot({ path: `/tmp/${vp.name.toLowerCase()}.png`, fullPage: true });
}
await browser.close();
})();Login flow:
// /tmp/playwright-test-login.js
const { chromium } = require('playwright');
const TARGET_URL = 'http://localhost:3001';
(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
await page.goto(`${TARGET_URL}/login`);
await page.fill('input[name="email"]', 'test@example.com');
await page.fill('input[name="password"]', 'password123');
await page.click('button[type="submit"]');
await page.waitForURL('**/dashboard');
console.log('Login successful');
await browser.close();
})();Available Helpers
const helpers = require('./lib/helpers');
const servers = await helpers.detectDevServers();
await helpers.safeClick(page, 'button.submit', { retries: 3 });
await helpers.safeType(page, '#username', 'testuser');
await helpers.takeScreenshot(page, 'test-result');
await helpers.handleCookieBanner(page);
const data = await helpers.extractTableData(page, 'table.results');Custom HTTP Headers
PW_HEADER_NAME=X-Automated-By PW_HEADER_VALUE=playwright-skill \
cd $SKILL_DIR && node run.js /tmp/my-script.js
PW_EXTRA_HEADERS='{"X-Automated-By":"playwright-skill","X-Debug":"true"}' \
cd $SKILL_DIR && node run.js /tmp/my-script.jsAdvanced API
See API_REFERENCE.md for selectors, network interception, auth, visual regression, mobile emulation, performance testing, debugging, and CI/CD.
Python Automation
Write native Python Playwright scripts for testing local web applications. Includes server lifecycle management.
Decision Tree
User task → Is it static HTML?
├─ Yes → Read HTML file directly to identify selectors
│ ├─ Success → Write Playwright script using selectors
│ └─ Fails/Incomplete → Treat as dynamic (below)
└─ No (dynamic webapp) → Is the server already running?
├─ No → Use with_server.py (see below)
└─ Yes → Reconnaissance-then-action:
1. Navigate and wait for networkidle
2. Take screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectorsServer Lifecycle (with_server.py)
Manages starting/stopping dev servers automatically. Run --help first:
python lib/with_server.py --helpSingle server:
python lib/with_server.py --server "npm run dev" --port 5173 -- python /tmp/my_automation.pyMultiple servers (backend + frontend):
python lib/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python /tmp/my_automation.pyPython Script Pattern
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto('http://localhost:5173')
page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS
# ... automation logic
browser.close()Reconnaissance-Then-Action
- Inspect rendered DOM:
page.screenshot(path='/tmp/inspect.png', full_page=True) content = page.content() page.locator('button').all() - Identify selectors from inspection results
- Execute actions using discovered selectors
Common pitfall: Don't inspect DOM before networkidle on dynamic apps.
Python Examples
Available in examples/:
element_discovery.py— Discovering buttons, links, inputs on a pagestatic_html_automation.py— Usingfile://URLs for local HTMLconsole_logging.py— Capturing console logs during automation
UI Test Suites
15 test categories with ~482 total test cases. Sub-skills in test-suites/.
Category A: UI Functional Testing
| Skill | Command | Tests | Description |
| Form Testing | /test-forms <url> | 27 | Form validation, input handling, submit states |
| Accessibility | /test-a11y <url> | 40 | WCAG 2.1 AA+ compliance |
| Responsive | /test-responsive <url> | 72 | Multi-viewport responsive design |
| User Flows | /test-flows <url> | 30 | Auth, navigation, SPA behavior |
| Cross-Browser | /test-cross-browser <url> | 30 | Chromium, Firefox, WebKit consistency |
| Security | /test-security <url> | 55 | OWASP+ vulnerability detection |
| Performance | /test-perf <url> | 25 | Core Web Vitals, runtime perf |
| SEO | /test-seo <url> | 27 | Meta tags, structured data, crawlability |
| UI States | /test-states <url> | 35 | Loading, empty, error, overlay states |
| Links | /test-links <url> | 23 | Link integrity, broken links |
| Regression | /test-regression <url> | 8 | Baseline comparison, structural diff |
Category B: UX Design Quality
| Skill | Command | Tests | Description |
| Heatmap | /test-heatmap <url> | 24 | Attention prediction, visual hierarchy |
| UX Writing | /test-ux-writing <url> | 26 | Micro-copy quality, CTA effectiveness |
| Consistency | /test-consistency <url> | 30 | Design system consistency audit |
| Conversion | /test-conversion <url> | 30 | Conversion optimization, cognitive load |
Full Suite
/test-all <url> # Runs all 15 skills in phased parallel executionOutput
All results saved to test-results/<skill-name>/<timestamp>/:
report.md— Pass/fail with severity and fix suggestionsscreenshots/— Visual evidencesnapshots/— Accessibility tree capturestraces/— Playwright execution tracesvideos/— Recorded flows
UI Testing References
| Topic | File |
| Common Setup | references/ui-testing-common-setup.md |
| Evidence Capture | references/ui-testing-evidence-capture.md |
| Report Format | references/ui-testing-report-format.md |
Tips
- CRITICAL: Detect servers FIRST for localhost testing
- Write test files to
/tmp— never clutter skill dir or project - Default: visible browser —
headless: falseunless user requests headless - Parameterize URLs —
TARGET_URLconstant at top of every script - Wait strategies — Use
waitForURL,waitForSelector,waitForLoadStateover fixed timeouts - slowMo: 100 — Makes actions visible for debugging
- Error handling — Always use try-catch for robust automation
Troubleshooting
# Playwright not installed
cd $SKILL_DIR && npm run setup
# Module not found — ensure running from skill dir via run.js
# Browser doesn't open — check headless: false, ensure display available
# Element not found — add wait: page.waitForSelector('.el', { timeout: 10000 })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
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.

