electron-pro
ウェブ技術でHTML/CSS/JSを使い、Electronフレームワークを用いてクロスプラットフォームのデスクトップアプリを開発するSkill。
📜 元の英語説明(参考)
Expert in building cross-platform desktop applications using web technologies (HTML/CSS/JS) with the Electron framework.
🇯🇵 日本人クリエイター向け解説
ウェブ技術でHTML/CSS/JSを使い、Electronフレームワークを用いてクロスプラットフォームのデスクトップアプリを開発するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o electron-pro.zip https://jpskill.com/download/6656.zip && unzip -o electron-pro.zip && rm electron-pro.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6656.zip -OutFile "$d\electron-pro.zip"; Expand-Archive "$d\electron-pro.zip" -DestinationPath $d -Force; ri "$d\electron-pro.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
electron-pro.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
electron-proフォルダができる - 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-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Electron デスクトップ開発者
目的
Electron、IPC アーキテクチャ、OS レベルの統合に特化した、クロスプラットフォームのデスクトップアプリケーション開発の専門知識を提供します。Windows、macOS、Linux 向けに、Web テクノロジーとネイティブ機能を活用した、セキュアで高性能なデスクトップアプリケーションを構築します。
使用する場面
- クロスプラットフォームのデスクトップアプリ(VS Code、Discord スタイル)を構築する場合
- Web アプリをネイティブ機能(ファイルシステム、通知)を持つデスクトップアプリに移行する場合
- セキュアな IPC(メインプロセス ↔ レンダラープロセス間の通信)を実装する場合
- Electron のメモリ使用量と起動時間を最適化する場合
- 自動アップデーター(electron-updater)を設定する場合
- アプリストア向けにアプリに署名し、公証する場合
2. 意思決定フレームワーク
アーキテクチャの選択
アプリの構造をどうするか?
│
├─ **セキュリティ第一(推奨)**
│ ├─ Context Isolation? → **Yes** (v12 以降の標準)
│ ├─ Node Integration? → **No** (レンダラープロセスでは決して使用しない)
│ └─ Preload Scripts? → **Yes** (ブリッジ API)
│
├─ **データ永続化**
│ ├─ シンプルな設定? → **electron-store** (JSON)
│ ├─ 大規模なデータセット? → **SQLite** (メインプロセスで `better-sqlite3`)
│ └─ ユーザーファイル? → **Native File System API**
│
└─ **UI フレームワーク**
├─ React/Vue/Svelte? → **Yes** (標準的な SPA アプローチ)
├─ 複数のウィンドウ? → **Window Manager Pattern**
└─ システムトレイアプリ? → **Hidden Window Pattern**
IPC 通信パターン
| パターン | メソッド | ユースケース |
|---|---|---|
| 一方向 (Renderer → Main) | ipcRenderer.send |
ロギング、分析、ウィンドウの最小化 |
| 双方向 (Request/Response) | ipcRenderer.invoke |
DB クエリ、ファイル読み込み、重い計算 |
| Main → Renderer | webContents.send |
メニューアクション、システムイベント、プッシュ通知 |
危険信号 → security-auditor にエスカレート:
- 本番環境で
nodeIntegration: trueを有効にする contextIsolationを無効にする- 厳格な CSP なしでリモートコンテンツ(
https://)を読み込む remoteモジュールを使用する(非推奨かつ安全でない)
ワークフロー 2: パフォーマンス最適化(起動)
目標: 起動時間を 2 秒未満に短縮する。
手順:
-
V8 スナップショット
electron-linkまたはv8-compile-cacheを使用して JS を事前コンパイルします。
-
モジュールの遅延読み込み
main.tsの先頭で全てをrequire()しないでください。// Bad import { heavyLib } from 'heavy-lib';
// Good ipcMain.handle('do-work', () => { const heavyLib = require('heavy-lib'); heavyLib.process(); });
-
メインプロセスのバンドル
- 未使用のコードをツリーシェイクし、ミニファイするために、メインプロセス(レンダラープロセスだけでなく)に
esbuildまたはwebpackを使用します。
- 未使用のコードをツリーシェイクし、ミニファイするために、メインプロセス(レンダラープロセスだけでなく)に
4. パターンとテンプレート
パターン 1: Worker Threads (CPU 負荷の高いタスク)
ユースケース: UI をフリーズさせることなく、画像処理や大規模ファイルの解析を行う場合。
// main.ts
import { Worker } from 'worker_threads';
ipcMain.handle('process-image', (event, data) => {
return new Promise((resolve, reject) => {
const worker = new Worker('./worker.js', { workerData: data });
worker.on('message', resolve);
worker.on('error', reject);
});
});
パターン 2: ディープリンク (プロトコルハンドラー)
ユースケース: ブラウザからアプリを開く場合(myapp://open?id=123)。
// main.ts
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('myapp', process.execPath, [path.resolve(process.argv[1])]);
}
} else {
app.setAsDefaultProtocolClient('myapp');
}
app.on('open-url', (event, url) => {
event.preventDefault();
// Parse url 'myapp://...' and navigate renderer
mainWindow.webContents.send('navigate', url);
});
6. 統合パターン
frontend-ui-ux-engineer:
- 引き渡し: UI 開発者が React/Vue アプリを構築 → Electron 開発者がそれをラップします。
- コラボレーション: ウィンドウコントロール(カスタムタイトルバー)、バイブランシー/アクリル効果の処理。
- ツール: CSS
app-region: drag。
devops-engineer:
- 引き渡し: Electron 開発者がビルド設定を提供 → DevOps が CI パイプラインをセットアップします。
- コラボレーション: コード署名証明書(Apple Developer ID、Windows EV)。
- ツール: Electron Builder、Notarization scripts。
security-engineer:
- 引き渡し: Electron 開発者が機能を実装 → セキュリティ開発者が IPC サーフェスを監査します。
- コラボレーション: Content Security Policy (CSP) ヘッダーの定義。
- ツール: Electronegativity (スキャナー)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Electron Desktop Developer
Purpose
Provides cross-platform desktop application development expertise specializing in Electron, IPC architecture, and OS-level integration. Builds secure, performant desktop applications using web technologies with native capabilities for Windows, macOS, and Linux.
When to Use
- Building cross-platform desktop apps (VS Code, Discord style)
- Migrating web apps to desktop with native capabilities (File system, Notifications)
- Implementing secure IPC (Main ↔ Renderer communication)
- Optimizing Electron memory usage and startup time
- Configuring auto-updaters (electron-updater)
- Signing and notarizing apps for app stores
2. Decision Framework
Architecture Selection
How to structure the app?
│
├─ **Security First (Recommended)**
│ ├─ Context Isolation? → **Yes** (Standard since v12)
│ ├─ Node Integration? → **No** (Never in Renderer)
│ └─ Preload Scripts? → **Yes** (Bridge API)
│
├─ **Data Persistence**
│ ├─ Simple Settings? → **electron-store** (JSON)
│ ├─ Large Datasets? → **SQLite** (`better-sqlite3` in Main process)
│ └─ User Files? → **Native File System API**
│
└─ **UI Framework**
├─ React/Vue/Svelte? → **Yes** (Standard SPA approach)
├─ Multiple Windows? → **Window Manager Pattern**
└─ System Tray App? → **Hidden Window Pattern**
IPC Communication Patterns
| Pattern | Method | Use Case |
|---|---|---|
| One-Way (Renderer → Main) | ipcRenderer.send |
logging, analytics, minimizing window |
| Two-Way (Request/Response) | ipcRenderer.invoke |
DB queries, file reads, heavy computations |
| Main → Renderer | webContents.send |
Menu actions, system events, push notifications |
Red Flags → Escalate to security-auditor:
- Enabling
nodeIntegration: truein production - Disabling
contextIsolation - Loading remote content (
https://) without strict CSP - Using
remotemodule (Deprecated & insecure)
Workflow 2: Performance Optimization (Startup)
Goal: Reduce launch time to < 2s.
Steps:
-
V8 Snapshot
- Use
electron-linkorv8-compile-cacheto pre-compile JS.
- Use
-
Lazy Loading Modules
- Don't
require()everything at top ofmain.ts.// Bad import { heavyLib } from 'heavy-lib';
// Good ipcMain.handle('do-work', () => { const heavyLib = require('heavy-lib'); heavyLib.process(); });
- Don't
-
Bundle Main Process
- Use
esbuildorwebpackfor Main process (not just Renderer) to tree-shake unused code and minify.
- Use
4. Patterns & Templates
Pattern 1: Worker Threads (CPU Intensive Tasks)
Use case: Image processing or parsing large files without freezing the UI.
// main.ts
import { Worker } from 'worker_threads';
ipcMain.handle('process-image', (event, data) => {
return new Promise((resolve, reject) => {
const worker = new Worker('./worker.js', { workerData: data });
worker.on('message', resolve);
worker.on('error', reject);
});
});
Pattern 2: Deep Linking (Protocol Handler)
Use case: Opening app from browser (myapp://open?id=123).
// main.ts
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('myapp', process.execPath, [path.resolve(process.argv[1])]);
}
} else {
app.setAsDefaultProtocolClient('myapp');
}
app.on('open-url', (event, url) => {
event.preventDefault();
// Parse url 'myapp://...' and navigate renderer
mainWindow.webContents.send('navigate', url);
});
6. Integration Patterns
frontend-ui-ux-engineer:
- Handoff: UI Dev builds the React/Vue app → Electron Dev wraps it.
- Collaboration: Handling window controls (custom title bar), vibrancy/acrylic effects.
- Tools: CSS
app-region: drag.
devops-engineer:
- Handoff: Electron Dev provides build config → DevOps sets up CI pipeline.
- Collaboration: Code signing certificates (Apple Developer ID, Windows EV).
- Tools: Electron Builder, Notarization scripts.
security-engineer:
- Handoff: Electron Dev implements feature → Security Dev audits IPC surface.
- Collaboration: Defining Content Security Policy (CSP) headers.
- Tools: Electronegativity (Scanner).