Skip to content
Back to skills

Verify

ASecurity

Build, launch, and drive Durango Code (Electron + Forge + Vite) in an isolated scratch profile via Chrome DevTools Protocol.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentstypescriptgobashreactnodedebugging

Works with

  • cli

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add Complexia/durango-code --skill verify --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Verify?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Verify
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/complexia-verify/badge)](https://www.skillsdirectory.com/skills/complexia-verify)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: verify
description: Build, launch, and drive Durango Code (Electron + Forge + Vite) in an isolated scratch profile via Chrome DevTools Protocol.
---

# Verifying Durango Code changes

Durango Code is an Electron app (`electron-forge` + Vite plugin). There is no `tsconfig.json` — Vite transpiles TypeScript without typechecking:

- Fastest renderer compile check: `bunx vite build --config vite.renderer.config.mjs`
- Renderer typecheck (write flags inline; zsh does not word-split `$VAR`):
  ```bash
  ./node_modules/.bin/tsc --noEmit --jsx react-jsx --skipLibCheck --strict --esModuleInterop --moduleResolution bundler --module esnext --target es2022 --lib es2023,dom,dom.iterable src/App.tsx src/types.d.ts
  ```
- Main-process syntax check (ESM): `node --input-type=module --check < src/main.js`

## Launch with an isolated scratch profile and CDP

Always use a temporary `ORION_DEV_USER_DATA` directory and a dedicated debugging port (pick an unused port such as your workspace port block, not a hardcoded port another agent may hold):

```bash
# If workspace node_modules lag package.json (e.g., Vite resolve errors), run `bun install` first.
mkdir -p /tmp/durango-verify-profile
# Optional: seed /tmp/durango-verify-profile/orion-store.json as {"version":1,"state":{...}}

ORION_DEV_USER_DATA=/tmp/durango-verify-profile \
  ./node_modules/.bin/electron-forge start -- --remote-debugging-port=9334 > /tmp/durango-verify.log 2>&1 &
# CDP is up within a few seconds; poll http://127.0.0.1:9334/json
```

Args after `--` are forwarded to Electron, so Chromium switches like `--remote-debugging-port` and Node's `--inspect=<port>` work.

## Drive via CDP (no Playwright needed)

Node >= 22 and Bun have a global `WebSocket`. Connect to the page target's `webSocketDebuggerUrl` from `GET http://127.0.0.1:<cdp-port>/json`, then:

- `Runtime.evaluate` with `{ awaitPromise: true, returnByValue: true }` runs JS in the renderer — including the preload bridge (`window.orion.*`), which exercises real IPC into the main process. Wrap each eval in an IIFE `(() => { ... })()` so `const` declarations don't collide across calls.
- `Page.captureScreenshot` captures PNG evidence.
- Simulate clicks with `document.querySelector(...).click()`; global Escape/outside-click handlers respond to synthetic `KeyboardEvent`s.
- To stub main-process IPC handlers (since `window.orion` is frozen by `contextBridge`), launch with `--inspect=<inspect-port>` and attach to the main process to swap `ipcMain` handlers during the test.

## Clean up safely

- **Never touch the user's running production app.** Do not run `pgrep Orion` / broad `pkill`.
- **macOS `pkill` option order:** never place options after the pattern (BSD `pkill` treats trailing flags as extra patterns and can kill unrelated apps).
- Stopping the `electron-forge` process alone leaves the Electron main process running and holding the profile's single-instance lock and CDP port. Call `Browser.close` over CDP (or find the exact PID via `pgrep -lf "remote-debugging-port=9334"`) and stop those specific PIDs with `kill <pid>`.
- On macOS, launching a dev build calls `setAsDefaultProtocolClient('orion')`, which can steal `orion://` links from the installed app; restore the default handler afterward if you launched a dev build on a desktop machine with the production app installed.

## Gotchas

- Main-process changes are not hot-reloaded reliably; restart `electron-forge`.
- Signed out, local project bots may invoke the machine's local CLI if you send a message — inspect UI state without sending live bot prompts unless intended.
- `osascript` Apple-events queries can hang on macOS TCC prompts in non-interactive sessions — avoid them.
- Error toasts use sonner: `document.querySelectorAll('[data-sonner-toast]')`.
- React renders asynchronously: DOM queried immediately after `.click()` inside the same `Runtime.evaluate` is stale — split into separate calls with a short (~200ms) pause.
- React controlled inputs ignore direct `.value =` writes — use the native prototype setter and dispatch an `input` event:
  ```js
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(input, value);
  input.dispatchEvent(new Event('input', { bubbles: true }));
  ```
- To stage hard-to-reach app state, either seed `/tmp/<profile>/orion-store.json` before launch, or update via `window.orion.loadStore()` / `window.orion.saveStore(...)` + `location.reload()`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.