mcpField
E
electron

electron

github.com/hairyfDevelopment26145 installsUpdated 3w ago
Repository

About electron

An Agent skill for building Electron applications with JavaScript across Windows, macOS, and Linux. It organizes guidance on app architecture, IPC, security, development, and distribution.

Key features

  1. 01Main, renderer, and preload process guidance
  2. 02IPC and context isolation patterns
  3. 03Security and performance practices
  4. 04Native APIs and module guidance
  5. 05Packaging, signing, and updates

Use cases

  1. 01Scaffolding an Electron application
  2. 02Connecting renderer and main processes
  3. 03Reviewing security and performance choices
  4. 04Preparing builds for distribution

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hairyf/skills --skill electron

After installing, type/electronin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

GENERATION.md
references/
best-practices-performance.md
best-practices-security.md
best-practices-versioning.md
core-context-isolation.md
core-ipc.md
core-process-model.md
core-sandbox.md
develop-accessibility.md
develop-app-lifecycle.md
develop-base-window.md
develop-browser-window.md
develop-clipboard.md
develop-command-line.md
develop-content-tracing.md
develop-context-menu.md
develop-cookies.md
develop-crash-reporter.md
develop-debug.md
develop-debugger.md
develop-devtools-extension.md
develop-dialog.md
develop-dock.md
develop-downloads.md
develop-drag-drop.md
develop-environment-variables.md
develop-esm.md
develop-keyboard-shortcuts.md
develop-linux-desktop-actions.md
develop-menus-tray.md

Details

From the project README

Electron embeds Chromium and Node.js so you can ship one JavaScript codebase for Windows, macOS, and Linux. Use these skills when scaffolding projects, wiring main/renderer IPC, configuring security and packaging, or integrating native modules and auto-updates.

The skill is based on Electron (latest), generated at 2026-01-30.

Core References

TopicDescriptionReference
Process ModelMain, renderer, preload, utility process; when to use eachcore-process-model
IPCRenderer↔main patterns (send, invoke, main→renderer), serializationcore-ipc
Context IsolationcontextBridge, exposing safe APIs from preloadcore-context-isolation
SandboxProcess sandboxing, preload polyfill, when it is disabledcore-sandbox

Develop

TopicDescriptionReference
AccessibilitysetAccessibilitySupportEnabled, assistive tech, AXManualAccessibilitydevelop-accessibility
App LifecyclewhenReady, window-all-closed, quit, single instance lockdevelop-app-lifecycle
BaseWindowMulti-view windows; contentView, View, addChildView; parent/modaldevelop-base-window
BrowserWindowCreating windows, loadURL/loadFile, ready-to-show, webPreferencesdevelop-browser-window
ClipboardreadText/writeText, readHTML/writeHTML; use from preloaddevelop-clipboard
Cookiessession.cookies; get, set, remove, flushStore; changed eventdevelop-cookies
Command Lineapp.commandLine, appendSwitch, hasSwitch; Electron/Node/Chromium flagsdevelop-command-line
Context MenuRight-click menu; webContents context-menu, Menu.popupdevelop-context-menu
contentTracingChromium tracing; startRecording, stopRecording; chrome://tracingdevelop-content-tracing
Crash ReportercrashReporter.start, submitURL, extra; call before readydevelop-crash-reporter
DebugRenderer DevTools, main process (--inspect, Chrome/VSCode)develop-debug
Debugger (CDP)webContents.debugger; attach, detach, sendCommand; DevTools Protocoldevelop-debugger
DevTools ExtensionloadExtension, removeExtension; electron-devtools-installerdevelop-devtools-extension
DialogshowOpenDialog, showSaveDialog, showMessageBox; expose via IPCdevelop-dialog
DockmacOS Dock; bounce, badge, icon, menu, hide/showdevelop-dock
Downloadswill-download, DownloadItem, setSavePath, preventDefaultdevelop-downloads
Keyboard ShortcutsAccelerators, local (MenuItem), global (globalShortcut)develop-keyboard-shortcuts
Linux Desktop Actions.desktop file Actions; launcher shortcuts; process.argvdevelop-linux-desktop-actions
Menus and TrayApplication/context/tray/dock menus; Tray icon and context menudevelop-menus-tray
Native ImagecreateFromPath, createFromBuffer, template image; tray, icondevelop-native-image
Native ModulesUsing native Node addons; @electron/rebuild, node-gypdevelop-native-modules
Netnet.fetch, net.request; HTTP from main (Chromium stack)develop-net
netLogSession network logging; startLogging, stopLogging, captureModedevelop-net-log
Drag and DropNative file drag out; webContents.startDrag, IPCdevelop-drag-drop
ESMES modules in main and preload; .mjs, caveatsdevelop-esm
MultithreadingWeb Workers, nodeIntegrationInWorker; no Electron in workersdevelop-multithreading
Navigation HistorywebContents.navigationHistory, goBack, goForward, getAllEntriesdevelop-navigation-history
Offscreen Renderingpaint event, NativeImage; GPU vs software; setFrameRatedevelop-offscreen-rendering
parentPortUtility process child; process.parentPort message/postMessagedevelop-parent-port
Power Monitorsuspend, resume, battery/AC, thermal-state-change, shutdowndevelop-power-monitor
Power Save BlockerpowerSaveBlocker; prevent display/app sleep; start/stop by iddevelop-power-save-blocker
Progress BarsetProgressBar (taskbar/dock); 0–1, indeterminatedevelop-progress-bar
ProtocolCustom protocol (protocol.handle), registerSchemesAsPrivilegeddevelop-protocol
Recent DocumentsaddRecentDocument, clearRecentDocuments; JumpList, Dockdevelop-recent-documents
Safe StorageencryptString, decryptString; OS keychaindevelop-safe-storage
ScreengetPrimaryDisplay, getAllDisplays, workAreaSize, display eventsdevelop-screen
Sessionpartition, defaultSession, permissionRequestHandler, cookiesdevelop-session
Share MenumacOS ShareMenu; share to apps/social; popup, shareMenu roledevelop-share-menu
ShellopenExternal, openPath, showItemInFolder, trashItem; securitydevelop-shell
Processprocess.type, process.versions, process.platform, process.masdevelop-process
Environment VariablesELECTRON_*, NODE_OPTIONS; fusesdevelop-environment-variables
Represented FilesetRepresentedFilename, setDocumentEdited (macOS title bar)develop-represented-file
System PreferencesgetEffectiveAppearance, getColor, getMediaAccessStatusdevelop-system-preferences
Touch BarmacOS TouchBar; items (Button, Label, Slider, etc.), setTouchBardevelop-touch-bar
TestsWebDriver/WebdriverIO E2E, headless CIdevelop-tests
Utility ProcessutilityProcess.fork, postMessage, MessagePortMaindevelop-utility-process
Web RequestonBeforeRequest, onHeadersReceived, filter; set CSPdevelop-web-request
webContents Navigationwill-navigate, setWindowOpenHandler, load eventsdevelop-webcontents-navigation
webFrameRenderer zoom, insertCSS, executeJavaScript, spell check, frame treedevelop-web-frame
webFrameMainMain process frame control; fromId/fromFrameToken, executeJavaScript, IPCdevelop-web-frame-main
webUtilsRenderer getPathForFile(File); file input path; expose via preloaddevelop-web-utils
Window CustomizationFrameless, transparent, custom title bardevelop-window-customization
Windows TaskbarJumpList, setThumbarButtons, setOverlayIcon, flashFramedevelop-windows-taskbar

Best Practices

TopicDescriptionReference
PerformanceMeasure first, defer loading, avoid blocking, bundlebest-practices-performance
SecurityContent loading, webPreferences, CSP, IPC validation, distributionbest-practices-security
VersioningSemVer, ~ vs ^, stabilization branches, upgrade and EOLbest-practices-versioning

Features

TopicDescriptionReference
ASARPack/unpack, Node and Web API usage, unpack option, integrityfeatures-asar
Corner Smoothing-electron-corner-smoothing CSS; smooth rounded corners; system-uifeatures-corner-smoothing
Dark ModenativeTheme, themeSource, prefers-color-schemefeatures-dark-mode
Desktop CapturedesktopCapturer, setDisplayMediaRequestHandler, getDisplayMediafeatures-desktop-capture
FusesrunAsNode, nodeCliInspect, asar integrity; @electron/fusesfeatures-fuses
In-App PurchaseMac App Store IAP; purchaseProduct, getProducts, transactions-updatedfeatures-in-app-purchase
MessagePortsRenderer-to-renderer and main-renderer messaging; MessagePortMainfeatures-message-ports
NotificationsMain (Notification), renderer (Web Notifications API)features-notifications
Online/Offlinenet.isOnline(), net.online; navigator.onLine, online/offline eventsfeatures-online-offline
Push NotificationsAPNS (macOS); registerForAPNSNotifications, received-apns-notificationfeatures-push-notifications
Service Workerssession.serviceWorkers; getAllRunning, main↔SW IPC (IpcMainServiceWorker)features-service-workers
SpellcheckerEnable, setSpellCheckerLanguages, context menu, dictionary URLfeatures-spellchecker
UpdatesautoUpdater, Squirrel, publishing release metadatafeatures-updates
Web Embedsiframe, WebContentsView, webview tag; when to use eachfeatures-web-embeds

Distribute

TopicDescriptionReference
Code SigningmacOS sign + notarize; Windows Authenticodedistribute-code-signing
Mac App StoreMAS build, Apple Distribution, sandbox, limitationsdistribute-mac-app-store
PackagingTooling (Forge), manual layout, asar, rebrandingdistribute-packaging
Windows StoreAppX/MSIX, electron-windows-store, process.windowsStoredistribute-windows-store

Comments

Markdown supported