chrome-devtools-deep
Skill0 starsChanged 6 months agoMITView on GitHub
Reach for raw Chrome DevTools Protocol when Playwright's high-level API isn't enough: performance traces, source-mapped console stacks, heap snapshots, deep network introspection. Stay inside Playwright via `newCDPSession` rather than running raw websocat.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architectureSkill
- before-after-evidenceSkill
- ci-optimizationSkill
- configurationSkill
- continuous-deliverySkill
- dependenciesSkill
- developer-experienceSkill
- documentationSkill
- drySkill
- environmentsSkill
- error-handlingSkill
- loggingSkill
- observability-queriesSkill
- orchestrating-a-vps-agent-swarmSkill
- playwright-debugSkill
- principles-and-patternsSkill
- purpose-and-scopeSkill
- running-experimentsSkill
- securitySkill
- software-complexitySkill
- testingSkill
- typesSkill
- versioningSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use this only when playwright-debug can't get you what you need.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chrome DevTools Protocol — escape hatch
When to use this skill
Use this only when playwright-debug can't get you what you need. Specific cases:
- Performance profiles (Tracing.start/stop)
- Source-mapped stack traces with original filenames
- Heap snapshots / memory leak diagnosis
- Filtering network responses by body content
- Throttling network or CPU
- Reading shadow DOM beyond Playwright's accessor
Get a CDP session via Playwright
Stay in one tool. Don't shell out to websocat.
import { chromium } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
const cdp = await context.newCDPSession(page);
await cdp.send('Network.enable');
await cdp.send('Page.enable');
// ... your CDP commands ...Recipe: performance trace of a user flow
const cdp = await context.newCDPSession(page);
await cdp.send('Tracing.start', {
categories: 'devtools.timeline,disabled-by-default-devtools.timeline',
transferMode: 'ReturnAsStream',
});
// ... do the flow ...
const { stream } = await cdp.send('Tracing.end');
// Then collect via IO.read until eofSave the resulting trace JSON; open it in chrome://tracing or feed sections to the agent.
Recipe: source-mapped console stack traces
const cdp = await context.newCDPSession(page);
await cdp.send('Runtime.enable');
cdp.on('Runtime.exceptionThrown', e => {
console.log(JSON.stringify(e.exceptionDetails, null, 2));
});The exceptionDetails.stackTrace.callFrames[].url and lineNumber will be source-map-resolved if the page ships maps.
Recipe: get network response body by URL pattern
const cdp = await context.newCDPSession(page);
await cdp.send('Network.enable');
const interesting = new Map();
cdp.on('Network.responseReceived', e => {
if (e.response.url.includes('/tasks')) interesting.set(e.requestId, e.response.url);
});
// Later, after the request completes:
for (const [requestId, url] of interesting) {
const body = await cdp.send('Network.getResponseBody', { requestId });
console.log(url, body.body);
}Recipe: heap snapshot
const cdp = await context.newCDPSession(page);
await cdp.send('HeapProfiler.enable');
const chunks = [];
cdp.on('HeapProfiler.addHeapSnapshotChunk', c => chunks.push(c.chunk));
await cdp.send('HeapProfiler.takeHeapSnapshot', { reportProgress: false });
const snapshot = chunks.join('');
// Save to .harness/artifacts/<iso>/heap-<timestamp>.heapsnapshot
// Open in Chrome DevTools Memory panelAnti-recipe: don't run raw websocat
Raw CDP via websocat/curl was an earlier approach. It's been removed because (a) every response is unfiltered protocol JSON (token-heavy), (b) error messages are numeric codes, (c) you lose Playwright's frame/target management. Use newCDPSession() instead.
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
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.

