erpc-communication

erpc-communication is a skill for Claude Code, Codex from MatrixAges/polywise. It costs 41 tokens per session (560 once invoked), scanned A, original, MIT.

Guides using eRPC (electron-tRPC) for inter-process communication (IPC) between Electron main and renderer processes. Triggered when handling Electron IPC or tRPC-based systems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/matrixages/polywise/erpc
Any agent
npx skills add MatrixAges/polywise --skill erpc
Clone the repo
git clone --depth 1 https://github.com/MatrixAges/polywise

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for erpc-communication

README.md
[![agentmods](https://agentmods.dev/badge/skills/matrixages/polywise/erpc.svg)](https://agentmods.dev/skills/matrixages/polywise/erpc)
Your own site
<a href="https://agentmods.dev/skills/matrixages/polywise/erpc"><img src="https://agentmods.dev/badge/skills/matrixages/polywise/erpc.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.00560
Opus 5 $0.00020 $0.00280
Sonnet 5 $0.00008 $0.00112
Haiku 4.5 $0.00004 $0.00056

Measured today against content hash 9d6624b106fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

erpc-communication scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/erpc/SKILL.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

eRPC Communication Guide

This skill provides mandatory instructions for implementing type-safe IPC using eRPC in this project.

1. Main Process Implementation

  • Route Definition: Must use the project's provided router utility to define tRPC routes.
  • Handler Initialization: Must use createIPCHandler from erpc/main to bind the router to Electron windows.
  • Context Injection: Should provide necessary instances (e.g., BrowserWindow or Tray) through createContext.
// Always initialize createIPCHandler within the app ready lifecycle
import { createIPCHandler } from 'erpc/main'

import { routers } from './rpcs'

createIPCHandler({
	createContext: async () => ({ win: mainWindow, tray: appTray }),
	router: routers,
	windows: [mainWindow]
})

2. Preload Script Configuration

  • Expose Bridge Interface: Must call exposeElectronTRPC() provided by erpc/main in the preload script.
  • Lifecycle: Should be called inside process.once('loaded').
import { exposeElectronTRPC } from 'erpc/main'

process.once('loaded', () => {
	exposeElectronTRPC()
})

3. Renderer Process Usage

  • Client Creation: Create tRPC client using ipcLink from erpc/renderer.
  • Type Safety: Always import Router type from main process to ensure complete end-to-end type safety.
import { createTRPCClient } from '@trpc/client'
import { ipcLink } from 'erpc/renderer'

import type { Router } from '@desktop/rpcs' // Import Router type from main process

export const trpc = createTRPCClient<Router>({
	links: [ipcLink()]
})

4. Routes and Endpoints Best Practices

  • Single Responsibility: Each route should correspond to a specific service in the main process (e.g., window, file, dialog).
  • Parameter Validation: It is strictly prohibited to write complex business logic in Router. Router is only responsible for validating input and output parameters; business logic must be delegated to Service (e.g., calling WindowService.open()).
  • Type Reference: For complex object parameters, type definitions must be placed under the packages/erpc package and shared between both ends, avoiding direct cross-package imports of entity logic.

Read the full file on GitHub · 63 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 63 lines · 41 tokens per session scan A 9d6624b106fc

Subscribe to this mod's changes

erpc-communication is a skill published in the GitHub repository MatrixAges/polywise (659 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 560 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other skills, from other repositories

artifact-deploy

One-click deploy a user's pre-built app/artifact into their OWN AWS account and get a global public HTTPS link (Vercel-like), with a default TTL and promote-to-persistent. Use when the user says "deploy this", "ship this demo", "give me a public link", "share this externally", or "deploy to AWS".

kirodotdev/KiroCrew · 74 tokens

explain-for

Explain a topic, a piece of code, an error, or a design decision calibrated to one named audience — a 5-year-old, a 5th grader, a manager, a designer, a graduate student, a parent. Resolves who the explanation is for (from the request, or from what memory already records about that person), establishes the ground…

kirodotdev/KiroCrew · 102 tokens

mochi-remind

Handle due reminders — notify the user with natural language and mark them done.

kirodotdev/KiroCrew · 20 tokens

agent-initialization

Initialize an Agent's settings from a user requirement by writing AGENTS.md, setting identity metadata, and installing only needed Skills.

Prism-Shadow/penguin-harness · 30 tokens

session-summaries

What the chat right-panel session summary shows, what it costs, and how to make a session summarize well. Load when the user asks about the session summary panel, why a summary looks wrong or empty, or how to turn it on.

kirodotdev/KiroCrew · 53 tokens

pr-integration-test

Design, implement, and validate Intelligent Terminal integration tests for a target pull request or regression. Use when asked to add PR integration tests, convert a bug fix into E2E coverage, prove existing behavior still works, map tests to the release checklist, or verify E2E reports mark checklist cases complete.

microsoft/intelligent-terminal · 66 tokens