$npx -y skills add avibebuilder/claude-prime --skill agent-browserBrowser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a websit
| 1 | # Browser Automation with agent-browser |
| 2 | |
| 3 | Use this skill to drive websites through the `agent-browser` CLI. Keep the main loop tight: inspect the page, act with refs, verify the result, and only pull deeper docs when the task actually needs them. |
| 4 | |
| 5 | ## Core workflow |
| 6 | |
| 7 | Prefer `agent-browser` directly for speed. Use `npx agent-browser` only if it is not installed globally. |
| 8 | |
| 9 | For most tasks, follow this loop: |
| 10 | |
| 11 | 1. Open the page |
| 12 | 2. Wait for the relevant state |
| 13 | 3. Snapshot with refs |
| 14 | 4. Interact using those refs |
| 15 | 5. Re-snapshot after page or DOM changes |
| 16 | 6. Verify the outcome |
| 17 | 7. Close the session when done |
| 18 | |
| 19 | ```bash |
| 20 | agent-browser open https://example.com/form |
| 21 | agent-browser wait --load networkidle |
| 22 | agent-browser snapshot -i |
| 23 | # Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit" |
| 24 | |
| 25 | agent-browser fill @e1 "user@example.com" |
| 26 | agent-browser fill @e2 "password123" |
| 27 | agent-browser click @e3 |
| 28 | agent-browser wait --load networkidle |
| 29 | agent-browser snapshot -i |
| 30 | ``` |
| 31 | |
| 32 | Chain commands with `&&` only when you do not need to inspect intermediate output. Good: `open && wait && screenshot`. Bad: `snapshot && click` when you still need to read the refs from the snapshot. |
| 33 | |
| 34 | ## Route fast |
| 35 | |
| 36 | Read only the reference that matches the task: |
| 37 | |
| 38 | | Need | Read | |
| 39 | | --- | --- | |
| 40 | | Full command or flag lookup | [references/commands.md](references/commands.md) | |
| 41 | | Ref lifecycle, stale refs, snapshot strategy | [references/snapshot-refs.md](references/snapshot-refs.md) | |
| 42 | | Login flows, OAuth, 2FA, saved auth state | [references/authentication.md](references/authentication.md) | |
| 43 | | Parallel sessions, state reuse, cleanup | [references/session-management.md](references/session-management.md) | |
| 44 | | Recording, profiling, local files, config, iOS, security | [references/advanced-usage.md](references/advanced-usage.md) | |
| 45 | | Proxy setup | [references/proxy-support.md](references/proxy-support.md) | |
| 46 | | Recording workflows | [references/video-recording.md](references/video-recording.md) | |
| 47 | | Profiling workflows | [references/profiling.md](references/profiling.md) | |
| 48 | |
| 49 | ## Golden path commands |
| 50 | |
| 51 | Use these first; go to the command reference only when you need something more specific. |
| 52 | |
| 53 | ```bash |
| 54 | agent-browser open <url> |
| 55 | agent-browser wait --load networkidle |
| 56 | agent-browser snapshot -i |
| 57 | agent-browser click @e1 |
| 58 | agent-browser fill @e2 "text" |
| 59 | agent-browser select @e3 "option" |
| 60 | agent-browser get url |
| 61 | agent-browser get text @e1 |
| 62 | agent-browser diff snapshot |
| 63 | agent-browser screenshot --annotate |
| 64 | agent-browser close |
| 65 | ``` |
| 66 | |
| 67 | ## Refs are the default interaction model |
| 68 | |
| 69 | The main value of `agent-browser` is that snapshots produce compact refs like `@e1`, `@e2`, `@e3`. Those refs are cheaper and more reliable than repeatedly reasoning from raw HTML or long selectors. |
| 70 | |
| 71 | Treat refs as short-lived. Re-snapshot after anything that can change the page state, especially: |
| 72 | - navigation |
| 73 | - form submission |
| 74 | - opening dropdowns or modals |
| 75 | - lazy-loaded or client-rendered content |
| 76 | |
| 77 | If a ref fails or the page looks different from what you expected, your next move is usually `agent-browser snapshot -i`, not another blind click. |
| 78 | |
| 79 | For the full lifecycle and troubleshooting rules, read [references/snapshot-refs.md](references/snapshot-refs.md). |
| 80 | |
| 81 | ## Choose the lightest tool that still proves the result |
| 82 | |
| 83 | Default order: |
| 84 | 1. `snapshot -i` for structure and interactive targets |
| 85 | 2. `get text`, `get url`, or `get title` for precise verification |
| 86 | 3. `diff snapshot` when you need to confirm something changed |
| 87 | 4. `screenshot --annotate` when layout, icon-only controls, canvas, or visual context matters |
| 88 | 5. semantic locators or `eval` only when refs are unavailable or the task truly needs them |
| 89 | |
| 90 | If you need semantic locators, JavaScript evaluation, local file access, annotated screenshots, or config details, jump to [references/advanced-usage.md](references/advanced-usage.md) and [references/commands.md](references/commands.md). |
| 91 | |
| 92 | ## Authentication: decide sensitivity first |
| 93 | |
| 94 | Before filling any credential, classify the auth flow. |
| 95 | |
| 96 | - **Non-sensitive**: localhost, staging, test accounts, or credentials the user explicitly provided for this task. The agent can usually fill these directly. |
| 97 | - **Sensitive**: production domains, real user accounts, OAuth/SSO, or anything where the agent should not handle the secret. In that case, reach the auth step, switch to a headed browser if needed, and let the user complete sign-in manually. |
| 98 | |
| 99 | After either path su |