Claude-skill-registry desktop
Electron desktop development guide. Use when implementing desktop features, IPC handlers, controllers, preload scripts, window management, menu configuration, or Electron-specific functionality. Triggers on desktop app development, Electron IPC, or desktop local tools implementation.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/desktop" ~/.claude/skills/majiayu000-claude-skill-registry-desktop-4f87ae && rm -rf "$T"
manifest:
skills/data/desktop/SKILL.mdsource content
Desktop Development Guide
Architecture Overview
LobeChat desktop is built on Electron with main-renderer architecture:
- Main Process (
): App lifecycle, system APIs, window managementapps/desktop/src/main - Renderer Process: Reuses web code from
src/ - Preload Scripts (
): Securely expose main process to rendererapps/desktop/src/preload
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