electron

Packages an ignifx game as an Electron desktop app with WebGPU, preload bridge, and file storage.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/astrum-forge/ignifx --skill electron-astrum-forge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: electron
Source: https://github.com/astrum-forge/ignifx/tree/main/packages/electron/skills/electron
Command: npx skills add https://github.com/astrum-forge/ignifx --skill electron-astrum-forge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @ignifx/electron, @ignifx/core, electron.

What problem does it solve? Turning a browser-based ignifx game into a desktop application normally requires wiring up Electron's main, preload, and renderer processes, enabling WebGPU flags, securing the window, and bridging storage — all with subtle ordering traps that fail silently. This Skill provides the complete @ignifx/electron workflow so one renderer bundle serves both browser and desktop builds. ## Core Features & Use Cases - Main-process window factory: createGameWindow, applyWebGpuSwitches, registerIgnifxScheme, and serveIgnifxProtocol set up a hardened WebGPU-capable window over the ignifx:// protocol. - Sandboxed preload bridge: exposeIgnifxHost() exposes window.ignifxHost as the entire renderer interface, with context isolation and strict CSP enforced by default. - Renderer extension: the electron() extension provides app.desktop (fullscreen, window events, dialogs, paths, quit) and a file-system StorageBackend for app.storage. - Use Case: Scaffold a game with npx @ignifx/cli my-game --template 3d-third-person --desktop, then run pnpm dev:desktop to get a hot-reloading desktop build, and pnpm dist:desktop for an unsigned packaged app. ## Quick Start Use the electron skill to package my ignifx game as a desktop app and set up the main, preload, and renderer entry points.

Frequently Asked Questions about electron

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package an ignifx game as an Electron desktop app?

Scaffold with npx @ignifx/cli my-game --template 3d-third-person --desktop, then run pnpm install and pnpm dev:desktop. The scaffolder writes the main, preload, and renderer entry points; pnpm dist:desktop produces an unsigned packaged app via electron-builder.

How do I enable WebGPU in an Electron window?

Call applyWebGpuSwitches() and registerIgnifxScheme() at the top of your main process file, before app.whenReady(). Calling them after whenReady is inert, and the symptom is navigator.gpu being undefined with no error.

Why is window.ignifxHost undefined in my Electron preload script?

The preload script must be built as CommonJS with the file name index.cjs. Under sandbox: true, an ES module preload silently fails, leaving window.ignifxHost undefined with no error anywhere.

Can I load the packaged renderer over file:// in Electron?

No. file:// gives an opaque origin with no secure context, so WebGPU is unavailable and relative fetch fails. Use serveIgnifxProtocol(dir) with entry: "index.html" to serve the build over the ignifx:// scheme instead.

Does the renderer process have access to Node or the electron module?

No. The renderer is sandboxed and context-isolated with nodeIntegration off; window.ignifxHost is the entire interface. Import @ignifx/electron in the renderer, and keep /main and /preload imports in their own processes.

Why does my game not pause when the Electron window is minimized?

An Electron renderer receives no DOM lifecycle events — no visibilitychange, focus/blur, or document.hidden changes. Subscribe to app.desktop.onWindowEvent for minimize and restore, or use onApplicationFocus which the electron() extension forwards.