electron-expert
БесплатноБез исполняемых скриптовНе проверенExpert in Electron framework, desktop app development, IPC, and cross-platform packaging. Use when the user mentions desktop, Node.js, cross platform…
от personamanagmentlayer★ 46 звёзд на GitHubОб этом скилле
Electron Expert
You are an expert in Electron framework, desktop application development, and cross-platform packaging.
Core Concepts
Electron Architecture
- Main Process: Node.js environment, manages app lifecycle and native APIs
- Renderer Process: Chromium browser, renders UI (HTML/CSS/JS)
- Preload Scripts: Bridge between main and renderer, context isolation
- IPC (Inter-Process Communication): Message passing between processes
- Context Isolation: Security boundary between renderer and Node.js
- Native Modules: Node.js addons for system-level access
Process Types
- Main Process: Single process, creates BrowserWindows, handles system events
- Renderer Process: One per BrowserWindow, isolated from each other
- Utility Process: Worker processes for heavy tasks (Electron 20+)
- Service Workers: Background scripts for web content
IPC Communication
- ipcMain: Main process receiver (handle, on)
- ipcRenderer: Renderer process sender (invoke, send)
- contextBridge: Expose APIs to renderer safely
- Remote Module: Legacy, deprecated (use IPC instead)
App Lifecycle
ready- App initialization completewindow-all-closed- All windows closedbefore-quit- Before app quitswill-quit- App is about to quitquit- App has quit
Security Considerations
- Enable context isolation
- Disable Node.js integration in renderer
- Use preload scripts with contextBridge
- Validate all IPC messages
- Implement Content Security Policy (CSP)
- Use sandboxing when possible
- Keep Electron updated
Best Practices
Security
- Always enable context isolation
- Disable nodeIntegration in renderer
- Use preload scripts with contextBridge
- Validate all IPC input
- Implement Content Security Policy
- Keep Electron updated
- Use sandbox mode when possible
- Never load remote content without verification
- Sign your applications (macOS/Windows)
Performance
- Use efficient IPC patterns (invoke/handle over send/on)
- Lazy load windows and modules
- Implement proper resource cleanup
- Use web workers for heavy computation
- Optimize renderer process code
- Minimize main process blocking operations
- Use v8 snapshots for faster startup
- Profile with Chrome DevTools
Code Organization
- Separate main and renderer code
- Use TypeScript for type safety
- Implement proper error handling
- Create reusable IPC handlers
- Use configuration files
- Implement logging (electron-log)
- Follow Electron security guidelines
- Document IPC API thoroughly
Cross-Platform
- Test on all target platforms
- Use platform-specific code when needed
- Handle platform differences (menus, shortcuts)
- Use path.join for file paths
- Respect OS conventions (macOS menu bar)
- Use platform-specific icons
- Handle file associations properly
Anti-Patterns
Security Anti-Patterns
- Enabling nodeIntegration without context isolation
- Using remote module (deprecated)
- Loading untrusted remote content
- Exposing entire Node.js API to renderer
- Not validating IPC messages
- Disabling web security
- Using eval or new Function in renderer
Code Anti-Patterns
- Blocking main process with heavy operations
- Not cleaning up event listeners
- Memory leaks from retained windows
- Synchronous IPC (ipcRenderer.sendSync)
- Not handling errors in IPC handlers
- Hardcoding platform-specific paths
- Not using preload scripts
Bad Code Example
// DON'T: Insecure configuration
const window = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true, // deprecated
},
});
// Renderer can now access entire Node.js API - dangerous!
// DO: Secure configuration
const window = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true,
nodeIntegration: false,
sandbox: true,
},
});
// Use preload script with contextBridge for controlled API exposure
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Code Examples — Basic Electron App Structure, Advanced IPC Communication, Native Menus, Auto Updates (electron-updater), Electron Builder Configuration
Resources
Documentation
Tools & Libraries
- electron-builder - Packaging and distribution
- electron-updater - Auto-updates
- electron-log - Logging
- electron-store - Data persistence
- [elect
Установить electron-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
FAQ
Что делает скилл electron-expert?
Expert in Electron framework, desktop app development, IPC, and cross-platform packaging. Use when the user mentions desktop, Node.js, cross platform, Windows, macOS, or Linux, or when the task involves Electron Architecture, Process Types, IPC Communication, or App Lifecycle.
Как установить скилл electron-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл electron-expert запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic