repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

opencode/skills/chrome-devtools/SKILL.md

Raw

name: chrome-devtools description: Browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, screenshots, network analysis, and performance profiling. license: MIT

Tool Categories

Navigation & Page Management

Input & Interaction

Debugging & Inspection

Emulation & Performance


Workflow Patterns

Snapshot-First

Always prefer take_snapshot for finding elements - provides UID values needed by interaction tools.

  1. take_snapshot - get page structure
  2. Find target element UID
  3. Use click(uid=...) or fill(uid=..., value=...)

Troubleshooting Errors

  1. list_console_messages - check JS errors
  2. list_network_requests - find failed resources (4xx/5xx)
  3. evaluate_script - check DOM state

Performance Profiling

  1. performance_start_trace(reload=true, autoStop=true)
  2. Wait for page load
  3. performance_analyze_insight - find LCP issues, layout shifts

Best Practices

Markdown source
File outline
---
name: chrome-devtools
description: Browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, screenshots, network analysis, and performance profiling.
license: MIT
---

## Tool Categories

### Navigation & Page Management

- `new_page`: Open a new tab
- `navigate_page`: Go to URL, reload, or navigate history
- `select_page`: Switch between open pages
- `list_pages`: List all open pages
- `close_page`: Close a page
- `wait_for`: Wait for text to appear

### Input & Interaction

- `click`: Click element by UID
- `fill` / `fill_form`: Type into inputs
- `hover`: Hover over element
- `press_key`: Send keyboard shortcuts
- `drag`: Drag and drop
- `handle_dialog`: Accept/dismiss alerts
- `upload_file`: Upload file via input

### Debugging & Inspection

- `take_snapshot`: Get accessibility tree (best for finding elements)
- `take_screenshot`: Capture visual
- `list_console_messages`: Check console output
- `evaluate_script`: Run JavaScript in page context
- `list_network_requests`: Analyze network traffic

### Emulation & Performance

- `resize_page`: Change viewport
- `emulate`: Throttle CPU/network, emulate geolocation
- `performance_start_trace`: Start profiling
- `performance_stop_trace`: Stop and save trace
- `performance_analyze_insight`: Analyze performance data

---

## Workflow Patterns

### Snapshot-First

Always prefer `take_snapshot` for finding elements - provides UID values needed
by interaction tools.

1. `take_snapshot` - get page structure
2. Find target element UID
3. Use `click(uid=...)` or `fill(uid=..., value=...)`

### Troubleshooting Errors

1. `list_console_messages` - check JS errors
2. `list_network_requests` - find failed resources (4xx/5xx)
3. `evaluate_script` - check DOM state

### Performance Profiling

1. `performance_start_trace(reload=true, autoStop=true)`
2. Wait for page load
3. `performance_analyze_insight` - find LCP issues, layout shifts

---

## Best Practices

- **Context awareness**: Run `list_pages` if unsure which tab is active
- **Snapshots**: Take new snapshot after navigation - UIDs change
- **Timeouts**: Use reasonable timeouts for `wait_for`
- **Screenshots**: Use sparingly for verification, rely on snapshots for logic