agentleFS
ww-w-aiww-w-ai/bkit-codex/.agents/skills/desktop-app/SKILL.md

desktop-app

Skill70 starsChanged 9 months agoApache-2.0View on GitHub

Desktop application development guide for Electron, Tauri, and native apps. Covers cross-platform desktop development for macOS, Windows, and Linux. Triggers: desktop app, Electron, Tauri, mac app, windows app, native app, 데스크톱 앱, 일렉트론, 타우리, デスクトップアプリ, Electron, 桌面应用, 桌面程序, aplicacion de escritorio, application bureau, Desktop-App Do NOT use for: mobile apps (use $mobile-app), web apps (use $dynamic or $starter).

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Desktop App Skill

Cross-platform desktop development with Electron or Tauri.

Actions

ActionDescriptionExample
initInitialize desktop project$desktop-app init my-app
guideDesktop dev guide$desktop-app guide
buildBuild configuration help$desktop-app build

Framework Comparison

FeatureElectronTauri
LanguageJS/TS (Node.js)Rust + JS/TS
Bundle Size~100MB+~5-10MB
Memory UsageHighLow
Native APIsVia Node.jsVia Rust
Web TechChromiumSystem WebView
MaturityVery matureGrowing rapidly
Best ForFeature-rich appsLightweight apps

Recommended: Tauri

For bkit-codex users, Tauri is recommended because:

  • Smaller bundle size
  • Lower memory footprint
  • Better security model
  • Uses system WebView (no Chromium bundled)
  • Rust backend for performance-critical tasks

Project Structure (Tauri)

desktop-app/
├── src/                       # Frontend (React/Next.js)
│   ├── app/
│   ├── components/
│   ├── hooks/
│   └── lib/
├── src-tauri/                 # Tauri backend (Rust)
│   ├── src/
│   │   ├── main.rs           # Entry point
│   │   ├── commands.rs       # IPC commands
│   │   └── lib.rs
│   ├── Cargo.toml            # Rust dependencies
│   ├── tauri.conf.json       # Tauri configuration
│   └── icons/                # App icons
├── public/
├── package.json
└── tsconfig.json

Core Patterns

Tauri Commands (IPC)

// src-tauri/src/commands.rs
#[tauri::command]
fn read_file(path: String) -> Result<String, String> {
    std::fs::read_to_string(&path).map_err(|e| e.to_string())
}

#[tauri::command]
fn save_file(path: String, content: String) -> Result<(), String> {
    std::fs::write(&path, content).map_err(|e| e.to_string())
}
// Frontend: invoke Tauri commands
import { invoke } from '@tauri-apps/api/core';

async function readFile(path: string): Promise<string> {
  return invoke('read_file', { path });
}

async function saveFile(path: string, content: string): Promise<void> {
  return invoke('save_file', { path, content });
}

Window Management

import { getCurrentWindow } from '@tauri-apps/api/window';

const appWindow = getCurrentWindow();
await appWindow.minimize();
await appWindow.maximize();
await appWindow.setTitle('My App - Document.txt');

System Tray

// src-tauri/src/main.rs
use tauri::{SystemTray, SystemTrayMenu, CustomMenuItem};

fn main() {
    let tray_menu = SystemTrayMenu::new()
        .add_item(CustomMenuItem::new("show", "Show"))
        .add_item(CustomMenuItem::new("quit", "Quit"));

    tauri::Builder::default()
        .system_tray(SystemTray::new().with_menu(tray_menu))
        .run(tauri::generate_context!())
        .expect("error running app");
}

File Dialog

import { open, save } from '@tauri-apps/plugin-dialog';

// Open file
const filePath = await open({
  filters: [{ name: 'Documents', extensions: ['txt', 'md', 'json'] }],
});

// Save file
const savePath = await save({
  filters: [{ name: 'Documents', extensions: ['txt'] }],
});

Electron Alternative

// main.ts (Electron)
import { app, BrowserWindow } from 'electron';

function createWindow() {
  const win = new BrowserWindow({
    width: 1200,
    height: 800,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
      contextIsolation: true,
    },
  });
  win.loadURL('http://localhost:3000');
}

app.whenReady().then(createWindow);

Build & Distribution

Tauri

# Development
npm run tauri dev

# Build
npm run tauri build

# Output: src-tauri/target/release/bundle/
# - macOS: .dmg, .app
# - Windows: .msi, .exe
# - Linux: .deb, .AppImage

Code Signing

  • macOS: Apple Developer ID certificate
  • Windows: Code signing certificate (EV recommended)
  • Linux: GPG signing

Pipeline Integration

Desktop apps follow the 9-phase pipeline with desktop-specific considerations:

  • Phase 3: Design for native OS look and feel
  • Phase 5: Include OS-specific components (menu bar, tray, dialogs)
  • Phase 6: Implement IPC between frontend and backend
  • Phase 9: Code signing, auto-update, store submission

Common Mistakes

MistakeSolution
Ignoring OS differencesTest on all target platforms
Large Electron bundlesConsider Tauri for smaller apps
No auto-updaterImplement from the start
Missing code signingUsers get security warnings without it
No offline supportDesktop apps should work offline

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.