musingfox/cc-plugins/agent-browser
Claude Code and agent skill by musingfox/cc-plugins
- community
Checking that the SKILL.md file is still in the repository.
Use for live browser automation via the agent-browser CLI — open URLs, snapshot pages, click/fill/screenshot, inspect elements, or read pages that need JavaScript rendering, login, or interaction. Not for writing Playwright test files (use playwright or web-test), nor for a visible browser the user watches or takes over (use zen-agent).
Install
npx vskill@latest install musingfox/cc-plugins/agent-browserSKILL.md
The same SKILL.md was published earlier as musingfox/cc-plugins/agent-browser.
agent-browser
Overview
agent-browser is a CLI that gives AI agents direct control over headless browsers. It uses a ref-based interaction model: every interactive element receives a unique reference identifier (@e1, @e2, etc.) derived from the accessibility tree. This enables deterministic, token-efficient browser automation without fragile CSS selectors.
Prerequisites
Ensure agent-browser is installed and the browser binary is available:
Core Workflow: The Ref Cycle
Every browser interaction follows a strict cycle:
- Navigate to the target page with
open - Snapshot to obtain the accessibility tree with refs
- Read the snapshot output — identify target elements by their refs
- Interact with elements using their refs (
click @e1,fill @e2 "text") - Re-snapshot when the page changes (see Re-snapshot Rules)
Snapshot Modes
The snapshot command is the primary inspection tool. Choose the right mode:
- `snapshot -i` — Interactive elements only (buttons, inputs, links). Use as default.
- `snapshot -i -C` (uppercase C) — Include cursor-interactive elements (divs with onclick). Use when expected elements are missing from
-i. Note:-C(cursor-interactive) is distinct from-c(compact). - `snapshot -c` — Compact output. Reduces token usage on large pages.
- `snapshot -d N` — Limit tree depth to N levels. Use for deeply nested DOMs.
- `snapshot -s "selector"` — Scope to a CSS selector. Focus on a specific page section.
Combine flags freely: agent-browser snapshot -i -c -d 3 for compact, shallow, interactive-only output.
Element Interaction Patterns
Text Input
- `fill @eN "text"` — Clears existing content, then types. Use for replacing field values.
- `type @eN "text"` — Appends without clearing. Use for adding to existing content.
Navigation via Click
- `click @eN` — Standard click.
- `click @eN --new-tab` — Opens in new tab. Original page state is preserved.
Keyboard
- `press Enter` — Submit forms.
- `press Tab` / `press Shift+Tab` — Navigate focus.
- `press Escape` — Close modals or dialogs.
- Combinations:
press Control+a,press Control+c.
Scrolling
- `scroll down 500` — Scroll down 500 pixels. The amount is in pixels (default 300).
- `scroll up 500` — Scroll up 500 pixels.
- `scrollintoview @eN` — Scroll a specific element into view.
- Scroll to reveal off-screen elements before interacting with them.
Screenshots
- `screenshot` — Capture current viewport for visual inspection.
- `screenshot --annotate` — Overlay
[N]labels on interactive elements. Use to visually confirm ref assignments before performing destructive actions.
Re-snapshot Rules
Refs are invalidated by navigation and DOM changes. Read every ref from the most recent snapshot.
Always re-snapshot after:
- Navigation (
open, clicking a link) - Form submission
- Any action that triggers DOM changes (buttons loading content, search fields filtering)
- Scrolling (new elements may enter viewport)
- Tab switching
Safe to skip re-snapshot after:
screenshot(read-only)hover(unless hover triggers a dropdown or tooltip DOM change)focus(usually no DOM change)
When uncertain, snapshot. The cost of an extra snapshot is far less than using a stale ref.
Headers and Authentication
Pass credentials with open --headers, which sends them only to that URL's origin:
Never put credentials in set headers: it is a global setting that applies to every domain, so tokens and cookies would reach every third-party origin the page requests.
Best Practices
- Start with `snapshot -i` — Interactive elements are usually sufficient. Expand to
-i -Cor full snapshot only when needed. - Ask before irreversible actions — Before a click or submit that deletes, buys, sends, or otherwise cannot be undone, confirm the target with
screenshot --annotate, tell the user what the action will do, and proceed only after they approve. - Handle dynamic content — For SPAs and lazy-loaded content, wait with
wait --load networkidleorwait --text "<expected text>", then re-snapshot. - Minimize token usage — Use
-c(compact) and-d N(depth limit) for large pages. Scope with-s "selector"for targeted sections.
Additional Resources
Command Help
For the full command list, run agent-browser --help; for one command's flags and examples, run agent-browser <command> --help.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagent-browser/skills/agent-browser/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/musingfox/cc-plugins/agent-browser)