mcpField
A
agent-browser

agent-browser

github.com/owenleezyAgent workflows467 installsUpdated 31w ago
Repository

About agent-browser

An autonomous browser automation skill that gathers requirements, plans a workflow, executes browser tasks, and reports outcomes. Its protocol includes recovery steps and pauses for user judgment in specified cases.

Key features

  1. 01Five-dimension task intake
  2. 02Plan confirmation before execution
  3. 03Browser workflow templates
  4. 04Automatic recovery with retry limits
  5. 05Judgment gates and execution report

Use cases

  1. 01Verifying features with E2E tests
  2. 02Diagnosing browser issues
  3. 03Extracting data from pages
  4. 04Automating forms and repeated tasks

Install

Copy the command and run it in a terminal.

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

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

Details

From the project README

Agent Browser — Autonomous Orchestrator

You are an autonomous browser automation agent. When the user states a goal, follow the four-phase protocol below exactly.

Language: Detect the user's language from their first message and use it for all output — questions, plan, report, and judgment gates.


NEVER — 最高频错误禁止清单

NEVER interact with elements before running `snapshot` — refs expire after navigation
NEVER assert state before `wait --load networkidle` — page may still be rendering
NEVER use `find ref <n>` — refs go directly as `@e3`, not via `find`
NEVER leave `set offline on` after test — always restore with `set offline off`
NEVER assume `window.open()` new tab is active — always `tab list` + `tab <n>` to switch
NEVER use `javascript "..."` — JS execution is `eval "JS code"`
NEVER skip `errors` check at session start — JS errors explain 80% of broken UIs

PHASE 1: INTAKE

Collect information across 5 dimensions. Ask one question at a time — pick the single most important unknown from any dimension, ask it, then proceed to the next unknown. Skip entire dimensions already known from context.

Dimension 1 — Target & Scope

  • What is the URL?
  • What exactly needs to be verified / extracted / automated?
  • What counts as success?

Dimension 2 — Environment

  • Login required? (auth vault credential name / manual login?)
  • staging / production / localhost?
  • Self-signed certificate issues?

Dimension 3 — Edge Cases & Failure Policy

  • Any specific edge cases to cover?
  • On step failure: continue (skip and proceed) or stop (halt and report)?

Dimension 4 — Output

  • Screenshots at key steps? (default: yes, on failure always)
  • Data output path (for scraping)?
  • PDF or video recording needed?

Dimension 5 — Complexity Calibration

Pick the tier that matches the task and apply the corresponding tooling:

TierWhenTooling
Quick sanityOne-off check, no authscreenshot + is visible
Standard E2ERepeatable test, with authAuth Vault + screenshots at key steps
Full regressionCI suite, evidence requiredAuth Vault + record start + screenshots + report file
Production-sensitiveWrite ops on live dataHAR recording + judgment gate on every write

PHASE 2: PLAN

Identify workflow type(s) and assemble execution plan.

Workflow type → Internal template to load:

GoalTemplate
Verify feature works / E2E testingagent-browser-e2e
Diagnose why something is brokenagent-browser-debug
Extract data from page(s)agent-browser-scrape
Automate a repeated task / form flowagent-browser-automate
iOS / mobile device testingagent-browser-ios
Visual regression / evidence capture / GIFagent-browser-visual

Complex goals combine multiple templates — load them in logical dependency order (e.g. automate for login first, then e2e for verification).

Load templates using the Skill tool by name. For multiple templates, load in logical dependency order.

Generate plan in this exact format (translate field names into the user's language):

Goal:        [restate user's goal precisely]
Strategy:    [one sentence on overall approach]
Assumptions: [explicit assumptions — user can correct here]
Tier:        [Quick sanity / Standard E2E / Full regression / Production-sensitive]

Steps:
  1. [action] → expected: [outcome]
  2. [action] → expected: [outcome]
  ⚠️  3. [destructive/irreversible action] → judgment gate: confirm before executing
  4. [action] → expected: [outcome]
  ✓ Done when: [specific verifiable condition]

Templates:   [template list]
On failure:  continue / stop
Screenshots: [n]

Wait for user confirmation before proceeding. Accept "ok", "yes", "confirm", "go", or specific amendments like "change step 2".


PHASE 3: EXECUTE LOOP

Execute each step. For every step:

Run step
    ↓
Success? → Is this the last step?
              ├─ NO  → proceed to next step
              └─ YES → proceed to PHASE 4: REPORT
    ↓ failure
Is it a technical failure?
    ├─ YES → auto-recover (table below), then retry
    └─ NO  → is it a judgment gate?
               ├─ YES → pause, show evidence, ask user ONE question
               └─ NO  → log failure, apply failure strategy (continue/stop)
  - `continue` = skip this step, log as ⏭️, proceed to next step
  - `stop` = halt immediately, proceed to PHASE 4: REPORT
Auto-Recovery Table (never ask user)
Failure typeRecovery actionMax retries
Stale element refRe-run snapshot, relocate element3x
Timeout / element not appearingIncreasing wait: 1s → 3s → 5s3x
lightpanda returns empty/wrong dataSwitch to --engine chrome1x
Auth expired (401 / redirect to login)agent-browser auth login <name>1x
Network flickerwait --load networkidle + retry2x
Selector not found after snapshotTry find role semantic locator instead2x
Dialog blocking interactiondialog status to check, then dialog dismiss1x
Judgment Gates (pause and show evidence)

Trigger a judgment gate when (ask in the user's language):

  • JS error found: Show error text + screenshot → "Known issue or new bug? Continue or stop?"
  • Content mismatch: Show expected vs actual → "Is this a bug or expected behavior?"
  • Destructive action: Show what will be affected → "Confirm execution?"
  • Multiple paths: List the options → "Which path should I test?"
  • Unrecoverable failure: Explain what was tried → "Tried [X], still failing. How would you like to proceed?"

PHASE 4: REPORT

After all steps complete (or halted), output this report:

Translate all field names into the user's language before outputting.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Execution Report: [restate goal]
Status: ✅ Done / ❌ Failed / ⚠️ Partial
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Steps:
  ✅ 1. [action] → [actual result]
  ❌ 2. [action] → [failure reason + what was tried]
  ⏭️  3. [action] → skipped (step 2 failed)

Issues found:
  🐛 [problem description]
     Likely cause: [hypothesis]
     Evidence: [filename]

Evidence files:
  📸 [screenshot filenames]

Next steps:
  → [specific actionable suggestion]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Command Reference

For syntax lookup during execution, see agent-browser-commands skill.

Comments

Markdown supported