Files
workbuddy_skills/browser-harness
admin d81f75f173 技能包:配置与代码分家 —— 每包自建 env/ 放本机专属配置,scripts/ 不再写死本机路径
用户 2026-10-11 原话:
· 19:22「这个环境都是针对一台机器的,同步到别的机器把环境都搞坏了」
· 19:28「不用挪出 用env文件夹区分就行,重点是 脚本是脚本 配置是配置」
· 19:29「每个技能 需要环境配置的 都有自己的 env文件夹」
· 19:30「修改完成后要仔细检查 避免调整后 各技能脚本运行失败」

改动:
1、session-mechanism 新增 env/(roots.env=本机真身不入库 + roots.env.example=样例入库),
   install.py 的 ROOTS_ENV 改指 env/roots.env;全包脚本/hook 的配置定位统一为
   「向上 4 层 × env/roots.env 优先 → 包根 roots.env 兼容 → 技能库那份兜底」。
2、去硬编码:collabctl / keepalive / supervise-launch / board-launch 里的本机路径与本机工作区
   清单全清,改为 DSH_AIROOT(兜底 dirname(DSH_WS_ROOT))+ 扫 <AIROOT>/*/.workbuddy/collab/
   自动发现;保活任务名按 collabd-keepalive-<工作区名> 现推;启动器默认值改 ~/.workbuddy 形态。
3、browser-harness:bh_chrome_keepalive.py 默认值全部改 env 驱动,新增 env/bh.env.example。
4、.gitignore:env/ 下只放行 *.example(三行三种层级)+ 兜住旧位置的包根 roots.env。
5、改包纪律.md 新增「四、包结构:脚本是脚本,配置是配置」,立为全仓通用规矩。
6、文档同步:SKILL.md / deploy.md(新增 §3b 配置层级、§6 换机器必查 6 件事)/ rules.md /
   pitfalls.md / supervise-persistence.md。

验收(本机):py_compile 34 个 py 全过;selftest PASS 109 / FAIL 0;
逐文件实证 8 个 loader 命中 env/roots.env;preflight-lock.sh 同目录实测解出两个根;
install.py --manifest 77 份、语法失败 0。

异机验证(包拷成「新克隆」(只有 *.example)+ 另造假工作区 ws-alpha/ws-beta):
install.py --apply 自生成该机 env/roots.env;collabctl/keepalive 自动发现的确实是
ws-alpha/ws-beta、任务名现推(写死清单确已消除);部署副本本地无 roots.env 时靠
CODEBUDDY_CONFIG_DIR 兜底读到技能库那份;整套 selftest 有宿主库时 PASS 108 / FAIL 1
(唯一 FAIL=该区没有常驻心跳,环境所致;本机常驻在跑时同一套为 PASS 109 / FAIL 0)。
2026-10-11 21:49:28 +08:00
..

Browser Harness

Browser Harness ♞

Connect an LLM directly to your real browser with a thin, editable CDP harness. For browser tasks where you need complete freedom.

One websocket to Chrome, nothing between. The agent writes what's missing during execution. The harness improves itself every run.

Try browser-harness in Browser Use Cloud or paste the setup prompt into your coding agent.

  ● agent: wants to upload a file
  │
  ● agent-workspace/agent_helpers.py → helper missing
  │
  ● agent writes it                         agent_helpers.py
  │                                                       + custom helper
  ✓ file uploaded

You will never use the browser again.

Setup prompt

Paste into Claude Code or Codex:

Install or upgrade browser-harness to the latest stable version with uv using Python 3.12, register the skill from `browser-harness skill`, and connect it to my browser. Ask whether I want local browser recordings enabled; default to no and preserve my existing preference on upgrades. Follow https://github.com/browser-use/browser-harness/blob/main/install.md if setup or connection fails.

The agent will open chrome://inspect/#remote-debugging. Tick the checkbox so the agent can connect to your browser:

Remote debugging setup

Click Allow when the per-attach popup appears (Chrome 144+):

Allow remote debugging popup

See agent-workspace/domain-skills/ for example tasks.

Free Browser Use Cloud browsers

Stealth, sub-agents, or headless deployment.
Browser Use Cloud free tier: 3 concurrent browsers, proxies, captcha solving, and more. No card required.

Architecture (~1k lines across 4 core files)

  • install.md — first-time install and browser bootstrap
  • SKILL.md — day-to-day usage
  • src/browser_harness/ — protected core package
  • ${XDG_CONFIG_HOME:-~/.config}/browser-harness/agent-workspace/agent_helpers.py — helper code the agent edits
  • ${XDG_CONFIG_HOME:-~/.config}/browser-harness/agent-workspace/domain-skills/ — reusable site-specific skills the agent edits

Plain browser-harness helper calls attach to the running Chrome/Chromium CDP endpoint. For isolated automation, launch Chrome yourself with --remote-debugging-port and pass BU_CDP_URL, or use a Browser Use cloud browser.

Development

From a checkout, use ./browser-harness to run the current working tree without activating a virtualenv or depending on the globally installed command:

./browser-harness <<'PY'
print(page_info())
PY

Normal agent-facing docs should keep using browser-harness; the ./browser-harness launcher is only for local repo testing.

Contributing

PRs and improvements welcome. The best way to help: contribute a new domain skill under agent-workspace/domain-skills/ for a site or task you use often (LinkedIn outreach, ordering on Amazon, filing expenses, etc.). Each skill teaches the agent the selectors, flows, and edge cases it would otherwise have to rediscover.

  • Skills are written by the harness, not by you. Just run your task with the agent — when it figures something non-obvious out, it files the skill itself (see SKILL.md). Please don't hand-author skill files; agent-generated ones reflect what actually works in the browser.
  • Open a PR with the generated domain-skills/<site>/ folder copied into this repo's agent-workspace/domain-skills/ examples — small and focused is great.
  • Bug fixes, docs tweaks, and helper improvements are equally welcome.
  • Browse existing skills (github/, linkedin/, amazon/, ...) to see the shape.

If you're not sure where to start, open an issue and we'll point you somewhere useful.

Domain skills

Set BH_DOMAIN_SKILLS=1 to enable domain skills from the agent workspace. This repo's agent-workspace/domain-skills/ directory contains examples to contribute via PR.


The Bitter Lesson of Agent Harnesses · Web Agents That Actually Learn