electron
Electronを使ってWindows、macOS、Linuxに対応したデスクトップアプリを開発する際に、プロセス間通信の設計、セキュリティ設定、自動アップデート実装、パッケージングなどを支援するSkill。
📜 元の英語説明(参考)
Assists with building cross-platform desktop applications using Electron. Use when architecting main/renderer process communication, configuring secure contexts, implementing auto-updates, or packaging apps for Windows, macOS, and Linux. Trigger words: electron, desktop app, browserwindow, ipc, auto-update, electron-builder.
🇯🇵 日本人クリエイター向け解説
Electronを使ってWindows、macOS、Linuxに対応したデスクトップアプリを開発する際に、プロセス間通信の設計、セキュリティ設定、自動アップデート実装、パッケージングなどを支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o electron.zip https://jpskill.com/download/14860.zip && unzip -o electron.zip && rm electron.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14860.zip -OutFile "$d\electron.zip"; Expand-Archive "$d\electron.zip" -DestinationPath $d -Force; ri "$d\electron.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
electron.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
electronフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Electron
概要
Electronは、ウェブ技術を使用してクロスプラットフォームのデスクトップアプリケーションを構築するためのフレームワークです。システムアクセスとウィンドウ管理のためのNode.jsのメインプロセスと、UIのためのChromiumレンダラープロセスを組み合わせ、セキュリティのためにコンテキスト分離とプリロードスクリプトを用いてIPCで通信します。
手順
- アーキテクチャをセットアップする際は、ウィンドウ管理とシステムAPIのためのメインプロセス、UIのためのレンダラープロセス、そして
contextBridge.exposeInMainWorld()を介して制御されたAPIブリッジを公開するためのプリロードスクリプトを作成します。 - IPCを実装する際は、非同期のリクエスト-レスポンスパターンには
ipcMain.handle()/ipcRenderer.invoke()を使用し、メインプロセスからレンダラーへのプッシュ通信にはwebContents.send()を使用します。 - ネイティブAPIにアクセスする際は、ダイアログ、ファイルシステム、クリップボード、通知、およびシェル操作をメインプロセスで使用し、プリロードブリッジを介してレンダラーに公開します。
- セキュリティを構成する際は、
contextIsolation: trueとnodeIntegration: false(デフォルト)を維持し、すべてのウィンドウにCSPヘッダーを設定し、レンダラープロセスをサンドボックス化し、メインプロセスですべてのIPC入力を検証します。 - アプリをパッケージ化する際は、
electron-builderまたはelectron-forgeを使用して、コード署名と公証を備えたプラットフォーム固有のインストーラー(Windowsの場合はNSIS/MSI、macOSの場合はDMG、Linuxの場合はAppImage/deb)を作成します。 - 自動アップデートを実装する際は、GitHub Releasesまたはカスタムサーバーで
electron-updaterを使用し、ダウンロードサイズを小さくするために差分アップデートを構成し、アップデートの署名を確認します。
例
例1:ネイティブダイアログを備えたファイルマネージャーを構築する
ユーザーリクエスト: 「ネイティブダイアログを使用してファイルを参照および管理するElectronアプリを作成してください」
アクション:
BrowserWindowとファイルシステムコマンドを公開するプリロードスクリプトを使用して、メインプロセスをセットアップします。dialog.showOpenDialog()、dialog.showSaveDialog()、およびファイル操作のためのIPCハンドラーを実装します。- ディレクトリの参照とファイルのプレビューのためのReactベースのレンダラーUIを構築します。
- ファイル操作のためのコンテキストメニューとキーボードショートカットを追加します。
出力: ネイティブOSダイアログとセキュアなIPCベースのファイルアクセスを備えたクロスプラットフォームファイルマネージャー。
例2:段階的ロールアウトによる自動アップデートを追加する
ユーザーリクエスト: 「GitHub Releasesを使用して、Electronアプリの自動アップデートをセットアップしてください」
アクション:
- GitHub Releasesを指す
publish設定でelectron-builderを構成します。 - 起動時にアップデートチェックを行う
electron-updaterをメインプロセスに追加します。 - ダウンロードの進行状況と再起動プロンプトを表示するレンダラーにアップデートUIを実装します。
- 最初に一部のユーザーをアップデートするように段階的ロールアウトを構成します。
出力: 自動的にアップデートをチェックし、バックグラウンドでダウンロードし、再起動を促すElectronアプリ。
ガイドライン
- 常にコンテキスト分離とプリロードスクリプトを使用してください。レンダラーで
nodeIntegrationを有効にしないでください。 - レンダラーはブラウザのように信頼できないため、メインプロセスですべてのIPCメッセージデータを検証します。
- 古い
send/onパターンではなく、非同期操作にはipcMain.handle()/ipcRenderer.invoke()を使用します。 - ウィンドウ管理とIPCルーティングのために、メインプロセスの作業を最小限に抑えて、応答性を維持します。
- すべてのウィンドウにCSPヘッダーを設定します:
default-src 'self'; script-src 'self'。 - Windows、macOS、およびLinuxは、メニュー、ショートカット、およびファイルパスの動作が異なるため、すべてのターゲットプラットフォームでテストします。
renderer-process-goneイベントを処理し、process.memoryUsage()でメモリ使用量を監視します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Electron
Overview
Electron is a framework for building cross-platform desktop applications using web technologies. It combines a Node.js main process for system access and window management with Chromium renderer processes for the UI, communicating via IPC with context isolation and preload scripts for security.
Instructions
- When setting up the architecture, create a main process for window management and system APIs, renderer processes for UI, and preload scripts to expose a controlled API bridge via
contextBridge.exposeInMainWorld(). - When implementing IPC, use
ipcMain.handle()/ipcRenderer.invoke()for async request-response patterns, andwebContents.send()for main-to-renderer push communication. - When accessing native APIs, use dialogs, file system, clipboard, notifications, and shell operations in the main process, exposing them to the renderer through the preload bridge.
- When configuring security, keep
contextIsolation: trueandnodeIntegration: false(defaults), set CSP headers on all windows, sandbox renderer processes, and validate all IPC inputs in the main process. - When packaging the app, use
electron-builderorelectron-forgeto produce platform-specific installers (NSIS/MSI for Windows, DMG for macOS, AppImage/deb for Linux) with code signing and notarization. - When implementing auto-updates, use
electron-updaterwith GitHub Releases or a custom server, configure delta updates for smaller downloads, and verify update signatures.
Examples
Example 1: Build a file manager with native dialogs
User request: "Create an Electron app that browses and manages files with native dialogs"
Actions:
- Set up main process with
BrowserWindowand preload script exposing file system commands - Implement IPC handlers for
dialog.showOpenDialog(),dialog.showSaveDialog(), and file operations - Build a React-based renderer UI for browsing directories and previewing files
- Add context menus and keyboard shortcuts for file operations
Output: A cross-platform file manager with native OS dialogs and secure IPC-based file access.
Example 2: Add auto-updates with staged rollout
User request: "Set up auto-updates for my Electron app using GitHub Releases"
Actions:
- Configure
electron-builderwithpublishsettings pointing to GitHub Releases - Add
electron-updaterin the main process with update check on startup - Implement update UI in the renderer showing download progress and restart prompt
- Configure staged rollout to update a percentage of users first
Output: An Electron app that automatically checks for updates, downloads them in the background, and prompts the user to restart.
Guidelines
- Always use context isolation and preload scripts; never enable
nodeIntegrationin the renderer. - Validate all IPC message data in the main process since the renderer is untrusted like a browser.
- Use
ipcMain.handle()/ipcRenderer.invoke()for async operations over the oldersend/onpattern. - Minimize main process work to keep it responsive for window management and IPC routing.
- Set CSP headers on all windows:
default-src 'self'; script-src 'self'. - Test on all target platforms since Windows, macOS, and Linux behave differently for menus, shortcuts, and file paths.
- Handle the
renderer-process-goneevent and monitor memory usage withprocess.memoryUsage().