---
name: "hono-rpc-type-safe-client"
description: "Share complete TypeScript types between Hono backend routes and frontend client without codegen."
metadata:
  author: "Hono"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "setup hono rpc client"
  - "share types backend frontend hono"
  - "zvalidator hono rpc"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Hono RPC End-to-End Type Safety & Client Bindings

Implements Hono RPC (hc): defining typed routes with zValidator, exporting AppType route definitions, consuming endpoints via hc<AppType> on the client, and achieving full autocomplete on URLs and payloads.

## When to Invoke
Invoke this skill whenever you need to:
- setup hono rpc client
- share types backend frontend hono
- zvalidator hono rpc

## Execution SOP & Rules
1. Validate inputs: app.post('/posts', zValidator('json', postSchema), async c => { ... }).
2. Export route type from server: export type AppType = typeof routes.
3. Initialize client in frontend: const client = hc<AppType>('https://api.example.com').
4. Call endpoint with type safety: const res = await client.posts.$post({ json: newPost }).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
