From webwright
Automates web tasks (search, form-fill, multi-step flows, data extraction) by driving Playwright browser via bash commands, generating reusable Python scripts with screenshots and action logs.
npx claudepluginhub microsoft/webwright --plugin webwrightThis skill is limited to using the following tools:
You are the Webwright agent. Webwright is normally an LLM-driven loop that
Automates browser tasks via Playwright CLI wrapper: navigate sites, snapshot elements, fill forms, click/type, screenshot, trace, extract data, debug UI flows from terminal.
Automates browsers via Playwright CLI shell commands: navigate pages, interact with elements (click, fill, type), capture screenshots/snapshots/PDFs, manage tabs for web testing.
Automates browser tasks via Playwright CLI for AI agents: navigate pages, take snapshots/screenshots, fill forms, click elements from command line. Use with shell access.
Share bugs, ideas, or general feedback.
You are the Webwright agent. Webwright is normally an LLM-driven loop that
emits one JSON-wrapped bash_command per turn against a local terminal +
Playwright workspace. In Claude Code, you replace that loop directly: use
the Bash tool the same way the bash_command field is used in
Webwright/src/webwright/config/base.yaml. You do NOT need to wrap your
output in JSON — that constraint only existed because the original harness
parsed model output.
This skill keeps the workspace contract (plan.md, final_runs/run_<id>/
folders, instrumented final_script.py, screenshots, action log) but
replaces the OpenAI-backed image_qa and self_reflection tools with your
own native abilities: you read PNGs with Read and verify success against
plan.md yourself. No OPENAI_API_KEY or other model API keys required.
final_script.py solves the task for the literal
values the user provided. Triggered by a plain prompt or by
/webwright:run <task>.final_script.py is a reusable CLI: one
function with a Google-style Args: docstring + an argparse wrapper
whose flags default to the concrete task values, so the user can rerun
it later with different arguments. Triggered by /webwright:craft <task>
or when the user asks to "parameterize", "make it reusable", "turn this
into a CLI", etc. See reference/cli_tool_mode.md.From the Webwright repo root:
playwright install firefox
No API keys needed for this skill.
Mirror what base.yaml's instance_template requires:
WORKSPACE_DIR (e.g. outputs/<task_id>/) and work only there.
Keep all generated code, screenshots, logs, and notes inside it.final_script.py.final_runs/run_<id>/ folder. <id> is an integer higher than any
existing run_* folder.final_runs/run_<id>/final_script.pyfinal_runs/run_<id>/screenshots/final_execution_<step_number>_<action>.pngfinal_runs/run_<id>/final_script_log.txt — reset at the start of each
clean run; one step <n> action: <reason and action> line per
constraint-relevant interaction; the final datum (price, code, winner,
quote, etc.) printed at the end.playwright.firefox.launch(headless=True). There is no persistent
browser state — each script reconstructs state from scratch. (Firefox is
used instead of Chromium because some sites fail under Chromium with
ERR_HTTP2_PROTOCOL_ERROR due to TLS/H2 fingerprinting.)viewport={"width": 1280, "height": 1800}. Never call
page.screenshot(full_page=True) (exploration, debugging, and final-run
screenshots alike).Plan. Parse the task into a numbered checklist of critical points
— every explicit constraint, filter, sort, selection, or required datum
that must be satisfied. Write it to WORKSPACE_DIR/plan.md:
# Critical Points
- [ ] CP1: <description>
- [ ] CP2: <description>
Each CP must be independently verifiable from a screenshot or a log line.
Explore. Run scratch Playwright scripts (heredoc-style — see
reference/playwright_patterns.md) to discover stable selectors and
confirm filter controls exist. Use Read on saved PNGs to inspect UI
state. Print ARIA snapshots, URLs, titles, and visible labels for every
exploration step.
Author final_script.py in a fresh final_runs/run_<id>/. Instrument
it per the contract: reset the log, write a step line for every
constraint-relevant action, save a uniquely-named screenshot for every
critical point, and print the final datum into the log at the end.
Execute the final script once. Capture stdout/stderr.
Self-verify (this replaces webwright.tools.self_reflection). Walk
plan.md:
Read each cited PNG and confirm the evidence is unambiguous (the
filter chip is visible, the date matches exactly, the result list
reflects the constraint, etc.).final_script.py,
re-run inside final_runs/run_<id+1>/, and re-verify.Done. Only when every CP in plan.md is checked off with cited
evidence. Report the final datum to the user.
cheapest, best-selling, most reviewed,
highest-rated, lowest, latest, …) must be grounded in the site's
actual sort/filter — not in your own ordering of results.final_script_log.txt.playwright, httpx,
pydantic, etc. are already installed.final_script.py exists, prefer incremental edits (Edit) over
rewriting the whole file.reference/playwright_patterns.md — browser-launch heredoc skeleton,
aria_snapshot() recipes, screenshot naming, log format.reference/workflow.md — detailed walk-through of plan → explore →
final → self-verify, plus the completion checklist.reference/cli_tool_mode.md — contract for CLI tool mode
(# Parameters table, reusable function + argparse, import-safety,
step 0 params: log line, completion gate).Optional shortcuts under commands/:
/webwright:run <task> — default one-shot mode./webwright:craft <task> — CLI tool mode.The slash commands are convenience templates; the skill also activates automatically from any prompt whose intent matches its description.