Agent skill

browser

Complete real user web tasks end-to-end via browser-tool, navigate, interact, wait for page state, extract results, and provide evidence when needed.

Stars 518
Forks 84

Install this agent skill to your Project

npx add-skill https://github.com/wecode-ai/Wegent/tree/main/backend/init_data/skills/browser

SKILL.md

Browser Control Skill

Goal

Finish the user’s real task reliably.
Prioritize successful completion and correct results over aggressive call minimization.

Operating Rules

  1. Start with the intended action directly (navigate/open/act/evaluate). Do not run status as a pre-check.
  2. Use snapshot only when refs are required for interaction (click/type/select/drag/scrollIntoView).
  3. Prefer evaluate for extraction. Return structured data in one comprehensive call when possible.
  4. Use condition waits by default (loadState/urlselector/text/textGonefn). Avoid timeMs unless explicitly needed.
  5. Before clicking potentially off-screen elements, run act.scrollIntoView on the ref first.
  6. Keep context stable: once targetId is known, pass it in follow-up calls when supported.
  7. Avoid blind loops: every extra call must have a clear purpose.

Reliability and Recovery

  1. If Ref not found, do not reuse stale refs. Take one fresh snapshot, retry once, then stop if still failing.
  2. For repeated failures with the same cause, stop and explain the blocker clearly instead of retrying endlessly.
  3. Connection recovery is built into the tool. Allow auto-recovery once; if still disconnected, instruct user to install/connect extension.

Screenshot Policy

  1. Default: no screenshot.
  2. Use screenshots only when user asks, or when visual proof is required.
  3. Prefer element screenshots (ref or element) over full-page screenshots.
  4. Use full-page screenshots only for page-level evidence.

Recommended Flow

  1. Direct action first (navigate/open or immediate act/evaluate).
  2. If interaction needs refs, run snapshot (interactive: true preferred).
  3. Wait for readiness using act.wait with explicit conditions.
  4. Interact (scrollIntoViewclick/type/select/drag as needed).
  5. Extract/verify with evaluate (preferred) or snapshot.
  6. Provide screenshot evidence only when necessary.

Connection Handling

Connection recovery is built into the tool. On connection failure, let the tool auto-attach/launch/retry once. If still disconnected, stop and instruct the user to install/connect the extension.

Minimal CLI Usage

Use <BROWSER_TOOL_CMD> for commands:

  • macOS/Linux: ~/.wegent-executor/bin/browser-tool
  • Windows: ~/.wegent-executor/bin/browser-tool.cmd
bash
<BROWSER_TOOL_CMD> '<json>'

Quick Examples

bash
# Navigate directly
<BROWSER_TOOL_CMD> '{"action":"navigate","url":"https://example.com"}'

# Snapshot only when refs are needed
<BROWSER_TOOL_CMD> '{"action":"snapshot","interactive":true}'

# Act on ref
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"click","ref":"e1"}}'

# Ensure element is visible before click (recommended on long pages)
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"scrollIntoView","ref":"e1"}}'

# Condition wait (preferred over fixed sleep)
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"wait","loadState":"domcontentloaded","timeoutMs":15000}}'

# URL-based wait
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"wait","url":"checkout","timeoutMs":10000}}'

# Run JS in page context via act.evaluate (function or expression)
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"evaluate","fn":"() => ({title: document.title, href: location.href})"}}'

# Run JS against a target element ref via act.evaluate
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"evaluate","ref":"e1","fn":"(el) => ({text: el.textContent?.trim() || \"\"})"}}'

# Close current tab (or pass targetId)
<BROWSER_TOOL_CMD> '{"action":"act","request":{"kind":"close"}}'

# Element screenshot (prefer over full-page when only target proof is needed)
<BROWSER_TOOL_CMD> '{"action":"screenshot","ref":"e1","type":"jpeg"}'

# Comprehensive extraction in one evaluate
<BROWSER_TOOL_CMD> '{"action":"evaluate","expression":"(() => ({title:document.title,url:location.href}))()"}'

Expand your agent's capabilities with these related and highly-rated skills.

wecode-ai/Wegent

wiki_submit

Submit wiki documentation sections to Wegent backend API. Simplifies the HTTP POST process for wiki content submission.

518 84
Explore
wecode-ai/Wegent

subscription-manager

Create and manage scheduled subscription tasks. Use when the user wants to set up recurring reminders, periodic reports, scheduled checks, or any automated tasks that run on a schedule. Supports cron expressions, fixed intervals, and one-time executions.

518 84
Explore
wecode-ai/Wegent

conversation_to_prompt

Convert the current conversation into a reusable system prompt draft with strict structure and quality checks.

518 84
Explore
wecode-ai/Wegent

mermaid-diagram

Use this skill when you need to draw diagrams including: Flowchart, Sequence Diagram, Class Diagram, State Diagram, ER Diagram, User Journey, Gantt Chart, Pie Chart, Quadrant Chart, Requirement Diagram, Gitgraph, Mindmap, Timeline, Sankey, XY Chart (Bar/Line), Block Diagram, Packet Diagram, Kanban, Architecture Diagram, C4 Diagram, Radar Chart, Treemap, and ZenUML. You MUST use this skill BEFORE outputting any mermaid code block.

518 84
Explore
wecode-ai/Wegent

wegent-knowledge

Knowledge base management tools for Wegent. Provides capabilities to list, create, and update knowledge bases and documents. Use this skill when the user wants to manage knowledge bases or documents programmatically.

518 84
Explore
wecode-ai/Wegent

sandbox

Provides read_file/write_file/exec/list_files/read_file/write_file for running process and managing filesystems in the sandbox. Ideal for code testing, file management, and command execution. The sub_claude_agent tool is available for advanced use cases. You MUST load this skill BEFORE use sandbox tools.

518 84
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results