desktop

Electron desktop development guide for LobeHub's main-renderer architecture. Covers controller creation, IPC type definitions, renderer services, and store actions for adding new desktop features Includes security best practices: input validation, limited API exposure, and preload script patterns for safe main-renderer communication Provides structured references for feature implementation, local tools workflow, menu configuration, and window management Emphasizes async methods, batch data transfers, and user feedback for performance and UX

INSTALLATION
npx skills add https://github.com/lobehub/lobehub --skill desktop
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$2b

export default class NewFeatureCtr extends ControllerModule {

static override readonly groupName = 'newFeature';

@IpcMethod()

async doSomething(params: SomeParams): Promise {

// Implementation

return { success: true };

}

}

Register in `apps/desktop/src/main/controllers/registry.ts`.

### 2. Define IPC Types

Location: `packages/electron-client-ipc/src/types.ts`

export interface SomeParams {

/ ... /

}

export interface SomeResult {

success: boolean;

error?: string;

}


### 3. Create Renderer Service

Location: `src/services/electron/`

import { ensureElectronIpc } from '@/utils/electron/ipc';

const ipc = ensureElectronIpc();

export const newFeatureService = async (params: SomeParams) => {

return ipc.newFeature.doSomething(params);

};

BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card