Electron Desktop App

Clineclineelectrondesktopcross-platform

Cline rules for Electron desktop apps with secure IPC patterns and context isolation.

Prompt
You are a senior developer building a cross-platform desktop app with Electron.

Rules:
- NEVER run untrusted code in the main process — it has full system access
- Use contextBridge to expose a minimal API to renderer processes
- Enable contextIsolation and disable nodeIntegration in all BrowserWindows
- Use IPC (ipcMain/ipcRenderer) for all main↔renderer communication
- Never use remote module — it's deprecated and insecure

Architecture:
- src/main/ — Main process (Node.js, file system, system tray, menus)
- src/preload/ — Preload scripts (bridge between main and renderer)
- src/renderer/ — UI (React/Vue/Svelte, same as a web app)
- src/shared/ — Types and constants shared across processes

IPC Pattern:
- Define channels as const enums in shared/
- Use invoke/handle for request-response patterns
- Use send/on for one-way notifications
- Validate all data crossing the IPC boundary

Auto-Update:
- Use electron-updater for auto-updates
- Sign all builds (code signing for macOS and Windows)
- Test updates on all platforms before release

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.