ipc-development

Add and modify Electron IPC channels with Zod validation and hooks.

11|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/BangDori/prowl --skill ipc-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ipc-development
Source: https://github.com/BangDori/prowl/tree/main/.agents/skills/ipc-development
Command: npx skills add https://github.com/BangDori/prowl --skill ipc-development

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized and safe procedure for adding or modifying Inter-Process Communication (IPC) channels, ensuring type safety and robust error handling.

Core Features & Use Cases

  • Centralized Schema: Defines all IPC channels in a single TypeScript file (ipc-schema.ts) for automatic type inference.
  • Standardized Workflow: Outlines the exact steps for adding new channels across ipc-schema.ts, main/ipc.ts, and preload/index.ts.
  • Return Type Rules: Enforces specific return types based on channel function (data query, mutation, fire-and-forget).
  • Error Handling: Leverages a wrapper for automatic try/catch, logging, and consistent error responses.
  • Serialization Guidelines: Addresses the need to serialize Date objects to ISO strings.
  • Naming Conventions: Provides a clear {domain}:{action} format for channel names.
  • Renderer Access Control: Mandates the use of hooks for accessing IPC from renderer processes, preventing direct window.electronAPI calls.
  • External Data Validation: Employs Zod safeParse for runtime validation of external data like plists.

Quick Start

Follow the IPC channel addition procedure by modifying src/shared/ipc-schema.ts, src/main/ipc.ts, and src/preload/index.ts.

Frequently Asked Questions about ipc-development

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

FAQPage Schema
How do I securely add IPC channels in an Electron application?

To securely add Electron IPC channels, define them in a centralized `ipc-schema.ts` file for type inference, implement handlers in `main/ipc.ts`, and expose them via `preload/index.ts`. This enforces type safety and standardized procedures.

How does Zod runtime validation work for Electron IPC external data?

Zod runtime validation for Electron IPC uses `safeParse` to validate external data like plists before processing. This ensures incoming data matches expected schemas, preventing type errors and enhancing application security.

What is the best way to handle IPC return types and errors in TypeScript?

The best way to handle IPC return types and errors is to enforce specific return types based on channel function and use a wrapper for automatic try/catch. This approach logs errors and provides consistent error responses.

Why do Date objects need serialization in Electron IPC channels?

Date objects need serialization in Electron IPC channels because the IPC protocol cannot clone raw Date objects. Serializing Date objects to ISO strings ensures data integrity and prevents transfer errors between processes.

How do I prevent direct window.electronAPI calls from the renderer process?

To prevent direct `window.electronAPI` calls from the renderer process, mandate the use of hook-based access. This enforces renderer access control, ensuring maintainability and strict type safety across your application.