| name | browser |
| description | Headless browser automation via playwright-cli for testing, screenshots, scraping, and parallel sessions. Use for UI testing, web scraping, screenshot capture, or any browser-based workflow. |
| argument-hint | [url or task description] |
| allowed-tools | ["Bash","Read"] |
Purpose
Automate browsers using playwright-cli, a token-efficient CLI for Playwright. Runs headless by default, supports parallel sessions via named sessions (-s=), and persistent profiles for cookies/state.
Prerequisites
playwright-cli must be installed and available in PATH
Variables
HEADED: false # Show browser window. Options: true, false
VISION: false # Return screenshots as images in context (higher token cost)
VIEWPORT_SIZE: 1440x900 # Browser viewport dimensions (WxH)
SCREENSHOTS_DIR: ./screenshots # Where screenshots are saved
Workflow
-
Open Session
-
Snapshot Page
- Capture element references to identify interactive elements
- Returns refs (e.g.,
e12, e45) for click, fill, etc.
- Example:
playwright-cli -s=mystore-checkout snapshot → element tree with refs
- Tool: Bash
playwright-cli -s=<session-name> snapshot
-
Interact with Elements
- Use refs from snapshot to click, fill, type, select, hover
- For full command list: see
./reference/commands.md
- Example:
playwright-cli -s=mystore-checkout click e12 → clicks element
- Example:
playwright-cli -s=mystore-checkout fill e15 "test@example.com" → fills input
- Example:
playwright-cli -s=mystore-checkout press Enter → presses key
- Navigate:
goto <url>, go-back, go-forward, reload
- Tool: Bash
playwright-cli -s=<session-name> <command> <args>
-
Take Screenshots
- Capture current page state as PNG
- IF: specific filename needed → use
--filename=<path>
- Example:
playwright-cli -s=mystore-checkout screenshot --filename=<SCREENSHOTS_DIR>/checkout-step1.png
- Tool: Bash
playwright-cli -s=<session-name> screenshot [--filename=<SCREENSHOTS_DIR>/<name>.png]
-
Close Session
- ALWAYS close the session when done — this is not optional
- Example:
playwright-cli -s=mystore-checkout close
- To close ALL sessions:
playwright-cli close-all
- Tool: Bash
playwright-cli -s=<session-name> close
Works well with
browser is the core capability others build on; it runs standalone and these degrade gracefully if absent.
- The browser family —
browser-workflow (runs saved workflows through it), browser-review (fans out parallel QA), and browser-microscope (layout/DOM forensics) all sit on top of this skill. The browser-operator and browser-qa agents drive it.