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.