Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
fix browser-use skill sync
Laith Weinberger3ed95c8b9c54
diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.ymlindex 8a6f407dc..2396837f3 100644--- a/.github/workflows/install-script.yml+++ b/.github/workflows/install-script.yml@@ -37,11 +37,8 @@ jobs:steps:- uses: actions/checkout@v4- - name: Install uv- uses: astral-sh/setup-uv@v6-- name: Check generated Browser Use skill- run: uv run --no-sync python scripts/sync_browser_harness_skill.py --check+ run: python3 scripts/sync_browser_harness_skill.py --checktest-pip-install:name: uv pip install (${{ matrix.os }})diff --git a/browser_use/skills/browser-use/SKILL.md b/browser_use/skills/browser-use/SKILL.mdindex b30a9767c..994aade1e 100644--- a/browser_use/skills/browser-use/SKILL.md+++ b/browser_use/skills/browser-use/SKILL.md@@ -5,7 +5,7 @@ description: "Direct browser control via CDP for web interaction: automation, sc# Browser Use-Direct browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py`. For setup, install, or connection problems, read https://github.com/browser-use/browser-use/blob/main/install.md.+Direct browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py`. For setup, install, or connection problems, read https://github.com/browser-use/browser-harness/blob/main/install.md.Domain skills are off by default. Set `BH_DOMAIN_SKILLS=1` to enable them; see the bottom section.@@ -71,7 +71,7 @@ When the task is done and a cloud browser is still running, ask directly: "ShoulDo not start a remote daemon and then keep using the default daemon. Use the same name for `BU_NAME`.-Cloud profile cookie sync reference: https://github.com/browser-use/browser-use/blob/main/interaction-skills/profile-sync.md.+Cloud profile cookie sync reference: https://github.com/browser-use/browser-harness/blob/main/interaction-skills/profile-sync.md.## Page Workflow@@ -85,7 +85,7 @@ Cloud profile cookie sync reference: https://github.com/browser-use/browser-use/## Interaction Skills-If you get stuck on a browser mechanic, check https://github.com/browser-use/browser-use/tree/main/interaction-skills.+If you get stuck on a browser mechanic, check https://github.com/browser-use/browser-harness/tree/main/interaction-skills.- connection.md- cookies.mddiff --git a/browser_use/skills/browser_use.py b/browser_use/skills/browser_use.pyindex c354b54fd..2fd43076c 100644--- a/browser_use/skills/browser_use.py+++ b/browser_use/skills/browser_use.py@@ -40,24 +40,21 @@ def as_browser_use_skill(text: str) -> str:)body = body.replace('# browser-harness', '# Browser Use', 1).replace('# Browser Harness', '# Browser Use', 1)+ body = body.replace('`browser-harness`', '`browser-use`')body = body.replace('browser-harness <<', 'browser-use <<')body = body.replace('browser-harness --', 'browser-use --')body = body.replace('browser-harness auth', 'browser-use auth')body = body.replace('browser-harness doctor', 'browser-use doctor')body = body.replace('Browser Harness', 'Browser Use')- body = body.replace('browser-harness', 'browser-use')frontmatter_text = '\n'.join(lines)return f'---\n{frontmatter_text}\n---\n{body}'def skill_text() -> str:"""Return the canonical Browser Use skill."""- for skill_path in (- Path(__file__).resolve().parent / 'browser-use' / 'SKILL.md',- Path(__file__).resolve().parents[2] / 'skills' / 'browser-use' / 'SKILL.md',- ):- if skill_path.exists():- return skill_path.read_text(encoding='utf-8')+ skill_path = Path(__file__).resolve().parent / 'browser-use' / 'SKILL.md'+ if skill_path.exists():+ return skill_path.read_text(encoding='utf-8')try:text = resources.files('browser_harness').joinpath('SKILL.md').read_text(encoding='utf-8')diff --git a/scripts/sync_browser_harness_skill.py b/scripts/sync_browser_harness_skill.pyindex 93ce9ce6e..4fe8e8c86 100644--- a/scripts/sync_browser_harness_skill.py+++ b/scripts/sync_browser_harness_skill.py@@ -2,12 +2,12 @@ from __future__ import annotationsimport argparseimport difflib+import importlib.utilimport sysfrom pathlib import Pathfrom urllib.request import urlopenROOT = Path(__file__).resolve().parents[1]-sys.path.insert(0, str(ROOT))DEFAULT_SOURCE_URL = 'https://raw.githubusercontent.com/browser-use/browser-harness/refs/heads/main/SKILL.md'DEFAULT_REPO_OUTPUT_PATH = ROOT / 'skills' / 'browser-use' / 'SKILL.md'DEFAULT_PACKAGE_OUTPUT_PATH = ROOT / 'browser_use' / 'skills' / 'browser-use' / 'SKILL.md'@@ -21,9 +21,14 @@ def _read_source(source: str) -> str:def _to_browser_use_skill(text: str) -> str:- from browser_use.skills.browser_use import as_browser_use_skill+ module_path = ROOT / 'browser_use' / 'skills' / 'browser_use.py'+ spec = importlib.util.spec_from_file_location('browser_use_skill_rewriter', module_path)+ if spec is None or spec.loader is None:+ raise RuntimeError(f'Could not load Browser Use skill rewriter from {module_path}')+ module = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(module)- return as_browser_use_skill(text)+ return module.as_browser_use_skill(text)def _build_parser() -> argparse.ArgumentParser:diff --git a/skills/browser-use/SKILL.md b/skills/browser-use/SKILL.mdindex b30a9767c..994aade1e 100644--- a/skills/browser-use/SKILL.md+++ b/skills/browser-use/SKILL.md@@ -5,7 +5,7 @@ description: "Direct browser control via CDP for web interaction: automation, sc# Browser Use-Direct browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py`. For setup, install, or connection problems, read https://github.com/browser-use/browser-use/blob/main/install.md.+Direct browser control via CDP. For task-specific edits, use `agent-workspace/agent_helpers.py`. For setup, install, or connection problems, read https://github.com/browser-use/browser-harness/blob/main/install.md.Domain skills are off by default. Set `BH_DOMAIN_SKILLS=1` to enable them; see the bottom section.@@ -71,7 +71,7 @@ When the task is done and a cloud browser is still running, ask directly: "ShoulDo not start a remote daemon and then keep using the default daemon. Use the same name for `BU_NAME`.-Cloud profile cookie sync reference: https://github.com/browser-use/browser-use/blob/main/interaction-skills/profile-sync.md.+Cloud profile cookie sync reference: https://github.com/browser-use/browser-harness/blob/main/interaction-skills/profile-sync.md.## Page Workflow@@ -85,7 +85,7 @@ Cloud profile cookie sync reference: https://github.com/browser-use/browser-use/## Interaction Skills-If you get stuck on a browser mechanic, check https://github.com/browser-use/browser-use/tree/main/interaction-skills.+If you get stuck on a browser mechanic, check https://github.com/browser-use/browser-harness/tree/main/interaction-skills.- connection.md- cookies.md