playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
What this skill does
# Playwright CLI A token-efficient CLI for browser automation. Use `Bash` tool to run these commands. ## Installation ```bash npm install -g @playwright/cli@latest ``` ## Core Workflow ```bash # 1. Open a page playwright-cli open https://example.com # 2. Capture snapshot (accessibility tree with element refs) playwright-cli snapshot # 3. Interact using refs from snapshot playwright-cli click e15 playwright-cli fill e20 "[email protected]" # 4. Re-snapshot to verify state playwright-cli snapshot ``` ## Command Reference ### Navigation & Core | Command | Description | |---------|-------------| | `playwright-cli open <url>` | Open URL in browser | | `playwright-cli open <url> --headed` | Open in visible browser | | `playwright-cli close` | Close browser | | `playwright-cli snapshot` | Capture accessibility tree with element refs | | `playwright-cli screenshot [ref]` | Take screenshot (viewport or element) | | `playwright-cli screenshot --full-page` | Full-page screenshot | | `playwright-cli pdf` | Save page as PDF | ### Interactions | Command | Description | |---------|-------------| | `playwright-cli click <ref>` | Click element | | `playwright-cli fill <ref> "<text>"` | Fill input field | | `playwright-cli type "<text>"` | Type text sequentially | | `playwright-cli hover <ref>` | Hover over element | | `playwright-cli select <ref> "<value>"` | Select dropdown option | | `playwright-cli check <ref>` | Check checkbox | | `playwright-cli uncheck <ref>` | Uncheck checkbox | | `playwright-cli upload <ref> <file>` | Upload file | | `playwright-cli drag <startRef> <endRef>` | Drag and drop | ### Keyboard & Mouse | Command | Description | |---------|-------------| | `playwright-cli press <key>` | Press key (e.g., `Enter`, `ArrowDown`) | | `playwright-cli keydown <key>` | Key down | | `playwright-cli keyup <key>` | Key up | | `playwright-cli mousemove <x> <y>` | Move mouse | | `playwright-cli mousedown` | Mouse button down | | `playwright-cli mouseup` | Mouse button up | ### Navigation | Command | Description | |---------|-------------| | `playwright-cli go-back` | Go back | | `playwright-cli go-forward` | Go forward | | `playwright-cli reload` | Reload page | ### Tabs | Command | Description | |---------|-------------| | `playwright-cli tab-list` | List tabs | | `playwright-cli tab-new [url]` | Open new tab | | `playwright-cli tab-close [index]` | Close tab | | `playwright-cli tab-select <index>` | Switch to tab | ### DevTools | Command | Description | |---------|-------------| | `playwright-cli console` | View console messages | | `playwright-cli network` | View network requests | | `playwright-cli eval "<js>"` | Execute JavaScript | | `playwright-cli run-code "<js>"` | Run Playwright code | ### Dialogs | Command | Description | |---------|-------------| | `playwright-cli dialog-accept` | Accept dialog | | `playwright-cli dialog-dismiss` | Dismiss dialog | ### Tracing & Video | Command | Description | |---------|-------------| | `playwright-cli tracing-start` | Start trace recording | | `playwright-cli tracing-stop` | Stop trace recording | | `playwright-cli video-start` | Start video recording | | `playwright-cli video-stop` | Stop video recording | ### Sessions | Command | Description | |---------|-------------| | `playwright-cli open <url> --session=<name>` | Use named session | | `playwright-cli session-list` | List sessions | | `playwright-cli session-stop <name>` | Stop session | | `playwright-cli session-delete <name>` | Delete session | ## Snapshot Output When you run `playwright-cli snapshot`, you get an accessibility tree: ``` - button "Create Strategy" [ref: e12] - textbox "Search" [ref: e13] - grid [ref: e14] - button "Filters" [ref: e15] ``` Use the `ref` values (e.g., `e12`) to interact with elements. ## Configuration Create `playwright-cli.json` for custom settings: ```json { "browser": "chromium", "headless": false, "timeout": 30000 } ```
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.