d-wwei/browser-control-skill/browser-control
Claude Code and agent skill by d-wwei/browser-control-skill
- community
Checking that the SKILL.md file is still in the repository.
Full browser control skill for AI agents. Multi-channel web access (search, fetch, Jina, CDP) with real Chrome session inheritance. Read, click, fill, upload, screenshot — including pages behind authentication. Three-layer safety system. Sub-agent parallel dispatch. Site experience memory. Auto-detects macOS, Windows, and Linux.
Install
npx vskill@latest install d-wwei/browser-control-skill/browser-controlSKILL.md
Browser Control
Control the user's real Chrome browser with full login session inheritance. Multi-channel web access — from lightweight search to full CDP browser automation — with three-layer safety, sub-agent parallel dispatch, and site experience memory.
When to Use
- Access any web page — public or behind corporate authentication (SSO, MFA, security gateways)
- Search, fetch, and extract information from the web
- Automate browser interactions: clicking, form filling, navigation, file upload
- Read content from dynamic pages (SPA, lazy-load, infinite scroll, virtual DOM)
- Write operations: compose messages, submit forms, upload files on web apps
- Rich interactions: React/Vue apps, rich text editors, file pickers, dropdowns
- Parallel research: dispatch sub-agents to investigate multiple targets simultaneously
Companion Sub-Skill: Web Search
For enhanced public web search, the companion web-search sub-skill (powered by omni-search-skill) provides multi-engine search, fetch, resolve, and crawl — stronger than built-in WebSearch/WebFetch.
On first use, check availability:
If not installed, suggest once:
💡 For enhanced web search, consider installing omni-search-skill:git clone https://github.com/d-wwei/omni-search-skill.git && cd omni-search-skill && python3 -m pip install -r requirements.txt
Do not block on this — built-in multi-channel tools (WebSearch → WebFetch → Jina → curl → CDP) work without it. Only suggest once per session.
Browsing Philosophy
Browse like a human — goal-driven, adaptive, evidence-based.
Do not over-plan steps upfront. Enter with a clear goal, observe the page, decide the next action based on what you see, handle obstacles as they arise, and dig deeper when content is insufficient. Every decision traces back to: "Am I getting closer to what the user needs?"
The Four Phases
1. Understand — Clarify what the user wants. Define success: what information, what action, what result? This anchors all subsequent decisions.
2. Enter — Choose the most direct entry point for the task. Consider platform characteristics and success criteria. If login is needed or static methods are known to fail (e.g., Xiaohongshu, WeChat), go straight to CDP.
3. Verify — Every result is evidence, not just pass/fail. Compare against the success criteria from phase 1. Is the path progressing? Is the quality, relevance, and completeness pointing toward the goal? If direction is wrong, pivot immediately — don't retry the same approach hoping for different results. Search misses don't always mean "wrong query" — they might mean "target doesn't exist." API errors, missing DOM elements, unchanged results after retry: these all signal "reassess direction."
4. Complete — Check against the defined success criteria. Stop when done. Don't over-operate for the sake of "completeness."
Step-by-Step Reasoning (EOPA)
Before each browser action, follow this mental model:
E — EVALUATE: What happened after my last action? Did it succeed?
- If I navigated: did the URL change? Is the page loaded?
- If I clicked: did anything change on the page?
- If I typed: is the text visible in the field?
O — OBSERVE: What does the current page state tell me?
- Read page content or check the current URL
- What interactive elements are available?
- Am I on the right page for the user's goal?
Auto-snapshot rules — decide whether to re-read:
- Last action was read-only (get text, get URL, list elements) → page state unchanged, skip re-read
- Last action was click / navigate / submit / scroll-that-loads → page state likely changed, must re-read
- You already have the exact selector or element index → operate directly, no need to list all elements first
- Never execute the same read command twice consecutively
P — PLAN: What is the single next action needed?
- Do I need to scroll to reveal more content?
- Do I need to wait for something to load?
- Which specific element should I interact with?
A — ACT: Execute exactly ONE browser action, then return to E.
Multi-Channel Web Access
Choose the lightest tool that gets the job done. Escalate only when lighter tools fail.
| Scenario | Tool | Notes | |
|---|---|---|---|
| Search snippets, discover sources | WebSearch | Discovery only — not proof of truth | |
| Known URL, extract specific info | WebFetch | Small model processes content per your prompt | |
| Known URL, need raw HTML (meta, JSON-LD) | curl | Direct, fast | |
| Known URL, convert to Markdown (save tokens) | Jina (r.jina.ai/example.com) | 20 RPM limit; best for articles/docs | |
| Dynamic content, anti-scraping sites | CDP Browser | Full browser rendering | |
| Login required, interactive operations | CDP Browser | Inherits real session |
Jina usage: Prefix URL without http(s):// — e.g., curl -s https://r.jina.ai/example.com. Great for articles, blogs, documentation. May extract wrong sections on dashboards or product pages.
Escalation principle: When multiple search attempts show no quality improvement, escalate to primary sources (official sites, original pages) via CDP.
Information integrity: Search engines are discovery tools, not proof. Primary sources (official sites, original documents, source code) outweigh secondary reports. Multiple media citing the same error creates circular confirmation — always trace to origin.
Programmatic vs GUI Interaction
Inside the browser, two approaches:
- Programmatic (construct URL, eval DOM): Fast and precise when it works, but sites may detect non-human behavior and trigger anti-scraping.
- GUI interaction (click buttons, fill inputs, scroll): Designed for humans — sites never restrict normal UI operations. Reliable fallback.
When programmatic access fails, GUI interaction is the dependable fallback. Site-generated links (DOM hrefs) carry full context; manually constructed URLs may miss implicit parameters.
Platform Detection
Before executing any command, detect the platform:
- Darwin → macOS → AppleScript (basic) + CDP Proxy (advanced)
- Linux → CDP Proxy
- MINGW* / CYGWIN* / MSYS* / Windows_NT → CDP Proxy (+ optional agent-browser)
Preflight Check
macOS AppleScript Preflight
If the second command fails: Chrome → View → Developer → Allow JavaScript from Apple Events (中文: 查看 → 开发者 → 允许 Apple 事件中的 JavaScript).
CDP Preflight (All Platforms)
The script checks Node.js 22+, Chrome debug port, and starts the CDP Proxy if needed.
Chrome remote debugging setup: Open chrome://inspect/#remote-debugging in Chrome, check "Allow remote debugging for this browser instance", restart Chrome if needed.
Mode Routing
This skill operates in two modes. The /browse command handles routing automatically, but the logic is documented here for all agents.
Two Modes
Foreground (`here`) — macOS AppleScript, operates on user's visible page
- Targets
front window→active tab— the page the user is looking at - User sees every action in real time
- Zero dependencies beyond Chrome
- Single-page, supervised operations
Background (`bg`) — CDP Proxy, operates in background tabs
- Creates its own tabs, never touches user's tabs
- User continues browsing normally, zero disruption
- Supports sub-agent parallel dispatch
- Required for advanced write operations (keyboard, upload, hover, isTrusted)
Routing Decision
Escalation Within Foreground Mode
If a foreground (AppleScript) operation fails:
- Try React-compatible event dispatch (still AppleScript)
- Still fails → auto-start CDP Proxy, switch to CDP for that operation
- Simple reads can stay on AppleScript even after one operation escalated
Operation-Level Reference
| Task | Foreground | Background | |
|---|---|---|---|
| Read page text/HTML | AppleScript JS eval | CDP /eval | |
| Click links, basic form fill | AppleScript JS click | CDP /click | |
| Navigate | AppleScript new tab | CDP /new | |
| Upload files | — (escalate to CDP) | CDP /setFiles or helper | |
| Rich text editors | — (escalate to CDP) | CDP helper type | |
Sites checking isTrusted | — (escalate to CDP) | CDP /clickAt | |
| Keyboard shortcuts | — (escalate to CDP) | CDP helper key | |
| Hover-triggered menus | — (escalate to CDP) | CDP helper hover | |
| Parallel multi-target | Not possible | Sub-agent dispatch |
Element Targeting Priority
macOS (AppleScript)
- Element index — inject
List Interactive Elements, then usewindow.__interactiveElements[index](most reliable) - Text content match — most readable for buttons/links
- CSS selector — for form inputs, specific elements
- Coordinates — last resort, fragile across screen sizes
CDP (All Platforms)
- CSS selector via
/click— simple JS click, fast - CDP mouse event via
/clickAt— trusted, bypasses anti-automation - JS eval — for complex targeting logic
- Coordinates via CDP
Input.dispatchMouseEvent— when all else fails
macOS AppleScript Quick Reference
Zero-dependency browser control via macOS native AppleScript. Full reference: modules/applescript-commands.md
For JXA tab targeting and MutationObserver-based element waiting, see modules/advanced-applescript.md.
CDP Proxy Quick Reference
HTTP-to-CDP bridge proxy for the user's daily Chrome. Full reference: modules/cdp-proxy-api.md
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/browser-control/SKILL.md
Popularity
- Repository stars
- 13
- Repository forks
- 1
- 7-day trend score
- 13
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/d-wwei/browser-control-skill/browser-control)