cdplisted
Install: claude install-skill ryan-brosas/universal-template
# CDP, `browser-harness-js` skill
Custom codegen'd CDP SDK (every method from browser_protocol.json + js_protocol.json gets a typed wrapper) plus a tiny HTTP server that holds one persistent CDP `Session`. The `browser-harness-js` CLI auto-starts the server on first use and forwards JS snippets to it.
The SDK lives in the skill's `sdk/` directory. In the rest of this doc, `$SKILL_DIR` refers to wherever `npx skills add` installed the skill (Claude Code: `~/.claude/skills/cdp`; Cursor: `~/.cursor/skills/cdp`; other agents vary). The CLI should be on PATH as `browser-harness-js`.
## Core Principle
One persistent CDP `Session` held by a long-lived Node HTTP server, every `browser-harness-js` call executes against the same connection, so session, active target, and globals survive across calls.
## When to Use / NOT
- **Use when:** automating, scripting, or inspecting a Chromium-based browser via CDP, single tab or multi-tab, attach to an existing browser or launch a new one with --remote-debugging-port.
- **NOT when:** N/A, no explicit exclusion stated; requires `node` on PATH and a Chromium-based browser with remote debugging (see compatibility).
## Workflow
1. Run `browser-harness-js '<JS>'`, the first call spawns the server; subsequent calls reuse the same session, WebSocket, and globals.
2. Connect with `session.connect()` (auto-detects a running browser) or resolve a WS URL explicitly.
3. Pick a target (tab) and call typed CDP methods (`session.Page.navigate(...)`, `