moai-framework-electron

Build cross-platform desktop applications with Electron 33+ using IPC, auto-update, and packaging.

2|Updated May 27, 2026
One-click install
npx skills add https://github.com/yekinya/moai-novel --skill moai-framework-electron-yekinya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-framework-electron
Source: https://github.com/yekinya/moai-novel/tree/main/moai-novel/.claude/skills/moai-framework-electron
Command: npx skills add https://github.com/yekinya/moai-novel --skill moai-framework-electron-yekinya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires electron, electron-updater, electron-builder, electron-vite, electron-store, electron-log, zod, and includes references (resource) components.

What problem does it solve? Building secure, production-grade desktop applications with Electron requires correctly coordinating the Main/Renderer process architecture, type-safe IPC communication, security hardening, auto-updates, and multi-platform packaging, which is error-prone without structured guidance. ## Core Features & Use Cases - Process Architecture & Security: Enforces mandatory BrowserWindow settings (contextIsolation, sandbox, disabled nodeIntegration), CSP headers, and Zod-validated IPC handlers to prevent common Electron vulnerabilities. - Type-Safe IPC & Preload Bridges: Provides shared TypeScript channel definitions, ipcMain.handle registration patterns, and contextBridge API exposure for safe renderer-to-main communication. - Auto-Update & Packaging: Covers electron-updater integration with user-controlled downloads, plus Electron Forge and electron-builder configuration for macOS, Windows, and Linux distribution. - Use Case: Scaffold a new Electron app with electron-vite, implement a file storage feature with validated IPC handlers, configure auto-updates via GitHub releases, and package signed installers for all three platforms. ## Quick Start Ask the AI to create a new Electron 33 application with a secure main process, type-safe IPC for file operations, and electron-builder packaging configured for macOS and Windows.

Frequently Asked Questions about moai-framework-electron

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up type-safe IPC communication in Electron?

Define a shared TypeScript interface mapping channel names to payload types, register handlers in the main process with ipcMain.handle, and expose wrapped ipcRenderer.invoke calls through contextBridge.exposeInMainWorld in the preload script. Validate all inputs with Zod before processing.

How to add auto-update to an Electron app with electron-updater?

Create an UpdateService class that initializes electron-updater with a reference to the main window, set autoDownload to false for user control, and handle update-available, download-progress, and update-downloaded events. The app must be code-signed and publish configuration must be set in electron-builder.yml.

Electron Forge vs electron-builder for packaging desktop apps?

Electron Forge provides integrated build tooling with a plugin ecosystem including Vite support and GitHub publishers. electron-builder offers flexible multi-platform targets like NSIS, DMG, AppImage, deb, and rpm with detailed signing and notarization options.

What security settings are required for Electron BrowserWindow?

Every BrowserWindow must set contextIsolation to true, nodeIntegration to false, sandbox to true, and webSecurity to true. Additionally configure Content Security Policy headers via session.webRequest.onHeadersReceived and validate all IPC inputs to prevent path traversal.

Why does my Electron app show a white screen on launch?

White screens usually come from an incorrect preload script path relative to the build output, loadFile or loadURL pointing to missing files, or CSP rules blocking script execution. Open DevTools to inspect console errors and verify paths.

Why do native modules fail after installing in an Electron project?

Native modules are compiled against the system Node.js version by default, but Electron embeds its own Node.js runtime. Run npx electron-rebuild after npm install, or add it as a postinstall script to automate recompilation.