electron
Assists with building cross-platform desktop applications using Electron. Use when architecting main/renderer process communication, configuring secure contexts, implementing auto-updates, or packaging apps for Windows, macOS, and Linux. Trigger words: electron, desktop app, browserwindow, ipc, auto-update, electron-builder.
What this skill does
# Electron ## Overview Electron is a framework for building cross-platform desktop applications using web technologies. It combines a Node.js main process for system access and window management with Chromium renderer processes for the UI, communicating via IPC with context isolation and preload scripts for security. ## Instructions - When setting up the architecture, create a main process for window management and system APIs, renderer processes for UI, and preload scripts to expose a controlled API bridge via `contextBridge.exposeInMainWorld()`. - When implementing IPC, use `ipcMain.handle()` / `ipcRenderer.invoke()` for async request-response patterns, and `webContents.send()` for main-to-renderer push communication. - When accessing native APIs, use dialogs, file system, clipboard, notifications, and shell operations in the main process, exposing them to the renderer through the preload bridge. - When configuring security, keep `contextIsolation: true` and `nodeIntegration: false` (defaults), set CSP headers on all windows, sandbox renderer processes, and validate all IPC inputs in the main process. - When packaging the app, use `electron-builder` or `electron-forge` to produce platform-specific installers (NSIS/MSI for Windows, DMG for macOS, AppImage/deb for Linux) with code signing and notarization. - When implementing auto-updates, use `electron-updater` with GitHub Releases or a custom server, configure delta updates for smaller downloads, and verify update signatures. ## Examples ### Example 1: Build a file manager with native dialogs **User request:** "Create an Electron app that browses and manages files with native dialogs" **Actions:** 1. Set up main process with `BrowserWindow` and preload script exposing file system commands 2. Implement IPC handlers for `dialog.showOpenDialog()`, `dialog.showSaveDialog()`, and file operations 3. Build a React-based renderer UI for browsing directories and previewing files 4. Add context menus and keyboard shortcuts for file operations **Output:** A cross-platform file manager with native OS dialogs and secure IPC-based file access. ### Example 2: Add auto-updates with staged rollout **User request:** "Set up auto-updates for my Electron app using GitHub Releases" **Actions:** 1. Configure `electron-builder` with `publish` settings pointing to GitHub Releases 2. Add `electron-updater` in the main process with update check on startup 3. Implement update UI in the renderer showing download progress and restart prompt 4. Configure staged rollout to update a percentage of users first **Output:** An Electron app that automatically checks for updates, downloads them in the background, and prompts the user to restart. ## Guidelines - Always use context isolation and preload scripts; never enable `nodeIntegration` in the renderer. - Validate all IPC message data in the main process since the renderer is untrusted like a browser. - Use `ipcMain.handle()` / `ipcRenderer.invoke()` for async operations over the older `send`/`on` pattern. - Minimize main process work to keep it responsive for window management and IPC routing. - Set CSP headers on all windows: `default-src 'self'; script-src 'self'`. - Test on all target platforms since Windows, macOS, and Linux behave differently for menus, shortcuts, and file paths. - Handle the `renderer-process-gone` event and monitor memory usage with `process.memoryUsage()`.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.