AGENT SKILL

browser_session

Multi-step browser automation via browser-use — the open-source framework for autonomous browser navigation (91K+ stars, MIT). Use INSTEAD of `web` when the task spans more than a single page fetch: - Login + navigate + extract (auth state preserved across steps) - 5+ page interaction sequences - DOM-numbered element targeting (the framework shows the agent which element index to click — far more reliable than guessing CSS selectors) - JS-heavy SPAs that need real interaction state, not just rendered HTML Cost: cold start ~10-20s (browser warmup + LLM init); per-step ~2-5s. **Don't use for one-shot fetches** — `web` is faster and cheaper for those. Use this when the task description naturally contains "log in", "navigate to", "fill the form", "find on page X then click", or any sentence with multiple verbs of interaction. First-time setup (one machine, ~5 min): cd skills/browser_session ./setup.sh This creates a per-skill venv at ./.venv/ and installs browser-use + Chromium. Subsequent calls use the venv directly — zero pollution of the system Python. LLM selection (env-driven, in order of preference): ANTHROPIC_API_KEY → Claude OPENAI_API_KEY → GPT-4o OLLAMA_BASE_URL=URL → local Ollama via OpenAI-compat Optional: BROWSER_USE_MODEL=<name> to override the model. Optional: BROWSER_USE_HEADLESS=false to watch the browser run.

License 许可
Apache-2.0
所属仓库
LocalKinAI/kinclaw
最近更新
2026-11-01
Stars
★ 9
Forks
3

01 前言 Front Matter

args
[ "{{task}}" ]
name
browser_session
schema
{ "task": { "type": "string", "required": true, "description": "High-level natural language task description. browser-use's\ninternal LLM agent will plan + execute the steps. Examples:\n\n\"Open Hacker News, find the top story right now, return its\n title + URL + first paragraph of the article\"\n\n\"Search GitHub for repositories matching 'computer use agent',\n sorted by stars, return the top 5 with their star counts\"\n\n\"Go to weather.com for 94025, extract today's high/low and the\n 7-day forecast as a markdown table\"\n\nThe task should be self-contained — browser-use can't ask\nfollowup questions, it just plans and acts.\n" } }
command
[ "sh", "-c", "TASK=\"$1\"\n[ -z \"$TASK\" ] && { echo \"task required\" >&2; exit 1; }\n\n# cwd is set to the skill dir by the kernel.\nif [ ! -x ./.venv/bin/python ]; then\n echo \"browser_session: venv missing — first-time setup required:\" >&2\n echo \" cd skills/browser_session && ./setup.sh\" >&2\n exit 1\nfi\n\nif ! ./.venv/bin/python -c \"import browser_use\" 2>/dev/null; then\n echo \"browser_session: venv exists but browser-use not installed —\" >&2\n echo \" re-run: cd skills/browser_session && ./setup.sh\" >&2\n exit 1\nfi\n\n# Sensible defaults so the skill works out of the box on a typical\n# KinClaw setup (local Ollama running, no external API keys\n# required). User-set env (ANTHROPIC_API_KEY etc.) still takes\n# precedence — runner.py picks Anthropic > OpenAI > Ollama.\n: \"${OLLAMA_BASE_URL:=http://localhost:11434}\"\n: \"${BROWSER_USE_MODEL:=kimi-k2.6:cloud}\"\nexport OLLAMA_BASE_URL BROWSER_USE_MODEL\n\n./.venv/bin/python ./runner.py \"$TASK\"\n", "_" ]
timeout
600
description
Multi-step browser automation via browser-use — the open-source framework for autonomous browser navigation (91K+ stars, MIT). Use INSTEAD of `web` when the task spans more than a single page fetch: - Login + navigate + extract (auth state preserved across steps) - 5+ page interaction sequences - DOM-numbered element targeting (the framework shows the agent which element index to click — far more reliable than guessing CSS selectors) - JS-heavy SPAs that need real interaction state, not just rendered HTML Cost: cold start ~10-20s (browser warmup + LLM init); per-step ~2-5s. **Don't use for one-shot fetches** — `web` is faster and cheaper for those. Use this when the task description naturally contains "log in", "navigate to", "fill the form", "find on page X then click", or any sentence with multiple verbs of interaction. First-time setup (one machine, ~5 min): cd skills/browser_session ./setup.sh This creates a per-skill venv at ./.venv/ and installs browser-use + Chromium. Subsequent calls use the venv directly — zero pollution of the system Python. LLM selection (env-driven, in order of preference): ANTHROPIC_API_KEY → Claude OPENAI_API_KEY → GPT-4o OLLAMA_BASE_URL=URL → local Ollama via OpenAI-compat Optional: BROWSER_USE_MODEL=<name> to override the model. Optional: BROWSER_USE_HEADLESS=false to watch the browser run.

02 资源文件 5

03 SKILL.md 正文

browser_session — multi-step browser automation

A web claw on steroids. While web is a one-shot Playwright wrapper good for "fetch this page and read it", browser_session hands the entire interaction loop to browser-use — a framework that keeps a persistent browser, decorates the DOM with numbered element IDs, and has its own LLM-driven planning loop to execute multi-step tasks.

When to use which

Need Tool Why
Read one page's content web Cheap (~3s cold start), trivial
Run one JS expression web Same
Take one screenshot web Same
Click + type once web Same — click= + type_text=
Login + then do stuff browser_session Persistent session
5+ page navigation browser_session No cold-start per step
Form + multi-page wizard browser_session Framework handles state
Anything where a CSS selector won't survive browser_session Element-index targeting

Why a super-skill

browser_session is the first member of LocalKin's super-skill pattern: skills that wrap a battle-tested third-party OSS framework (here, browser-use's 91K-star codebase) inside a thin SKILL.md adapter. The kinclaw kernel doesn't care that there's an entire LLM-driven planning agent inside; it just sees one tool call going in, one result coming out.

This is "thin soul, fat skill" pushed to its useful extreme:

  • We don't reinvent browser-use. We host it.
  • Other LocalKin souls (researcher / marketer / curator) can also enable browser_session and get the same capability.
  • If browser-use ships a new version, we re-run setup.sh — the SKILL.md interface stays the same.

Setup details

./setup.sh:

  1. Picks a Python ≥3.11 (homebrew, pyenv, or system) — browser-use doesn't support 3.10
  2. Creates ./.venv/ (per-skill venv, isolated)
  3. pip install browser-use playwright
  4. playwright install chromium (~92 MB Chrome Headless Shell)
  5. Verifies the imports work

The venv lives in ./.venv/. Add .venv/ to .gitignore so the ~500 MB of dependencies don't get committed.

LLM selection

The framework drives a real LLM internally. Pick one with vision support — browser-use feeds screenshots to the LLM for visual reasoning. Recommended (in descending preference):

  1. claude-sonnet-4.5 via ANTHROPIC_API_KEY — current SOTA for browser-use's WebVoyager benchmark
  2. gpt-4o via OPENAI_API_KEY — second-best, cheaper
  3. Local Ollama with a vision model (e.g. qwen2.5-vl:7b) via OLLAMA_BASE_URL=http://localhost:11434 — free but ~3-5x slower per step; good for long batch runs you don't want to pay for

Set BROWSER_USE_MODEL=<name> to override the default for the selected provider.

Returns

stdout: the agent's final answer (a string — could be markdown if the task asked for structured output).

stderr: errors, warnings, the playwright/chromium boot noise.

Non-zero exit: agent failed or reported errors. The kernel will surface this as a tool error to the calling soul.

Costs

A typical 5-step task with Claude Sonnet:

  • ~30-60 seconds wall-clock
  • ~$0.05-0.15 in API tokens (browser-use sends DOM + screenshot at every step)

For dev/test use the local Ollama path; for production runs use Anthropic.

04 同仓库更多 Skills

LocalKinAI
LocalKinAI/kinclaw

web

Universal web tool — fetches and interacts with web pages through real Chromium (Playwright). Renders JavaScript, follows redirects, handles cookies, bypasses many anti-scrape stubs that block plain `web_fetch`. Each call launches a fresh browser, executes the requested flow, closes. ~2-3s cold start; no persistent state. Use INSTEAD of `web_fetch` when: - Target is a JS-heavy SPA (prices via XHR, lazy content) - `web_fetch` returned an anti-scrape placeholder (Zhihu's "click here" stub, JD's chrome-only HTML) - You need to interact (click, fill input) before extracting Common patterns: fetch rendered text: url=X wait for content then read: url=X wait_for=".price" extract specific element: url=X selector=".product-list" click and read result: url=X click=".search-button" fill form, then read: url=X click="input[name=q]" type_text="kinclaw" fill + Enter (React forms): url=X click="input" type_text="hi" press_enter=true wait_for=".reply" screenshot the page: url=X screenshot=true (returns image:// marker) run JS and get result: url=X js="document.title" First-time setup (one-time per machine, ~500MB Chromium download): pip install playwright playwright install chromium

文档处理测试与质量
★ 9
LocalKinAI
LocalKinAI/kinclaw

weather

Current conditions plus a three-day forecast (today / tomorrow / day after) for a place, in metric, from wttr.in. No API key. Use this for any weather question — including "明天" and "后天" — before reaching for web search.

★ 9
LocalKinAI
LocalKinAI/kinclaw

tts

Synthesize speech from text and play it through the macOS speakers. Talks to a local LocalKin Service Audio Server (default :8001 / Kokoro). When `record` is running with audio=true, the spoken audio is captured into the recording — use this in place of `shell say` for high-quality multilingual narration in demo videos. Set the TTS_ENDPOINT env var to point at a different server.

图像与多媒体Skill与智能体开发
★ 9
LocalKinAI
LocalKinAI/kinclaw

translate

Translate text between languages using the system's translate command

★ 9
LocalKinAI
LocalKinAI/kinclaw

summarize

Summarize a file's contents into key bullet points

资料检索与研究
★ 9
LocalKinAI
LocalKinAI/kinclaw

stt

Transcribe an audio file (wav/mp3/mp4/m4a) into text via a local LocalKin Service Audio Server (default :8000 / SenseVoice). Pair with `record action=start mic=true` to turn a recorded mic track into text. Set STT_ENDPOINT env var to point at a different server.

图像与多媒体
★ 9