agentleFS
FirzusFirzus/agent-skills/skills/engineering/chrome-devtools/SKILL.md

chrome-devtools

Skill4 starsChanged 20 days agoMITView on GitHub

Debug and automate Google Chrome from the shell with the `chrome-devtools` CLI (npm package `chrome-devtools-mcp`), without configuring an MCP server. Use to inspect a web page's console errors, network requests, cookies and 401/403 failures, performance traces, LCP and Core Web Vitals, Lighthouse scores, accessibility, or memory leaks, and to script page navigation, clicks, form input, emulation, and screenshots. Not for native desktop applications or the host's built-in browser.

  • Installs packages

43 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use aesthetic, web-frameworks and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • mrgoonieSkill

    aesthetic

    Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

    Also in 5 projects that use this

  • mrgoonieSkill

    web-frameworks

    Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.

    Also in 8 projects that use this

  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 4 projects that use this

  • truongtv22Skill

    mobile-development

    Build modern mobile applications with React Native, Flutter, Swift/SwiftUI, and Kotlin/Jetpack Compose. Covers mobile-first design principles, performance optimization (battery, memory, network), offline-first architecture, platform-specific guidelines (iOS HIG, Material Design), testing strategies, security best practices, accessibility, app store deployment, and mobile development mindset. Use when building mobile apps, implementing mobile UX patterns, optimizing for mobile constraints, or making native vs cross-platform decisions.

    Also in 5 projects that use this

  • +8 more from mrgoonie

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the command is missing, report it and propose npm i -g chrome-devtools-mcp@latest.

    line 18
  2. Very specific:

    Run chrome-devtools status.

    line 21
  3. Distinctive:

    If a daemon you did not start is running, reuse it when its arguments suit the task.

    line 22
  4. Very specific:

    Read it: take_snapshot <pageId> returns the accessibility tree with element uids.

    line 84
  5. Very specific:

    Verify the effect: add --includeSnapshot true to the action or take a new snapshot, then check list_console_messages <pageId> --types …

    line 89
  6. Very specific:

    Use --output-format=json when a script or one-liner parses the result.

    line 104
  7. Distinctive:

    Do not quote cookie values, tokens, or authorization headers in reports.

    line 129
  8. Distinctive:

    Read the matching reference before starting that work:

    line 134
  9. Very specific:

    Run chrome-devtools stop if you started or restarted the daemon.

    line 149
  10. Distinctive:

    Pending: if a step failed, report the command, its error output, and the next action instead of claiming the result.

    line 157

“Common” is measured: kept by at least 6 in 10 of the 42 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Chrome DevTools CLI

Drive Chrome through chrome-devtools, a client of a background daemon that keeps pages, cookies, and state between commands. Inputs: the target URL or page, the goal (debugging or automation), and the browser mode. Output: findings backed by evidence (console messages, requests, trace insights) and the paths of the files produced. Side effects: a daemon and a browser start; files are written only at the paths you pass.

1. Check the CLI

  1. Run chrome-devtools --version.
  2. If the command is missing, report it and propose npm i -g chrome-devtools-mcp@latest. Install only with the user's approval. An "Update available" notice is information, not authorization to update.
  3. Run chrome-devtools status. A running daemon prints its version= and args=. If a daemon you did not start is running, reuse it when its arguments suit the task. Otherwise tell the user before restarting it, since a restart closes its pages.

Done: the CLI responds and the daemon state is known. Blocked: CLI absent and installation declined; report the blocker and stop.

2. Choose the browser mode

The first tool command starts the daemon with default options. Options apply only when the daemon starts, so run chrome-devtools start <options> before the first tool command whenever you need a non-default mode or option. start always restarts the daemon.

ModeStart commandUse when
Isolated, headless (default)none, or chrome-devtools startDefault for every task. The temporary profile is deleted on stop.
Visible windowstart --headless=falseThe user wants to watch, or behavior differs in headless mode.
Persistent profilestart --userDataDir=<dir>Logins or storage must survive between sessions.
User's own Chromestart --autoConnect, or start --browserUrl=http://127.0.0.1:9222 / --wsEndpoint=<ws-url>Only with the user's explicit approval for this task: it exposes their sessions, cookies, and tabs.

For the user's own Chrome:

  • --autoConnect needs Chrome 144+ already running with remote debugging enabled in chrome://inspect/#remote-debugging. The first command can time out while Chrome waits for the user to accept the connection; ask them to accept, then retry list_pages.
  • Page IDs are the user's tabs. Act only on tabs the user designates, or open your own with new_page <url> --background true and close it when finished. Do not repeat other tabs' titles or URLs unless the task requires them.
  • Extension tools are off unless you add --categoryExtensions; PWA tools (--categoryPwa) work only in launch modes.

3. Set start options

Combine every option the task needs in one start call:

SituationOption
Private, internal, or localhost URL--performanceCrux=false --usageStatistics=false (both are on by default; CrUX receives URLs from traces)
Output files or uploads--workspace=<dir>, repeatable. Without it, file access is unrestricted; with it, paths outside are rejected with Access denied.
Shared output where secrets appear in headers--redactNetworkHeaders, unless the task inspects those headers
Coordinate clicks (click_at)--experimentalVision
Self-signed development certificate--acceptInsecureCerts
chrome-devtools start --performanceCrux=false --usageStatistics=false --workspace=<abs-output-dir>

Done: mode and options chosen; after a start, chrome-devtools status shows the intended args=.

4. Act on the page

Syntax: chrome-devtools <tool> <required positionals> [--optional-flags]. Most tools take <pageId> first; evaluate_script takes the function first and --pageId <id>. chrome-devtools --help lists the commands and the start flag each one requires, and chrome-devtools <tool> --help gives its exact arguments. The installed help wins over any reference.

  1. Find the page: list_pages, then navigate_page <pageId> --url <url> or new_page <url>.
  2. Read it: take_snapshot <pageId> returns the accessibility tree with element uids. Prefer it to a screenshot for automation.
  3. Act on a uid: click <pageId> <uid>, fill <pageId> <uid> <value>, press_key <pageId> <key>, type_text <pageId> <text>, hover, drag, upload_file, handle_dialog <pageId> accept|dismiss.
  4. Verify the effect: add --includeSnapshot true to the action or take a new snapshot, then check list_console_messages <pageId> --types error, list_network_requests <pageId>, or take_screenshot <pageId> --filePath <abs>.
  • Uids belong to a page state. After a navigation or reload, an old uid fails with Element with uid ... no longer exists; take a new snapshot. Content added by an action receives new uids.
  • The CLI has no wait_for. Repeat take_snapshot until the expected element appears.
  • Console and network lists start at the last navigation. Add --includePreservedMessages true or --includePreservedRequests true to cover the last 3 navigations.
  • emulate <pageId> replaces every previous emulation setting except --extraHttpHeaders. Pass all settings in one call; emulate <pageId> alone resets them.
  • Use --output-format=json when a script or one-liner parses the result.

Quoting

  • Git Bash and POSIX shells: wrap JavaScript in single quotes; double quotes inside are preserved: chrome-devtools evaluate_script '() => document.querySelector("h1").textContent' --pageId 1.
  • PowerShell: double quotes inside an argument are stripped when (Get-Command chrome-devtools).Source is a .cmd shim. In that case, write JavaScript with single quotes inside a double-quoted string, escape JSON quotes as \" (--extraHttpHeaders '{\"X-Test\": \"1\"}'), and move code containing $ or backticks to a file.
  • In any shell, long or quote-heavy code goes in a file passed with evaluate_script --pageId <id> --sourcePath <abs-file>.

5. Collect evidence

  • Pass absolute paths to --filePath, --outputDirPath, --responseFilePath, and take_heapsnapshot. Write only where the user asked, or in a directory created for the task, and list the files produced.
  • Send large results (verbose snapshots, traces, Lighthouse reports, heap snapshots) to files and extract the relevant part with node or jq instead of reading them whole.
  • Cite evidence by its identifier: console msgid, request reqid with status and URL, insight set and insight name with values, file paths. Separate observations from inferences, and state the browser mode and options used.
  • Do not quote cookie values, tokens, or authorization headers in reports; give names and attributes.

6. Specialized work

Read the matching reference before starting that work:

When the task involvesReadTo obtain
A command not covered above, or an inventory by categoryreferences/commands.mdCommand signatures grouped by category, with the start flags they need
LCP, Core Web Vitals, slow loads, traces, throttlingreferences/performance.mdThe trace and insight workflow, LCP subparts, and fixes by bottleneck
401/403, login redirects, cookies, headers, consent bannersreferences/network-cookies.mdRequest inspection, HttpOnly handling, clean-context tests, cookie issues
Accessibility audit, labels, focus, contrastreferences/accessibility.mdLighthouse parsing, snapshot checks, keyboard tests, measurement snippets
Memory growth, leaks, heap snapshotsreferences/memory.mdSnapshot capture, comparison, retainer analysis, common leak causes
A failing start, list_pages, or new_page, a hang, or a refused connectionreferences/troubleshooting.mdDiagnosis by error message, log capture, recovery steps

7. Finish

  1. Close the pages you opened in the user's Chrome and release loaded heap snapshots with close_heapsnapshot <file>.
  2. Run chrome-devtools stop if you started or restarted the daemon. In connected modes it disconnects without closing the user's Chrome. Leave a daemon you only reused running.
  3. Report the findings and evidence, the mode and options used, the files produced, and what was not verified.

Done: requested evidence delivered, files listed, and the daemon in the state the task found it or stopped. Pending: if a step failed, report the command, its error output, and the next action instead of claiming the result.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.