一键导入
browsermate
Direct browser control via CDP. Use when the user wants to automate, scrape, test, or interact with web pages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Direct browser control via CDP. Use when the user wants to automate, scrape, test, or interact with web pages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | browsermate |
| description | Direct browser control via CDP. Use when the user wants to automate, scrape, test, or interact with web pages. |
Give your Claude Code agent full browser control. Read this file in full before using or editing the harness.
Read helpers.py first.
browsermate <<'PY'
new_tab("https://example.com")
wait_for_load()
print(page_info())
PY
browsermate — it's on $PATH. No cd, no uv run.new_tab(url), not goto(url) — goto runs in the user's active tab.The code is the doc.
Available interaction skills:
interaction-skills/connection.md — startup sequence, tab visibility, omnibox popup fixAvailable domain skills:
domain-skills/ for site-specific patterns you or your agent have contributedbrowsermate <<'PY'
# any python. helpers pre-imported. daemon auto-starts.
PY
run.py calls ensure_daemon() before exec — you never start/stop manually unless you want to.
Use remote for parallel sub-agents (each gets its own isolated browser via a distinct BU_NAME) or on a headless server. BROWSER_USE_API_KEY must be set. start_remote_daemon, list_cloud_profiles, list_local_profiles, sync_local_profile are pre-imported.
browsermate <<'PY'
start_remote_daemon("work") # default — clean browser, no profile
# start_remote_daemon("work", profileName="my-work") # reuse a cloud profile (already logged in)
# start_remote_daemon("work", profileId="<uuid>") # same, but by UUID
# start_remote_daemon("work", proxyCountryCode="de", timeout=120) # DE proxy, 2-hour timeout
PY
BU_NAME=work browsermate <<'PY'
new_tab("https://example.com")
print(page_info())
PY
start_remote_daemon prints liveUrl and auto-opens it in the local browser (if a GUI is detected) so you can watch along.
After cloning the repo, search domain-skills/ first for the domain you are working on before inventing a new approach.
Only if you start struggling with a specific mechanic while navigating, look in interaction-skills/ for helpers.
If you learned anything non-obvious about how a site works, write it to domain-skills/<site>/ before you finish. Default to contributing. The harness gets better only because agents file what they learn.
Examples of what's worth writing:
wait_for_load() missesThe durable shape of the site — the map, not the diary:
screenshot() to understand the page, find targets, decide next action.screenshot() → look → click(x, y) → screenshot() again to verify.http_get(url) + ThreadPoolExecutor. No browser for static pages.wait_for_load().ensure_real_tab().print(page_info()) for a quick health check. Screenshots for visual verification.js(...) for inspection and extraction when screenshots show coordinates are wrong.click(x, y) passes through; only drop to iframe DOM work when needed.cdp("Domain.method", **params).Browser (local or cloud) -> CDP WS -> daemon.py -> /tmp/bu-<NAME>.sock -> run.py
BU_NAME namespaces socket, pid, and log files.BU_CDP_WS overrides local browser discovery for remote browsers.BU_BROWSER_ID + BROWSER_USE_API_KEY lets the daemon stop a cloud browser on shutdown.The harness needs a CDP-enabled browser to connect to. How you get there is up to you. Options:
BU_CDP_WS environment variable pointing at any CDP websocketstart_remote_daemon()DevToolsActivePort can exist before the port is actually listening. Give it a few seconds.page targets. Filter them when looking for real tabs.ensure_real_tab() re-attaches.no close frame received or sent usually means stale daemon. Use restart_daemon().cdpUrl is HTTPS, not ws. Resolve via /json/version.interaction-skills/ holds reusable UI mechanics (dialogs, tabs, dropdowns, iframes, uploads).domain-skills/ holds site-specific workflows — update when you discover patterns.