Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Electron Apps?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-electron-apps)
---
description: Secure Electron desktop apps: context isolation, preload bridges, IPC validation, navigation guards and packaging
profile: standard
tags: electron, desktop, security, typescript
---
# Electron apps
Use when configuring `BrowserWindow`, preload scripts, IPC channels, or Electron packaging/updates.
## Process isolation (non-negotiable)
Every renderer loading UI or remote/user-controlled content must set:
- `contextIsolation: true`
- `nodeIntegration: false`
- `sandbox: true`
- `webSecurity: true`
Never set `nodeIntegrationInWorker: true` or expose raw `ipcRenderer`, `fs`, or `child_process` on `window`.
## Preload and IPC boundaries
- Expose only explicit, narrow actions through `contextBridge.exposeInMainWorld("api", { ... })` instead of passing generic `invoke(channel, args)` wrappers.
- Validate every `ipcMain.handle` payload (schema check, path canonicalization) and verify `event.senderFrame.url` matches a trusted app origin before acting.
## Navigation and external links
- Restrict `webContents.on("will-navigate", ...)` to trusted app origins and deny `setWindowOpenHandler` for unknown schemes (`file://`, `javascript:`), delegating safe `https://` links to `shell.openExternal` only after parsing the URL.
- Enforce a strict `Content-Security-Policy` disabling `unsafe-eval` and remote inline scripts.
## Verify
Inspect `BrowserWindow` `webPreferences`, run unit tests for IPC sender/payload rejection, and package/run signed builds with `anvil app` check against `app.asar`.