Skip to main content
ClaudeWave
EN, English
Skill8.6k repo starsupdated 4d ago

chrome-automation

This Claude Code skill automates Google Chrome browser control through Chrome DevTools Protocol, enabling real-time visual feedback and precise interactions in the user's running browser instance. Use it when automation with live visual feedback is required, existing Chrome instances must be controlled, or advanced browser task automation is needed beyond built-in browser tools.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/anbeime/skill /tmp/chrome-automation && cp -r /tmp/chrome-automation/skills/chrome-automation/chrome-automation ~/.claude/skills/chrome-automation
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Chrome Browser Automation with Real-time Control

Control the user's Google Chrome browser using agent-browser connected via Chrome DevTools Protocol (CDP). All actions are visible in real-time in the user's browser window.

## ⚠️ CRITICAL: Automatic Installation & Dependency Check

**BEFORE using this skill, ALWAYS run the auto-installation check:**

This skill automatically checks and installs all required dependencies without user confirmation. The installation process verifies:
- agent-browser repository and binary
- Node.js and pnpm
- Playwright Chromium
- Rust toolchain (cargo)
- Native binary compilation

**Auto-installation workflow:**

```bash
# Mac: Run auto-install script
bash ~/.claude/skills/chrome-automation/scripts/auto-install-mac.sh

# Windows: Run auto-install script (PowerShell)
powershell -ExecutionPolicy Bypass -File "$HOME\.claude\skills\chrome-automation\scripts\auto-install-windows.ps1"
```

**The script will:**
1. Check if agent-browser binary exists and works
2. Install missing dependencies automatically (pnpm, Rust, etc.)
3. Clone repository if not present
4. Build native binary with proper Rust toolchain
5. Verify installation success

**Critical rules:**
- ❌ DO NOT fall back to using built-in browser tools (browser_use_desktop)
- ✅ MUST run auto-install script before any browser automation
- ✅ Only proceed with browser automation AFTER successful installation
- ✅ Script handles all dependency checks automatically

**Why agent-browser is required:**
- Provides real-time visual feedback in user's actual Chrome browser
- Allows user to see and interact with automation in progress
- Offers precise element selection and interaction capabilities
- Built-in browser tools are NOT a substitute for this skill's functionality

## Quick Start

### First-time setup (automatic)

**Run the auto-install script first:**

```bash
# Mac
bash ~/.claude/skills/chrome-automation/scripts/auto-install-mac.sh

# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File "$HOME\.claude\skills\chrome-automation\scripts\auto-install-windows.ps1"
```

The script automatically handles:
- Repository cloning
- Dependency installation (pnpm, Playwright)
- Rust toolchain setup
- Native binary compilation

### Connect and control Chrome

**IMPORTANT: Use the start-chrome script to preserve login states across sessions**

```bash
# Mac: Start Chrome with persistent profile (RECOMMENDED)
# This preserves your login states, cookies, and settings
bash ~/.claude/skills/chrome-automation/scripts/start-chrome-mac.sh

# Windows: Start Chrome with persistent profile (PowerShell)
powershell -ExecutionPolicy Bypass -File "$HOME\.claude\skills\chrome-automation\scripts\start-chrome-windows.ps1"

# Use agent-browser with --cdp flag
cd /Users/jyxc-dz-0100272/Documents/agent-browser
AGENT_BROWSER_HOME=/Users/jyxc-dz-0100272/Documents/agent-browser \
./bin/agent-browser --cdp 9222 snapshot -i
```

**What the start-chrome script does:**
1. First run: Creates a dedicated automation profile at `~/Library/Application Support/Google/Chrome-Automation`
2. First run: Imports your existing Chrome configuration (login states, cookies, settings)
3. Subsequent runs: Uses the existing automation profile - all your logins are preserved
4. You only need to log in once - it will be remembered for future sessions

## Core Workflow

**CRITICAL: Always show browser state to user after each significant action using screenshots.**

1. **Connect**: Ensure Chrome running with remote debugging port 9222
2. **Navigate**: Open pages using `--cdp 9222` flag
3. **Snapshot**: Get interactive elements with `snapshot -i`
4. **Interact**: Use element refs (@e1, @e2, etc.)
5. **Screenshot**: Capture state and show to user
6. **Report**: Describe what's visible in browser

### Standard operation pattern

```bash
# Set path variables
export AB_HOME=/Users/jyxc-dz-0100272/Documents/agent-browser
cd $AB_HOME

# Navigate
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 open https://example.com
sleep 2

# Get interactive elements
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 snapshot -i

# Screenshot to show user
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 screenshot /tmp/state.png

# Interact
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 fill @e1 "text"
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 press Enter

# Capture result
sleep 2
AGENT_BROWSER_HOME=$AB_HOME ./bin/agent-browser --cdp 9222 screenshot /tmp/result.png
```

## Installation & Setup

### Automatic Installation (RECOMMENDED)

**Always use the auto-install script - it handles all dependencies automatically:**

#### Mac Installation

```bash
# Run auto-install script
bash ~/.claude/skills/chrome-automation/scripts/auto-install-mac.sh
```

**What it does:**
1. Checks if agent-browser binary exists and works
2. Clones repository if missing
3. Installs Node.js dependencies (pnpm)
4. Installs Playwright Chromium
5. Checks/installs Rust toolchain (cargo, rustup)
6. Sets up stable Rust toolchain if needed
7. Builds native binary with `npm run build:native`
8. Verifies installation success

**Requirements:**
- Node.js (will notify if missing)
- Git (for cloning repository)
- Internet connection

#### Windows Installation

```powershell
# Run auto-install script (PowerShell)
powershell -ExecutionPolicy Bypass -File "$HOME\.claude\skills\chrome-automation\scripts\auto-install-windows.ps1"
```

**What it does:**
1. Checks if agent-browser binary exists and works
2. Clones repository if missing
3. Installs Node.js dependencies (pnpm)
4. Installs Playwright Chromium
5. Downloads and installs Rust toolchain if needed
6. Sets up stable Rust toolchain
7. Builds native binary with `npm run build:native`
8. Verifies installation success

**Requirements:**
- Node.js (will notify if missing - download from https://nodejs.org/)
- Git (for cloning repository)
- Internet connection

### Manual Installation (Advanced Users Only)

If you
agent-teamSkill

产品经理与项目管理专家在应对复杂项目时,使用此技能可动态组建包含“执行、指挥、评审”的专属AI团队。实时查看多智能体辩论与决策全过程,共享统一上下文记忆,一键完成从会议决策到系统构建的全流程高效协同!

agentkit-multimedia-shoppingSkill

电商运营与内容创作者在需要制作带货短视频时,用此技能一键生成9:16竖屏数字人成片。自动编排AI绘画、语音合成与视频生成,快速产出“小省导购员”专属形象与专业配音,让多模态视频制作省时省力。

antinet-doc-parseSkill

软件开发工程师与数据科学家在构建RAG系统时,当需处理PDF/Word/Excel等多格式复杂文档,用此技能可自动触发三级解析降级,一键输出高置信度结构化Markdown与元数据,免去繁琐清洗,直接夯实企业知识库数据底座!

antinet-four-color-cardsSkill

财务和投资分析师、律师助理与法律助手在撰写金融研报或分析法律文档时,必用此技能!基于解析文档一键生成事实蓝卡、解释绿卡、风险黄卡与行动红卡。自动完成深度剖析与风险排查,产出100%可溯源的结构化四色报告,让复杂分析高效且严谨。

antinet-provenanceSkill

软件开发工程师与信息安全分析师在构建多智能体系统时,当需全链路可观测与安全审计,请用此技能。它自动收集操作日志,生成可追溯证据链与向量索引,开箱即用实现系统审计与精准回放,让Agent运行安全透明。

antinet-security-scanSkill

信息安全分析师与软件开发工程师在搭建文档处理流水线时,当需要拦截违规文件或外部URL,请挂载此技能作为强制前置安检,自动输出 pass/reject 判定与详细合规扫描报告,一键守住零信任安全底线。

article-illustratorSkill

内容创作者和自媒体创作者在撰写长文时,当需要“给文章配图”或“添加插图”时使用。自动分析文章结构,精准识别需要视觉辅助的位置,生成并插入契合语境的插画,将抽象概念具象化,一键完成高质量图文排版,大幅提升阅读体验。

baoyu-format-markdownSkill

技术写作员与内容创作者在处理纯文本或 Markdown 稿件时,若需优化文章结构、添加 frontmatter 或自动修正中英文排版间距,使用此技能可一键生成专业美观的 {filename}-formatted.md 文件,让文档排版更完美。