Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

electron-dev

БесплатноБез исполняемых скриптовНе проверен

Electron main process and IPC development guidelines for Gemini-Subtitle-Pro. Use when working with IPC handlers, preload scripts, native integrations…

corvo007от corvo007★ 850 звёзд на GitHub18 установок в других каталогах

Об этом скилле

Electron Development Guidelines

Purpose

Establish secure and consistent patterns for Electron main process development in Gemini-Subtitle-Pro.

When to Use This Skill

Automatically activates when working on:

  • Creating or modifying IPC handlers
  • Working with preload scripts
  • Native integrations (ffmpeg, whisper, yt-dlp)
  • File system operations
  • Desktop-specific features
  • Protocol handlers

Quick Start

New IPC Channel Checklist

  • Handler: Add in electron/main.ts using ipcMain.handle()
  • Bridge: Expose in electron/preload.ts via contextBridge
  • Types: Update src/types/electron.d.ts
  • Naming: Use feature:action convention

Security Requirements (CRITICAL)

These settings MUST be maintained in electron/main.ts:

const mainWindow = new BrowserWindow({
  webPreferences: {
    nodeIntegration: false, // NEVER change to true
    contextIsolation: true, // NEVER change to false
    sandbox: true, // NEVER change to false
    preload: path.join(__dirname, 'preload.js'),
  },
});

Why?

  • nodeIntegration: false - Prevents renderer from accessing Node.js APIs directly
  • contextIsolation: true - Separates preload from renderer context
  • sandbox: true - Limits preload script capabilities

IPC Contract Pattern

Step 1: Handler in main.ts

// electron/main.ts
ipcMain.handle('video:compress', async (event, options: CompressOptions) => {
  try {
    const result = await compressVideo(options);
    return { success: true, data: result };
  } catch (error) {
    return { success: false, error: error.message };
  }
});

Step 2: Bridge in preload.ts

// electron/preload.ts
contextBridge.exposeInMainWorld('electronAPI', {
  compressVideo: (options: CompressOptions) => ipcRenderer.invoke('video:compress', options),
});

Step 3: Types in electron.d.ts

// src/types/electron.d.ts
interface ElectronAPI {
  compressVideo: (options: CompressOptions) => Promise<CompressResult>;
}

declare global {
  interface Window {
    electronAPI: ElectronAPI;
  }
}

Step 4: Use in Renderer

// src/services/video/compressor.ts
const result = await window.electronAPI.compressVideo(options);

Directory Structure

electron/
├── main.ts              # Main process entry, IPC handlers
├── preload.ts           # Context bridge
├── logger.ts            # Logging utilities
├── i18n.ts              # i18n for main process
├── locales/             # Main process locales
└── services/            # Native service integrations
    ├── ffmpegService.ts
    ├── localWhisper.ts
    └── videoPreviewTranscoder.ts

Naming Conventions

IPC Channels

Use feature:action format:

// ✅ Good
'video:compress';
'audio:extract';
'subtitle:export';
'file:select';
'app:getVersion';

// ❌ Bad
'compressVideo';
'COMPRESS_VIDEO';
'video_compress';

Resource Files

For detailed guidelines, see the resources directory:

Полный SKILL.md на GitHub

Установить electron-dev в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/ipc-patterns.mdresources/native-services.mdresources/security-guide.md

FAQ

Что делает скилл electron-dev?

Electron main process and IPC development guidelines for Gemini-Subtitle-Pro. Use when working with IPC handlers, preload scripts, native integrations (ffmpeg, whisper, yt-dlp), file system operations, and desktop-specific features. Covers security requirements, IPC patterns, and cross-process communication.

Как установить скилл electron-dev?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл electron-dev запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить electron-dev с