agent-cdp
Skill733 starsChanged 2 months agoApache-2.0View on GitHub
Chrome DevTools Protocol CLI workflow for runtime, console, network, trace, memory, and JavaScript CPU profiling analysis. Use when Codex needs to inspect debuggable Chrome/Chromium tabs, Node processes started with --inspect, React Native/Metro/Hermes targets, or to combine agent-device UI driving with CDP evidence for performance, heat, re-render, network, memory, or runtime-state diagnosis.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-native-skills/AGENTS.mdAGENTS.md
- agent-deviceSkill
- deploy-iosSkill
- dogfoodSkill
- hot-updater-qa-shipSkill
- hot-updaterSkill
- react-devtoolsSkill
- react-native-best-practicesSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 8
Use agent-cdp for evidence-backed runtime diagnostics through Chrome DevTools Protocol.
- Distinctive: line 18
If that command cannot read bundled skills, fall back to the installed package files:
- Distinctive: line 27
Start/check the daemon:
- Distinctive: line 43
Default target scanning checks local Chrome, Node inspect, and Metro-style endpoints.
- Distinctive: line 91
Prefer short captures over long recordings.
≈ “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
agent-cdp
Use agent-cdp for evidence-backed runtime diagnostics through Chrome DevTools Protocol. Pair it with agent-device when a mobile UI interaction must be driven on a simulator/device while CDP records what the JS runtime, network, or profiler did.
First Step
Load the bundled upstream guide before non-trivial use:
agent-cdp skills get coreIf that command cannot read bundled skills, fall back to the installed package files:
AGENT_CDP_ROOT="$(npm root -g)/agent-cdp"
sed -n '1,220p' "$AGENT_CDP_ROOT/skills/core.md"Core Workflow
- Start/check the daemon:
agent-cdp start
agent-cdp status- Find and select a target:
agent-cdp target list
agent-cdp target list --url http://127.0.0.1:8081
agent-cdp target list --url http://127.0.0.1:9229
agent-cdp target select <target-id>Default target scanning checks local Chrome, Node inspect, and Metro-style endpoints. If no React Native target appears, first verify Metro/dev-server reachability and whether the app is actually running in a debuggable dev mode.
React Native/Metro inspector endpoints may reject WebSocket connections with HTTP 401 unless the client sends an Origin such as http://localhost:8081. If target list sees a React Native target but target select fails with 401, verify the installed agent-cdp transport sends that Origin for targets whose kind is react-native or whose websocket URL contains /inspector/debug.
- Capture only the evidence needed:
agent-cdp console list --limit 50
agent-cdp runtime eval --expr "globalThis.location?.href ?? process.version" --json
agent-cdp network start --name repro
agent-cdp trace start
agent-cdp profile cpu start --name hot-path- Reproduce the interaction. For mobile, drive the UI with
agent-device:
agent-device --session <name> snapshot
agent-device --session <name> press <target>
agent-device --session <name> wait 1000- Stop and inspect:
agent-cdp network stop
agent-cdp network summary
agent-cdp network list --limit 20
agent-cdp trace stop
agent-cdp trace summary
agent-cdp profile cpu stop
agent-cdp profile cpu hotspots --limit 20Common Tasks
For heat or high CPU, prefer a bounded CPU profile around the suspect interaction, then inspect hotspots and stacks. Also capture a process snapshot with ps so CDP findings can be correlated with OS-level CPU.
For slow or noisy network behavior, use network start, reproduce once, then inspect network summary, filtered network list, and only specific request/response headers or bodies. Avoid dumping auth headers or secrets.
For runtime state, use runtime eval with read-only expressions. Do not mutate app state from CDP unless the user explicitly asks for that side effect.
For trace-style UI performance, use trace start/stop around a short interaction and inspect summary/tracks/entries. Export the raw trace only when compact summaries are insufficient.
For memory leaks, take baseline/action/cleanup samples or snapshots, then use the built-in memory diff/leak commands. Keep heap artifacts out of commits unless explicitly requested.
Safety
Prefer short captures over long recordings. Stop active network, trace, CPU, or allocation sessions before finishing. Report when no CDP target is available instead of pretending profile evidence exists.
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.

