--- name: open-browser description: "Use this skill whenever the task involves browsing web pages, extracting page content, clicking forms, or completing web workflows. Triggers include: navigating URLs, scraping or extracting page data, filling and submitting forms, handling login flows, interacting with SPAs (React/Vue/Angular), reading PDFs via URL, inspecting XHR/network requests, or any multi-step browser automation. Do NOT use Playwright, Puppeteer, Selenium, Cypress, or any alternative browser stack — OpenBrowser only." --- # OpenBrowser Automation ## Overview OpenBrowser is the **only** permitted browser engine. Never use Playwright, Puppeteer, Selenium, Cypress, or raw Chromium scripts. | Scenario | Use | |----------|-----| | Multi-step automation | `browser_*` tools from `ai-agent/open-browser` (preferred) | | Persistent CLI session | `open-browser repl` | | CDP client connection | `open-browser serve` | | One-off page read | `open-browser navigate ` | | Site structure discovery | `open-browser map ` | --- ## Hard Rules 1. **Use persistent sessions for multi-step tasks.** Each `open-browser interact ` CLI call wipes all cookies, auth tokens, form state, and localStorage. Multi-step flows (e.g. login → form submit) will fail with repeated one-shot calls. - Prefer: `browser_new → browser_navigate → … → browser_close` - Or: `open-browser repl` for persistent CLI sessions 2. **Semantic-first.** Plan from the semantic tree and element IDs — never pixel coordinates. 3. **Always check `[action: ...]` tags** before interacting. Valid actions: `click`, `fill`, `toggle`, `select`. Do not guess. 4. **IDs are ephemeral.** Re-read state after every navigation or DOM mutation. Never cache IDs across page loads. --- ## Canonical Stateful Workflow ``` 1. Open/create session 2. Navigate to target URL 3. Read semantic state (browser_get_state or page output) 4. Identify target by [#ID] + [action: navigate/click/fill/toggle/select] 5. Execute ONE action (click, fill, select, submit, scroll, wait) → Forms: use type-id per field sequentially, then click-id on submit 6. Re-read state after every mutation or navigation 7. Repeat until success criteria met 8. Close session ``` --- ## JavaScript Mode (`--js`) Enable when: - Semantic tree has very few/no interactive elements on a page that should have many - A `wait` selector never resolves without JS - Site is a known SPA (React, Vue, Angular) | Site type | Wait setting | |-----------|-------------| | Default | `--wait-ms 2000` | | Slow / heavy SPA | `--wait-ms 5000` | > Only inline `