SKILL.md--- name: ao-desktop-dev description: Launch, restart, or troubleshoot the real AO Electron desktop app from this repository; run a checkout against isolated or real local AO data; combine PR branches for local UI review; and diagnose stale Electron processes, port conflicts, or preload bridge mismatches. Use whenever asked to run, open, show, or visually verify AO frontend changes in the actual desktop app rather than ao preview, dev:web, or mock data. --- # AO Desktop Dev Run the Electron application from the current checkout and verify it in the native window. Keep the dev daemon, renderer, Electron preload, and selected data mode explicit so the user never reviews a mock or stale build by accident. ## Choose the data mode Ask only when the request does not make the desired data source clear. - Use **isolated mode** by default for implementation and destructive testing. The default launch gives each checkout `~/.ao/dev/run-<checkout>/` (data, run file, Electron profile) and a free port from 3500-3599. The foreground fallback uses the shared port `3002`, `~/.ao/dev/running.json`, `~/.ao/dev/data`, and `~/.ao/dev/electron`. - Use **real-data mode** only when the user explicitly asks to see this machine's actual AO projects or sessions. Start the checkout's dev daemon on the isolated dev port/run file while pointing `AO_DATA_DIR` at the real AO data directory. This is a separate daemon process using real data; do not describe it as the installed app's daemon. - Never try to attach an unpackaged Electron app directly to a packaged daemon from another checkout. The supervisor intentionally rejects daemon identity mismatches. - Warn before actions in real-data mode that create, terminate, rename, or otherwise mutate sessions. Merely opening and inspecting the UI is expected. - Real-data mode reads the same database as the installed app, and only one daemon can own a data directory. Quit the packaged app first: while its daemon runs, the dev daemon waits for the data-dir lock (9 x `AO_SHUTDOWN_TIMEOUT` + 18s, 108s by default) and then exits with code 75. The dev window is marked with an `Agent Orchestrator (dev)` title, an orange-badged `DEV` dock icon, and an in-app `dev` badge — verify those markers before acting. ## Preflight 1. Work from the repository root and inspect `git status --short --branch`. 2. Read `frontend/package.json`, `frontend/src/main.ts`, and `frontend/forge.config.ts` when the launch behavior may have changed. Treat source as authoritative over this skill. 3. Confirm Node/npm and the Go version required by `backend/go.mod` are available. Before every launch, run `npm run dev:warm` in `frontend/`. It clones a cached real install for an identical lockfile (or runs `npm ci`) and restores cached predev outputs, so a fresh checkout is ready in seconds and an already-warm one is a no-op. It ends with `ready for npm run dev`. If it fails