[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DMEFN0FBSAPWY6YBAEFR11":3,"skill-same:01M7DMEFN0FBSAPWY6YBAEFR11":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M7DMEFN0FBSAPWY6YBAEFR11","agent-browser",null,"Browser 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 website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","mvschwarz\u002Fopenrig-world","mvschwarz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F171890339?v=4","01M7DM95A4N5936P8G2FTSPMY7","Mike Schwarz","01M7DM95AX80NY8HZA7XXDYAZR",16,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Fagents\u002Fshared\u002Fskills\u002Fprocess\u002Fagent-browser\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agent-browser\ndescription: Browser 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 website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.\nallowed-tools: Bash(npx agent-browser:*), Bash(agent-browser:*)\nmetadata:\n  openrig:\n    vendored_from: \"Vercel agent-browser (https:\u002F\u002Fgithub.com\u002Fvercel\u002Fagent-browser)\"\n    vendoring_pattern: add-supplementary-files\n    last_upstream_check: \"2026-05-13 (initial vendoring declaration)\"\n    divergence_notes: |\n      Upstream SKILL.md content tracks upstream; a small \"Local Dev Insights\"\n      pointer section was added near the end of the body to surface the sibling\n      LOCAL-INSIGHTS.md companion file. See OPENRIG.md for the full OpenRig\n      relationship to this skill.\n---\n\n# Browser Automation with agent-browser\n\n## Core Workflow\n\nEvery browser automation follows this pattern:\n\n1. **Navigate**: `agent-browser open \u003Curl>`\n2. **Snapshot**: `agent-browser snapshot -i` (get element refs like `@e1`, `@e2`)\n3. **Interact**: Use refs to click, fill, select\n4. **Re-snapshot**: After navigation or DOM changes, get fresh refs\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fform\nagent-browser snapshot -i\n# Output: @e1 [input type=\"email\"], @e2 [input type=\"password\"], @e3 [button] \"Submit\"\n\nagent-browser fill @e1 \"user@example.com\"\nagent-browser fill @e2 \"password123\"\nagent-browser click @e3\nagent-browser wait --load networkidle\nagent-browser snapshot -i  # Check result\n```\n\n## Command Chaining\n\nCommands can be chained with `&&` in a single shell invocation. The browser persists between commands via a background daemon, so chaining is safe and more efficient than separate calls.\n\n```bash\n# Chain open + wait + snapshot in one call\nagent-browser open https:\u002F\u002Fexample.com && agent-browser wait --load networkidle && agent-browser snapshot -i\n\n# Chain multiple interactions\nagent-browser fill @e1 \"user@example.com\" && agent-browser fill @e2 \"password123\" && agent-browser click @e3\n\n# Navigate and capture\nagent-browser open https:\u002F\u002Fexample.com && agent-browser wait --load networkidle && agent-browser screenshot page.png\n```\n\n**When to chain:** Use `&&` when you don't need to read the output of an intermediate command before proceeding (e.g., open + wait + screenshot). Run commands separately when you need to parse the output first (e.g., snapshot to discover refs, then interact using those refs).\n\n## Essential Commands\n\n```bash\n# Navigation\nagent-browser open \u003Curl>              # Navigate (aliases: goto, navigate)\nagent-browser close                   # Close browser\n\n# Snapshot\nagent-browser snapshot -i             # Interactive elements with refs (recommended)\nagent-browser snapshot -i -C          # Include cursor-interactive elements (divs with onclick, cursor:pointer)\nagent-browser snapshot -s \"#selector\" # Scope to CSS selector\n\n# Interaction (use @refs from snapshot)\nagent-browser click @e1               # Click element\nagent-browser click @e1 --new-tab     # Click and open in new tab\nagent-browser fill @e2 \"text\"         # Clear and type text\nagent-browser type @e2 \"text\"         # Type without clearing\nagent-browser select @e1 \"option\"     # Select dropdown option\nagent-browser check @e1               # Check checkbox\nagent-browser press Enter             # Press key\nagent-browser scroll down 500         # Scroll page\n\n# Get information\nagent-browser get text @e1            # Get element text\nagent-browser get url                 # Get current URL\nagent-browser get title               # Get page title\n\n# Wait\nagent-browser wait @e1                # Wait for element\nagent-browser wait --load networkidle # Wait for network idle\nagent-browser wait --url \"**\u002Fpage\"    # Wait for URL pattern\nagent-browser wait 2000               # Wait milliseconds\n\n# Capture\nagent-browser screenshot              # Screenshot to temp dir\nagent-browser screenshot --full       # Full page screenshot\nagent-browser screenshot --annotate   # Annotated screenshot with numbered element labels\nagent-browser pdf output.pdf          # Save as PDF\n\n# Diff (compare page states)\nagent-browser diff snapshot                          # Compare current vs last snapshot\nagent-browser diff snapshot --baseline before.txt    # Compare current vs saved file\nagent-browser diff screenshot --baseline before.png  # Visual pixel diff\nagent-browser diff url \u003Curl1> \u003Curl2>                 # Compare two pages\nagent-browser diff url \u003Curl1> \u003Curl2> --wait-until networkidle  # Custom wait strategy\nagent-browser diff url \u003Curl1> \u003Curl2> --selector \"#main\"  # Scope to element\n```\n\n## Common Patterns\n\n### Form Submission\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fsignup\nagent-browser snapshot -i\nagent-browser fill @e1 \"Jane Doe\"\nagent-browser fill @e2 \"jane@example.com\"\nagent-browser select @e3 \"California\"\nagent-browser check @e4\nagent-browser click @e5\nagent-browser wait --load networkidle\n```\n\n### Authentication with State Persistence\n\n```bash\n# Login once and save state\nagent-browser open https:\u002F\u002Fapp.example.com\u002Flogin\nagent-browser snapshot -i\nagent-browser fill @e1 \"$USERNAME\"\nagent-browser fill @e2 \"$PASSWORD\"\nagent-browser click @e3\nagent-browser wait --url \"**\u002Fdashboard\"\nagent-browser state save auth.json\n\n# Reuse in future sessions\nagent-browser state load auth.json\nagent-browser open https:\u002F\u002Fapp.example.com\u002Fdashboard\n```\n\n### Session Persistence\n\n```bash\n# Auto-save\u002Frestore cookies and localStorage across browser restarts\nagent-browser --session-name myapp open https:\u002F\u002Fapp.example.com\u002Flogin\n# ... login flow ...\nagent-browser close  # State auto-saved to ~\u002F.agent-browser\u002Fsessions\u002F\n\n# Next time, state is auto-loaded\nagent-browser --session-name myapp open https:\u002F\u002Fapp.example.com\u002Fdashboard\n\n# Encrypt state at rest\nexport AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)\nagent-browser --session-name secure open https:\u002F\u002Fapp.example.com\n\n# Manage saved states\nagent-browser state list\nagent-browser state show myapp-default.json\nagent-browser state clear myapp\nagent-browser state clean --older-than 7\n```\n\n### Data Extraction\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fproducts\nagent-browser snapshot -i\nagent-browser get text @e5           # Get specific element text\nagent-browser get text body > page.txt  # Get all page text\n\n# JSON output for parsing\nagent-browser snapshot -i --json\nagent-browser get text @e1 --json\n```\n\n### Parallel Sessions\n\n```bash\nagent-browser --session site1 open https:\u002F\u002Fsite-a.com\nagent-browser --session site2 open https:\u002F\u002Fsite-b.com\n\nagent-browser --session site1 snapshot -i\nagent-browser --session site2 snapshot -i\n\nagent-browser session list\n```\n\n### Connect to Existing Chrome\n\n```bash\n# Auto-discover running Chrome with remote debugging enabled\nagent-browser --auto-connect open https:\u002F\u002Fexample.com\nagent-browser --auto-connect snapshot\n\n# Or with explicit CDP port\nagent-browser --cdp 9222 snapshot\n```\n\n### Visual Browser (Debugging)\n\n```bash\nagent-browser --headed open https:\u002F\u002Fexample.com\nagent-browser highlight @e1          # Highlight element\nagent-browser record start demo.webm # Record session\nagent-browser profiler start         # Start Chrome DevTools profiling\nagent-browser profiler stop trace.json # Stop and save profile (path optional)\n```\n\n### Local Files (PDFs, HTML)\n\n```bash\n# Open local files with file:\u002F\u002F URLs\nagent-browser --allow-file-access open file:\u002F\u002F\u002Fpath\u002Fto\u002Fdocument.pdf\nagent-browser --allow-file-access open file:\u002F\u002F\u002Fpath\u002Fto\u002Fpage.html\nagent-browser screenshot output.png\n```\n\n### iOS Simulator (Mobile Safari)\n\n```bash\n# List available iOS simulators\nagent-browser device list\n\n# Launch Safari on a specific device\nagent-browser -p ios --device \"iPhone 16 Pro\" open https:\u002F\u002Fexample.com\n\n# Same workflow as desktop - snapshot, interact, re-snapshot\nagent-browser -p ios snapshot -i\nagent-browser -p ios tap @e1          # Tap (alias for click)\nagent-browser -p ios fill @e2 \"text\"\nagent-browser -p ios swipe up         # Mobile-specific gesture\n\n# Take screenshot\nagent-browser -p ios screenshot mobile.png\n\n# Close session (shuts down simulator)\nagent-browser -p ios close\n```\n\n**Requirements:** macOS with Xcode, Appium (`npm install -g appium && appium driver install xcuitest`)\n\n**Real devices:** Works with physical iOS devices if pre-configured. Use `--device \"\u003CUDID>\"` where UDID is from `xcrun xctrace list devices`.\n\n## Diffing (Verifying Changes)\n\nUse `diff snapshot` after performing an action to verify it had the intended effect. This compares the current accessibility tree against the last snapshot taken in the session.\n\n```bash\n# Typical workflow: snapshot -> action -> diff\nagent-browser snapshot -i          # Take baseline snapshot\nagent-browser click @e2            # Perform action\nagent-browser diff snapshot        # See what changed (auto-compares to last snapshot)\n```\n\nFor visual regression testing or monitoring:\n\n```bash\n# Save a baseline screenshot, then compare later\nagent-browser screenshot baseline.png\n# ... time passes or changes are made ...\nagent-browser diff screenshot --baseline baseline.png\n\n# Compare staging vs production\nagent-browser diff url https:\u002F\u002Fstaging.example.com https:\u002F\u002Fprod.example.com --screenshot\n```\n\n`diff snapshot` output uses `+` for additions and `-` for removals, similar to git diff. `diff screenshot` produces a diff image with changed pixels highlighted in red, plus a mismatch percentage.\n\n## Timeouts and Slow Pages\n\nThe default Playwright timeout is 60 seconds for local browsers. For slow websites or large pages, use explicit waits instead of relying on the default timeout:\n\n```bash\n# Wait for network activity to settle (best for slow pages)\nagent-browser wait --load networkidle\n\n# Wait for a specific element to appear\nagent-browser wait \"#content\"\nagent-browser wait @e1\n\n# Wait for a specific URL pattern (useful after redirects)\nagent-browser wait --url \"**\u002Fdashboard\"\n\n# Wait for a JavaScript condition\nagent-browser wait --fn \"document.readyState === 'complete'\"\n\n# Wait a fixed duration (milliseconds) as a last resort\nagent-browser wait 5000\n```\n\nWhen dealing with consistently slow websites, use `wait --load networkidle` after `open` to ensure the page is fully loaded before taking a snapshot. If a specific element is slow to render, wait for it directly with `wait \u003Cselector>` or `wait @ref`.\n\n## Session Management and Cleanup\n\nWhen running multiple agents or automations concurrently, always use named sessions to avoid conflicts:\n\n```bash\n# Each agent gets its own isolated session\nagent-browser --session agent1 open site-a.com\nagent-browser --session agent2 open site-b.com\n\n# Check active sessions\nagent-browser session list\n```\n\nAlways close your browser session when done to avoid leaked processes:\n\n```bash\nagent-browser close                    # Close default session\nagent-browser --session agent1 close   # Close specific session\n```\n\nIf a previous session was not closed properly, the daemon may still be running. Use `agent-browser close` to clean it up before starting new work.\n\n## Ref Lifecycle (Important)\n\nRefs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after:\n\n- Clicking links or buttons that navigate\n- Form submissions\n- Dynamic content loading (dropdowns, modals)\n\n```bash\nagent-browser click @e5              # Navigates to new page\nagent-browser snapshot -i            # MUST re-snapshot\nagent-browser click @e1              # Use new refs\n```\n\n## Annotated Screenshots (Vision Mode)\n\nUse `--annotate` to take a screenshot with numbered labels overlaid on interactive elements. Each label `[N]` maps to ref `@eN`. This also caches refs, so you can interact with elements immediately without a separate snapshot.\n\n```bash\nagent-browser screenshot --annotate\n# Output includes the image path and a legend:\n#   [1] @e1 button \"Submit\"\n#   [2] @e2 link \"Home\"\n#   [3] @e3 textbox \"Email\"\nagent-browser click @e2              # Click using ref from annotated screenshot\n```\n\nUse annotated screenshots when:\n- The page has unlabeled icon buttons or visual-only elements\n- You need to verify visual layout or styling\n- Canvas or chart elements are present (invisible to text snapshots)\n- You need spatial reasoning about element positions\n\n## Semantic Locators (Alternative to Refs)\n\nWhen refs are unavailable or unreliable, use semantic locators:\n\n```bash\nagent-browser find text \"Sign In\" click\nagent-browser find label \"Email\" fill \"user@test.com\"\nagent-browser find role button click --name \"Submit\"\nagent-browser find placeholder \"Search\" type \"query\"\nagent-browser find testid \"submit-btn\" click\n```\n\n## JavaScript Evaluation (eval)\n\nUse `eval` to run JavaScript in the browser context. **Shell quoting can corrupt complex expressions** -- use `--stdin` or `-b` to avoid issues.\n\n```bash\n# Simple expressions work with regular quoting\nagent-browser eval 'document.title'\nagent-browser eval 'document.querySelectorAll(\"img\").length'\n\n# Complex JS: use --stdin with heredoc (RECOMMENDED)\nagent-browser eval --stdin \u003C\u003C'EVALEOF'\nJSON.stringify(\n  Array.from(document.querySelectorAll(\"img\"))\n    .filter(i => !i.alt)\n    .map(i => ({ src: i.src.split(\"\u002F\").pop(), width: i.width }))\n)\nEVALEOF\n\n# Alternative: base64 encoding (avoids all shell escaping issues)\nagent-browser eval -b \"$(echo -n 'Array.from(document.querySelectorAll(\"a\")).map(a => a.href)' | base64)\"\n```\n\n**Why this matters:** When the shell processes your command, inner double quotes, `!` characters (history expansion), backticks, and `$()` can all corrupt the JavaScript before it reaches agent-browser. The `--stdin` and `-b` flags bypass shell interpretation entirely.\n\n**Rules of thumb:**\n- Single-line, no nested quotes -> regular `eval 'expression'` with single quotes is fine\n- Nested quotes, arrow functions, template literals, or multiline -> use `eval --stdin \u003C\u003C'EVALEOF'`\n- Programmatic\u002Fgenerated scripts -> use `eval -b` with base64\n\n## Configuration File\n\nCreate `agent-browser.json` in the project root for persistent settings:\n\n```json\n{\n  \"headed\": true,\n  \"proxy\": \"http:\u002F\u002Flocalhost:8080\",\n  \"profile\": \".\u002Fbrowser-data\"\n}\n```\n\nPriority (lowest to highest): `~\u002F.agent-browser\u002Fconfig.json` \u003C `.\u002Fagent-browser.json` \u003C env vars \u003C CLI flags. Use `--config \u003Cpath>` or `AGENT_BROWSER_CONFIG` env var for a custom config file (exits with error if missing\u002Finvalid). All CLI options map to camelCase keys (e.g., `--executable-path` -> `\"executablePath\"`). Boolean flags accept `true`\u002F`false` values (e.g., `--headed false` overrides config). Extensions from user and project configs are merged, not replaced.\n\n## Deep-Dive Documentation\n\n| Reference | When to Use |\n|-----------|-------------|\n| [references\u002Fcommands.md](references\u002Fcommands.md) | Full command reference with all options |\n| [references\u002Fsnapshot-refs.md](references\u002Fsnapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting |\n| [references\u002Fsession-management.md](references\u002Fsession-management.md) | Parallel sessions, state persistence, concurrent scraping |\n| [references\u002Fauthentication.md](references\u002Fauthentication.md) | Login flows, OAuth, 2FA handling, state reuse |\n| [references\u002Fvideo-recording.md](references\u002Fvideo-recording.md) | Recording workflows for debugging and documentation |\n| [references\u002Fprofiling.md](references\u002Fprofiling.md) | Chrome DevTools profiling for performance analysis |\n| [references\u002Fproxy-support.md](references\u002Fproxy-support.md) | Proxy configuration, geo-testing, rotating proxies |\n\n## Ready-to-Use Templates\n\n| Template | Description |\n|----------|-------------|\n| [templates\u002Fform-automation.sh](templates\u002Fform-automation.sh) | Form filling with validation |\n| [templates\u002Fauthenticated-session.sh](templates\u002Fauthenticated-session.sh) | Login once, reuse state |\n| [templates\u002Fcapture-workflow.sh](templates\u002Fcapture-workflow.sh) | Content extraction with screenshots |\n\n```bash\n.\u002Ftemplates\u002Fform-automation.sh https:\u002F\u002Fexample.com\u002Fform\n.\u002Ftemplates\u002Fauthenticated-session.sh https:\u002F\u002Fapp.example.com\u002Flogin\n.\u002Ftemplates\u002Fcapture-workflow.sh https:\u002F\u002Fexample.com .\u002Foutput\n```\n\n## Local Dev Insights\n\n**IMPORTANT:** Read `LOCAL-INSIGHTS.md` in this skill directory for gotchas, corrections, and tested workflows discovered through hands-on use that this upstream skill doesn't cover.\n","# Browser Automation with agent-browser\n\n## Core Workflow\n\nEvery browser automation follows this pattern:\n\n1. **Navigate**: `agent-browser open \u003Curl>`\n2. **Snapshot**: `agent-browser snapshot -i` (get element refs like `@e1`, `@e2`)\n3. **Interact**: Use refs to click, fill, select\n4. **Re-snapshot**: After navigation or DOM changes, get fresh refs\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fform\nagent-browser snapshot -i\n# Output: @e1 [input type=\"email\"], @e2 [input type=\"password\"], @e3 [button] \"Submit\"\n\nagent-browser fill @e1 \"user@example.com\"\nagent-browser fill @e2 \"password123\"\nagent-browser click @e3\nagent-browser wait --load networkidle\nagent-browser snapshot -i  # Check result\n```\n\n## Command Chaining\n\nCommands can be chained with `&&` in a single shell invocation. The browser persists between commands via a background daemon, so chaining is safe and more efficient than separate calls.\n\n```bash\n# Chain open + wait + snapshot in one call\nagent-browser open https:\u002F\u002Fexample.com && agent-browser wait --load networkidle && agent-browser snapshot -i\n\n# Chain multiple interactions\nagent-browser fill @e1 \"user@example.com\" && agent-browser fill @e2 \"password123\" && agent-browser click @e3\n\n# Navigate and capture\nagent-browser open https:\u002F\u002Fexample.com && agent-browser wait --load networkidle && agent-browser screenshot page.png\n```\n\n**When to chain:** Use `&&` when you don't need to read the output of an intermediate command before proceeding (e.g., open + wait + screenshot). Run commands separately when you need to parse the output first (e.g., snapshot to discover refs, then interact using those refs).\n\n## Essential Commands\n\n```bash\n# Navigation\nagent-browser open \u003Curl>              # Navigate (aliases: goto, navigate)\nagent-browser close                   # Close browser\n\n# Snapshot\nagent-browser snapshot -i             # Interactive elements with refs (recommended)\nagent-browser snapshot -i -C          # Include cursor-interactive elements (divs with onclick, cursor:pointer)\nagent-browser snapshot -s \"#selector\" # Scope to CSS selector\n\n# Interaction (use @refs from snapshot)\nagent-browser click @e1               # Click element\nagent-browser click @e1 --new-tab     # Click and open in new tab\nagent-browser fill @e2 \"text\"         # Clear and type text\nagent-browser type @e2 \"text\"         # Type without clearing\nagent-browser select @e1 \"option\"     # Select dropdown option\nagent-browser check @e1               # Check checkbox\nagent-browser press Enter             # Press key\nagent-browser scroll down 500         # Scroll page\n\n# Get information\nagent-browser get text @e1            # Get element text\nagent-browser get url                 # Get current URL\nagent-browser get title               # Get page title\n\n# Wait\nagent-browser wait @e1                # Wait for element\nagent-browser wait --load networkidle # Wait for network idle\nagent-browser wait --url \"**\u002Fpage\"    # Wait for URL pattern\nagent-browser wait 2000               # Wait milliseconds\n\n# Capture\nagent-browser screenshot              # Screenshot to temp dir\nagent-browser screenshot --full       # Full page screenshot\nagent-browser screenshot --annotate   # Annotated screenshot with numbered element labels\nagent-browser pdf output.pdf          # Save as PDF\n\n# Diff (compare page states)\nagent-browser diff snapshot                          # Compare current vs last snapshot\nagent-browser diff snapshot --baseline before.txt    # Compare current vs saved file\nagent-browser diff screenshot --baseline before.png  # Visual pixel diff\nagent-browser diff url \u003Curl1> \u003Curl2>                 # Compare two pages\nagent-browser diff url \u003Curl1> \u003Curl2> --wait-until networkidle  # Custom wait strategy\nagent-browser diff url \u003Curl1> \u003Curl2> --selector \"#main\"  # Scope to element\n```\n\n## Common Patterns\n\n### Form Submission\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fsignup\nagent-browser snapshot -i\nagent-browser fill @e1 \"Jane Doe\"\nagent-browser fill @e2 \"jane@example.com\"\nagent-browser select @e3 \"California\"\nagent-browser check @e4\nagent-browser click @e5\nagent-browser wait --load networkidle\n```\n\n### Authentication with State Persistence\n\n```bash\n# Login once and save state\nagent-browser open https:\u002F\u002Fapp.example.com\u002Flogin\nagent-browser snapshot -i\nagent-browser fill @e1 \"$USERNAME\"\nagent-browser fill @e2 \"$PASSWORD\"\nagent-browser click @e3\nagent-browser wait --url \"**\u002Fdashboard\"\nagent-browser state save auth.json\n\n# Reuse in future sessions\nagent-browser state load auth.json\nagent-browser open https:\u002F\u002Fapp.example.com\u002Fdashboard\n```\n\n### Session Persistence\n\n```bash\n# Auto-save\u002Frestore cookies and localStorage across browser restarts\nagent-browser --session-name myapp open https:\u002F\u002Fapp.example.com\u002Flogin\n# ... login flow ...\nagent-browser close  # State auto-saved to ~\u002F.agent-browser\u002Fsessions\u002F\n\n# Next time, state is auto-loaded\nagent-browser --session-name myapp open https:\u002F\u002Fapp.example.com\u002Fdashboard\n\n# Encrypt state at rest\nexport AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)\nagent-browser --session-name secure open https:\u002F\u002Fapp.example.com\n\n# Manage saved states\nagent-browser state list\nagent-browser state show myapp-default.json\nagent-browser state clear myapp\nagent-browser state clean --older-than 7\n```\n\n### Data Extraction\n\n```bash\nagent-browser open https:\u002F\u002Fexample.com\u002Fproducts\nagent-browser snapshot -i\nagent-browser get text @e5           # Get specific element text\nagent-browser get text body > page.txt  # Get all page text\n\n# JSON output for parsing\nagent-browser snapshot -i --json\nagent-browser get text @e1 --json\n```\n\n### Parallel Sessions\n\n```bash\nagent-browser --session site1 open https:\u002F\u002Fsite-a.com\nagent-browser --session site2 open https:\u002F\u002Fsite-b.com\n\nagent-browser --session site1 snapshot -i\nagent-browser --session site2 snapshot -i\n\nagent-browser session list\n```\n\n### Connect to Existing Chrome\n\n```bash\n# Auto-discover running Chrome with remote debugging enabled\nagent-browser --auto-connect open https:\u002F\u002Fexample.com\nagent-browser --auto-connect snapshot\n\n# Or with explicit CDP port\nagent-browser --cdp 9222 snapshot\n```\n\n### Visual Browser (Debugging)\n\n```bash\nagent-browser --headed open https:\u002F\u002Fexample.com\nagent-browser highlight @e1          # Highlight element\nagent-browser record start demo.webm # Record session\nagent-browser profiler start         # Start Chrome DevTools profiling\nagent-browser profiler stop trace.json # Stop and save profile (path optional)\n```\n\n### Local Files (PDFs, HTML)\n\n```bash\n# Open local files with file:\u002F\u002F URLs\nagent-browser --allow-file-access open file:\u002F\u002F\u002Fpath\u002Fto\u002Fdocument.pdf\nagent-browser --allow-file-access open file:\u002F\u002F\u002Fpath\u002Fto\u002Fpage.html\nagent-browser screenshot output.png\n```\n\n### iOS Simulator (Mobile Safari)\n\n```bash\n# List available iOS simulators\nagent-browser device list\n\n# Launch Safari on a specific device\nagent-browser -p ios --device \"iPhone 16 Pro\" open https:\u002F\u002Fexample.com\n\n# Same workflow as desktop - snapshot, interact, re-snapshot\nagent-browser -p ios snapshot -i\nagent-browser -p ios tap @e1          # Tap (alias for click)\nagent-browser -p ios fill @e2 \"text\"\nagent-browser -p ios swipe up         # Mobile-specific gesture\n\n# Take screenshot\nagent-browser -p ios screenshot mobile.png\n\n# Close session (shuts down simulator)\nagent-browser -p ios close\n```\n\n**Requirements:** macOS with Xcode, Appium (`npm install -g appium && appium driver install xcuitest`)\n\n**Real devices:** Works with physical iOS devices if pre-configured. Use `--device \"\u003CUDID>\"` where UDID is from `xcrun xctrace list devices`.\n\n## Diffing (Verifying Changes)\n\nUse `diff snapshot` after performing an action to verify it had the intended effect. This compares the current accessibility tree against the last snapshot taken in the session.\n\n```bash\n# Typical workflow: snapshot -> action -> diff\nagent-browser snapshot -i          # Take baseline snapshot\nagent-browser click @e2            # Perform action\nagent-browser diff snapshot        # See what changed (auto-compares to last snapshot)\n```\n\nFor visual regression testing or monitoring:\n\n```bash\n# Save a baseline screenshot, then compare later\nagent-browser screenshot baseline.png\n# ... time passes or changes are made ...\nagent-browser diff screenshot --baseline baseline.png\n\n# Compare staging vs production\nagent-browser diff url https:\u002F\u002Fstaging.example.com https:\u002F\u002Fprod.example.com --screenshot\n```\n\n`diff snapshot` output uses `+` for additions and `-` for removals, similar to git diff. `diff screenshot` produces a diff image with changed pixels highlighted in red, plus a mismatch percentage.\n\n## Timeouts and Slow Pages\n\nThe default Playwright timeout is 60 seconds for local browsers. For slow websites or large pages, use explicit waits instead of relying on the default timeout:\n\n```bash\n# Wait for network activity to settle (best for slow pages)\nagent-browser wait --load networkidle\n\n# Wait for a specific element to appear\nagent-browser wait \"#content\"\nagent-browser wait @e1\n\n# Wait for a specific URL pattern (useful after redirects)\nagent-browser wait --url \"**\u002Fdashboard\"\n\n# Wait for a JavaScript condition\nagent-browser wait --fn \"document.readyState === 'complete'\"\n\n# Wait a fixed duration (milliseconds) as a last resort\nagent-browser wait 5000\n```\n\nWhen dealing with consistently slow websites, use `wait --load networkidle` after `open` to ensure the page is fully loaded before taking a snapshot. If a specific element is slow to render, wait for it directly with `wait \u003Cselector>` or `wait @ref`.\n\n## Session Management and Cleanup\n\nWhen running multiple agents or automations concurrently, always use named sessions to avoid conflicts:\n\n```bash\n# Each agent gets its own isolated session\nagent-browser --session agent1 open site-a.com\nagent-browser --session agent2 open site-b.com\n\n# Check active sessions\nagent-browser session list\n```\n\nAlways close your browser session when done to avoid leaked processes:\n\n```bash\nagent-browser close                    # Close default session\nagent-browser --session agent1 close   # Close specific session\n```\n\nIf a previous session was not closed properly, the daemon may still be running. Use `agent-browser close` to clean it up before starting new work.\n\n## Ref Lifecycle (Important)\n\nRefs (`@e1`, `@e2`, etc.) are invalidated when the page changes. Always re-snapshot after:\n\n- Clicking links or buttons that navigate\n- Form submissions\n- Dynamic content loading (dropdowns, modals)\n\n```bash\nagent-browser click @e5              # Navigates to new page\nagent-browser snapshot -i            # MUST re-snapshot\nagent-browser click @e1              # Use new refs\n```\n\n## Annotated Screenshots (Vision Mode)\n\nUse `--annotate` to take a screenshot with numbered labels overlaid on interactive elements. Each label `[N]` maps to ref `@eN`. This also caches refs, so you can interact with elements immediately without a separate snapshot.\n\n```bash\nagent-browser screenshot --annotate\n# Output includes the image path and a legend:\n#   [1] @e1 button \"Submit\"\n#   [2] @e2 link \"Home\"\n#   [3] @e3 textbox \"Email\"\nagent-browser click @e2              # Click using ref from annotated screenshot\n```\n\nUse annotated screenshots when:\n- The page has unlabeled icon buttons or visual-only elements\n- You need to verify visual layout or styling\n- Canvas or chart elements are present (invisible to text snapshots)\n- You need spatial reasoning about element positions\n\n## Semantic Locators (Alternative to Refs)\n\nWhen refs are unavailable or unreliable, use semantic locators:\n\n```bash\nagent-browser find text \"Sign In\" click\nagent-browser find label \"Email\" fill \"user@test.com\"\nagent-browser find role button click --name \"Submit\"\nagent-browser find placeholder \"Search\" type \"query\"\nagent-browser find testid \"submit-btn\" click\n```\n\n## JavaScript Evaluation (eval)\n\nUse `eval` to run JavaScript in the browser context. **Shell quoting can corrupt complex expressions** -- use `--stdin` or `-b` to avoid issues.\n\n```bash\n# Simple expressions work with regular quoting\nagent-browser eval 'document.title'\nagent-browser eval 'document.querySelectorAll(\"img\").length'\n\n# Complex JS: use --stdin with heredoc (RECOMMENDED)\nagent-browser eval --stdin \u003C\u003C'EVALEOF'\nJSON.stringify(\n  Array.from(document.querySelectorAll(\"img\"))\n    .filter(i => !i.alt)\n    .map(i => ({ src: i.src.split(\"\u002F\").pop(), width: i.width }))\n)\nEVALEOF\n\n# Alternative: base64 encoding (avoids all shell escaping issues)\nagent-browser eval -b \"$(echo -n 'Array.from(document.querySelectorAll(\"a\")).map(a => a.href)' | base64)\"\n```\n\n**Why this matters:** When the shell processes your command, inner double quotes, `!` characters (history expansion), backticks, and `$()` can all corrupt the JavaScript before it reaches agent-browser. The `--stdin` and `-b` flags bypass shell interpretation entirely.\n\n**Rules of thumb:**\n- Single-line, no nested quotes -> regular `eval 'expression'` with single quotes is fine\n- Nested quotes, arrow functions, template literals, or multiline -> use `eval --stdin \u003C\u003C'EVALEOF'`\n- Programmatic\u002Fgenerated scripts -> use `eval -b` with base64\n\n## Configuration File\n\nCreate `agent-browser.json` in the project root for persistent settings:\n\n```json\n{\n  \"headed\": true,\n  \"proxy\": \"http:\u002F\u002Flocalhost:8080\",\n  \"profile\": \".\u002Fbrowser-data\"\n}\n```\n\nPriority (lowest to highest): `~\u002F.agent-browser\u002Fconfig.json` \u003C `.\u002Fagent-browser.json` \u003C env vars \u003C CLI flags. Use `--config \u003Cpath>` or `AGENT_BROWSER_CONFIG` env var for a custom config file (exits with error if missing\u002Finvalid). All CLI options map to camelCase keys (e.g., `--executable-path` -> `\"executablePath\"`). Boolean flags accept `true`\u002F`false` values (e.g., `--headed false` overrides config). Extensions from user and project configs are merged, not replaced.\n\n## Deep-Dive Documentation\n\n| Reference | When to Use |\n|-----------|-------------|\n| [references\u002Fcommands.md](references\u002Fcommands.md) | Full command reference with all options |\n| [references\u002Fsnapshot-refs.md](references\u002Fsnapshot-refs.md) | Ref lifecycle, invalidation rules, troubleshooting |\n| [references\u002Fsession-management.md](references\u002Fsession-management.md) | Parallel sessions, state persistence, concurrent scraping |\n| [references\u002Fauthentication.md](references\u002Fauthentication.md) | Login flows, OAuth, 2FA handling, state reuse |\n| [references\u002Fvideo-recording.md](references\u002Fvideo-recording.md) | Recording workflows for debugging and documentation |\n| [references\u002Fprofiling.md](references\u002Fprofiling.md) | Chrome DevTools profiling for performance analysis |\n| [references\u002Fproxy-support.md](references\u002Fproxy-support.md) | Proxy configuration, geo-testing, rotating proxies |\n\n## Ready-to-Use Templates\n\n| Template | Description |\n|----------|-------------|\n| [templates\u002Fform-automation.sh](templates\u002Fform-automation.sh) | Form filling with validation |\n| [templates\u002Fauthenticated-session.sh](templates\u002Fauthenticated-session.sh) | Login once, reuse state |\n| [templates\u002Fcapture-workflow.sh](templates\u002Fcapture-workflow.sh) | Content extraction with screenshots |\n\n```bash\n.\u002Ftemplates\u002Fform-automation.sh https:\u002F\u002Fexample.com\u002Fform\n.\u002Ftemplates\u002Fauthenticated-session.sh https:\u002F\u002Fapp.example.com\u002Flogin\n.\u002Ftemplates\u002Fcapture-workflow.sh https:\u002F\u002Fexample.com .\u002Foutput\n```\n\n## Local Dev Insights\n\n**IMPORTANT:** Read `LOCAL-INSIGHTS.md` in this skill directory for gotchas, corrections, and tested workflows discovered through hands-on use that this upstream skill doesn't cover.\n",{"name":5,"metadata":24,"description":7,"allowed-tools":30},{"openrig":25},{"vendored_from":26,"divergence_notes":27,"vendoring_pattern":28,"last_upstream_check":29},"Vercel agent-browser (https:\u002F\u002Fgithub.com\u002Fvercel\u002Fagent-browser)","Upstream SKILL.md content tracks upstream; a small \"Local Dev Insights\"\npointer section was added near the end of the body to surface the sibling\nLOCAL-INSIGHTS.md companion file. See OPENRIG.md for the full OpenRig\nrelationship to this skill.","add-supplementary-files","2026-05-13 (initial vendoring declaration)","Bash(npx agent-browser:*), Bash(agent-browser:*)","main","60438a272b68d091eddb01aad6e399af4996d536","agents\u002Fshared\u002Fskills\u002Fprocess\u002Fagent-browser",4,"https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world","https:\u002F\u002Fgithub.com\u002Fmvschwarz","https:\u002F\u002Fopenrig.dev","Building OpenRig. Running rogue AI civilizations. Debugging their coordination problems.","2026-11-12 13:31:38",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add mvschwarz\u002Fopenrig-world --skill agent-browser",{"tool":46,"command":47},"bunx","bunx skills add mvschwarz\u002Fopenrig-world --skill agent-browser",{"tool":49,"command":50},"pnpm","pnpm dlx skills add mvschwarz\u002Fopenrig-world --skill agent-browser","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Fagents\u002Fshared\u002Fskills\u002Fprocess\u002Fagent-browser\u002FSKILL.md",true,[54,60],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"LOCAL-INSIGHTS.md","REFERENCE","参考文档",6630,"https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Fagents\u002Fshared\u002Fskills\u002Fprocess\u002Fagent-browser\u002FLOCAL-INSIGHTS.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"OPENRIG.md",2454,"https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Fagents\u002Fshared\u002Fskills\u002Fprocess\u002Fagent-browser\u002FOPENRIG.md",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DMSEDCRREMBJF57RQB59HC","notes","Use when taking notes.","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Ftools\u002Ftest\u002Ffixtures\u002Finstall-verify\u002Fbundle\u002Fagents\u002Fteam\u002Fskills\u002Fnotes\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DMSBZP9WE8MC09JDXFCR2F","software-for-agents","Use when older OpenRig instructions name software-for-agents or describe agent-in-the-middle or studio software under the former skill name.","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Frigs\u002Fworkshop\u002Fagents\u002Fworkshop\u002Fskills\u002Fsoftware-for-agents\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DMS55VHEAGPXMHZJ7FX94R","session-compaction-and-restore","Use when reasoning about what survives compaction\u002Fcontext-loss\u002Frestart\u002Fseat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions).","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Frigs\u002Fworkshop\u002Fagents\u002Fworkshop\u002Fskills\u002Fsession-compaction-and-restore\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7DMRYQK0JTV7MMVHFWZ0BW0","seat-continuity-and-handover","Use when replacing a seat's occupant (rebuild\u002Fhandover\u002Fswap), reasoning about stable-seat-identity vs fluid-occupant-identity, choosing an old-occupant disposition (retire\u002Fadvise\u002Fshadow), or recording provenance for an occupant change. Two independent outcomes (continuityOutcome + seatBindingOutcome) and the 5 failure modes that prevent silent dishonesty.","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Frigs\u002Fworkshop\u002Fagents\u002Fworkshop\u002Fskills\u002Fseat-continuity-and-handover\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7DMRP6RRGCJZSH9CE3PC1MY","retiring-and-inheriting-a-seat","Use when you are a sitting agent near your context threshold (~85%) and a PLANNED seat transition is due — retire deliberately and hand your seat to a fresh successor primed from a packet, rather than let compaction degrade you. Covers the handover packet, the append-only lineage ledger (one row per tenure), physical-seat continuity, the do-not-over-inherit framing, the optional warm-handoff window, and wake-v0 (consulting a retired predecessor). NOT for unplanned compaction\u002Fcrash recovery (session-compaction-and-restore \u002F claude-compaction-restore) and NOT the seat-binding primitive mechanics (seat-continuity-and-handover).","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Frigs\u002Fworkshop\u002Fagents\u002Fworkshop\u002Fskills\u002Fretiring-and-inheriting-a-seat\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7DMRJGN6Z8TZDR7JNHXH6KX","refocusing","Use when a long-running agent may have lost the product outcome, when context was compacted, when work has crossed a major boundary, or when a fresh path-based trace is needed before the next consequential action. Not for fresh-session orientation, waking an idle seat, or checkpoints.","https:\u002F\u002Fgithub.com\u002Fmvschwarz\u002Fopenrig-world\u002Fblob\u002Fmain\u002Frigs\u002Fworkshop\u002Fagents\u002Fworkshop\u002Fskills\u002Frefocusing\u002FSKILL.md",[],[]]