D

desktop

by @lobehubv
4.4(80)

提供桌面应用开发指南,基于Electron的主渲染器架构,涵盖应用生命周期、系统API和窗口管理,助力桌面应用开发。

desktop-applicationselectron.jscross-platform-developmentbackend-serviceslobehubGitHub
安装方式
npx skills add https://github.com/lobehub/lobehub --skill desktop
compare_arrows

Before / After 效果对比

1 组
使用前

独立开发Electron桌面应用时,开发者需自行摸索应用生命周期、系统API调用和窗口管理等复杂细节,容易遇到兼容性问题和性能瓶颈,开发效率较低。

使用后

桌面应用开发指南提供了基于Electron主渲染器架构的全面指导。它系统性地涵盖了应用生命周期、系统API和窗口管理,帮助开发者快速构建稳定高效的桌面应用。

SKILL.md

desktop

Desktop Development Guide

Architecture Overview

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

  • Main Process (apps/desktop/src/main): App lifecycle, system APIs, window management

  • Renderer Process: Reuses web code from src/

  • Preload Scripts (apps/desktop/src/preload): Securely expose main process to renderer

Adding New Desktop Features

1. Create Controller

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

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.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);
};

4. Implement Store Action

Location: src/store/

5. Add Tests

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

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

Best Practices

  • Security: Validate inputs, limit exposed APIs

  • Performance: Use async methods, batch data transfers

  • UX: Add progress indicators, provide error feedback

  • Code organization: Follow existing patterns, add documentation

Weekly Installs345Repositorylobehub/lobehubGitHub Stars73.9KFirst SeenJan 27, 2026Security AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled oncodex305opencode302gemini-cli301github-copilot283cursor255claude-code250

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量4.2K
评分4.4 / 5.0
版本
更新日期2026年9月29日
对比案例1 组

用户评分

4.4(80)
5
78%
4
23%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

时间线

创建2026年3月17日
最后更新2026年9月29日
🎁 Agent 知识卡片
调研问卷