desktop

Implements Electron desktop features with IPC controllers, preload scripts, and window management.

74|11|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill desktop-opensourceagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: desktop
Source: https://github.com/OpenSourceAGI/qwksearch-research-agent/tree/main/apps/qwk-in-lobe/.agents/skills/desktop
Command: npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill desktop-opensourceagi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding features to an Electron desktop app requires coordinating code across the main process, preload scripts, IPC type definitions, renderer services, and store actions, which is error-prone without a clear architectural guide. ## Core Features & Use Cases - IPC Controller Patterns: Step-by-step guidance for creating controllers with the ControllerModule base class and IpcMethod decorators, plus registry integration. - Local Tools Workflow: End-to-end instructions for building agent-callable local tools, from manifest definition through controller implementation. - Window and Menu Management: Reference guides for window state persistence, multi-window coordination, app menus, context menus, and tray menus with i18n support. - Use Case: When adding a desktop notification feature, follow the guide to create the controller, define IPC types, build the renderer service, and wire up the store action in the correct order. ## Quick Start Use the desktop skill to add a new IPC controller for a desktop feature in the Electron app.

Frequently Asked Questions about desktop

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

FAQPage Schema
How do I add a new IPC handler in an Electron app?

Create a controller class extending ControllerModule with a static groupName, decorate methods with @IpcMethod(), and register it in the controllers registry. Then define matching TypeScript types in the electron-client-ipc package and expose a renderer service via ensureElectronIpc.

How to communicate between Electron main and renderer processes?

Use preload scripts with contextIsolation enabled to securely expose main process APIs to the renderer. The renderer calls typed service methods that route through IPC to controllers in the main process, which return structured success or error results.

How do I persist window size and position in Electron?

Save the window bounds on the close event when the window is neither minimized nor maximized, then restore them with setBounds on creation. Store the state in a settings module and apply it when constructing the BrowserWindow.

Does Electron menu configuration support multiple languages?

Yes, menu labels can use an i18n module so app menus, context menus, and tray menus render translated strings. Use i18n.t() calls for each label and handle platform differences such as the macOS app menu with process.platform checks.

Why should nodeIntegration be disabled in Electron BrowserWindow?

Disabling nodeIntegration and enabling contextIsolation prevents renderer code from directly accessing Node.js APIs, reducing the attack surface. Expose only the specific APIs the renderer needs through preload scripts instead.