Skip to content

a5c-ai/babysitter / library/specializations/desktop-development/skills/electron-native-addon-builder

electron-native-addon-builder

Verified

Build and bundle native Node.js addons for Electron with proper ABI compatibility, cross-compilation support, and rebuild automation

FileKindSize
README.mdmarkdown1.6 KB
SKILL.mdskill md6.9 KB
# electron-native-addon-builder

Build and bundle native Node.js addons for Electron with proper ABI compatibility.

## Overview

This skill manages the complexity of native module compilation for Electron applications. It handles electron-rebuild configuration, cross-platform compilation, and N-API module setup.

## Quick Start

```javascript
const result = await invokeSkill('electron-native-addon-builder', {
  projectPath: '/path/to/electron-app',
  nativeModules: [
    { name: 'better-sqlite3', version: '^9.0.0', source: 'npm' },
    { name: 'sharp', version: '^0.33.0', source: 'npm' }
  ],
  electronVersion: '28.0.0',
  targetPlatforms: ['win32', 'darwin', 'linux'],
  targetArchitectures: ['x64', 'arm64'],
  useNAPI: true
});
```

## Features

### Build Methods

| Method | Use Case |
|--------|----------|
| electron-rebuild | Standard rebuilding for Electron |
| node-gyp | Direct compilation control |
| prebuild | Binary distribution |
| N-API | Version-independent modules |

### Platform Support

- Windows (x64, ia32)
- macOS (x64, arm64)
- Linux (x64, arm64)

## Generated Configuration

```json
{
  "scripts": {
    "postinstall": "electron-rebuild",
    "rebuild": "electron-rebuild -f"
  },
  "devDependencies": {
    "@electron/rebuild": "^3.6.0"
  }
}
```

## Common Issues

| Issue | Solution |
|-------|----------|
| ABI mismatch | Rebuild with correct Electron version |
| Missing build tools | Install platform-specific tools |
| Python errors | Set python path in npm config |

## Related Skills

- `electron-builder-config`
- `cross-platform-test-matrix`

## Related Agents

- `electron-architect`
- `desktop-ci-architect`
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall