# Electron Guidelines This directory contains the Electron main process, preload bridge, IPC, desktop integration, and local persistence glue. ## Workflow - Build with `npm run build:electron`. - Use `npm run electron:dev` or `npm run dev` when you need the integrated desktop stack. - See `../doc/typescript.md` for shared TypeScript rules. ## Boundaries - Keep bootstrapping and lifecycle concerns in `app/`. - Keep desktop platform integrations in focused modules such as `audio/`, `update/`, and `window/`. - Keep renderer-exposed APIs typed in `preload.ts` and routed through explicit IPC handlers. - When adding a new renderer-facing capability, update the Electron implementation, the preload surface, and the renderer bridge together. - Keep persistence entities, migrations, and CQRS helpers aligned with the desktop database model rather than duplicating renderer types. ## Generated Output - Treat `dist/electron/` and packaged artifacts in `dist-electron/` as build output, not source. ## Before You Finish - Validate whether relevant markdown docs or `AGENTS.md` files need updates. If behavior, workflows, commands, or architecture changed, update those docs in the same task.