desktop

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

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill desktop-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: desktop
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/desktop
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill desktop-smallai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building features for an Electron desktop app requires coordinating code across the main process, preload scripts, and renderer process, which is error-prone without a clear architectural guide. ## Core Features & Use Cases - IPC Feature Implementation: Step-by-step patterns for creating controllers with @IpcMethod decorators, defining typed IPC contracts, and wiring renderer services. - Local Tools Workflow: Guides building agent-callable local tools (e.g., file rename/move) from manifest definition through store actions to main-process controllers. - Window & Menu Management: Covers app menus, context menus, tray menus, window state persistence, multi-window coordination, and frameless windows. - Use Case: Add a desktop notification feature by creating a NotificationCtr controller, defining IPC types, exposing a renderer service, and calling it from a store action. ## Quick Start Use the desktop skill to add a new Electron IPC feature with a controller, typed IPC contract, and renderer service.

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 feature to an Electron app?

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

How to build local file tools for an Electron desktop agent?

Define a tool manifest with API names and JSON parameters, add IPC types, implement a store action handling loading and error states, create a renderer service, and write a main-process controller using fs operations. Finally document the tool in the agent's system role.

How do I persist window size and position in Electron?

Save the window's position and size on the close event when it is neither minimized nor maximized, storing bounds in a settings store. On startup, restore those bounds with setBounds before showing the window.

What webPreferences should an Electron BrowserWindow use for security?

Enable contextIsolation, disable nodeIntegration, and load a preload script to expose only validated APIs to the renderer. Validate all IPC inputs in main-process controllers and limit the surface of exposed methods.

How do I create tray and context menus in Electron?

Build menu templates with Menu.buildFromTemplate using roles like copy and paste for native behavior, then attach them via tray.setContextMenu or menu.popup for right-click menus. Use CmdOrCtrl accelerators and handle platform differences with process.platform checks.