К основному содержанию
скилл CX Codex

inspecting-hermes-desktop-dom — скилл для Claude Code: DOM и установка

Скилл inspecting-hermes-desktop-dom читает DOM, CSS и консоль работающего Hermes Desktop через CDP. Пригодится, чтобы проверить, применился ли стиль и какое CSS-правило победило.

MIT 263 установок ★ 265 216 обновлён 2026-11-10

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add NousResearch/hermes-agent --skill inspecting-hermes-desktop-dom -a claude-code
Открыть на GitHub

Что делает inspecting-hermes-desktop-dom

Скилл обращается к Chromium-окну apps/desktop через Chrome DevTools Protocol: читает отрисованный DOM, вычисленные стили, геометрию элементов и сообщения консоли. Для быстрых проверок использует apps/desktop/scripts/eval.mjs, для нескольких шагов — клиент CDP с поиском нужного окна и выполнением JavaScript.

CDP доступен на 127.0.0.1:9222 при запуске dev-сервера; упакованная сборка порт не открывает. Для отдельного запуска скилл описывает изолированный экземпляр Electron с отдельными HERMES_HOME, портом и --user-data-dir. Не перезапускайте приложение пользователя ради доступа к DOM: это завершит его сессию.

Скилл помогает найти унаследованный стиль или правило плагина, которое перекрывает CSS-класс. Он не оценивает, хорошо ли выглядит интерфейс, и не предназначен для профилирования производительности.

Какие задачи решает

  • проверить, появился ли элемент после UI-изменения
  • найти CSS-правило, которое задаёт вычисленный стиль
  • проверить значение дизайн-токена на реальном элементе
  • прочитать ошибки консоли renderer-процесса
  • подобрать стабильный data-slot-селектор

Примеры запросов агенту

  • Проверь через CDP, применился ли стиль к этому элементу.
  • Найди правило, которое задаёт fontWeight для ссылки в сообщении ассистента.
  • Прочитай ошибки консоли работающего apps/desktop.

Как установить inspecting-hermes-desktop-dom

1Через Skills CLI (Vercel)

npx skills add NousResearch/hermes-agent --skill inspecting-hermes-desktop-dom -a claude-code

2Вручную: положить файлы

~/.claude/skills/inspecting-hermes-desktop-dom/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/inspecting-hermes-desktop-dom/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об inspecting-hermes-desktop-dom

Как установить inspecting-hermes-desktop-dom в Claude Code?

Выполните npx skills add NousResearch/hermes-agent --skill inspecting-hermes-desktop-dom -a claude-code. Файл скилла находится по пути ~/.claude/skills/inspecting-hermes-desktop-dom/SKILL.md.

Что делает inspecting-hermes-desktop-dom?

Он читает живой DOM и вычисленные стили окна Hermes Desktop через CDP, а также может получить сообщения консоли. Это помогает выяснить, какой CSS-селектор применился к элементу.

Когда CDP-порт Hermes Desktop недоступен?

Порт закрыт в упакованных сборках и при запуске electron . без HERMES_DESKTOP_DEV_SERVER. Для проверки можно поднять отдельный экземпляр Electron с собственным портом и каталогом данных.

Исходный текст

SKILL.md · MIT
---
name: inspecting-hermes-desktop-dom
description: "Read the live Hermes desktop DOM/CSS over CDP."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [desktop, electron, cdp, dom, ui-verification, self-inspection]
    related_skills: [node-inspect-debugger, systematic-debugging, dogfood]
---

# Inspecting the live Hermes desktop DOM

## Overview

When you are developing `apps/desktop` and the user is running that same app
(`hgui` / `pnpm run dev`), you can read the **live rendered DOM** of the window
they are looking at — computed styles, geometry, which CSS rule actually won,
console output — instead of inferring it from `.tsx` and being wrong.

Dev-server runs open a Chrome DevTools Protocol port on `127.0.0.1:9222`
automatically. The renderer is a Chromium page, so everything DevTools can read,
a script can read.

**This does not replace looking at it.** CDP answers *factual* questions ("what
is the computed padding", "did this element render", "which selector matches").
It cannot tell you whether the result looks good. Colour balance, spacing feel,
and "is this ugly" still need the user's eyes or a screenshot. Answer facts with
CDP; hand aesthetics to the user.

## When to Use

- Verifying a UI change actually took effect in the running app
- "Why is this element still X?" — find the winning rule before editing anything
- Locating a stable selector for a component you're about to change
- Checking a design token's computed value on a real node
- Reading renderer console errors the user mentions but can't copy out

**Don't use for:** perf profiling or heap work (`node-inspect-debugger`,
`debugging-hermes-desktop`), or anything where the real question is "does this
look right".

## The port

Open on `127.0.0.1:9222` for any dev-server run. Closed in exactly two cases
(`apps/desktop/electron/dev-cdp.ts`):

- **packaged builds** — always, and no environment value overrides it;
- **no `HERMES_DESKTOP_DEV_SERVER`** — an unpackaged `electron .` against
  `dist/` is how the packaged app gets smoke tested, so it behaves like one.

`HERMES_DESKTOP_CDP_PORT` moves the port (`=9333`) or disables it (`=off`).

Check before doing anything else:

```bash
curl -s --max-time 3 http://127.0.0.1:${HERMES_DESKTOP_CDP_PORT:-9222}/json/version
```

Empty → no port. Do not guess another port silently.

**Never relaunch the user's app to get a port.** That destroys their session and
their state. Launch your own isolated instance instead (below).

## Reading the DOM

`apps/desktop/scripts/eval.mjs` is the one-liner:

```bash
cd apps/desktop
node scripts/eval.mjs "document.querySelectorAll('[data-slot]').length"
```

For multi-step work use the shared client — it has target discovery and
promise-aware eval:

```js
import { CDP, SELECTORS } from './scripts/perf/lib/cdp.mjs'

const cdp = await CDP.connect({ port: 9222, match: '5174' })
const out = await cdp.eval(`JSON.stringify({
  radius: getComputedStyle(document.documentElement).getPropertyValue('--radius-scalar').trim(),
  composer: !!document.querySelector('[data-slot="composer-rich-input"]')
})`)
cdp.close()
```

`SELECTORS` in `scripts/perf/lib/cdp.mjs` holds the stable `data-slot` hooks
(composer, thread viewport, assistant message, turn pair, profile rail). Prefer
them over inventing a `querySelector` — they are updated as a unit when
components move.

## The question this is best at: which rule won?

Editing every call site because a style "isn't applying" is the classic waste.
Read the real node first:

```js
const el = document.querySelector('[data-slot="aui_assistant-message-root"] a')
JSON.stringify({
  ownClasses: el.className,
  weight: getComputedStyle(el).fontWeight,
  parents: (() => {
    const out = []
    let n = el
    while ((n = n.parentElement) && out.length < 6) out.push(n.className)
    return out
  })()
})
```

If the node carries no class of its own, the value is **inherited** — sweeping
call sites will not fix it, and you need the ancestor rule. A plugin stylesheet
(e.g. `@tailwindcss/typography`'s `prose a { font-weight: 500 }`) routinely beats
a utility class; override on the shared class, not at each usage.

## Your own isolated instance

When there is no port, or you must not disturb the user's window:

```bash
cd apps/desktop
HERMES_HOME=$HOME/.hermes/cache/scratch/cdp-probe-home \
HERMES_DESKTOP_DEV_SERVER=http://127.0.0.1:5174 \
HERMES_DESKTOP_CDP_PORT=9333 \
  pnpm exec electron . --user-data-dir=$HOME/.hermes/cache/scratch/cdp-probe-userdata
```

The separate `--user-data-dir` dodges Electron's single-instance lock, so it
cannot collide with a running `hgui`; the separate `HERMES_HOME` keeps it away
from real sessions. Pick a port other than 9222 for the same reason. Run it in
the background and kill it when done.

`pnpm run perf:serve` does the same with a temp `HERMES_HOME` baked in, if you
also want the perf harness.

## Pitfalls

- **Never kill the user's dev server or app to "free" anything.** A mid-serve
  kill nukes Chromium's socket pool, and the resulting `ERR_NETWORK_CHANGED`
  gets blamed on whatever you just changed.
- **A throwaway `HERMES_HOME` has no backend.** The app logs `ECONNREFUSED` for
  `hermes:api` and may exit on its own. The renderer still mounts and the DOM is
  readable — read promptly, and don't mistake a self-exited probe for a broken
  port. Chromium logs `DevTools listening on ws://127.0.0.1:<port>/…` when it
  binds; that line is the proof the port opened.
- **Poll, don't probe once.** A just-launched app needs a second or two before
  the port answers.
- **Never dump the whole DOM.** The desktop renders hundreds of nodes and
  `outerHTML` will bury your context. Project down to a small JSON object inside
  the evaluated expression.
- **Pass `match` to `CDP.connect`.** Without it you may attach to the pet
  overlay, quick-entry window, or a devtools target instead of the main window.
- **`cdp.eval` returns the value; raw `Runtime.evaluate` double-nests it**
  (`.result.result.value`). Use the wrapper.
- **`import.meta.env.DEV` is `true` under `vite dev`** in this repo. The note in
  `apps/desktop/scripts/profile-typing-lag.md` claiming otherwise is stale.

© Hermes Agent · MIT · NousResearch/hermes-agent

Похожие скиллы

Все скиллы по теме «Фронтенд и UI» →
js-batch-dom-css tech-leads-club Правило js-batch-dom-css запрещает чередовать чтение геометрии DOM с записью стилей. Защищает код от синхронного reflow и просадок FPS при анимациях. CX Codex +1 ★ 7 191звёзд репо expo-dom expo Скилл expo-dom запускает веб-код в webview на нативных платформах и рендерит как есть на вебе. Позволяет использовать веб-библиотеки вроде recharts или react-syntax-highlighter в Expo без переписывания. CX Codex +1 25 700установок pixijs-scene-dom-container pixijs Скилл pixijs-scene-dom-container для Claude Code и Codex: объясняет агенту, как накладывать HTML-элементы на canvas PixiJS v8 через DOMContainer и DOMPipe. Поля ввода, iframe и видео крепятся поверх сцены. CX Codex +1 6 900установок measuring-dom-nodes coleam00 Правило measuring-dom-nodes объясняет, как правильно измерять размеры DOM-элементов в Remotion с учётом масштаба видеоконтейнера. CX Codex +1 ★ 849звёзд репо hunt-dom Sachin Sharma Скилл hunt-dom для поиска клиентских DOM-уязвимостей: DOM Clobbering, PostMessage без проверки origin, CSS Injection с утечкой токенов. CX Codex +1 ★ 16 193звёзд репо

Из того же набора61

Весь набор →
grounded-citations Скилл grounded-citations привязывает утверждения агента к проверенным ссылкам со сквозной нумерацией в стиле Perplexity и проверяет точность цитат по сохранённому тексту. CX Codex +1 307установок openhue Скилл openhue для Claude Code управляет светильниками, комнатами и сценами Philips Hue через терминал. Настраивает освещение дома из чата с агентом. CX Codex +1 288установок pdf Работает с PDF-файлами: создаёт, читает, объединяет, заполняет формы, извлекает текст и таблицы. CX Codex +1 283установок polymarket Получает из публичных REST API Polymarket данные о рынках, ценах, стаканах заявок и истории. Показывает, какие шансы рынок даёт событию. CX Codex +1 282установок github Скилл github управляет задачами, пулл-реквестами, ревью и репозиториями через консольную утилиту gh. Помогает вести полный цикл от создания issue до слияния проверенного PR. CX Codex +1 245установок heartmula Запускает локальную генерацию песен из текста и тегов через HeartMuLa. Работает без облачного сервиса. CX Codex +1 230установок godmode Скилл godmode для Claude Code предлагает три способа обхода фильтров модели на уровне промпта: шаблоны, маскировку триггерных слов и опрос моделей через OpenRouter. CX Codex +1 214установок competitor-news-monitor Скилл competitor-news-monitor следит за заданными компаниями и присылает дайджест только по значимым событиям, со ссылками на первоисточники. CX Codex +1 204установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой