Agent Skill
2/7/2026

playwright

Browser automation via Playwright MCP tools. Use when AI Agent needs to interact with web browsers for: (1) Web scraping and data extraction, (2) Form interaction and submission, (3) Browser testing and validation, (4) Taking screenshots of web pages, or any browser automation tasks.

Z
zhongjis
0GitHub Stars
1Views
npx skills add zhongjis/nix-config

SKILL.md

Nameplaywright
DescriptionBrowser automation via Playwright MCP tools. Use when AI Agent needs to interact with web browsers for: (1) Web scraping and data extraction, (2) Form interaction and submission, (3) Browser testing and validation, (4) Taking screenshots of web pages, or any browser automation tasks.

name: playwright description: Browser automation via Playwright MCP tools. Use when AI Agent needs to interact with web browsers for: (1) Web scraping and data extraction, (2) Form interaction and submission, (3) Browser testing and validation, (4) Taking screenshots of web pages, or any browser automation tasks. mcp:
playwright:
command: nix args: ["run", "nixpkgs#playwright-mcp"]

Playwright MCP Browser Automation

Core Workflow

navigate → snapshot → interact → snapshot → close

Tool Selection

ToolUse Case
playwright_browser_navigateOpen URL
playwright_browser_snapshotRead page structure (preferred over screenshot)
playwright_browser_take_screenshotCapture visual state
playwright_browser_clickClick elements
playwright_browser_typeType text into elements
playwright_browser_fill_formBatch fill multiple form fields
playwright_browser_select_optionSelect dropdown options
playwright_browser_press_keyKeyboard shortcuts
playwright_browser_dragDrag and drop
playwright_browser_hoverMouse hover
playwright_browser_evaluateExecute JavaScript
playwright_browser_file_uploadUpload files
playwright_browser_handle_dialogHandle alerts/confirms
playwright_browser_wait_forWait for text/disappear/timer
playwright_browser_tabsTab management (list/new/close/select)
playwright_browser_console_messagesCheck for errors
playwright_browser_network_requestsInspect network traffic
playwright_browser_run_codeRun Playwright code snippets

Best Practices

Order matters:

  1. navigate to URL
  2. snapshot to find elements (use ref from output)
  3. wait_for text to ensure load
  4. Interact with ref from snapshot
  5. Repeat snapshot to track changes
  6. close when done

Form filling: Use fill_form with fields array (each needs name, type, ref, value).

Element references: Always use ref from snapshot output - never guess selectors.

Dialogs: Call handle_dialog with accept: true/false before triggering action.

Errors: Check console_messages(onlyErrors=true) before completing.

Screenshots: Only use when visual inspection needed. Use snapshot for structure.

Multiple tabs: Use tabs(action="new/select/close") with index for close/select.

Skills Info
Original Name:playwrightAuthor:zhongjis