Fantasia electron preload

From vishiri/fantasia-archive · View interactive version

Fantasia electron preload is an AI agent skill from the GitHub repository vishiri/fantasia-archive. Extends or fixes renderer-facing Electron APIs exposed through the preload script and contextBridge. Use when adding IPC-like surface area, typing window.faContentBridgeAPIs, editing src-electron/contentBridgeAPIs, or extending shared IPC channel names in electron-ipc-bridge.ts.

How to use this skill

Skill file

Fantasia Archive — preload and content bridge

Architecture

Main ↔ preload IPC (electron-ipc-bridge)

Adding a new API surface

  1. Contract in types/I_<Name>.ts
  2. Channels in electron-ipc-bridge.ts + register*Ipc.ts + startup
  3. Implement contentBridgeAPIs/<name>.ts
  4. Add to apiObject in electron-preload.ts
  5. Extend globals.d.ts
  6. Vitest: contentBridgeAPIs/_tests/, ipcManagement/_tests/ — dev scoped connected specs during edits; full yarn testbatch:verify enforces 95% on src-electron before commit

Security and boundaries

Related skills

Types

Shared types → types/. See types-folder.mdc.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.