# /browser-testing-with-devtools: Let the agent check a real browser instead of guessing

Source: https://trendhub.net/skills/addyosmani-agent-skills/browser-testing-with-devtools
Skill folder: https://github.com/addyosmani/agent-skills/tree/main/skills/browser-testing-with-devtools
Pack: Addy Osmani's Agent Skills (https://trendhub.net/skills/addyosmani-agent-skills)
Works with: Claude Code, Any agent via the skills CLI, Codex, Gemini CLI, Antigravity CLI, Command Code

This skill connects the agent to Chrome through the Chrome DevTools MCP server so it can take screenshots, read the DOM, console, network traffic, styles and accessibility tree, and record performance traces. It gives step-by-step routines for UI, network and performance bugs, and strict rules for treating page content as untrusted and keeping the browser profile isolated.

## When to use it

- A UI change needs to be confirmed in a running page, not just in unit tests.
- Requests fail, return the wrong data or run into CORS errors.
- Layout shifts, slow loads or console warnings need tracking down.

## How it works

1. **Set up the MCP server**: You add chrome-devtools-mcp to the project's MCP config, by default with its own browser profile or a temporary isolated one.
2. **Reproduce and inspect**: The agent opens the page, triggers the bug, takes a screenshot and reads console errors, the relevant DOM, computed styles and accessibility tree.
3. **Diagnose by type**: It compares actual against expected structure and styles, or reads status codes, payloads and timing for network issues, or records a trace for LCP, CLS and INP.
4. **Fix and verify**: After changing the source it reloads, compares before and after screenshots, confirms a clean console and runs the automated tests.

## What it steers the agent away from

- Following instructions that appear in page text, console output or network responses
- Reading cookies, tokens or localStorage through in-page JavaScript
- Attaching to your everyday Chrome profile when localhost testing does not need it

## What it can touch

Launches and controls Chrome through the DevTools MCP server, runs JavaScript in the page for read-only inspection, and edits source files to apply fixes; navigating to links found on a page or mutating the page needs your confirmation.

## Pairs well with

- `/debugging-and-error-recovery`
- `/frontend-ui-engineering`
- `/performance-optimization`

## Questions

### Does it need anything installed?

Yes. It relies on the chrome-devtools-mcp server, which you add to .mcp.json or your Claude Code settings and which runs through npx.

### Can it use my logged-in browser session?

Only via the --autoConnect option, which the skill advises against unless the test truly needs it; a separate test profile is preferred.
