electron-api-and-ipc

Enforce structured Electron IPC channel families and DTO-based API boundaries.

6.9k|262|Updated Mar 29, 2022
One-click install
npx skills add https://github.com/massCodeIO/massCode --skill electron-api-and-ipc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: electron-api-and-ipc
Source: https://github.com/massCodeIO/massCode/tree/main/.agents/skills/electron-api-and-ipc
Command: npx skills add https://github.com/massCodeIO/massCode --skill electron-api-and-ipc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Renderer processes in massCode require safe, clearly defined access to data and system operations, but shortcuts can bypass boundaries and expose sensitive internals.

Core Features & Use Cases

  • Renderer access rules and IPC channel conventions to prevent direct access to backend modules.
  • Clear DTO/Route governance: new endpoints require DTO in src/main/api/dto and route in src/main/api/routes.
  • Use of pnpm api:generate to keep the client synchronized with server changes.

Quick Start

Follow the guidelines to add a new endpoint by creating its DTO in src/main/api/dto/, a route in src/main/api/routes/, and running pnpm api:generate to synchronize the client.

Frequently Asked Questions about electron-api-and-ipc

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

FAQPage Schema
How do I structure Electron IPC channels for secure renderer-to-main communication?

Secure Electron IPC requires using defined channel families like fs:*, system:*, and db:* to enforce boundaries. This prevents the renderer process from directly accessing sensitive backend modules and system operations.

How do I add a new API endpoint with DTOs and routes in Electron?

To add an endpoint, create a DTO in src/main/api/dto/ and a corresponding route in src/main/api/routes/. This governance ensures structured API access and consistent routing across the application.

How does pnpm api:generate keep the Electron client synchronized with the main process API?

Running pnpm api:generate synchronizes the client with server changes after you update DTOs and routes. It automatically updates client-side bindings to match the defined IPC channel families.

Why do my Electron renderer processes bypass API boundaries and access backend modules directly?

Bypassing API boundaries happens when shortcuts skip structured IPC routing. Enforcing DTO usage in src/main/api/dto and routes in src/main/api/routes prevents this exposure and maintains secure communication.

What IPC channel families should I use for filesystem and system operations in Electron?

Use defined IPC channel families such as fs:*, system:*, db:*, main-menu:*, prettier:*, spaces:*, and theme:* for filesystem and system operations. This categorization enforces secure, structured renderer-to-main communication.