Approved catalog listing
SKILL #1494
skillshunter.net
Home / Software & Development / Implement Desktop Features with Electron
Listing Approved Approved on: November 22, 2026

Implement Desktop Features with Electron

Add new features to an Electron desktop application by creating controllers, defining IPC types, and implementing renderer services. The process includes logging, testing, and referencing detailed guides for specific tasks.

Rate this skill

No ratings yet

Editor's Note

Ensure the Electron environment is set up with TypeScript support. Create a controller in `apps/desktop/src/main/controllers/`, define IPC types in `packages/electron-client-ipc/src/types/`, and implement a renderer service in `src/services/electron/`. The first deliverable is a registered controller with an IPC method.

When to Use It

  • Adding a new feature to the Electron desktop application
  • Creating an IPC handler for communication between main and renderer processes
  • Implementing a renderer service for Electron desktop functionality

SKILL.md

SkillsHunter provides this listing for informational purposes only. Review the skill’s source, license, and required permissions before use. You are responsible for deciding whether to install or run it. Terms of Use

↓ Download .md
---
name: desktop
description: Electron desktop development guide — IPC handlers, controllers, preload scripts, window/menu management.
disable-model-invocation: true
---

# Desktop Development Guide

## Architecture Overview

LobeHub desktop is built on Electron with main-renderer architecture:

1. **Main Process** (`apps/desktop/src/main`): App lifecycle, system APIs, window management
2. **Renderer Process**: Reuses web code from `src/`
3. **Preload Scripts** (`apps/desktop/src/preload`): Securely expose main process to renderer

Both processes log to `<userData>/logs/{main,renderer}.jsonl` in dev and packaged
builds (`apps/desktop/src/main/utils/structuredLog/`); read them with
`pnpm --dir apps/desktop logs list|query|follow` (filters: `--level`, `--since`,
`--operation op_…`, `--topic tpc_…`) instead of `tail`ing files.

## Adding New Desktop Features

### 1. Create Controller

Location: `apps/desktop/src/main/controllers/`

```typescript
import { ControllerModule, IpcMethod } from '@/controllers';

export default class NewFeatureCtr extends ControllerModule {
  static override readonly groupName = 'newFeature';

  @IpcMethod()
  async doSomething(params: SomeParams): Promise<SomeResult> {
    // Implementation
    return { success: true };
  }
}
```

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

### 2. Define IPC Types

Location: `packages/electron-client-ipc/src/types/<domain>.ts`, re-exported from `types/index.ts`

```typescript
export interface SomeParams {
  /* ... */
}
export interface SomeResult {
  success: boolean;
  error?: string;
}
```

### 3. Create Renderer Service

Location: `src/services/electron/`

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

const ipc = ensureElectronIpc();

export const newFeatureService = async (params: SomeParams) => {
  return ipc.newFeature.doSomething(params);
};
```

### 4. Implement Store Action

Location: `src/store/`

### 5. Add Tests

Location: beside the controller, `apps/desktop/src/main/controllers/<Name>Ctr.test.ts` (`source-layout` §2)

## Detailed Guides

See `references/` for specific topics:

- **Feature implementation**: `references/feature-implementation.md`
- **Local tools workflow**: `references/local-tools.md`
- **Menu configuration**: `references/menu-config.md`
- **Window management**: `references/window-management.md`

Community Reviews & Field Notes

Tried this skill on your own project? Share the model you used and the results you got.

Add Your Review

Approved reviews appear publicly with the name or role you enter. See the Privacy Notice.