inspecting-hermes-desktop-dom
Skill75 starsChanged 4 months agoMITView on GitHub
inspecting-hermes-desktop-dom — Read the live Hermes desktop DOM/CSS over CDP.
- Reads credentials
We split this skill into the rules it gives an agent
5 rules. 3 are common, 0 are distinctive, and 2 are very specific to this project.
3
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
When you are developing apps/desktop and the user is running that same app (hgui / npm run dev), you can read the live rendered DOM of the …
- Common: line 66
Check before doing anything else:
- Common: line 108
Read the real node first:
- Very specific: line 124
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.
- Common: line 131
When there is no port, or you must not disturb the user's window:
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Inspecting the live Hermes desktop DOM
Overview
When you are developing apps/desktop and the user is running that same app
(hgui / npm 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 unpackagedelectron .againstdist/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:
curl -s --max-time 3 http://127.0.0.1:${HERMES_DESKTOP_CDP_PORT:-9222}/json/versionEmpty → 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:
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:
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:
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:
cd apps/desktop
HERMES_HOME=/tmp/cdp-probe-home \
HERMES_DESKTOP_DEV_SERVER=http://127.0.0.1:5174 \
HERMES_DESKTOP_CDP_PORT=9333 \
npx electron . --user-data-dir=/tmp/cdp-probe-userdataThe 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.
npm 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_CHANGEDgets blamed on whatever you just changed. - A throwaway
HERMES_HOMEhas no backend. The app logsECONNREFUSEDforhermes:apiand 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 logsDevTools 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
outerHTMLwill bury your context. Project down to a small JSON object inside the evaluated expression. - Pass
matchtoCDP.connect. Without it you may attach to the pet overlay, quick-entry window, or a devtools target instead of the main window. cdp.evalreturns the value; rawRuntime.evaluatedouble-nests it (.result.result.value). Use the wrapper.import.meta.env.DEVistrueundervite devin this repo. The note inapps/desktop/scripts/profile-typing-lag.mdclaiming otherwise is stale.
Other versions8 projects use a version of this.
Word for word · 1
- AtlasOmnia/donna-starter★ 136100% same
Edited · 7
- NousResearch/hermes-agent★ 257k98% same
- aivrar/portable-hermes-agent★ 23999% same
- Samin12/skills★ 897% same
- barzzly/BarzzLyp_Agent_Skills★ 199% same
- 2867203296/hermes-agent★ 099% same
- nobodyohm-web/Thot★ 099% same
- rakaarwaky/agents-arwaky★ 098% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository74 other files it gives its agents.
- apple-remindersSkill
- application-security-reviewSkill
- browser-harness-authoringSkill
- claude-designSkill
- codebase-inspectionSkill
- coding-worktree-recoverySkill
- computer-useSkill
- content-styleSkill
- cross-browser-typography-qaSkill
- daily-news-digestsSkill
- daily-note-wrapupSkill
- destination-trip-planningSkill
- discord-connectSkill
- dogfoodSkill
- domestic-trip-planningSkill
- dynamic-content-extractionSkill
- evidence-based-repliesSkill
- external-model-reviewSkill
- github-authSkill
- github-code-reviewSkill
- github-issuesSkill
- github-pre-push-gatesSkill
- github-pr-workflowSkill
- github-readme-maintenanceSkill
- github-repo-managementSkill
- github-workflowsSkill
- google-workspaceSkill
- hermes-agent-skill-authoringSkill
- hermes-agentSkill
- hermes-config-editingSkill
- hermes-context-optimizationSkill
- hermes-desktop-pluginsSkill
- hermes-diagnostic-reviewSkill
- hermes-mnemosyneSkill
- hermes-nightly-self-check-decisionsSkill
- hermes-overnight-autonomySkill
- hermes-plugin-developmentSkill
- hermes-plugin-evaluationSkill
- hermes-self-evaluationSkill
- hermes-session-maintenanceSkill
- hermes-themesSkill
- hf-model-card-researchSkill
- imessageSkill
- local-app-github-publishingSkill
- local-discoverySkill
- local-model-selectionSkill
- macos-app-automationSkill
- macos-storage-managementSkill
- mapsSkill
- marketing-collateral-designSkill
- marketplace-purchase-vettingSkill
- meal-trackerSkill
- messaging-gateway-troubleshootingSkill
- meta-business-postingSkill
- mnemosyne-maintenanceSkill
- notes-automation-workflowsSkill
- notion-artifact-captureSkill
- notionSkill
- obsidian-memory-architectureSkill
- obsidianSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

