mcpField
A
agent-browser

agent-browser

github.com/hjewkesAgent workflows443 installsUpdated 35w ago
Repository

About agent-browser

agent-browser is a browser-automation skill for agents, organized around navigation, snapshots, and interactions using element references. It includes command guidance and templates for common form, authentication, and content-capture workflows.

Key features

  1. 01Navigate and inspect pages
  2. 02Interact through element references
  3. 03Refresh references after page changes
  4. 04Guides for sessions and authentication
  5. 05Reusable automation templates

Use cases

  1. 01Automating form submission
  2. 02Reusing authenticated browser state
  3. 03Extracting content with screenshots

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hjewkes/agent-skills --skill agent-browser

After installing, type/agent-browserin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
authentication.md
commands.md
common-patterns.md
javascript-evaluation.md
proxy-support.md
semantic-locators.md
session-management.md
snapshot-refs.md
video-recording.md
templates/
authenticated-session.sh
capture-workflow.sh
form-automation.sh

Details

From the project README

Browser Automation with agent-browser

Core Workflow

Every browser automation follows this pattern:

  1. Navigate: agent-browser open <url>
  2. Snapshot: agent-browser snapshot -i (get element refs like @e1, @e2)
  3. Interact: Use refs to click, fill, select
  4. Re-snapshot: After navigation or DOM changes, get fresh refs
agent-browser open https://example.com/form
agent-browser snapshot -i
# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit"

agent-browser fill @e1 "[email protected]"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i  # Check result

Essential Commands

# Navigation
agent-browser open <url>              # Navigate
agent-browser close                   # Close browser

# Snapshot
agent-browser snapshot -i             # Interactive elements with refs (recommended)
agent-browser snapshot -i -C          # Include cursor-interactive elements

# Interaction (use @refs from snapshot)
agent-browser click @e1               # Click
agent-browser fill @e2 "text"         # Clear and type
agent-browser select @e1 "option"     # Select dropdown
agent-browser check @e1               # Checkbox
agent-browser press Enter             # Key press

# Wait
agent-browser wait @e1                # Wait for element
agent-browser wait --load networkidle # Wait for network idle

# Capture
agent-browser screenshot              # Screenshot
agent-browser screenshot --full       # Full page

Ref Lifecycle (Important)

Refs (@e1, @e2, etc.) are invalidated when the page changes. Always re-snapshot after clicking links/buttons that navigate, form submissions, or dynamic content loading.

Deep-Dive Documentation

ReferenceWhen to Use
references/commands.mdFull command reference with all options
references/snapshot-refs.mdRef lifecycle, invalidation rules, troubleshooting
references/session-management.mdParallel sessions, state persistence, concurrent scraping
references/authentication.mdLogin flows, OAuth, 2FA handling, state reuse
references/video-recording.mdRecording workflows for debugging and documentation
references/proxy-support.mdProxy configuration, geo-testing, rotating proxies
references/common-patterns.mdForm submission, auth, data extraction, parallel sessions, iOS simulator
references/semantic-locators.mdAlternatives to refs
references/javascript-evaluation.mdeval rules, --stdin/-b explanation

Ready-to-Use Templates

TemplateDescription
templates/form-automation.shForm filling with validation
templates/authenticated-session.shLogin once, reuse state
templates/capture-workflow.shContent extraction with screenshots

Comments

Markdown supported