Electron desktop app
Skill swd3k/skills/agent-skills/desktop-apps/electron-desktop-app
Scaffold and harden Electron desktop apps: main/preload/renderer isolation, contextBridge, auto-update, packaging. Use when building or auditing Electron shells, IPC, security, or distributable installers.From its SKILL.md
npx -y skills add swd3k/skills --skill electron-desktop-appAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.8 KB, 378 tokens by cl100k_base, as published. Nobody here has run it
Electron Desktop App
Use Electron when you need cross-platform desktop with full Chromium + Node ecosystem.
When to use
- macOS + Windows + Linux required
- Heavy web stack already exists
- Photino/Tauri not viable for the team
Security defaults (non-negotiable)
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: true,
preload: path.join(__dirname, 'preload.js')
}
- Expose APIs only via
contextBridge - Validate every IPC channel; never pass untrusted paths to
shell.open/fs - Disable remote module; avoid
enableRemoteModule
Structure
main/ # process lifecycle, windows, menus, auto-update
preload/ # thin safe API surface
renderer/ # UI (React/Vue/Svelte or plain)
shared/ # types + channel names
Workflow
- One BrowserWindow first; add tray/menu later.
- Define typed IPC channels in
shared/channels.ts. - Preload exposes only needed methods.
- Package with
electron-builderorelectron-forge. - Code-sign on macOS/Windows for SmartScreen/Gatekeeper.
Packaging defaults
- NSIS (Windows), DMG (macOS), AppImage (Linux)
- Publish updates via GitHub Releases +
electron-updater - Ship asari symbols only if debugging crashes
Pitfalls
nodeIntegration: truein production- Huge asar from bundling entire monorepo
- Auto-update without code signing → silent failure
- Blocking main process with sync FS/network
Acceptance
- Renderer cannot
require('fs') - Quit cleans timers and windows
- Update check fails gracefully offline
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.