skills/cdp-connect/SKILL.md
Connect Claude Code to an existing Chrome browser via CDP (Chrome DevTools Protocol). Zero dependencies — uses Node 22 built-in WebSocket. Attach to any Chrome running with --remote-debugging-port, then navigate, click, type, screenshot, evaluate JS, read accessibility tree, and monitor console/network. Use when you need to interact with a browser the agent already started, control an existing Chrome instance, or drive browser automation without Playwright MCP. Triggers on: cdp connect, connect to browser, connect to chrome, attach to browser, interact with browser, drive browser, browser automation, control chrome, connect 9222.
npx skillsauth add catalan-adobe/skills cdp-connectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Connect to an existing Chrome browser via Chrome DevTools Protocol. Zero dependencies — Node 22 built-in WebSocket only.
Chrome must be running with remote debugging enabled:
# Launched manually:
chrome --remote-debugging-port=9222
# Or by a dev server that launches Chrome:
npm run dev # if it opens Chrome with --remote-debugging-port
if [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
CDP_JS="${CLAUDE_SKILL_DIR}/scripts/cdp.js"
else
CDP_JS="$(command -v cdp.js 2>/dev/null || \
find ~/.claude -path "*/cdp-connect/scripts/cdp.js" -type f 2>/dev/null | head -1)"
fi
if [[ -z "$CDP_JS" || ! -f "$CDP_JS" ]]; then
echo "Error: cdp.js not found. Ask the user for the path." >&2
fi
Store in CDP_JS and use for all commands below.
node "$CDP_JS" list # Show all tabs with IDs
node "$CDP_JS" navigate <url> [--id <tid>] # Navigate to URL
node "$CDP_JS" eval <expr> [--id <tid>] # Evaluate JavaScript
node "$CDP_JS" screenshot <path> [--id <tid>] # Save screenshot as PNG
node "$CDP_JS" ax-tree [--id <tid>] # Accessibility tree (primary)
node "$CDP_JS" dom [--id <tid>] # Full HTML (fallback)
node "$CDP_JS" click <selector> [--id <tid>] # Click element
node "$CDP_JS" type <sel> <text> [--id <tid>] # Type into element
node "$CDP_JS" console [--timeout 10] # Stream console events
node "$CDP_JS" network [--timeout 10] # Stream network events
All commands default to port 9222. Override with --port N.
Use --id <target-id> from list output to target a specific tab.
list to see tabs and their unique IDsax-tree for page structure (prefer over dom)navigate, click, type, eval as neededscreenshot /tmp/shot.png, then Read the PNGconsole or network to stream eventsax-tree is the primary way to understand page state — semantic
roles and names are more useful than raw HTML for an agent/tmp/ and use the Read tool to vieweval supports promises: eval "await fetch('/api').then(r=>r.json())"--timeout 15CDP_TIMEOUT=10000 env var overrides default 5s timeout globallylist first and use --idtools
Reduce a webpage to a structural skeleton with semantic tokens. Two-phase pipeline: Phase 1 injects a browser script that tokenizes content ({TEXT}, {HEADING:n}, {IMAGE:WxH}, {CTA:label}, {LINK:label}, {INPUT:type}, {VIDEO}, {ICON}). Phase 2 applies LLM structural reasoning to collapse repeated patterns ({REPEAT:N}), remove decorative wrappers, strip utility classes, and produce skeleton.html + manifest.json. Use when migrating pages to EDS, analyzing page structure, extracting page blueprints, or preparing input for GenAI block generation. Triggers on: reduce page, page skeleton, page blueprint, extract structure, tokenize page, page reduction, structural skeleton, reduce URL.
tools
Capture a spatial hierarchy of rendered DOM elements from any webpage. Injects a pre-built script via playwright-cli that walks the DOM, detects layout grids, extracts backgrounds, prunes invisible nodes, promotes elements rendered outside their DOM parent (overlays, fixed navs, modals), and tags overlay nodes with occlusion metadata. Returns three outputs: LLM-friendly indented text, structured JSON tree, and a nodeMap mapping positional IDs to CSS selectors with background and overlay data. Use before page decomposition, overlay detection, brand extraction, or any workflow that needs structured page analysis. Triggers on: visual tree, capture tree, page structure, page hierarchy, DOM tree, capture visual, page analysis, extract tree.
tools
Summarize any video by analyzing both audio and visuals. Downloads via yt-dlp, extracts transcript (YouTube captions or Whisper), pulls scene-detected keyframes, and produces a multimodal summary with clickable timestamped YouTube links. Use this skill whenever the user wants to summarize a YouTube video, digest a talk or tutorial, get notes from a video, extract key points from a recording, or says things like "tl;dw", "summarize this video", "what's in this video", or pastes a YouTube URL and asks for a summary. Also triggers for non-YouTube URLs that yt-dlp supports.
development
Design and build web UIs with Adobe Spectrum 2 design system. Applies S2 layout principles, visual hierarchy, spacing, and component composition to produce accessible interfaces. Outputs vanilla CSS with Spectrum tokens (static pages) or Spectrum Web Components (interactive apps). Recommends tier based on complexity. Covers sp-theme setup, side-effect imports, overlay system, form patterns, --mod-* token customization, and 14 critical gotchas. Use for: spectrum 2 web, SWC, sp-button, sp-theme, build UI with spectrum, S2 layout, spectrum application, adobe design system, web component form, spectrum overlay.