Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Electron App

ASecurity

Build Electron desktop applications with IPC, window management, and packaging. Use when working on TitanMirror desktop app or any cross-platform desktop applications.

33 stars
0 votes
0 copies
0 views
Added 2/10/2026
developmentjavascriptjavabashnodeapi

Works with

cliapi

Security Analysis

A100/100

Scanned 2/12/2026

$npx -y skills add lovedragonball/power-ranger-toolkit --skill electron-app --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Electron App?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Electron App
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lovedragonball-electron-app/badge)](https://www.skillsdirectory.com/skills/lovedragonball-electron-app)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
skill.md
---
name: electron-app
description: Build Electron desktop applications with IPC, window management, and packaging. Use when working on TitanMirror desktop app or any cross-platform desktop applications.
---

# šŸ–„ļø Electron App Skill

## Project Structure

```
šŸ“ electron-app/
   šŸ“ main/
      šŸ“„ main.js         ← Main process
      šŸ“„ preload.js      ← Bridge script
   šŸ“ renderer/
      šŸ“„ index.html
      šŸ“„ renderer.js     ← Renderer process
      šŸ“„ styles.css
   šŸ“„ package.json
```

---

## Main Process

```javascript
const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');

let mainWindow;

function createWindow() {
  mainWindow = new BrowserWindow({
    width: 1200,
    height: 800,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
      contextIsolation: true,
      nodeIntegration: false
    }
  });

  mainWindow.loadFile('renderer/index.html');
}

app.whenReady().then(createWindow);

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit();
});
```

---

## IPC Communication

### Preload (Bridge)
```javascript
const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('electronAPI', {
  // Renderer → Main
  sendCommand: (cmd) => ipcRenderer.send('command', cmd),
  
  // Main → Renderer
  onFrame: (callback) => ipcRenderer.on('frame', (_, data) => callback(data)),
  
  // Two-way
  getDeviceInfo: () => ipcRenderer.invoke('get-device-info')
});
```

### Main Process Handlers
```javascript
// One-way
ipcMain.on('command', (event, cmd) => {
  socket.emit('command', cmd);
});

// Two-way (async)
ipcMain.handle('get-device-info', async () => {
  return await fetchDeviceInfo();
});

// Send to renderer
mainWindow.webContents.send('frame', frameData);
```

### Renderer Usage
```javascript
// Send command
window.electronAPI.sendCommand({ type: 'click', x: 100, y: 200 });

// Receive frame
window.electronAPI.onFrame((data) => {
  renderFrame(data);
});

// Get data
const info = await window.electronAPI.getDeviceInfo();
```

---

## Window Controls

```javascript
// Fullscreen
mainWindow.setFullScreen(true);

// Always on top
mainWindow.setAlwaysOnTop(true);

// Resize
mainWindow.setSize(800, 600);

// Get bounds
const { width, height } = mainWindow.getBounds();
```

---

## Packaging

### package.json
```json
{
  "name": "titan-mirror",
  "main": "main/main.js",
  "scripts": {
    "start": "electron .",
    "build": "electron-builder"
  },
  "build": {
    "appId": "com.example.titanmirror",
    "win": {
      "target": "nsis"
    },
    "mac": {
      "target": "dmg"
    }
  }
}
```

### Build Commands
```bash
# Development
npm start

# Production build
npm run build
```

---

## TitanMirror Integration

```javascript
// Socket.IO in main process
const io = require('socket.io')(server);

io.on('connection', (socket) => {
  socket.on('frame', (data) => {
    // Forward to renderer
    mainWindow.webContents.send('frame', data);
  });
});

// Renderer receives
window.electronAPI.onFrame((frameData) => {
  const img = new Image();
  img.onload = () => ctx.drawImage(img, 0, 0);
  img.src = 'data:image/jpeg;base64,' + frameData;
});
```

Attribution

lovedragonballlovedragonball
View sourceSee grades on GitHubMore from lovedragonball →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →