Skills for Real Engineers. Straight from my .agents directory.
browser-cdp
Agent skill fromzenstory-ai/oh-story-claudecode
Use this skill when you need to control a Chrome browser via CDP (Chrome DevTools Protocol) to reuse existing login sessions. Covers: launching Chrome in debug mode, opening URLs, waiting for page load, evaluating JavaScript, taking snapshots, and extracting auth tokens. Trigger phrases: browser automation, CDP, agent-browser, 浏览器操作, 操作浏览器, Chrome CDP, 复用登录态, extract token from browser.
How to install browser-cdp
npx skills add zenstory-ai/oh-story-claudecode# or add only this skill to Claude Code: copy the folder
skills/browser-cdp/
# into
~/.claude/skills/browser-cdp/ (all projects)
.claude/skills/browser-cdp/ (one project)
1# Browser CDP 操作工具23通过 CDP(Chrome DevTools Protocol)连接 Chrome,复用登录态并执行浏览器操作。45## 前置条件67- macOS / Linux / Windows(实验性),已安装并使用过 Google Chrome,来源 profile 已存在8- Node.js 20+9- `agent-browser` 已安装:`npm install -g agent-browser`1011> 启动或重建时,若需结束 Chrome 进程,先按下方流程征得同意;未保存的标签页或草稿可能丢失。1213---1415## 启动流程(每次都按这个顺序)1617下文 `{SKILL_DIR}` 指本 skill(browser-cdp)的目录。1819**第一步:探测当前状态(无副作用)**2021```bash22node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --detect-only23```2425输出形如:2627```28CDP_STATUS=ready # 已就绪,可直接复用29CDP_URL=http://127.0.0.1:9222/json/version30BROWSER=Chrome/148.0.7778.16831```3233或:3435```36CDP_STATUS=needs-setup37CHROME_RUNNING=yes # 用户有 Chrome 在跑,启动会杀掉38CHROME_PID_COUNT=339```4041**第二步:根据探测结果分支**4243- `CDP_STATUS=needs-setup` 且 `CHROME_INSTALLED=no` → 本机没找到 Chrome,告诉用户先安装并用它登录一次需要的网站,不要运行 setup。44- `CDP_STATUS=ready` 且本次只需连接 → 直接使用 `agent-browser --cdp 9222 ...`,**不要运行 setup**。45- 明确请求 `--reset` / `--profile` → 即使 ready 也走重建,按下方「需要结束 Chrome 时」处理。46- `CDP_STATUS=needs-setup` 且 `CHROME_RUNNING=no` → 安全启动:47 ```bash48 node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --yes49 ```50- `CDP_STATUS=needs-setup` 且 `CHROME_RUNNING=yes` → 按下方「需要结束 Chrome 时」处理。5152**需要结束 Chrome 时(同意流程)**:凡是会结束正在运行的 Chrome 的命令(Chrome 在运行时启动、`--reset`、显式 `--profile`),都按这三步走:53541. 带上原定选项加 `--dry-run` 跑一次,看会结束几个 Chrome 进程;552. 告诉用户会结束 N 个 Chrome 进程、未保存的标签页或草稿可能丢失,问是否继续;563. 用户同意后,去掉 `--dry-run`、加 `--yes` 重跑;用户拒绝就放弃这次自动化。57…
Excerpt shown under the repository's MIT license.
More skills in oh-story-claudecode
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
