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
-
Prefer the
agent_browsertool (argv: [...]) when available in the current Pi session:- It executes
agent-browserdirectly without a shell (shell: false). - It automatically scopes
AGENT_BROWSER_SESSIONto 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_browserreads the captured image and returns it inline as an image content block so you can inspect the page visually right away. - If the
agent_browsertool is unavailable, fall back to runningagent-browserviabash.
- It executes
-
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 coreThis loads the exact commands, flags, and conventions supported by the installed
agent-browserbinary.
Core Workflow Loop
Follow the open → snapshot → interact → screenshot/verify → close loop:
- Navigate (
open):{ "argv": ["open", "https://example.com"] } - Inspect interactive elements (
snapshot -i):
Returns a compact accessibility tree assigning element refs like{ "argv": ["snapshot", "-i"] }@e1,@e2,@e3to interactive elements. - Interact using
@eNrefs (click,fill,select,press,hover):{ "argv": ["click", "@e1"] }
Important: Always run{ "argv": ["fill", "@e2", "search query"] }snapshot -iagain after page navigation, form submission, modal open/close, or dynamic DOM updates because@eNrefs belong to the latest snapshot. - Capture visual state (
screenshot):
Or save to a specific file path:{ "argv": ["screenshot"] }
When called without a file path through{ "argv": ["screenshot", "artifacts/homepage.png"] }agent_browser, a temporary.pngis captured, attached inline as an image block, and cleaned up automatically. - 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
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.
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.
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.
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.
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.
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.