AGENT SKILL

electron-builder-config

Generate and validate electron-builder configuration for multi-platform desktop builds with code signing, auto-update, and platform-specific packaging

License 许可
MIT
所属仓库
EthanYoQ/Skill-hub
最近更新
2026-11-07
Stars
★ 11
Forks
5

01 前言 Front Matter

name
electron-builder-config
tags
[ "electron", "desktop", "build", "packaging", "cross-platform" ]
graph
{ "roles": [ "role:desktop-developer", "role:fullstack-engineer" ], "domains": [ "domain:software-engineering" ], "workflows": [ "workflow:feature-development", "workflow:release-management" ], "skillAreas": [ "skill-area:desktop-ui-frameworks", "skill-area:cross-platform-desktop" ], "specializations": [ "specialization:desktop-development" ] }
description
Generate and validate electron-builder configuration for multi-platform desktop builds with code signing, auto-update, and platform-specific packaging
allowed-tools
Read, Write, Edit, Bash, Glob, Grep

02 资源文件 1

03 SKILL.md 正文

electron-builder-config

Generate and validate electron-builder configuration for multi-platform desktop builds. This skill handles the complete configuration for building Electron applications across Windows, macOS, and Linux with proper code signing, auto-update channels, and platform-specific installers.

Capabilities

  • Generate complete electron-builder.yml or electron-builder.json5 configuration
  • Configure platform-specific build targets (NSIS, DMG, AppImage, DEB, RPM, Snap, Flatpak)
  • Set up code signing for Windows (Authenticode) and macOS (Developer ID)
  • Configure auto-update settings with electron-updater
  • Optimize build artifacts with compression and deduplication
  • Validate existing configurations for common issues
  • Generate CI/CD build scripts for GitHub Actions, Azure DevOps, CircleCI

Input Schema

{
  "type": "object",
  "properties": {
    "projectPath": {
      "type": "string",
      "description": "Path to the Electron project root"
    },
    "appInfo": {
      "type": "object",
      "properties": {
        "appId": { "type": "string", "description": "Application bundle ID (com.company.app)" },
        "productName": { "type": "string" },
        "copyright": { "type": "string" }
      },
      "required": ["appId", "productName"]
    },
    "platforms": {
      "type": "array",
      "items": { "enum": ["windows", "macos", "linux"] },
      "description": "Target platforms to build for"
    },
    "targets": {
      "type": "object",
      "properties": {
        "windows": { "type": "array", "items": { "enum": ["nsis", "nsis-web", "portable", "appx", "msi", "squirrel"] } },
        "macos": { "type": "array", "items": { "enum": ["dmg", "pkg", "mas", "mas-dev", "zip"] } },
        "linux": { "type": "array", "items": { "enum": ["AppImage", "deb", "rpm", "snap", "flatpak", "tar.gz"] } }
      }
    },
    "codeSigning": {
      "type": "object",
      "properties": {
        "windows": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "certificateSubjectName": { "type": "string" },
            "timestampServer": { "type": "string" }
          }
        },
        "macos": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "identity": { "type": "string" },
            "hardenedRuntime": { "type": "boolean", "default": true },
            "notarize": { "type": "boolean" }
          }
        }
      }
    },
    "autoUpdate": {
      "type": "object",
      "properties": {
        "enabled": { "type": "boolean" },
        "provider": { "enum": ["github", "s3", "generic", "spaces", "keygen"] },
        "channel": { "enum": ["latest", "beta", "alpha"] }
      }
    },
    "generateCIScripts": {
      "type": "boolean",
      "description": "Generate CI/CD build scripts"
    }
  },
  "required": ["projectPath", "appInfo", "platforms"]
}

Output Schema

{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "configPath": { "type": "string", "description": "Path to generated config file" },
    "config": { "type": "object", "description": "Generated electron-builder configuration" },
    "ciScripts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": { "type": "string" },
          "description": { "type": "string" }
        }
      }
    },
    "warnings": { "type": "array", "items": { "type": "string" } },
    "recommendations": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["success"]
}

Usage Instructions

  1. Analyze project structure: Examine package.json, existing build configs, and project layout
  2. Determine build requirements: Based on target platforms and distribution needs
  3. Generate configuration: Create electron-builder.yml with all necessary settings
  4. Validate configuration: Check for common issues and missing dependencies
  5. Generate CI scripts: If requested, create GitHub Actions or other CI workflows

Configuration Templates

Basic Multi-Platform Build

appId: com.example.myapp
productName: MyApp
directories:
  buildResources: build
  output: dist
files:
  - "**/*"
  - "!**/*.{md,txt}"
  - "!**/node_modules/*/{CHANGELOG.md,README.md,readme.md}"
win:
  target:
    - target: nsis
      arch: [x64, ia32]
  icon: build/icon.ico
mac:
  target:
    - target: dmg
      arch: [x64, arm64]
  icon: build/icon.icns
  hardenedRuntime: true
  gatekeeperAssess: false
linux:
  target:
    - target: AppImage
      arch: [x64]
    - target: deb
      arch: [x64]
  icon: build/icons
  category: Utility

With Code Signing and Notarization

win:
  sign: ./scripts/sign.js
  signingHashAlgorithms: [sha256]
  signDlls: true
mac:
  identity: "Developer ID Application: Company Name (TEAMID)"
  hardenedRuntime: true
  entitlements: build/entitlements.mac.plist
  entitlementsInherit: build/entitlements.mac.plist
afterSign: scripts/notarize.js

With Auto-Update

publish:
  provider: github
  owner: your-org
  repo: your-repo
  releaseType: release
nsis:
  oneClick: false
  perMachine: true
  allowToChangeInstallationDirectory: true
  differentialPackage: true

Best Practices

  1. Always use hardenedRuntime: true for macOS to pass notarization
  2. Enable signingHashAlgorithms: [sha256] for modern Windows compatibility
  3. Use differentialPackage: true for efficient auto-updates
  4. Configure files patterns to exclude unnecessary files and reduce bundle size
  5. Set up separate channels (latest, beta, alpha) for staged rollouts
  6. Store signing credentials in CI secrets, never in config files

Community References

Related Skills

  • electron-main-preload-generator - Generate secure main process and preload scripts
  • electron-auto-updater-setup - Configure electron-updater with advanced features
  • windows-authenticode-signer - Windows code signing with signtool
  • macos-codesign-workflow - macOS code signing and notarization

Related Agents

  • electron-architect - Expert in Electron architecture and best practices
  • desktop-ci-architect - CI/CD pipeline design for desktop builds

04 同仓库更多 Skills

EthanYoQ
EthanYoQ/Skill-hub

xhs-pharma-social-listening

Run evidence-disciplined Xiaohongshu social listening for foreign pharma employee pain points. Use when the user asks to collect and analyze notes/comments about pharma companies, aliases, roles, compliance, medical affairs, or AI topics, then produce a cited and scored sampled-insight report. Includes independent-evidence counting, MediaCrawler batch collection, and CAPTCHA/461 fallback to Agent Reach/OpenCLI.

Skill与智能体开发
★ 11
EthanYoQ
EthanYoQ/Skill-hub

healthcare-phi-compliance

Protected Health Information (PHI) and Personally Identifiable Information (PII) compliance patterns for healthcare applications. Covers data classification, access control, audit trails, encryption, and common leak vectors. Use when code touches PHI or PII in a healthcare system, or when auditing access control, audit trails, or leak vectors.

律师与法务Skill与智能体开发
★ 11
EthanYoQ
EthanYoQ/Skill-hub

healthcare-eval-harness

Patient safety evaluation harness for healthcare application deployments. Automated test suites for CDSS accuracy, PHI exposure, clinical workflow integrity, and integration compliance. Blocks deployments on safety failures. Use when a healthcare deployment must be gated on patient-safety tests for CDSS accuracy, PHI exposure, and workflow integrity.

Skill与智能体开发
★ 11
EthanYoQ
EthanYoQ/Skill-hub

healthcare-emr-patterns

EMR/EHR development patterns for healthcare applications. Clinical safety, encounter workflows, prescription generation, clinical decision support integration, and accessibility-first UI for medical data entry. Use when building EMR or EHR features such as encounter workflows, prescription generation, or clinical data entry UI.

Skill与智能体开发
★ 11
EthanYoQ
EthanYoQ/Skill-hub

healthcare-cdss-patterns

Clinical Decision Support System (CDSS) development patterns. Drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), alert severity classification, and integration into EMR workflows. Use when building clinical decision support — drug interaction checks, dose validation, clinical scoring, or alert severity.

Skill与智能体开发
★ 11
EthanYoQ
EthanYoQ/Skill-hub

dxy-task-clarify

用户的请求含糊、缺背景、缺资料说明、缺读者或用途时使用。先用少量带选项的追问把任务问清楚,写成任务卡,用户确认后再执行。尤其适用于医生、科研人员和药企各岗位的工作,例如「帮我分析一下这些数据」「帮我准备明天的拜访」「写个总结」「做个 PPT」「回一下这封邮件」「整理一下会议纪要」「整理一下这些文献」「帮我准备下周的讲课」「写个病例汇报」「帮我写个提示词」。用户说「先问我」「帮我理清需求」「我不知道怎么描述」「我不会问 AI」时也使用。用途、资料、读者都已说清的请求,纯翻译,以及写代码、改代码,不使用。

Skill与智能体开发
★ 11