mcpField
E
electron-skills

electron-skills

github.com/llama-farm開発83685 回インストール21 週間前に更新
リポジトリ

electron-skills について

LlamaFarm Desktop 向けの Electron 開発ガイドです。プロセス構成、IPC、セキュリティ、パフォーマンスのパターンを扱い、TypeScript スキルを補完します。

主な機能

  1. 01メイン、プリロード、レンダラーパターン
  2. 02型安全な IPC の指針
  3. 03コンテキスト分離とプリロードの安全性
  4. 04ウィンドウと起動のパフォーマンス指針

活用シーン

  1. 01Electron プロセス間通信の設計
  2. 02プリロード API とレンダラーの安全性確認
  3. 03ウィンドウ管理と起動の最適化

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/llama-farm/llamafarm --skill electron-skills

インストール後、Claude Code で/electron-skillsを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

electron.md
performance.md
security.md

詳細

LlamaFarm Desktop 向け Electron スキル

LlamaFarm Desktop アプリケーション向けの Electron 28 + Electron Vite パターンです。

概要

このスキルは、メイン/レンダラープロセスのアーキテクチャ、IPC 通信、セキュリティ、パフォーマンスに関する Electron 固有のパターンを、typescript-skills に追加します。

技術スタック

コンポーネント技術目的
フレームワークElectron 28デスクトップアプリケーションのフレームワーク
ビルドelectron-vite 2メイン/プリロード/レンダラー向けの Vite ベースのビルド
アップデートelectron-updaterGitHub リリース経由の自動アップデート
パッケージングelectron-builderクロスプラットフォームのパッケージング(macOS/Win/Linux)

アーキテクチャ

electron-app/
  src/
    main/           # Main process (Node.js context)
      index.ts      # App entry, lifecycle, IPC handlers
      backend/      # CLI installer, model downloader
      window-manager.ts
      menu-manager.ts
      logger.ts
    preload/        # Preload scripts (bridge context)
      index.ts      # contextBridge API exposure
    renderer/       # Renderer process (browser context)
      index.html    # Main window
      splash.html   # Splash screen

基本原則

  1. プロセスの分離 - メイン、プリロード、レンダラーは別々のコンテキストです
  2. コンテキストの分離 - 常に contextBridge.exposeInMainWorld を使用します
  3. レンダラーで Node を使用しない - 常に nodeIntegration: false にします
  4. 型安全な IPC - チャネルの型とペイロードのスキーマを定義します
  5. デフォルトでセキュア - プリロードで公開する API を最小限にします

関連ドキュメント

  • electron.md - IPC パターン、メイン/レンダラー間の通信
  • security.md - コンテキストの分離、プリロードのセキュリティ、CSP
  • performance.md - ウィンドウ管理、メモリ、起動

共通の TypeScript パターン

このスキルは typescript-skills を継承します:

クイックリファレンス

IPC ハンドラーパターン(メインプロセス)
ipcMain.handle('cli:info', async () => {
  const isInstalled = await this.cliInstaller.isInstalled()
  return {
    isInstalled,
    path: isInstalled ? this.cliInstaller.getCLIPath() : null
  }
})
プリロードブリッジパターン
const api = {
  cli: {
    getInfo: () => ipcRenderer.invoke('cli:info')
  },
  platform: process.platform,
  version: process.versions.electron
}

contextBridge.exposeInMainWorld('llamafarm', api)
BrowserWindow の設定
new BrowserWindow({
  webPreferences: {
    preload: path.join(__dirname, '../preload/index.js'),
    nodeIntegration: false,
    contextIsolation: true
  }
})

チェックリストの概要

カテゴリ重大高中低
IPC2321
セキュリティ4321
パフォーマンス1332

コメント