claude/ai-resources-plugin/skills/browser-automation/SKILL.md
Automate browser interaction with Playwright: open pages, take screenshots, verify UI, test flows, debug pages, inspect elements.
npx skillsauth add amhuppert/my-ai-resources browser-automationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Route the request to the right tool and let the dedicated skill drive the interaction. This file does not teach Playwright usage — it picks the tool, ensures the right skill is installed, and hands off.
Pick one based on the use case:
| Use case | Tool | Where to go |
|----------|------|-------------|
| Interactive automation, debugging a running app, ad-hoc verification | Playwright CLI | The official playwright-cli skill (see Setup) |
| Running an existing Playwright test suite | npx playwright test | Official playwright-cli skill → references/playwright-tests.md |
| Generating new test code from a recorded session | npx playwright codegen | Official playwright-cli skill → references/test-generation.md |
| MCP-only client (Claude Desktop, Cursor) where shell isn't an option, or a single quick interaction where launching the CLI isn't worth it | Playwright MCP (fallback) | references/playwright-mcp-reference.md |
Default to the CLI. Microsoft's own guidance: coding agents are better served by CLI + skills than by MCP. CLI saves snapshots to disk instead of streaming them into context (~4× fewer tokens per session) and avoids the ~3,400-token MCP tool-schema overhead on every message. See references/token-optimization.md for the full breakdown.
Use MCP only when no shell/filesystem is available, or for a one-shot interaction where setup overhead beats the per-action token savings.
The Playwright CLI ships its own Claude Code skill (playwright-cli) — the canonical, always-up-to-date command reference plus task playbooks (test running, request mocking, tracing, video recording, storage state, spec-driven testing, element-attribute inspection, session management). This skill never duplicates that content. It either defers to the official skill or installs it.
# Is the binary on PATH?
which playwright-cli || npx --no-install playwright-cli --version
# Is the skill installed (project-level or user-level)?
test -f .claude/skills/playwright-cli/SKILL.md && echo "project skill installed"
test -f ~/.claude/skills/playwright-cli/SKILL.md && echo "user skill installed"
Install without asking — Alex always wants the official skill present:
# Install the global binary if `which playwright-cli` failed
npm install -g @playwright/cli@latest
# Scaffold .playwright/ workspace, install default browser,
# and copy the skill to ./.claude/skills/playwright-cli/
playwright-cli install --skills
Briefly state what was installed (binary + skill path) so Alex can see it.
After install, all CLI command reference and patterns come from the official playwright-cli skill. Do not invent commands, paraphrase its content here, or fall back to memory. Read its SKILL.md and the relevant references/*.md for the task at hand.
If you find yourself wanting to add CLI command examples to this skill, stop — the right place is upstream (the official skill) or, for our own router-level concerns, in references/token-optimization.md.
For sessions involving more than a few interactions, delegate to a subagent. The Playwright maintainer recommends this pattern explicitly: each subagent gets its own context loop, so browser snapshots and intermediate state accumulate there instead of in the main conversation.
"Use a subagent to: navigate to http://localhost:3000/settings,
verify the theme toggle exists, click it, confirm dark mode applies.
Report back pass/fail."
When browser automation reveals unexpected behavior — console errors, wrong UI state, failed interactions — combine Playwright with the web-debugger skill for runtime inspection:
get_logs to check structured app logs (browser + server)get_snapshot to inspect application state at the failure pointSee the web-debugger skill for full tool reference.
Watch for inefficiency or struggle:
eval or direct URLs would sufficeSurface concrete suggestions to Alex after the immediate task. For CLI command gaps, the fix is upstream in the official playwright-cli skill, not here. For routing, MCP, or token-economics gaps, propose specific edits to this skill or its references.
references/playwright-mcp-reference.md — MCP setup, full tool catalog, configuration flags, and patterns. Use only when CLI isn't an option.references/token-optimization.md — Token cost analysis, per-tool optimization patterns, architecture-level decisions.development
Debug a running web app via the web-debugger SDK: app logs, application state, runtime snapshots, React state, query cache.
development
Thoroughly understand a software development objective before implementation: research, identify ambiguities, ask clarifying questions. Use before starting implementation of a non-trivial or ambiguously specified feature, or when requirements leave open design decisions.
development
Locate the on-disk Claude Code transcript file (.jsonl under ~/.claude/projects/) for the current or a specified conversation.
development
Reflect on codebase navigation effectiveness at end of conversation. Surfaces dead ends, inefficiencies, missing context. Does not write files — pair with /kiro:steering-custom to persist.