본문으로 건너뛰기
cccskills
무료GitHub에 공개

desktop-electron-expert

Expert guide for Electron 33+ desktop application development — Electron Forge, context isolation, IPC security, native menus, auto-updates, and multi-window management / Panduan ahli pengembangan desktop Electron 33+.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Desktop Electron Application Expert (Electron 33+ Security Standard)

English | Bahasa Indonesia


<a name="english"></a>

English

Description

Production guide for engineering secure, high-performance cross-platform desktop applications using Electron 33+. Covers strictly isolated IPC communication via contextBridge, mandatory Context Isolation and Sandbox execution modes, native OS shell integrations (system tray, desktop notifications, global shortcuts), automated delta updates with electron-updater, multi-platform packaging via Electron Forge or electron-builder, and zero-trust renderer security policies (CSP, nodeIntegration: false).

Trigger Conditions

  • Developing desktop software for macOS, Windows, and Linux using React, Vue, or Next.js static exports.
  • Hardening Electron application security to prevent Remote Code Execution (RCE) via IPC or XSS vulnerabilities.
  • Configuring automatic background software updates and code-signing pipelines (Apple Notarization & Windows EV Authenticode).
  • Implementing multi-window managers and native operating system menus.

Core Security & Process Isolation Architecture

┌────────────────────────────────────────────────────────┐
│ 1. MAIN PROCESS (Node.js Environment)                  │
│    Direct OS access, window lifecycle, file system     │
└───────────────────────────┬────────────────────────────┘
                            │  ipcMain.handle()
                            ▼
┌────────────────────────────────────────────────────────┐
│ 2. PRELOAD SCRIPT (Secure Bridge)                      │
│    `contextBridge.exposeInMainWorld('electronAPI', ...)`│
└───────────────────────────┬────────────────────────────┘
                            │  window.electronAPI
                            ▼
┌────────────────────────────────────────────────────────┐
│ 3. RENDERER PROCESS (Chromium Sandbox)                 │
│    Pure UI: React 19 / Vite. Zero direct Node.js access │
└────────────────────────────────────────────────────────┘

Production Security Configuration (main.ts)

// src/main/index.ts
import { app, BrowserWindow, ipcMain } from 'electron';
import path from 'node:path';

let mainWindow: BrowserWindow | null = null;

function createSecureWindow() {
  mainWindow = new BrowserWindow({
    width: 1280,
    height: 800,
    webPreferences: {
      preload: path.join(__dirname, '../preload/index.js'),
      contextIsolation: true,       // MANDATORY: Isolates preload from page JS
      nodeIntegration: false,        // MANDATORY: Prohibits Node.js in renderer
      sandbox: true,                 // MANDATORY: Enables OS-level sandbox
      webSecurity: true,             // MANDATORY: Enforces Same-Origin Policy
      allowRunningInsecureContent: false,
    },
  });

  // Strict Content Security Policy (CSP) header enforcement
  mainWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
    callback({
      responseHeaders: {
        ...details.responseHeaders,
        'Content-Security-Policy': ["default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"],
      },
    });
  });

  if (process.env.NODE_ENV === 'development') {
    mainWindow.loadURL('http://localhost:5173');
  } else {
    mainWindow.loadFile(path.join(__dirname, '../renderer/index.html'));
  }
}

app.whenReady().then(() => {
  createSecureWindow();

  // Type-Safe IPC Handlers
  ipcMain.handle('app:get-version', () => app.getVersion());
  ipcMain.handle('system:notify', (_event, title: string, body: string) => {
    // Validate inputs strictly before triggering OS dialogs
    return { status: 'delivered', title };
  });
});

Type-Safe Preload Script (preload.ts)

// src/preload/index.ts
import { contextBridge, ipcRenderer } from 'electron';

export interface DesktopBridge {
  getAppVersion: () => Promise<string>;
  sendNotification: (title: string, body: string) => Promise<{ status: string }>;
}

const desktopAPI: DesktopBridge = {
  getAppVersion: () => ipcRenderer.invoke('app:get-version'),
  sendNotification: (title, body) => ipcRenderer.invoke('system:notify', title, body),
};

contextBridge.exposeInMainWorld('desktopAPI', desktopAPI);

Orchestration & Integration

  • tauri-expert: Provides architectural comparison (Electron's ecosystem matureness vs. Tauri's low memory footprint).
  • senior-frontend: Structures the React 19 UI running inside the sandboxed renderer window.
  • ci-cd-devops-architect: Configures GitHub Actions for macOS notarization and Windows code signing.
  • error-resilience-expert: Catches unhandled exceptions in the Main process and handles renderer crashes gracefully.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi bersama tauri-expert, senior-frontend, ci-cd-devops-architect, dan error-resilience-expert.

Deskripsi

Panduan produksi untuk membangun aplikasi desktop cross-platform yang aman dan efisien menggunakan Electron 33+. Mengutamakan keamanan IPC dengan Context Isolation, isolasi proses renderer berbasis sandbox, integrasi sistem operasi natif (system tray, menu bar, notifikasi desktop), pembaruan otomatis (auto-updates), dan packaging multi-OS (Windows .exe, macOS .dmg/.app, Linux .AppImage).

Kondisi Pemicu

  • Membangun aplikasi desktop menggunakan teknologi web (React, Vue, Vite, Tailwind CSS).
  • Memperketat keamanan Electron untuk mencegah kerentanan eksekusi kode jarak jauh (Remote Code Execution / RCE).
  • Menerapkan komunikasi antarmuka (Renderer) ke sistem file (Main) secara type-safe via contextBridge.
  • Menyiapkan alur pembaruan otomatis (auto-updater) tanpa mengganggu pengalaman pengguna.

Pola Konsumsi API di Komponen React Renderer

// src/renderer/components/SystemInfoCard.tsx
import { useEffect, useState } from 'react';

declare global {
  interface Window {
    desktopAPI: {
      getAppVersion: () => Promise<string>;
      sendNotification: (title: string, body: string) => Promise<{ status: string }>;
    };
  }
}

export function SystemInfoCard() {
  const [version, setVersion] = useState<string>('Memuat...');

  useEffect(() => {
    window.desktopAPI.getAppVersion().then(setVersion);
  }, []);

  const handleNotify = () => {
    window.desktopAPI.sendNotification('Vibes Desktop', 'Pembaruan aplikasi siap dipasang.');
  };

  return (
    <div className="rounded-xl border border-slate-200 bg-white p-6 shadow-sm">
      <h3 className="font-bold text-slate-800">Informasi Aplikasi Desktop</h3>
      <p className="mt-1 text-sm text-slate-600">Versi Terpasang: <span className="font-semibold">{version}</span></p>
      <button
        onClick={handleNotify}
        className="mt-4 rounded-lg bg-slate-900 px-4 py-2 text-sm font-medium text-white hover:bg-slate-800"
      >
        Kirim Notifikasi Sistem
      </button>
    </div>
  );
}

3 Hukum Keamanan Mutlak Electron

  1. Wajib Context Isolation: contextIsolation: true wajib aktif agar skrip halaman web tidak dapat mengakses atau memodifikasi objek internal Node.js di preload script.
  2. Matikan nodeIntegration di Renderer: nodeIntegration: false mutlak ditegakkan. Renderer dilarang mengimpor modul fs, child_process, atau crypto secara langsung.
  3. Sandbox Chromium Aktif: Selalu nyalakan sandbox: true untuk membatasi akses proses renderer ke tingkat kernel sistem operasi.

Integrasi Orkestrasi

  • tauri-expert: Menjadi acuan pembanding jika pengguna mempertimbangkan framework alternatif berbasis Rust.
  • senior-frontend: Menyediakan arsitektur komponen UI yang responsif di dalam window aplikasi.
  • ci-cd-devops-architect: Menangani penandatanganan sertifikat digital (code signing) pada pipeline rilis.
  • error-resilience-expert: Mencegah aplikasi tertutup tiba-tiba (crash) saat terjadi unhandled error di Main process.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

Expert guide for autonomous Machine-to-Machine (M2M) agent settlement, dual-rail fiat & stablecoin micro-clearing, dynamic budget envelopes, and cryptographic agent invoicing / Panduan ahli settlement otonom antar-agen (M2M), kliring mikro dual-rail fiat & stablecoin, pagu anggaran dinamis, dan penagihan agen kriptografis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

Expert guide for long-term episodic memory integration (Mem0 v2, Letta/MemGPT, Zep v2), memory tier architecture, pgvector HNSW storage, and unified context management for autonomous AI agents / Panduan ahli untuk integrasi memori episodik jangka panjang (Mem0 v2, Letta/MemGPT, Zep v2), arsitektur tier memori, penyimpanan pgvector HNSW, dan manajemen konteks terpadu untuk agen AI otonom.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug802026년 10월 19일 업데이트

roedyrustam의 스킬 모두 보기

이 스킬의 문제 신고