mcpField
A
agent-browser-automate

agent-browser-automate

github.com/owenleezyAgent workflows461 installsUpdated 31w ago
Repository

About agent-browser-automate

A skill with execution guidance for browser automation using agent-browser. It covers forms, files, tabs, authentication, and recovery, with checkpoints for sensitive actions.

Key features

  1. 01Form filling and submission checks
  2. 02File upload and download flows
  3. 03Authentication setup and recovery
  4. 04Multi-tab and clipboard operations
  5. 05Wait and failure-recovery patterns

Use cases

  1. 01Automating web forms with confirmation before submission
  2. 02Uploading attachments or saving downloaded reports
  3. 03Handling login expiry and browser dialogs

Install

Copy the command and run it in a terminal.

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

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

Details

From the project README

Task Automation — Execution Protocol

Internal template. Entry point: agent-browser skill.


NEVER

NEVER use `fill` when you want to append — it clears first; use `type` to append
NEVER upload a file with `click` then `fill` — use dedicated `upload <sel> <path>` command
NEVER submit a form without showing field values first — judgment gate required

Auth Setup (choose one, in priority order)

# Option 1 (recommended): Auth Vault — encrypted, reusable
agent-browser auth login <vault-name>
agent-browser open <url>

# Option 2: Persistent profile (local only)
agent-browser --profile ~/.myapp open <url>

# Option 3: Token injection
agent-browser open <url>
agent-browser storage local set authToken "<token>"
agent-browser reload

# Option 4: HTTP Basic Auth
agent-browser open <url>
agent-browser set credentials <user> <pass>

# Option 5: Bearer header
agent-browser --headers '{"Authorization":"Bearer <token>"}' open <url>

Form Automation Sequence

agent-browser snapshot -i                                    # get refs
agent-browser find label "Email" fill "[email protected]"
agent-browser find label "Password" fill "<password>"
agent-browser find role button click --name "Submit"
agent-browser wait --load networkidle
agent-browser screenshot --full step-complete.png           # evidence

File Operations

# Upload
agent-browser find label "Attachment" upload ./file.pdf

# Download (triggers on button click, waits for completion)
agent-browser find role button click --name "Export CSV"
agent-browser wait --download ~/report.csv

# Generate PDF
agent-browser pdf ./report.pdf

Multi-Tab Flows

agent-browser tab new
agent-browser open <second-url>
agent-browser tab 0       # switch back to first tab (0-based index)
agent-browser tab list    # see all tabs with URLs

Clipboard

# Read clipboard
agent-browser clipboard read

# Write to clipboard
agent-browser clipboard write "text to copy"

# Copy element text to clipboard
agent-browser clipboard copy @e3

# Paste clipboard into element
agent-browser clipboard paste @e5

# macOS: paste system clipboard into focused element
agent-browser keyboard inserttext "$(pbpaste)"

Fine Mouse Control (canvas / Kanban / drawing apps)

agent-browser mouse move <x> <y>
agent-browser mouse down
agent-browser mouse move <x2> <y2>   # drag
agent-browser mouse up

Waiting Patterns

# Page load
agent-browser wait --load networkidle

# Wait for element to appear
agent-browser wait "#success-toast"

# Wait for element to disappear (loading spinner)
agent-browser wait "#spinner" --state hidden

# Wait for URL to change (after form submit / redirect)
agent-browser wait --url "**/dashboard"

# Wait for text to appear
agent-browser wait --text "Upload complete"

# Wait for download to finish
agent-browser wait --download ./report.xlsx

Recovery Patterns

FailureRecovery
Auth expiredauth login <name> re-authenticate
Auth Vault password changedauth delete <name> then auth save <name>
Unexpected popup/dialogdialog status to confirm, then dialog dismiss
fill overwrites existing contentUse type to append
Modal won't scrollscroll down --selector ".modal-body"

Judgment Gates

Pause when:

  • About to submit a form (show field values → ask confirm)
  • About to trigger download / delete / payment
  • Auth fails after retry (need fresh credentials)

Pitfalls

MistakeFix
Auth Vault password changedauth delete + auth save again — no in-place update
fill clears content unintentionallyUse type to append
File upload failsUse find label "..." upload <path>, not click then fill
Can't scroll inside modalscroll down --selector ".modal-body"
Download not capturedUse wait --download <path> after clicking the download button
JS dialog blocks daemon completelyPlaywright intercepts at CDP level — eval "window.confirm = () => true" does NOT work (JS layer override can't reach CDP). Only reliable fix: dialog accept must be called from a second concurrent process while click is blocking.
Read-only DOM nodes missing from snapshot (<p>, <span>, <div> without ARIA roles)snapshot only exposes the accessibility tree — interactive elements only. Read non-interactive node content with eval "document.querySelector('#id').textContent" or eval "document.querySelector('.class').innerText".

Comments

Markdown supported