Skip to content

aidenlx/zotlit / .agents/skills/obsidian-debug

obsidian-debug

Verified

Drive the running Obsidian instance to verify plugin changes — build, reload, eval, screenshot. Use after editing plugin UI or behavior to confirm the change works in the real app, when debugging why something looks wrong at runtime, or when another skill says "verify in Obsidian." Also use when the user asks to test, check, run, or screenshot the plugin, or to inspect desktop Obsidian with CDP, iOS with Safari Web Inspector, or Android with adb and CDP.

FileKindSize
SKILL.mdskill md11.3 KB
android.mdmarkdown3.0 KB
devtools.mdmarkdown1.9 KB
ios.mdmarkdown2.6 KB

devtools.md

View on GitHub
# DevTools over CDP

`packages/scripts/scripts/obsidian-cdp.ts` (written `obsidian-cdp.ts` below) reaches Obsidian
over the Chrome DevTools Protocol: console-style `eval` with top-level `await`, any raw CDP
method, and a full DevTools URL. Its `--help` is the contract — commands, window selection,
the launch command, and main-process scope.

1. **Contract** — run `obsidian-cdp.ts --help`. Done when you know which target holds the
   state: the main process, a vault's main window, or a popout or settings window.
2. **Main process** — use `--main`. It opens the main process's inspector from a vault window,
   so the running Obsidian serves it as is. Skip to step 5.
3. **Debugging port** — windows answer only when Obsidian started with the debugging port.
   Obsidian is shared with other worktree sessions: ask the user before you quit and relaunch
   it. Done when `obsidian-cdp.ts windows` lists the windows.
4. **Target** — pick the window from the `windows` list. Done when an `eval` of
   `app.vault.adapter.basePath` (or `document.title` for a settings window) names the window
   you mean.
5. **Inspect** — `eval` for values, `send` for any other CDP domain (DOM, CSS, Network,
   Profiler, HeapProfiler, Debugger), `inspect` for a DevTools URL the user opens in Chrome.
   For snapshots, clicks, and screenshots, attach agent-browser to the same port; run
   `agent-browser skills get electron` first.
6. **Restore** — once the work is done, close every door you opened: an open inspector or
   debugging port lets any local process drive Obsidian.
   - After `--main`, close the main-process inspector:
     `packages/scripts/scripts/obsidian-cli.ts --code 'require("@electron/remote").require("inspector").close()||"closed"' vault=<id>`.
     Done when it prints `=> closed`.
   - After step 3, start Obsidian normally again. Done when `obsidian-cdp.ts windows` reports
     no endpoint.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall