跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 chrome-devtools-axi-browser-automation

Chrome Devtools Axi 浏览器自动化

Agent-ergonocal 浏览器自动化,并配有象征性高效的可访问树快照和组合操作

196 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

Agent-ergonocal 浏览器自动化,并配有象征性高效的可访问树快照和组合操作

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:chrome-devtools-axi Browser Automation、Overview、Installation、Architecture、Core Commands、Navigation and Snapshot。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Agent-ergonomic browser automation with token-efficient accessibility tree snapshots and combined operations

chrome-devtools-axi Browser AutomationOverviewInstallationArchitectureCore CommandsNavigation and SnapshotNavigate to a URL and capture accessibility treeCapture current page stateNavigate backScroll pageWait for time or contentElement Interaction

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
chrome-devtools-axi-browser-automation
description
Agent-ergonomic browser automation with token-efficient accessibility tree snapshots and combined operations
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「chrome-devtools-axi-browser-automation」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-0edb8653dd23a7fd-Chrome-Devtools-Axi-%E6%B5%8F%E8%A7%88%E5%99%A8%E8%87%AA%E5%8A%A8%E5%8C%96.html
请存为 .cursor/skills/chrome-devtools-axi-browser-automation/SKILL.md 或 .claude/skills/chrome-devtools-axi-browser-automation/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/reason-machines/devtools-skills' --list

npx skills add 'https://github.com/reason-machines/devtools-skills' --skill 'chrome-devtools-axi-browser-automation'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: chrome-devtools-axi-browser-automation description: Agent-ergonomic browser automation with token-efficient accessibility tree snapshots and combined operations triggers: - automate browser interactions - control Chrome headlessly - capture accessibility tree - take screenshot of webpage - fill form fields automatically - navigate and interact with pages - test web application behavior - run Lighthouse performance audit --- # chrome-devtools-axi Browser Automation > Skill by [ara.so](https://ara.so) — Devtools Skills collection. ## Overview `chrome-devtools-axi` is an AXI-compliant CLI wrapper around `chrome-devtools-mcp` that provides token-efficient browser automation. It uses TOON-encoded output to reduce token usage by ~40% compared to raw JSON, combines operations (navigate + snapshot + suggestions in one command), and includes contextual next-step hints in every response. Key features: - **Accessibility tree snapshots** with `uid=` refs for precise element targeting - **Generation-based staleness detection** prevents silent no-ops when page state changes - **Persistent bridge process** keeps Chrome session alive across commands - **Combined operations** reduce round-trips for agents ## Installation **For agents to install automatically:** ```bash npx -y chrome-devtools-axi ``` **For manual installation:** ```bash npm install -g chrome-devtools-axi ``` **Tell your agent:** ``` Execute `npx -y chrome-devtools-axi` to get browser automation tools. ``` ## Architecture The CLI communicates with a persistent bridge server (localhost:9224 by default) that maintains an MCP session with Chrome via DevTools Protocol. The bridge auto-starts on first command and writes state to `~/.chrome-devtools-axi/`. ## Core Commands ### Navigation and Snapshot ```bash # Navigate to a URL and capture accessibility tree chrome-devtools-axi open https://example.com # Capture current page state chrome-devtools-axi snapshot # Navigate back chrome-devtools-axi back # Scroll page chrome-devtools-axi scroll down chrome-devtools-axi scroll top # Wait for time or content chrome-devtools-axi wait 2000 chrome-devtools-axi wait "Welcome" ``` ### Element Interaction Elements in snapshots are marked with `uid=g:` refs. Always use refs exactly as printed: ```bash # Click an element chrome-devtools-axi click @g1:1 # Fill a form field chrome-devtools-axi fill @g2:5 "[email protected]" # Fill multiple fields at once chrome-devtools-axi fillform @g2:5=john @g2:6=doe @g2:[email protected] # Type text at current focus chrome-devtools-axi type "search query" # Press keyboard key chrome-devtools-axi press Enter chrome-devtools-axi press Tab # Hover over element chrome-devtools-axi hover @g1:3 # Drag and drop chrome-devtools-axi drag @g1:4 @g1:8 # Upload file chrome-devtools-axi upload @g1:2 /path/to/file.pdf # Handle browser dialogs chrome-devtools-axi dialog accept chrome-devtools-axi dialog dismiss ``` ### Screenshots ```bash # Save screenshot to file chrome-devtools-axi screenshot output.png # Capture specific element chrome-devtools-axi screenshot element.png --uid @g1:5 # Full-page screenshot chrome-devtools-axi screenshot full.png --full-page # Specify format chrome-devtools-axi screenshot output.jpg --format jpeg ``` ### JavaScript Evaluation ```bash # Evaluate expression (auto-wrapped) chrome-devtools-axi eval "document.title" # Execute function chrome-devtools-axi eval "() => document.querySelectorAll('a').length" # Multi-statement logic chrome-devtools-axi eval "() => { const rows = [...document.querySelectorAll('tr')]; return rows.map(row => row.textContent.trim()); }" ``` ### Multi-Step Scripts ```bash # Execute script from stdin cat << 'EOF' | chrome-devtools-axi run open https://example.com wait "Example Domain" click @g1:1 snapshot EOF ``` ## Page Management ```bash # List all tabs chrome-devtools-axi pages # Open new tab chrome-devtools-axi newpage https://google.com # Open in background chrome-devtools-axi newpage https://github.com --background # Switch tab chrome-devtools-axi selectpage # Close tab chrome-devtools-axi closepage # Resize viewport chrome-devtools-axi resize 1920 1080 ``` ## Device Emulation ```bash # Emulate mobile viewport chrome-devtools-axi emulate --viewport "390x844x3,mobile" # Set color scheme chrome-devtools-axi emulate --color-scheme dark # Network throttling chrome-devtools-axi emulate --network "Slow 3G" # CPU throttling (1-20) chrome-devtools-axi emulate --cpu 4 # Set geolocation chrome-devtools-axi emulate --geolocation "37.7749x-122.4194" # Custom user agent chrome-devtools-axi emulate --user-agent "CustomBot/1.0" # Combine options chrome-devtools-axi emulate --viewport "390x844x3,mobile" --color-scheme dark --network "Fast 3G" ``` ## DevTools Debugging ### Console Messages ```bash # List all console messages chrome-devtools-axi console # Filter by type chrome-devtools-axi console --type error chrome-devtools-axi console --type warn # Pagination chrome-devtools-axi console --limit 10 --page 2 # Get specific message chrome-devtools-axi console-get ``` Available types: `log`, `debug`, `info`, `error`, `warn`, `dir`, `dirxml`, `table`, `trace`, `clear`, `assert`, `all` ### Network Requests ```bash # List network requests chrome-devtools-axi network # Filter by type chrome-devtools-axi network --type xhr chrome-devtools-axi network --type fetch # Get specific request chrome-devtools-axi network-get # Save response body chrome-devtools-axi network-get --response-file response.json # Save request body chrome-devtools-axi network-get --request-file request.json ``` Available types: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `xhr`, `fetch`, `websocket`, `manifest`, `other`, `all` ## Performance ### Lighthouse Audits ```bash # Run Lighthouse audit chrome-devtools-axi lighthouse # Mobile device chrome-devtools-axi lighthouse --device mobile # Snapshot mode (current state) chrome-devtools-axi lighthouse --mode snapshot # Save reports to directory chrome-devtools-axi lighthouse --output-dir ./reports ``` ### Performance Tracing ```bash # Start trace chrome-devtools-axi perf-start # Start without reload chrome-devtools-axi perf-start --no-reload # Stop and save trace chrome-devtools-axi perf-stop --file trace.json # Analyze performance insight chrome-devtools-axi perf-insight lcp "Largest Contentful Paint" ``` ### Heap Snapshots ```bash # Capture heap snapshot chrome-devtools-axi heap memory.heapsnapshot ``` ## Configuration ### Environment Variables ```bash # Change bridge server port (default: 9224) export CHROME_DEVTOOLS_AXI_PORT=9225 # Connect to existing Chrome instance (HTTP/HTTPS) export CHROME_DEVTOOLS_AXI_BROWSER_URL=http://127.0.0.1:9222 # Connect via WebSocket directly export CHROME_DEVTOOLS_AXI_BROWSER_URL=wss://cluster.example/launch # WebSocket authentication headers (JSON) export CHROME_DEVTOOLS_AXI_WS_HEADERS='{"Authorization":"Bearer token"}' # Disable session hook auto-install export CHROME_DEVTOOLS_AXI_DISABLE_HOOKS=1 ``` ### State Files State stored in `~/.chrome-devtools-axi/`: - `bridge.pid` — Running bridge PID and port - `snapshot-generation` — Staleness detection counter ## Common Patterns ### Login Flow ```bash # Navigate and fill login form chrome-devtools-axi open https://app.example.com/login chrome-devtools-axi fillform @g1:[email protected] @g1:2=password chrome-devtools-axi click @g1:3 chrome-devtools-axi wait "Dashboard" chrome-devtools-axi snapshot ``` ### Form Scraping ```bash # Extract form data with JavaScript chrome-devtools-axi eval "() => { const form = document.querySelector('form'); const data = new FormData(form); return Object.fromEntries(data.entries()); }" ``` ### Multi-Page Workflow ```typescript // In TypeScript/Node.js import { execSync } from 'child_process'; function runCommand(cmd: string): string { return execSync(`chrome-devtools-axi ${cmd}`, { encoding: 'utf-8' }); } // Navigate and extract data runCommand('open https://example.com'); const title = runCommand('eval "document.title"'); // Take screenshot runCommand('screenshot page.png'); // Fill and submit form runCommand('fill @g1:1 "search term"'); runCommand('press Enter'); runCommand('wait 2000'); // Extract results const results = runCommand('eval "() => [...document.querySelectorAll(\'.result\')].map(el => el.textContent)"'); ``` ### Handling Dynamic Content ```bash # Wait for element to appear, then interact chrome-devtools-axi open https://spa.example.com chrome-devtools-axi wait "Loading complete" chrome-devtools-axi snapshot chrome-devtools-axi click @g2:5 ``` ### Testing Responsive Design ```bash # Test mobile layout chrome-devtools-axi emulate --viewport "390x844x3,mobile" chrome-devtools-axi open https://example.com chrome-devtools-axi screenshot mobile.png # Test desktop layout chrome-devtools-axi resize 1920 1080 chrome-devtools-axi snapshot chrome-devtools-axi screenshot desktop.png ``` ## Understanding Refs and Staleness Refs use a generation prefix (`g:`) that increments with each snapshot. If you capture a snapshot at generation 1, get ref `@g1:5`, then the page re-renders and moves to generation 2, attempting to use `@g1:5` will fail with `STALE_REF` error. **Agent pattern:** 1. Capture snapshot 2. Extract refs 3. Attempt action with ref 4. If `STALE_REF` error, re-snapshot and retry with new ref ```bash # First snapshot chrome-devtools-axi snapshot # Output shows: uid=g1:1 link "Click here" # Page changes, generation bumps to g2 chrome-devtools-axi click @g1:1 # Error: STALE_REF # Re-snapshot to get fresh refs chrome-devtools-axi snapshot # Output shows: uid=g2:3 link "Click here" chrome-devtools-axi click @g2:3 # Success ``` ## Troubleshooting ### Bridge Not Starting ```bash # Manually stop and restart bridge chrome-devtools-axi stop chrome-devtools-axi start ``` ### Port Conflicts ```bash # Use different port export CHROME_DEVTOOLS_AXI_PORT=9999 chrome-devtools-axi open https://example.com ``` ### Stale Refs Always use refs exactly as printed in snapshot output. If you get `STALE_REF`, capture a new snapshot. ### Element Not Found If `uid` is valid but element doesn't respond: - Check if element is visible (scroll into view) - Wait for page to finish loading - Use `chrome-devtools-axi wait` before interaction ### Full Output Needed ```bash # Disable truncation for complete data chrome-devtools-axi snapshot --full chrome-devtools-axi console --full ``` ### Debugging JavaScript Eval ```bash # Check for errors in console chrome-devtools-axi console --type error # Test simple eval first chrome-devtools-axi eval "2 + 2" # Use arrow function for complex logic chrome-devtools-axi eval "() => { console.log('debug'); return 42; }" ``` ## Example: E2E Testing Workflow ```bash #!/bin/bash # Start fresh session chrome-devtools-axi stop chrome-devtools-axi start # Navigate to app chrome-devtools-axi open https://app.example.com # Login chrome-devtools-axi fillform @g1:1=$USER_EMAIL @g1:2=$USER_PASSWORD chrome-devtools-axi click @g1:3 chrome-devtools-axi wait "Dashboard" # Take baseline screenshot chrome-devtools-axi screenshot baseline.png # Navigate to feature chrome-devtools-axi click @g2:10 chrome-devtools-axi wait "Feature Page" # Interact with feature chrome-devtools-axi fill @g3:5 "test data" chrome-devtools-axi click @g3:6 # Verify result chrome-devtools-axi wait "Success" chrome-devtools-axi snapshot --full > result.txt # Capture performance chrome-devtools-axi lighthouse --output-dir ./reports # Cleanup chrome-devtools-axi stop ``` ## Best Practices for Agents 1. **Always re-snapshot after page changes** — Don't reuse refs across navigation or mutations 2. **Use combined operations** — `open` gives snapshot automatically, reducing round-trips 3. **Check help hints** — Every response includes suggested next steps 4. **Use `--full` sparingly** — Default truncation saves tokens; only expand when needed 5. **Prefer `fillform` over multiple `fill`** — Batch form operations when possible 6. **Wait strategically** — Use `wait ` instead of arbitrary timeouts when possible 7. **Leverage eval for extraction** — JavaScript eval is more efficient than scraping via snapshots

相关技能

Agent 工作流

技能创建者Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

克劳德胡布Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

团队指挥Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

超级力量Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…