Agent skill

Enso Cdp

by J3n5en in J3n5en/EnsoCode

Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222.

MITAuto-check passedDevelopment

Install Enso Cdp

skills CLI
$ npx skills add J3n5en/EnsoCode --skill enso-cdp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install J3n5en/EnsoCode enso-cdp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/J3n5en/EnsoCode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/enso-cdp .claude/skills/enso-cdp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
enso-cdp
GitHub stars
118
Token cost
~1.3k tokens
SKILL.md length
327 words
Files
3 (incl. scripts)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222.

  • Works in 3 steps: pnpm dev is running. → curl -s… → Pick type === "page", not json/list[0]…
  • Verifying UI in the running app
  • SKILL.md covers Scripts first, 鼠标拖拽 /…, Connect(手写时才看) and Read, plus 2 more sections
  • Runs JavaScript scripts from its folder; calls node, pnpm and curl

What it does

Enso Cdp is an agent skill from J3n5en/EnsoCode. Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222. Use when verifying UI in the running app, sending a composer chat turn, reading conversation/timeline state, screenshots, CDP, 真机验证, remote-debugging-port, or after changing renderer/main/agent/preload. Use when the user runs /enso-cdp.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts.

It sits in Development, covering Browser testing. It works with Chrome DevTools. The repository describes itself as: One Developer. An Entire Fleet of Autonomous Coding Agents. Local-first desktop agent workbench built on Electron + pi. The licence is MIT.

When your agent uses it

  • Verifying UI in the running app
  • Sending a composer chat turn
  • Reading conversation/timeline state
  • Remote-debugging-port

Example prompts

  • “/enso-cdp”

Requirements

  • Python 3
  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. pnpm dev is running.
  2. curl -s http://127.0.0.1:9222/json/version — if this fails, restart dev (port is not HMR).
  3. Pick type === "page", not json/list[0] (a browser target may come first). Main window is http://localhost:5173/index.html.

What it can do on your machine

Read from SKILL.md and the folder at commit 470def9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • pnpm
    • curl
    • osascript
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm and curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Enso Cdp loads about 1.3k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 327 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from J3n5en/EnsoCode at commit 470def9, republished under its MIT licence (© J3n5en). 327 words, ~1,343 tokens.

Download SKILL.mdSave it as .claude/skills/enso-cdp/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
enso-cdp
description
Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222. Use when verifying UI in the running app, sending a composer chat turn, reading conversation/timeline state, screenshots, CDP, 真机验证, remote-debugging-port, or after changing renderer/main/agent/preload. Use when the user runs /enso-cdp.

EnsoCode CDP

Dev (!app.isPackaged) already opens 9222 in src/main/index.ts. Do not inject TEMP-DEBUG. Packaged builds stay closed.

Scripts first

免依赖脚本在 scripts/(相对本 skill 目录),优先用它们,不要重写 connect 样板:

bash
node scripts/cdp.mjs pages                          # 列出 page 目标
node scripts/cdp.mjs eval '(async()=>{...})()'      # 主窗口执行 JS(支持 await)
node scripts/cdp.mjs eval '...' --page settings.html # 设置窗口
node scripts/cdp.mjs shot /tmp/x.png                # 截图
node scripts/cdp.mjs keys ArrowDown Enter           # 受信任按键(真实输入管线)
node scripts/cdp.mjs type '@rev'                    # 受信任文本输入
node scripts/cdp.mjs drag '<fromJS>' '<toJS>'       # 受信任鼠标拖拽(from/to 为返回 {x,y} 的 JS)

合成事件(eval 里 dispatchEvent)isTrusted=false 且不过 IME/焦点管线;排查“真实键盘行为”用 keys/type。

keys Enter 只发 rawKeyDown/keyUp,不产生字符事件,不会触发 <form> 的隐式提交;验表单回车要手发 Input.dispatchKeyEvent {type:'keyDown', text:'\r', key:'Enter', windowsVirtualKeyCode:13},或直接点提交按钮。

鼠标拖拽 / 点击(Input.dispatchMouseEvent)

窗口必须可见:document.visibilityState === 'hidden'(窗口被遮挡/后台/另一 Space)时, Chromium 会静默丢弃 CDP 的 mousePressed/mouseReleased(mouseMoved 照常送达)—— 表现为拖拽/点击“时好时坏”,极易误判为产品 bug。Page.bringToFront 无效,要 OS 级激活:

bash
osascript -e 'tell application "System Events" to set frontmost of (first process whose name contains "Electron") to true'

cdp.mjs drag 已内置这个检查与自动激活;手写鼠标序列时先 eval document.visibilityState 确认。

其它要点:

  • dnd-kit 等 PointerSensor 库必须走真实指针管线;eval 里合成 PointerEvent/HTML5 drag 事件无效。
  • 拖拽需要 press 后分段 move(越过 activation 距离阈值),落点前悬停 ~150ms 让 droppable 识别。
  • 拖到“拖动中才出现的落点”(如临时 drop bar):先 press+小幅 move 激活拖拽,再 query 落点坐标继续 move。
  • 验证断言别用 class 子串(如 border-ring):Tailwind 的 focus-within:border-ring 会让 className.includes() 永真。

隔离验证环境(不碰真实 userData):

bash
node scripts/mk-env.mjs /tmp/enso-x 2      # 2 个 fake provider(凭证尾号可区分)
node <repo>/scripts/fake-provider-issue-27.mjs &   # 8899;支持 [[tool:name {json}]] 指令
ENSO_USER_DATA_DIR=/tmp/enso-x ENSO_CDP_PORT=9333 pnpm dev
ENSO_CDP_PORT=9333 node scripts/cdp.mjs pages
curl -s http://127.0.0.1:8899/__requests   # 每个请求实际带的凭证尾号

隔离验证必须错开 CDP 端口:用户自己的 dev 实例(真实 userData)常驻 9222,第二个实例绑不上端口也不报错,cdp.mjs 会静默连到用户实例,写操作直接落进真实数据。动手前先 lsof -nP -iTCP:<port> -sTCP:LISTEN 确认 PID 属于隔离实例(ps -E -p <pid> 能看到 ENSO_USER_DATA_DIR)。

常用 store 入口(eval 里):window.__stores.sessions.getState() / window.__stores.settings.getState();window.electronAPI.* 是 preload API。

Connect(手写时才看)

  1. pnpm dev is running.
  2. curl -s http://127.0.0.1:9222/json/version — if this fails, restart dev (port is not HMR).
  3. Pick type === "page", not json/list[0] (a browser target may come first). Main window is http://localhost:5173/index.html.
bash
curl -s http://127.0.0.1:9222/json/list \
  | python3 -c "import json,sys; d=json.load(sys.stdin); p=next(x for x in d if x.get('type')=='page'); print(p['webSocketDebuggerUrl'])"

Node ≥ 22 has global WebSocket. Enable CDP, then evaluate with monotonic ids:

js
await send('Runtime.enable');
async function evalExpr(expression) {
  const res = await send('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true });
  if (res.result?.exceptionDetails) throw new Error(JSON.stringify(res.result.exceptionDetails));
  return res.result?.result?.value;
}

send must map replies by id. Renderer vite root is src/renderer: dynamic import /stores/..., never /src/renderer/stores/....

Read

  • Live chat: document.body.innerText (tail slice(-1200) for the latest turn). Messages are not in localStorage.
  • Metadata only: localStorage['enso-conversations'] — messages is always [].
  • Composer: document.querySelector('textarea').
  • Diff widgets: read el.shadowRoot, not light DOM.
  • Viewport: chat scroller is [data-slot=scroll-area-viewport], not window.
  • Screenshot: Page.captureScreenshot { format: 'png' }.

Send (composer)

Controlled React textarea: assigning .value does not update state. Native setter + input + Enter (no Shift):

js
await evalExpr(`(() => {
  const ta = document.querySelector('textarea');
  const proto = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value');
  proto.set.call(ta, 'YOUR_PROMPT');
  ta.dispatchEvent(new Event('input', { bubbles: true }));
  ta.focus();
  ta.dispatchEvent(new KeyboardEvent('keydown', {
    key: 'Enter', code: 'Enter', which: 13, keyCode: 13, bubbles: true,
  }));
  return ta.value;
})()`);

Wait 5–25s for the turn, then read the text tail. Do not assert immediately.

Failed assistant text stays in the transcript. Judge “no error” on new timestamps or the tail, not the whole innerText.

After code changes

  • Renderer: HMR.
  • src/main / src/agent / src/preload: restart pnpm dev or CDP is still the old worker.

Do not leave test sessions, scratch scripts, or mutated settings.json / userData behind. Backup real user files before touching them; restore and checksum after.

© J3n5en, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in .agents/skills/enso-cdp of J3n5en/EnsoCode.

  • SKILL.md
  • scripts/cdp.mjs
  • scripts/mk-env.mjs

Open the folder on GitHubat commit 470def9

Compare with similar skills

Enso Cdp next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Enso Cdp compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Enso Cdp this skillJ3n5en/EnsoCode118—~1.3kAutomated safety check: PassMIT
Go Pedantrychromedp/chromedp13k—~3.7kAutomated safety check: PassMIT
Docs AuthoringTracecatHQ/tracecat3.8k—~3.1kAutomated safety check: NotesAGPL-3.0
Extension Puppeteer Debuggingmengxi-ream/read-frog10k—~2kAutomated safety check: NotesGPL-3.0
Steam Cdpjinzhongjia/decky-music122—~1.3kAutomated safety check: PassMIT
Profiling Client PerformanceTriliumNext/Trilium38k—~1.9kAutomated safety check: PassAGPL-3.0

Similar skills

  • Go Pedantry

    chromedp/chromedp

    This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…

    13k GitHub stars~3.7k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Docs Authoring

    TracecatHQ/tracecat

    A skill your agent uses when adding or updating documentation pages in an existing docs site.

    3.8k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Extension Puppeteer Debugging

    mengxi-ream/read-frog

    Debug the built Read Frog extension in real Chrome. An agent skill from mengxi-ream/read-frog.

    10k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check: notes
  • Steam Cdp

    jinzhongjia/decky-music

    Drive and inspect the running Steam client UI over the Chrome DevTools Protocol (CEF remote debugging, port 8080) — list targets, evaluate JS probes, navigate routes, click elements, dispatch keys…

    122 GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Profiling Client Performance

    TriliumNext/Trilium

    A skill your agent uses when diagnosing a hard client-side performance problem in Trilium — a stutter while typing, janky dragging, a slow widget, a periodic freeze, "why does this only lag on my…

    38k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • QA Frontend

    PostHog/posthog

    Official

    Internal PostHog developer frontend/browser QA skill. An agent skill from PostHog/posthog.

    40k GitHub stars~5.9k tokensUpdated today
    DevelopmentAuto-check: notes

More from J3n5en/EnsoCode

  • Project Knowledge

    J3n5en/EnsoCode

    Navigate EnsoCode's long-term engineering conventions, layer boundaries, testing rules, historical decisions, and high-cost pitfalls.

    118 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Questions about Enso Cdp

What does Enso Cdp do?

Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222. Enso Cdp is an agent skill from J3n5en/EnsoCode. Drive the EnsoCode Electron renderer via Chrome DevTools Protocol on port 9222.

When should I use Enso Cdp?

Enso Cdp fits situations like: verifying UI in the running app; sending a composer chat turn; reading conversation/timeline state; remote-debugging-port.

How do I install Enso Cdp in Claude Code?

Run `npx skills add J3n5en/EnsoCode --skill enso-cdp -a claude-code`. Or copy the skill folder (.agents/skills/enso-cdp in J3n5en/EnsoCode) into .claude/skills/enso-cdp in your project. Claude Code loads it when a task matches its description.

How do I install Enso Cdp in Codex?

Run `npx skills add J3n5en/EnsoCode --skill enso-cdp -a codex`. Or copy the skill folder (.agents/skills/enso-cdp in J3n5en/EnsoCode) into .agents/skills/enso-cdp in your project. Codex loads it when a task matches its description.

Can I use Enso Cdp in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add J3n5en/EnsoCode --skill enso-cdp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/enso-cdp, .gemini/skills/enso-cdp, .github/skills/enso-cdp and .opencode/skills/enso-cdp in your project.

What does Enso Cdp need to run?

Going by SKILL.md and its folder, Enso Cdp needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node, pnpm, curl, osascript and python3). Our summary lists: Python 3; Node.js.

Does Enso Cdp access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Enso Cdp safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Enso Cdp use?

Enso Cdp is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Enso Cdp use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Enso Cdp?

Skills that share tags, products or a category with Enso Cdp: Go Pedantry (chromedp/chromedp, 13k stars), Docs Authoring (TracecatHQ/tracecat, 3.8k stars), Extension Puppeteer Debugging (mengxi-ream/read-frog, 10k stars) and Steam Cdp (jinzhongjia/decky-music, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Enso Cdp?

J3n5en (a GitHub user) maintains it in J3n5en/EnsoCode, which has 118 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

Source: J3n5en/EnsoCode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.