AgentSkillsCN

hono-ipc-routes

在 Electron 中使用 Hono RPC 实现类型安全的 IPC 路由。适用于在主进程与渲染进程之间创建 API 路由时使用。

SKILL.md
--- frontmatter
name: hono-ipc-routes
description: Implement type-safe IPC routes in Electron using Hono RPC. Use when creating API routes between main and renderer processes.
allowed-tools: Read, Write, Edit, Grep, Glob

Hono IPC Routes

Resources

TopicFile
Route implementationROUTE-HANDLERS.md
Type safety patternsTYPE-SAFETY.md
Error handlingERROR-HANDLING.md

Quick Reference

typescript
// Route: src/shared/callable/users/index.ts
export const route = new Hono<{ Variables: AppVariables }>()
  .get('/', async (c) => c.json(await c.var.services.users.list(), 200))
  .post('/', zValidator('json', schema), async (c) => { ... });

// Client: fully typed
const users = await client.users.$get().then(r => r.json());

Related Skills