Electron

From skeletorflet/opencode-supreme-setup · View interactive version

Electron is an AI agent skill from the GitHub repository skeletorflet/opencode-supreme-setup. Cross-platform desktop apps using Chromium and Node.js — main/renderer process, IPC, contextBridge, native APIs, electron-builder, auto-update, and security best practices.

How to use this skill

Skill file

Electron

Main and Renderer Processes

Two process types: main (Node.js backend) and renderer (Chromium frontend). Main process manages windows, menus, and system APIs. Renderer handles the UI.

IPC (Inter-Process Communication)

ipcMain / ipcRenderer for async message passing. Use invoke/handle for request-response patterns and send/on for fire-and-forget events.

Context Bridge and Preload

Security boundary between main and renderer. Preload scripts run before renderer code and use contextBridge.exposeInMainWorld() to expose specific APIs.

Native APIs

dialog (file pickers), Notification, Tray, Menu, shell.openExternal, clipboard, desktopCapturer, and screen for native functionality.

electron-builder

Package apps for distribution. Supports .dmg / .zip (macOS), .exe / .msi (Windows), .AppImage / .deb (Linux). Auto-update via electron-updater.

Auto-Update

electron-updater checks for updates, downloads in background, and installs on restart. Supports GitHub Releases, S3, and custom servers.

Security Best Practices

Enable sandbox: true, set restrictive Content-Security-Policy, disable nodeIntegration in renderers, validate IPC inputs, and use contextIsolation: true.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.