AGENT SKILL

agent-browser

Browser automation and web testing for AI agents using agent-browser (Chrome/Chromium CDP, accessibility-tree snapshots with @eN element refs, inline screenshots, and isolated sessions). Use when the user wants to open a website, test a web app, inspect UI, click buttons, fill forms, take screenshots, scrape data, or run exploratory QA.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 3
Forks
0

01 前言 Front Matter

name
agent-browser
description
Browser automation and web testing for AI agents using agent-browser (Chrome/Chromium CDP, accessibility-tree snapshots with @eN element refs, inline screenshots, and isolated sessions). Use when the user wants to open a website, test a web app, inspect UI, click buttons, fill forms, take screenshots, scrape data, or run exploratory QA.

03 SKILL.md 正文

Browser Automation with agent-browser

Drive a real headless or headed Chrome/Chromium browser through agent-browser using compact accessibility-tree snapshots (@e1, @e2, …) and deterministic ref-based interactions.

Tool Preference & First Step

  1. Prefer the agent_browser tool (argv: [...]) when available in the current Pi session:

    • It executes agent-browser directly without a shell (shell: false).
    • It automatically scopes AGENT_BROWSER_SESSION to the current Pi session (pi-<sessionId>) so concurrent sessions never collide.
    • It automatically closes the session's browser daemon when the Pi session switches or shuts down.
    • When you run screenshot, agent_browser reads the captured image and returns it inline as an image content block so you can inspect the page visually right away.
    • If the agent_browser tool is unavailable, fall back to running agent-browser via bash.
  2. Load the CLI's version-matched core workflow skill before your first browser action:

    { "argv": ["skills", "get", "core"] }
    

    Or via CLI:

    agent-browser skills get core
    

    This loads the exact commands, flags, and conventions supported by the installed agent-browser binary.

Core Workflow Loop

Follow the open → snapshot → interact → screenshot/verify → close loop:

  1. Navigate (open):
    { "argv": ["open", "https://example.com"] }
    
  2. Inspect interactive elements (snapshot -i):
    { "argv": ["snapshot", "-i"] }
    
    Returns a compact accessibility tree assigning element refs like @e1, @e2, @e3 to interactive elements.
  3. Interact using @eN refs (click, fill, select, press, hover):
    { "argv": ["click", "@e1"] }
    
    { "argv": ["fill", "@e2", "search query"] }
    
    Important: Always run snapshot -i again after page navigation, form submission, modal open/close, or dynamic DOM updates because @eN refs belong to the latest snapshot.
  4. Capture visual state (screenshot):
    { "argv": ["screenshot"] }
    
    Or save to a specific file path:
    { "argv": ["screenshot", "artifacts/homepage.png"] }
    
    When called without a file path through agent_browser, a temporary .png is captured, attached inline as an image block, and cleaned up automatically.
  5. Close the browser when done (close):
    { "argv": ["close"] }
    

Specialized Workflow Skills

agent-browser bundles additional specialized workflow guides you can load on demand:

  • List available skills:
    { "argv": ["skills", "list"] }
    
  • Fetch a specialized skill:
    • dogfood — exploratory QA and bug hunting on a live web application (argv: ["skills", "get", "dogfood"])
    • electron — automating Electron desktop apps over CDP (argv: ["skills", "get", "electron"])
    • slack — automating Slack workspaces (argv: ["skills", "get", "slack"])
    • derive-client — inspecting network traffic to derive typed API clients (argv: ["skills", "get", "derive-client"])

Prerequisite

If agent-browser is not installed on the host machine, install the CLI and its browser runtime with:

npm install -g agent-browser && agent-browser install

04 同仓库更多 Skills

minhuw
minhuw/pi-extensions

ui-sdk

Builds interfaces with ui-sdk in React, Vue, Svelte, Solid or web components. Covers choosing and composing its components, building a component or behavior it doesn't ship from @ui-sdk/core (like a stepper, splitter, transfer list or emoji picker), making the interface usable by agents through createAgent, agent tools and WebMCP, and testing keyboard, focus, ARIA, server rendering and right to left, including writing tests for an existing component. Use whenever a project has @ui-sdk/* installed or the user mentions ui-sdk.

★ 3
minhuw
minhuw/pi-extensions

pika-relay

Talk to Pi agents and other Codex threads through pika relay, and stand by for their requests. Use when a [relay] message arrives, when the user asks to message, list, or coordinate with other agents or Pi sessions, or when asked to stand by on pika relay.

★ 3
minhuw
minhuw/pi-extensions

impeccable

Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks.

★ 3
minhuw
minhuw/pi-extensions

herder-simplify

Survey a codebase, read-only, for evidence-backed opportunities to delete or consolidate code, retire obsolete paths and abstractions, reduce state and control-flow complexity, and lower maintenance burden without changing required behavior; then let the user pick findings and start a Herder run for them. Use after /herder-simplify or when asked for a smaller, clearer, easier-to-maintain codebase with the work run by Herder.

★ 3
minhuw
minhuw/pi-extensions

herder-improve

Survey a codebase as a senior advisor, read-only, and present prioritized, verified findings - bugs, security, performance, tests, architecture, dependencies, tooling, docs, and evidence-backed direction - then let the user pick findings and start a Herder run for them. Use after /herder-improve or when asked to audit code or find improvement opportunities to hand to Herder.

★ 3
minhuw
minhuw/pi-extensions

herder

Runs coding work as a durable, verified Herder run - an approved goal with checks, agent steps in isolated git worktrees, serial integration, runtime verification, and delivery after user confirmation. Use after /herder or /herder resume, or when a Herder run is active and you need to plan, orchestrate, verify, or deliver it.

★ 3