Agent skill
chrome-devtools
Chrome debugging and inspection via local CDP Docker container
Install this agent skill to your Project
npx add-skill https://github.com/arlenagreer/claude_configuration_docs/tree/main/skills/chrome-devtools
SKILL.md
Chrome DevTools Protocol Skill
Purpose
Provides Chrome DevTools Protocol (CDP) access through a local Docker container, enabling browser debugging, network inspection, performance profiling, and DOM manipulation without remote MCP dependencies.
Capabilities
- Page Control: Navigate, reload, screenshot
- JavaScript Execution: Evaluate scripts in browser context
- Network Monitoring: Capture requests, responses, timing
- DOM Inspection: Query and manipulate DOM elements
- Performance: Profiling, metrics, Core Web Vitals
- Console: Capture console logs and errors
Requirements
Docker
- Docker Desktop installed and running
agent-networkDocker network created- Chrome DevTools container running
Ruby
- Ruby ≥2.7
- Gems:
websocket-client-simple,json,net-http
Setup
# Start Chrome DevTools container
cd ~/.claude/skills/chrome-devtools/docker
docker-compose up -d
# Verify container is running
docker ps | grep chrome-devtools-server
# Check CDP endpoint
curl http://localhost:9222/json/version
Usage
Page Navigation
# Navigate to URL
~/.claude/skills/chrome-devtools/scripts/navigate.rb "https://example.com"
JavaScript Evaluation
# Execute JavaScript
~/.claude/skills/chrome-devtools/scripts/evaluate.rb "document.title"
# Get complex data
~/.claude/skills/chrome-devtools/scripts/evaluate.rb "Array.from(document.querySelectorAll('a')).map(a => a.href)"
Network Monitoring
# Capture network traffic
~/.claude/skills/chrome-devtools/scripts/network_capture.rb "https://example.com" 5
# Arguments: URL, duration (seconds)
Screenshots
# Capture screenshot
~/.claude/skills/chrome-devtools/scripts/screenshot.rb /tmp/screenshot.png
# JPEG with quality
~/.claude/skills/chrome-devtools/scripts/screenshot.rb /tmp/screenshot.jpg --format jpeg --quality 80
Console Logs
# Monitor console output
~/.claude/skills/chrome-devtools/scripts/console_log.rb "https://example.com" 10
# Arguments: URL, duration (seconds)
Docker Management
Start Container
~/.claude/skills/chrome-devtools/scripts/start.sh
Stop Container
~/.claude/skills/chrome-devtools/scripts/stop.sh
Restart Container
~/.claude/skills/chrome-devtools/scripts/restart.sh
Check Status
~/.claude/skills/chrome-devtools/scripts/status.sh
VNC Access (Visual Debugging)
# Get VNC connection details
~/.claude/skills/chrome-devtools/scripts/vnc_url.sh
# Connect with VNC viewer to: vnc://localhost:5900
# Password: secret
Troubleshooting
Container won't start
Symptom: docker-compose up -d fails
Solutions:
- Check Docker Desktop is running
- Verify SHM size setting (Chrome needs shared memory)
- Check logs:
docker-compose logs - Try with increased shm_size in docker-compose.yml
CDP connection failed
Symptom: Can't connect to WebSocket
Solutions:
- Verify container is running:
docker ps | grep chrome - Check CDP endpoint:
curl http://localhost:9222/json - Verify port not in use:
lsof -i :9222 - Check container logs:
docker logs chrome-devtools-server
Browser crashed
Symptom: CDP commands fail with "Target closed"
Solutions:
- Restart container:
docker-compose restart - Check memory limits (Chrome needs ≥1GB)
- Review crash logs:
docker logs chrome-devtools-server
VNC not working
Symptom: Can't connect to VNC
Solutions:
- Verify VNC port exposed:
docker port chrome-devtools-server - Check DEFAULT_HEADLESS=false in environment
- Try different VNC client
- Restart container:
docker-compose restart
Performance Notes
- Container startup: ~15-20 seconds
- CDP response time: <200ms typical
- Memory usage: ~800MB-1.5GB
- Supports up to 5 concurrent sessions (configurable)
Advanced Configuration
Headless vs Headed Mode
Edit docker-compose.yml environment:
environment:
- DEFAULT_HEADLESS=false # Enable headed mode for VNC
Session Limits
environment:
- MAX_CONCURRENT_SESSIONS=10
Preboot Optimization
environment:
- PREBOOT_CHROME=true # Faster first connection
CDP Domains Reference
Commonly Used Domains
- Page: Navigation, lifecycle, resources
- Runtime: JavaScript evaluation, console
- Network: Request/response monitoring
- DOM: Document structure, queries
- Performance: Metrics, profiling
- Debugger: Breakpoints, stepping
- Profiler: CPU/Memory profiling
Event Subscription Example
require_relative 'cdp_client'
client = CDPClient.new
client.network_enable
client.on_event('Network.requestWillBeSent') do |params|
puts "Request: #{params['request']['url']}"
end
client.page_navigate('https://example.com')
sleep 5 # Capture traffic
See Also
- Playwright skill for browser automation
- CDP Protocol documentation: https://chromedevtools.github.io/devtools-protocol/
- Original research:
~/.claude/claudedocs/research_mcp_to_agent_skill_conversion_20251116.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Send and draft professional emails with seasonal HTML formatting, authentic writing style, contact lookup via Google Contacts, security-first approach, and Google Gmail API via Ruby CLI. This skill should be used for ALL email operations (mandatory per RULES.md).
commit
Create detailed Git commits and push to GitHub. Use when the user wants to commit changes, save work to Git, or push updates to the repository. Trigger words include "commit", "save changes", "push to git", "update repository". (project, gitignored)
worklog
Track billable hours for clients. This skill should be used when the user requests to log work hours, record time spent on client projects, view worklog entries, calculate total billable hours, or summarize recent work. Automatically prompts for missing information (client, hours, description) and validates client names against the invoice skill's client database.
calendar
Manage Google Calendar with full event operations including viewing schedule, creating/editing/deleting events, finding free time, managing attendees via Google Contacts, adding Google Meet links, and timezone handling. This skill should be used for ALL calendar-related requests.
google-sheets
Manage Google Sheets with comprehensive spreadsheet operations including reading/writing cell values, formulas, formatting, sheet management, and batch operations. Use for spreadsheet data operations, cell ranges, formulas, formatting, batch updates, and data analysis workflows. Shares OAuth token with email, calendar, contacts, drive, and docs skills.
google-drive
Manage Google Drive files and folders with full CRUD operations via Ruby scripts. Use for file storage operations, folder organization, sharing permissions, searching across Drive, and uploading/downloading files of any type. Works seamlessly with google-sheets and google-docs skills for complete Google Workspace integration.
Didn't find tool you were looking for?