Skip to main content
AI/MLTechNickAI

playwright-browser

Use when automating browsers, testing pages, taking screenshots, checking UI, verifying login flows, or testing responsive behavior

Stars
23
Source
TechNickAI/ai-coding-config
Updated
2026-05-20
Slug
TechNickAI--ai-coding-config--playwright-browser
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/TechNickAI/ai-coding-config/HEAD/plugins/core/skills/playwright-browser/SKILL.md -o .claude/skills/playwright-browser.md

Drops the SKILL.md into .claude/skills/playwright-browser.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Browser automation via Playwright. Write scripts, execute via run.js. Write Playwright code to /tmp, execute from skill directory:
node $SKILL_DIR/run.js /tmp/playwright-task.js

For inline code (variables are auto-injected, see below):

node $SKILL_DIR/run.js "const b = await chromium.launch(); const p = await b.newPage(); await p.goto('http://localhost:3000'); console.log(await p.title()); await b.close();"

$SKILL_DIR is where you loaded this file from.

Default: headless (invisible, less intrusive).

Use { headless: false } when user wants to see the browser. You know when that is.

Screenshots to /tmp. Use `slowMo: 100` for debugging. For inline code, these are available:
  • BASE_URL - from PLAYWRIGHT_BASE_URL env var
  • CI_ARGS - browser args for CI (['--no-sandbox', '--disable-setuid-sandbox'])
  • EXTRA_HEADERS - from PW_HEADER_NAME/VALUE or PW_EXTRA_HEADERS
  • chromium, firefox, webkit, devices - from playwright

Example:

node $SKILL_DIR/run.js "
const browser = await chromium.launch({ args: CI_ARGS });
const page = await browser.newPage();
await page.goto(BASE_URL || 'http://localhost:3000');
console.log(await page.title());
await browser.close();
"
run.js auto-installs Playwright on first use. No manual setup needed. For network mocking, auth persistence, multi-tab, downloads, video, traces: [API_REFERENCE.md](API_REFERENCE.md)