desktop-shell

Guides changes to Electron main, preload, IPC, and native desktop behavior.

9.5k|1.0k|Updated Sep 11, 2025
One-click install
npx skills add https://github.com/openchamber/openchamber --skill desktop-shell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: desktop-shell
Source: https://github.com/openchamber/openchamber/tree/main/.agents/skills/desktop-shell
Command: npx skills add https://github.com/openchamber/openchamber --skill desktop-shell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modifying Electron desktop code risks breaking the privilege boundary between renderer and main process, flashing console windows on Windows, or regressing startup, updater, and deep-link behavior across packaged builds. This Skill enforces the architectural rules and validation steps needed to change the OpenChamber desktop shell safely.

Core Features & Use Cases

  • Runtime Boundary Enforcement: Keeps renderer contracts in packages/ui, server behavior in packages/web, and Electron limited to native concerns like windows, menus, dialogs, notifications, updater, deep links, SSH, and tunnels.
  • IPC and Security Rules: Gates privileged commands in the main process, exposes the narrowest preload bridge payloads, and prevents leaking filesystem, shell, tokens, or host secrets to remote pages.
  • Windows Background Process Handling: Spawns hidden child processes with windowsHide, stdio ignore, and unref, avoiding cmd.exe shims that flash console windows.
  • Use Case: When adding a new native notification capability, use this Skill to place the bridge in preload, handle the operation in main.mjs, gate the privileged command, and validate both HMR development and bundled builds.

Quick Start

Use the desktop-shell skill to add a new native menu action with a preload bridge and privileged main-process handler in the Electron package.

Frequently Asked Questions about desktop-shell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new IPC capability to an Electron app securely?

Add a preload bridge shape only when the renderer-facing capability changes, handle the native operation in main.mjs, and gate privileged commands in the main process. Renderer checks are not security boundaries, so expose the narrowest payload possible.

How to spawn background processes on Windows without a console window flashing?

Spawn the target executable directly with windowsHide: true, use stdio: 'ignore' for detached helpers, and call unref() when they must outlive Electron. Avoid cmd.exe /c, batch shims, and pipelines that create console grandchildren.

Can renderer code in Electron import Electron modules directly?

No, shared UI code must never import Electron. Keep renderer contracts and domain logic in packages/ui and let Electron handle only inherently native behavior like windows, menus, dialogs, and privileged IPC.

Why does my Electron child process still show a console window?

windowsHide reliably controls only the directly spawned process, so wrappers like cmd.exe /c or batch files create visible grandchildren. Spawn the executable directly or use a single hidden powershell.exe helper with -WindowStyle Hidden for delayed work.

What validation is required after changing Electron startup or packaging code?

Completion requires both HMR development and bundled UI validation for startup, preload, routing, or packaging changes. For Windows process work, inspect the complete process tree to confirm no console flash, since command success alone is insufficient.