一键导入
playwright
// Browser automation CLI using Playwright. Use when automating browser workflows, filling forms, clicking elements, scraping pages, or debugging web issues.
// Browser automation CLI using Playwright. Use when automating browser workflows, filling forms, clicking elements, scraping pages, or debugging web issues.
| name | playwright |
| description | Browser automation CLI using Playwright. Use when automating browser workflows, filling forms, clicking elements, scraping pages, or debugging web issues. |
Use the playwright-cli.ts script bundled with this skill to automate web interactions and debug browser issues.
Run it with: tsx .agents/skills/playwright/cli.ts
tsx .agents/skills/playwright/cli.ts open <url> # Launch browser and navigate to URL
tsx .agents/skills/playwright/cli.ts exec <code> # Execute Playwright TypeScript code
tsx .agents/skills/playwright/cli.ts snapshot # Save full-page PNG + HTML to tmp/playwright-screenshots/
tsx .agents/skills/playwright/cli.ts list # List open tabs
tsx .agents/skills/playwright/cli.ts close # Close the browser
The exec command provides access to: page, context, state, browser, snapshot
tsx .agents/skills/playwright/cli.ts open https://example.com
tsx .agents/skills/playwright/cli.ts exec "await page.locator('button:has-text(\"Sign in\")').click()"
tsx .agents/skills/playwright/cli.ts exec "await page.fill('input[name=\"email\"]', 'user@example.com')"
tsx .agents/skills/playwright/cli.ts snapshot
tsx .agents/skills/playwright/cli.ts close
Use --session <name> to run multiple isolated browser instances simultaneously.
Use save <domain> after logging in to persist cookies/localStorage for automatic reuse:
tsx .agents/skills/playwright/cli.ts open https://linkedin.com
# ... manually log in ...
tsx .agents/skills/playwright/cli.ts save linkedin.com
# Next time, profile is loaded automatically
Launch the extension in a background tmux session with CDP enabled:
pnpm debug:extension # starts in tmux "opencode-debug", CDP on :9222
pnpm debug:extension --stop # stops the session
Then connect Playwright to it:
tsx .agents/skills/playwright/cli.ts connect http://127.0.0.1:9222 --session extension
tsx .agents/skills/playwright/cli.ts exec "return await page.title()" --session extension
Connect to any browser exposing a CDP endpoint:
tsx .agents/skills/playwright/cli.ts connect http://127.0.0.1:9222 --session my-session
tsx .agents/skills/playwright/cli.ts exec "return await page.title()" --session my-session
Interact with the running VSCode extension via Playwright. Use when automating, testing, or debugging the OpenCode webview UI.
Create a spec sheet for the given feature/fix request in specs/ directory. Use when planning a significant new feature or complex fix.
Implement a single phase of a spec. Use when given a spec file and a phase number to implement.
Review a spec for under-specified areas, bugs, and adherence to the generate-spec skill. Use when asked to review, critique, or check a spec.
Update AGENTS.md files based on session learnings about a topic. Use when documenting patterns, commands, or conventions discovered during development.
Address PR review comments systematically. Use when responding to code review feedback on a pull request.