Skip to content
Back to skills

Chrome Devtools

ASecurity

Puppeteer-based browser automation via single-purpose CLI scripts with persistent sessions and structured JSON output

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
developmentjavascriptgojavabashnodetestingdebuggingapifrontendperformance

Works with

  • cli
  • api
  • mcp

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned October 5, 2026

npx -y skills add trungdo9/ClauKit --skill chrome-devtools --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Chrome Devtools?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Chrome Devtools
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/trungdo9-chrome-devtools/badge)](https://www.skillsdirectory.com/skills/trungdo9-chrome-devtools)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: chrome-devtools
description: Puppeteer-based browser automation via single-purpose CLI scripts with persistent sessions and structured JSON output
category: Testing & Debug
status: active
---

# Chrome DevTools — Puppeteer Automation Toolkit

## Purpose

Browser automation through Puppeteer CLI scripts with **persistent sessions**. Every script outputs structured JSON for easy parsing. Navigate URLs, screenshot with auto-compression, click elements, fill forms, execute JavaScript in page context, monitor console/network, and measure Core Web Vitals.

The skill emphasizes **persistent browser sessions**: the browser keeps running across script executions, preserving state (logged-in sessions, cookies). Scripts disconnect but leave the browser alive for the next script — making multi-step workflows efficient.

## When to Use

- Quick screenshots and visual verification
- Custom Puppeteer automation scripts
- WebSocket debugging
- Integrating into existing developer workflows
- Auth injection and session reuse
- Low-level CDP (Chrome DevTools Protocol) access
- Console/network/performance debugging
- Web scraping with full JS execution

**Do NOT use when**: running long autonomous AI sessions (drive a browser MCP server — Playwright MCP, Chrome DevTools MCP — which keeps page state as compact snapshots instead of script output), or for unit/E2E framework testing (use [`test-automation`](../development/test-automation/SKILL.md)).

## Prerequisites

- Node.js 18+
- Skill directory (project-scope `.claude/skills/chrome-devtools/` or user-scope `~/.claude/skills/chrome-devtools/`)
- Linux/WSL: Chrome system libraries (skill includes `install-deps.sh`)

See [references/installation.md](references/installation.md) for full setup.

## Quick Start

```bash
# Install
cd .claude/skills/chrome-devtools/scripts && npm install
./install-deps.sh   # Linux/WSL only

# Verify
node navigate.js --url https://example.com
# {"success": true, "url": "...", "title": "..."}
```

## The 4-Step Workflow

```bash
# 1. Navigate
node navigate.js --url https://example.com/login

# 2. Discover elements (when structure unknown)
node aria-snapshot.js

# 3. Interact (browser stays alive between calls)
node fill.js --selector "#email" --value "user@example.com"
node click.js --selector "button[type=submit]"

# 4. Verify and close
node screenshot.js --output ./result.png
node navigate.js --url about:blank --close true
```

## Available Scripts

All scripts live in `scripts/` and output JSON.

| Script | Purpose |
|---|---|
| `navigate.js` | Navigate to URLs |
| `screenshot.js` | Capture screenshots (auto-compresses if >5MB) |
| `click.js` | Click elements |
| `fill.js` | Fill form fields |
| `evaluate.js` | Execute JavaScript in page context |
| `snapshot.js` | Extract interactive elements (JSON) |
| `aria-snapshot.js` | Get ARIA accessibility tree (YAML with refs) |
| `select-ref.js` | Interact with elements by ref from ARIA snapshot |
| `console.js` | Monitor console messages/errors |
| `network.js` | Track HTTP requests/responses |
| `performance.js` | Measure Core Web Vitals |
| `ws-debug.js` | Debug WebSocket connections (basic) |
| `ws-full-debug.js` | Debug WebSocket with full events/frames |

Detailed usage: [references/scripts-reference.md](references/scripts-reference.md)

## Session Persistence

Browser state persists across script runs via `.browser-session.json` (WebSocket endpoint).

- **No flag** → keep browser running (default)
- `--close true` → close browser and remove session file

This is the key feature for multi-step workflows: login once, then run many follow-up scripts that reuse the authenticated state.

## Browser Run Modes

Auto-detected from OS:

- **Linux, WSL, CI** → headless
- **macOS, Windows** → headed (visible window for debug)

Override with `--headless false` to force visible.

## Common Options (all scripts)

- `--headless false` — show browser window
- `--close true` — close browser entirely (default: keep alive)
- `--timeout 30000` — timeout in ms
- `--wait-until networkidle2` — wait strategy (`load`, `domcontentloaded`, `networkidle0`, `networkidle2`)

## Examples

See [references/examples.md](references/examples.md) for full workflows:
- Automated login flow
- Debug unknown page structure (ARIA discovery)
- Capture error logs (console + network)
- Performance audit (Core Web Vitals)
- Web scraping
- Testing local HTML files

## Custom Scripts

For complex automation, write custom scripts in `.claude/chrome-devtools/tmp/` using the `lib/browser.js` helpers (`getBrowser`, `getPage`, `disconnectBrowser`, `outputJSON`). See [references/custom-scripts.md](references/custom-scripts.md).

## Troubleshooting

Common issues and fixes: [references/troubleshooting.md](references/troubleshooting.md)

Quick reference:

| Error | Fix |
|---|---|
| `Cannot find package 'puppeteer'` | `npm install` in scripts dir |
| `libnss3.so` missing | `./install-deps.sh` |
| Element not found | Use `aria-snapshot.js` first |
| Script hangs | `--timeout 60000` or `--wait-until load` |
| Stale session | Delete `.browser-session.json` |

## Best Practices

1. **Use session persistence** — keep browser alive for multi-step workflows
2. **Close when done** — `--close true` on the final script
3. **Discover elements first** — `aria-snapshot.js` beats guessing selectors
4. **Organize outputs** — timestamped session directories under `.claude/chrome-devtools/`
5. **Never `file://`** — always serve local HTML through a server (CORS, ES modules, fetch all break otherwise)
6. **Test incrementally** — execute → verify JSON → continue

## Related Skills

- [`test-automation`](../development/test-automation/SKILL.md) — Playwright/Vitest/k6, the single testing toolkit
- [`frontend-design`](../design/frontend-design/SKILL.md) — Screenshot implementations for design comparison

## Core Principle

Incremental, focused scripts. Structured JSON output. Persistent sessions. ARIA-first discovery. One script, one task — repeat until done.

Files in this skill

  • SKILL.md6.4 KB
  • references/cdp-domains.md6.7 KB
  • references/custom-scripts.md3.3 KB
  • references/examples.md3 KB
  • references/installation.md2 KB
  • references/performance-diagnostics.md3.8 KB
  • references/performance-guide.md1.4 KB
  • references/performance-metrics.md3.5 KB
  • references/puppeteer-advanced.md4 KB
  • references/puppeteer-api.md3.9 KB
  • references/puppeteer-reference.md1.7 KB
  • references/scripts-reference.md5.6 KB
  • references/troubleshooting.md2.6 KB
  • scripts/.gitignore54 B
  • scripts/README.md2.6 KB
  • scripts/aria-snapshot.js3.6 KB
  • scripts/click.js850 B
  • scripts/console.js1.4 KB
  • scripts/evaluate.js804 B
  • scripts/fill.js951 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.