ClawBrowser

From bighardperson/computer-science-skills-collection · View interactive version

ClawBrowser is an AI agent skill from the GitHub repository bighardperson/computer-science-skills-collection. Use when the agent needs to drive a browser through the Microsoft Playwright CLI (`playwright-cli`) for navigation, form interactions, screenshots, recordings, data extraction, session management, or debugging without loading a full MCP browser. It trains the agent on the CLI commands, snapshots, an

How to use this skill

Skill file

Clawbrowser – browser control via Playwright CLI

![No high vulnerabilities found by ClawAudit AI analyse. Click to get more info](https://clawaudit.duckdns.org/audit/f4d4fb45-ed25-4659-8235-2459d0dc8189)

![No high vulnerabilities found by ClawAudit AI analyse. Click to get more info](https://clawaudit.duckdns.org/audit/a55cb413-b111-4f1a-9f39-a5c857090ebf)

Setup & orientation

  1. Install the CLI and verify availability:

```bash

npm install -g @playwright/cli@latest

playwright-cli --help

```

The CLI is headless by default; add --headed to open or set browser.launchOptions.headless to false in playwright-cli.json when you need to see the UI.

  1. The CLI reads playwright-cli.json by default or whatever file you pass with --config. Use the config to tune browser name, launch/context options, viewport, timeouts, output directories, and recording settings without changing every command.
  2. Keep playwright-cli --help terminal-accessible; the script self-documents the latest commands and options so you can refresh your memory before trying a new action.

Core interaction loop

  1. Start with playwright-cli open <url> to load the page (add --session=name if you want isolation up front).
  2. Run playwright-cli snapshot to generate element refs (e1, e2, …) before any interaction. Always re-snapshot after DOM changes or navigation to avoid stale refs.
  3. Use refs for actions:
  1. Capture output evidence with screenshot [ref], pdf, console [level], or network to prove the flow or inspect errors.
  2. Example flow:

```bash

playwright-cli open https://example.com/login

playwright-cli snapshot

playwright-cli fill e1 "user@example.com"

playwright-cli fill e2 "supersecret"

playwright-cli click e3

playwright-cli snapshot

playwright-cli screenshot

```

Sessions & persistence

```bash

playwright-cli session-list

playwright-cli session-stop <name>

playwright-cli session-stop-all

playwright-cli session-restart <name>

playwright-cli session-delete <name>

```

Tabs, navigation, and devtools

```bash

playwright-cli console [level]

playwright-cli network

playwright-cli run-code "async page => await page.context().grantPermissions(['clipboard-read'])"

```

Use these to check console logs, inspect network requests, or inject helper scripts.

Recording, tracing, and exports

```bash

playwright-cli tracing-start

# perform steps

playwright-cli tracing-stop

playwright-cli video-start

# perform steps

playwright-cli video-stop video.webm

```

Config, state, and housekeeping

```bash

playwright-cli config --headed --browser=firefox

playwright-cli --session=auth config --config=playwright-cli.json

```

Change browser, contextOptions, launchOptions, or recording settings in the config and restart the session to apply them.

```bash

playwright-cli session-stop <name>

playwright-cli session-delete <name>

```

Troubleshooting & reminders

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.