Skip to main content

browser-setup

Configure the browser tool for Clacky. Guides the user through Chrome or Edge setup, verifies the connection, and writes ~/.clacky/browser.yml. Supports macOS, Linux, and WSL (Windows Chrome/Edge via remote debugging). Trigger on: "browser setup", "setup browser", "้…็ฝฎๆต่งˆๅ™จ", "browser config", "browser doctor". Subcommands: setup, doctor.

Source facts

Repository
clacky-ai/openclacky
Last source activity
September 28, 2026 at 13:23
Detected SKILL.md language
English
Stars
1,202
Forks
114

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
browser-setup
name_zh
ๆต่งˆๅ™จ้…็ฝฎ
description_zh
้…็ฝฎ Chrome ๆˆ– Edge ๆต่งˆๅ™จๅทฅๅ…ทๅนถๆฃ€ๆต‹่ฟžๆŽฅ๏ผŒๆ”ฏๆŒ macOSใ€Linux ๅ’Œ WSLใ€‚
description
Configure the browser tool for Clacky. Guides the user through Chrome or Edge setup, verifies the connection, and writes ~/.clacky/browser.yml. Supports macOS, Linux, and WSL (Windows Chrome/Edge via remote debugging). Trigger on: "browser setup", "setup browser", "้…็ฝฎๆต่งˆๅ™จ", "browser config", "browser doctor". Subcommands: setup, doctor.
argument-hint
setup | doctor
allowed-tools
["Bash","Read","Write","browser"]
# Browser Setup Skill Configure the browser tool for Clacky. Config is stored at `~/.clacky/browser.yml`. ## Region-Aware Download Links Whenever you show the user a link to download or upgrade Chrome/Edge, pick the right one for their region instead of always using google.com. Treat the user as **in China** when any of these is true: - The user is talking to you in Chinese - The system locale is Chinese (`echo $LANG` contains `zh_CN` / `zh_`) - A previous run of `install_browser.sh` reported `Region: china` (visible in its output) - `curl -s --max-time 3 https://www.google.com -o /dev/null -w "%{http_code}"` returns `000` while baidu.com works Use these links accordingly: | Region | Chrome | Edge | |---|---|---| | China | https://www.google.cn/chrome/ | https://www.microsoft.com/zh-cn/edge | | Global | https://www.google.com/chrome/ | https://www.microsoft.com/edge | When unsure, show **both** lines (label them "China:" and "Global:") so the user can pick. ## Command Parsing | User says | Subcommand | |---|---| | `browser setup`, `้…็ฝฎๆต่งˆๅ™จ`, `setup browser` | setup | | `browser doctor` | doctor | If no subcommand is clear, default to `setup`. --- ## `setup` **Core Strategy**: Progressive validation with clear next steps at each failure point. ### Step 1 โ€” Ensure Node.js is installed Check Node.js version: ```bash node --version 2>/dev/null ``` Parse the version. If Node.js is missing or version < 20: Run the bundled installer to automatically install Node.js: ```bash bash ~/.clacky/scripts/install_browser.sh ``` If the script exits 0 โ†’ Node.js is now installed. Proceed to Step 2. If the script exits non-zero or doesn't exist: > โŒ Node.js 20+ is required for browser automation. > > Please install Node.js from: https://nodejs.org > > Let me know when done and I'll continue. Wait for user confirmation, then retry this step once. If still failing, stop. ### Step 2 โ€” Ensure chrome-devtools-mcp is installed Check if installed: ```bash chrome-devtools-mcp --version 2>/dev/null ``` If found and exits 0 โ†’ skip to Step 3. If missing, run the bundled installer: ```bash bash ~/.clacky/scripts/install_browser.sh ``` If the script exits non-zero or doesn't exist: > โŒ Failed to install chrome-devtools-mcp automatically. > > Please run manually: > ``` > npm install -g chrome-devtools-mcp@latest > ``` > > Let me know when done. Wait for user confirmation, then verify installation: ```bash chrome-devtools-mcp --version 2>/dev/null ``` If still missing after user confirms, stop with error message. ### Step 3 โ€” Verify Chrome/Edge is running with remote debugging **CRITICAL**: Do NOT attempt `browser()` calls yet. First check if the browser is reachable using the API: ```bash curl -s http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/browser/status ``` This returns JSON with `daemon_running` and `enabled` status. **Ignore the result for now** โ€” we just need to see if the Clacky server is running. Now attempt a browser connection to detect Chrome: ```bash browser(action="status") ``` **If this succeeds** โ†’ Chrome is running and reachable. Proceed to Step 4. **If this fails** โ†’ The error message will indicate the specific issue. Parse it carefully: #### Case A: "Chrome/Edge is not running or remote debugging is not enabled" This is the most common case. The system can't find Chrome's DevToolsActivePort file or the port is not reachable. **Action**: Guide the user to enable remote debugging. **On macOS**: ```bash open "chrome://inspect/#remote-debugging" 2>/dev/null || echo "Please open chrome://inspect/#remote-debugging manually" ``` Then tell the user: > I've tried to open the remote debugging page in Chrome. > > Please follow these steps: > 1. Make sure **Chrome or Edge is open** > 2. Visit: `chrome://inspect/#remote-debugging` (or `edge://inspect/#remote-debugging`) > 3. Click **"Allow remote debugging for this browser instance"** > 4. You should see a brief connection message appear > > Let me know when done โœ… **On Linux (non-WSL)**: > Please follow these steps: > 1. Make sure **Chrome or Edge is open** > 2. Visit: `chrome://inspect/#remote-debugging` > 3. Click **"Allow remote debugging for this browser instance"** > > Let me know when done โœ… **On WSL**: > Please follow these steps: > 1. Open **Edge** on Windows > 2. Visit: `edge://inspect/#remote-debugging` > 3. Click **"Allow remote debugging for this browser instance"** > > Let me know when done โœ… **After user confirms**, retry the connection **once**: ```bash browser(action="status") ``` If still failing: > โŒ Still unable to connect to Chrome. > > Please make sure: > - Chrome/Edge is running > - You clicked "Allow remote debugging" in chrome://inspect/#remote-debugging > - No firewall is blocking localhost connections > > Run `/browser-setup doctor` to diagnose the issue in detail. Fetch the online troubleshooting guide for additional help: ``` web_fetch(url="https://www.openclacky.com/docs/browser-troubleshooting") ``` Stop here and suggest running doctor. #### Case B: Other errors (MCP handshake timeout, daemon crash, etc.) For any other error message, show it to the user and suggest: > โŒ Browser connection failed: <error message> > > This may be a temporary issue. Please try: > 1. Restart your browser > 2. Run `/browser-setup` again > > If the problem persists, run `/browser-setup doctor` for detailed diagnostics. ### Step 4 โ€” Get and verify browser version Now that connection is established, get the version: ```bash browser(action="act", kind="evaluate", js="navigator.userAgentData?.brands?.find(b => b.brand === 'Google Chrome' || b.brand === 'Microsoft Edge')?.version || navigator.userAgent.match(/Chrome\/(\d+)/)?.[1] || 'unknown'") ``` Parse the version number: - **version >= 146** โ†’ Excellent, proceed - **version 144-145** โ†’ Show warning but proceed: > โš ๏ธ Your browser version is v${VERSION}. Version 146+ is recommended for best compatibility. > Continuing anyway... - **version < 144 or "unknown"** โ†’ Stop: > โŒ Browser version v${VERSION} is too old. Please upgrade Chrome or Edge to v146+. > > Use the download link from the **Region-Aware Download Links** section above > (pick `China` or `Global` based on the user's region). > > After upgrading, run `/browser-setup` again. ### Step 5 โ€” Save configuration via API Call the API to save the configuration: ```bash curl -s -X POST http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/browser/configure \ -H "Content-Type: application/json" \ -d "{\"chrome_version\":\"${VERSION}\"}" ``` If this fails (HTTP error or empty response), show a warning: > โš ๏ธ Failed to save configuration via API. You may need to run `/browser-setup` again after restarting Clacky. ### Step 6 โ€” Done > โœ… Browser setup complete! > > **Chrome/Edge v${VERSION}** is connected and ready to use. > > You can now use browser automation features. Try asking me to: > - "Open google.com in the browser" > - "Take a screenshot" > - "Fill out a form on this page" --- ## `doctor` **Core Strategy**: Diagnose don't fix. Check each component and report status. This is a **diagnostic tool**, not a repair tool. It will check each component and tell you what's wrong, but won't automatically fix things. ### Diagnostic Steps Run all checks **before** showing results. Then show a summary report. #### 1. Check Config File ```bash test -f ~/.clacky/browser.yml && cat ~/.clacky/browser.yml ``` Parse the result: - **File missing** โ†’ โŒ Not configured - **File exists, `enabled: false`** โ†’ โธ๏ธ Disabled - **File exists, `enabled: true`** โ†’ โœ… Enabled #### 2. Check Node.js ```bash node --version 2>/dev/null ``` - **Not found** โ†’ โŒ Node.js not installed - **Version < 20** โ†’ โŒ Node.js too old (need 20+) - **Version >= 20** โ†’ โœ… Node.js OK #### 3. Check chrome-devtools-mcp ```bash chrome-devtools-mcp --version 2>/dev/null ``` - **Not found** โ†’ โŒ Not installed - **Found** โ†’ โœ… Installed (version: ...) #### 4. Check Clacky Server ```bash curl -s -f http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/browser/status ``` - **Failed** โ†’ โŒ Server not responding - **Success** โ†’ Parse JSON and show `daemon_running` status #### 5. Check Chrome Connection Only run this if steps 1-4 are OK. ```bash browser(action="status") ``` - **Success** โ†’ โœ… Connected. Also get the tab count from the result. - **Failed** โ†’ โŒ Not connected. Parse the error message to determine cause. #### 6. Check Chrome Version Only run this if step 5 succeeded. ```bash browser(action="act", kind="evaluate", js="navigator.userAgent.match(/Chrome\/(\d+)/)?.[1] || 'unknown'") ``` - **version >= 146** โ†’ โœ… Excellent - **version 144-145** โ†’ โš ๏ธ Acceptable but upgrade recommended - **version < 144 or unknown** โ†’ โŒ Too old ### Report Format Show results in a clean table: ``` Browser Doctor โ€” Diagnostic Report โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Configuration [โœ…] Config file found (~/.clacky/browser.yml) [โœ…] Browser tool enabled Dependencies [โœ…] Node.js v22.1.0 [โœ…] chrome-devtools-mcp installed (v1.2.3) Connection [โœ…] Clacky server running [โœ…] MCP daemon running [โœ…] Chrome connected (3 tabs open) [โœ…] Chrome v146 โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• โœ… All systems operational! ``` If there are any โŒ or โš ๏ธ items, show them first in a **Problems Found** section, followed by specific **Recommended Actions**: ``` Browser Doctor โ€” Diagnostic Report โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• โš ๏ธ Problems Found [โŒ] Chrome not connected Error: Chrome/Edge is not running or remote debugging is not enabled [โŒ] Chrome version v142 is too old โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Configuration [โœ…] Config file found [โœ…] Browser tool enabled Dependencies [โœ…] Node.js v22.1.0 [โœ…] chrome-devtools-mcp installed Connection [โœ…] Clacky server running [โŒ] Chrome not connected โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• ๐Ÿ”ง Recommended Actions 1. Enable remote debugging: - Open Chrome and visit: chrome://inspect/#remote-debugging - Click "Allow remote debugging for this browser instance" 2. Upgrade your browser: - Chrome v142 is too old (need v146+) - Pick the download link for the user's region from the **Region-Aware Download Links** section at the top of this skill (China users โ†’ google.cn; others โ†’ google.com). After fixing these issues, run `/browser-setup` again to verify. ``` ### Common Diagnostic Scenarios **Scenario 1: Config not found** ``` [โŒ] Config file not found ๐Ÿ”ง Fix: Run `/browser-setup` to configure the browser tool. ``` **Scenario 2: Chrome not running** ``` [โŒ] Chrome not connected Error: Chrome/Edge is not running or remote debugging is not enabled ๐Ÿ”ง Fix: 1. Open Chrome or Edge 2. Visit: chrome://inspect/#remote-debugging 3. Click "Allow remote debugging" ``` **Scenario 3: MCP not installed** ``` [โŒ] chrome-devtools-mcp not installed ๐Ÿ”ง Fix: Run `npm install -g chrome-devtools-mcp@latest` (or run `/browser-setup` to install automatically) ``` **Scenario 4: Everything OK** ``` โœ… All systems operational! The browser tool is ready to use. ``` ### Online Troubleshooting Guide If any โŒ items are found, or the user reports a problem you cannot resolve with the above scenarios, fetch the latest troubleshooting guide: ``` web_fetch(url="https://www.openclacky.com/docs/browser-troubleshooting") ``` Use the content from that page to provide up-to-date diagnosis and resolution steps. This online document is maintained separately and may contain newer solutions not listed here.
View on GitHub