Agent skill

Kkrpc

by kunkunsh in kunkunsh/kkrpc

A skill your agent uses when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage adapters, or integrating validation, middleware, transferables, streaming, remote…

MITAuto-check passedBackend & APIs

Install Kkrpc

skills CLI
$ npx skills add kunkunsh/kkrpc --skill kkrpc -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kunkunsh/kkrpc kkrpc --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kunkunsh/kkrpc.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/kkrpc .claude/skills/kkrpc && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kkrpc
GitHub stars
174
Token cost
~3.1k tokens
SKILL.md length
618 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage adapters, or integrating validation, middleware, transferables, streaming, remote…

  • Works in 4 steps: Pick the stable entry point. → Pick the native transport factory. → Decide whether one side or both sides… → …
  • Building TypeScript RPC with kkrpc stable APIs
  • SKILL.md covers First Decisions, Entry Points, Core API Pattern and Streaming Example, plus 10 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kkrpc is an agent skill from kunkunsh/kkrpc. Use when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage adapters, or integrating validation, middleware, transferables, streaming, remote references, relay, or inspector tooling.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Works in Node.js, Deno, Bun, browsers, Electron, Tauri, Chrome extensions, and queue-backed runtimes with the correct stable entry point and transport.

It sits in Backend & APIs, covering Realtime and WebSockets. It works with TypeScript, Hono and Chrome Extensions. The repository describes itself as: A TypeScript RPC protocol for multiple environments (iframe, web worker, stdio, http, WebSocket). The licence is MIT.

When your agent uses it

  • Building TypeScript RPC with kkrpc stable APIs
  • Choosing native Transport<RPCMessage adapters
  • Integrating validation
  • Remote references

Example prompts

  • “/kkrpc”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Works in Node.js, Deno, Bun, browsers, Electron, Tauri, Chrome extensions, and queue-backed runtimes with the correct stable entry point and transport.

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Pick the stable entry point.
  2. Pick the native transport factory.
  3. Decide whether one side or both sides expose APIs.
  4. Add plugins only when validation, middleware, logging, or custom behavior is required.

What it can do on your machine

Read from SKILL.md and the folder at commit e558873. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Works in Node.js, Deno, Bun, browsers, Electron, Tauri, Chrome extensions, and queue-backed runtimes with the correct stable entry point and transport.

    From compatibility in the SKILL.md frontmatter.

Context cost

Kkrpc loads about 3.1k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 618 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kunkunsh/kkrpc at commit e558873, republished under its MIT licence (© kunkunsh). 618 words, ~3,058 tokens.

Download SKILL.mdSave it as .claude/skills/kkrpc/SKILL.md (or your agent's skills folder).
name
kkrpc
description
Use when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage> adapters, or integrating validation, middleware, transferables, streaming, remote references, relay, or inspector tooling.
compatibility
Works in Node.js, Deno, Bun, browsers, Electron, Tauri, Chrome extensions, and queue-backed runtimes with the correct stable entry point and transport.
version
2.0.0
license
MIT
metadata.author
kkrpc
metadata.domain
typescript-rpc
metadata.tags
rpc, typescript, bidirectional, ipc, websocket, http, workers, electron, tauri, chrome-extension

kkrpc - TypeScript RPC Library

Use kkrpc to expose a local TypeScript object and call the remote side as a typed proxy. The stable API is native Transport<RPCMessage> based. Start with the small default kkrpc entry, then opt into kkrpc/streaming or kkrpc/remote-refs only when the API needs those features.

typescript
import { expose, wrap } from "kkrpc"

const controller = expose(localAPI, serverTransport)
const remote = wrap<RemoteAPI>(clientTransport)

controller.dispose()

Use low-level RPCChannel when both sides expose APIs or when you need explicit channel ownership:

typescript
import { RPCChannel } from "kkrpc"

const channel = new RPCChannel<LocalAPI, RemoteAPI>(transport, { expose: localAPI })
const remote = channel.getAPI()

First Decisions

  1. Pick the stable entry point.
  2. Pick the native transport factory.
  3. Decide whether one side or both sides expose APIs.
  4. Add plugins only when validation, middleware, logging, or custom behavior is required.

Entry Points

Runtime or featureImport pathNotes
CorekkrpcBrowser-safe wrap, expose, RPCChannel, protocol and transport types
Browser corekkrpc/browserExplicit browser entry when package conditions are not enough
Workerkkrpc/workerworkerTransport, workerSelfTransport
stdiokkrpc/stdioNative JSON-line stdio transports
HTTPkkrpc/httpHTTP client and handler helpers
WebSocketkkrpc/wsWebSocket client/server transports
Hono WebSocketkkrpc/ws/honoOptional hono peer
Elysia WebSocketkkrpc/ws/elysiaOptional elysia peer
iframekkrpc/iframeiframe postMessage transports
Chrome extensionkkrpc/chrome-extensionChrome runtime port transports
Electronkkrpc/electronElectron IPC and utility process transports
Taurikkrpc/tauriTauri shell plugin transport
Validationkkrpc/validationStandard Schema validation plugin
Middlewarekkrpc/middlewareInterceptor middleware plugin
SuperJSONkkrpc/superjsonSuperJSON codecs
Streamingkkrpc/streamingAsync iterable arguments/results with pull-based backpressure
Remote refskkrpc/remote-refsExplicit proxy(value) references, callback return values, object handles, releaseProxy()
Relaykkrpc/relayTransport-to-transport relay helper
Inspectorkkrpc/inspectorNative plugin/event traffic logging
Queueskkrpc/rabbitmq, kkrpc/kafka, kkrpc/redis-streams, kkrpc/natsOptional peer dependencies; set remotePeerId for point-to-point streaming or remote refs

Core API Pattern

Prefer explicit local and remote API types. In bidirectional RPC, each side can expose its own API and call the other side.

typescript
type ServerAPI = {
	math: {
		add(a: number, b: number): Promise<number>
	}
	version(): Promise<string>
}

type ClientAPI = {
	notify(message: string): Promise<void>
}

const clientAPI: ClientAPI = {
	async notify(message) {
		console.log(message)
	}
}

const channel = new RPCChannel<ClientAPI, ServerAPI>(transport, { expose: clientAPI })
const server = channel.getAPI()

console.log(await server.math.add(1, 2))

Remote property access is supported:

typescript
const counter = await api.counter
const nested = await api.nested.deepObj.prop

Top-level callbacks can be passed as arguments for fire-and-forget progress notifications:

typescript
await api.process("input", (progress) => {
	console.log("progress", progress)
})

Default callbacks do not propagate return values or thrown errors. Use kkrpc/remote-refs and proxy(callback) when the remote side must await the callback result.

kkrpc/remote-refs is explicit: unmarked function values are rejected rather than passed by raw object identity. Wrap each callback, returned function leaf, or object handle that should remain remote with proxy(value).

Remote proxies are channel-scoped. Do not pass a remote proxy decoded from one RPCChannel through a different channel; expose an explicit bridge method if that is truly required.

Show full SKILL.md (244 more words)Show less

Streaming Example

typescript
import { expose, wrap } from "kkrpc/streaming"

type LogAPI = {
	tail(service: string): AsyncIterable<string>
}

for await (const line of wrap<LogAPI>(transport).tail("api")) {
	console.log(line)
}

Remote References Example

typescript
import { proxy, releaseProxy, wrap } from "kkrpc/remote-refs"

const result = await wrap<RemoteAPI>(transport).useCallback(
	proxy(async (value) => `callback:${value}`)
)

const counter = await wrap<RemoteAPI>(transport).createCounter()
await releaseProxy(counter)

Worker Example

Parent side:

typescript
import { wrap } from "kkrpc"
import { workerTransport } from "kkrpc/worker"

const worker = new Worker(new URL("./worker.ts", import.meta.url), { type: "module" })
const api = wrap<WorkerAPI>(workerTransport(worker))

console.log(await api.ping())

Worker side:

typescript
import { expose } from "kkrpc"
import { workerSelfTransport } from "kkrpc/worker"

expose(
	{
		async ping() {
			return "pong"
		}
	},
	workerSelfTransport()
)

WebSocket Example

typescript
import { wrap } from "kkrpc"
import { webSocketClientTransport } from "kkrpc/ws"

const api = wrap<RemoteAPI>(webSocketClientTransport("ws://localhost:3000/rpc"))

Validation Example

typescript
import { expose, wrap } from "kkrpc"
import { validationPlugin } from "kkrpc/validation"

const plugins = [validationPlugin(validators)]
const controller = expose(localAPI, serverTransport, { plugins })
const remote = wrap<RemoteAPI>(clientTransport, { plugins })

Middleware Example

typescript
import { middlewarePlugin } from "kkrpc/middleware"

const plugins = [
	middlewarePlugin([
		async (ctx, next) => {
			console.log(ctx.method)
			return next()
		}
	])
]

SuperJSON Example

Use kkrpc/superjson only when the application needs SuperJSON value support. Do not import it from the main kkrpc entry.

typescript
import { superJsonCodec } from "kkrpc/superjson"
import { createTransport } from "kkrpc/transport"

const transport = createTransport({ platform, codec: superJsonCodec() })

Inspector Example

typescript
import { createInspector, MemoryBackend } from "kkrpc/inspector"

const memory = new MemoryBackend()
const inspector = createInspector({ backends: [memory], options: { trackLatency: true } })
const channel = new RPCChannel<LocalAPI, RemoteAPI>(transport, {
	expose: localAPI,
	plugins: [inspector.plugin("server")]
})

Relay Example

typescript
import { relayTransport } from "kkrpc/relay"

const relay = relayTransport(leftTransport, rightTransport)
relay.dispose()

Migration Rules

  1. Use kkrpc instead of old experimental native entry paths.
  2. Use native transport factories instead of blocking IO classes.
  3. Keep optional peers behind their stable subpaths.
  4. Do not import runtime-specific transports from the main kkrpc entry.
  5. Do not use removed compatibility entries or browser-lite/browser-mini entries in new code.

Common Pitfalls

PitfallFix
Importing optional transport peers from kkrpcImport from the specific subpath, such as kkrpc/ws or kkrpc/electron
Pulling SuperJSON into every browser bundleImport codecs from kkrpc/superjson only where needed
Expecting async iterables from kkrpcImport wrap/expose/RPCChannel from kkrpc/streaming on both sides
Expecting callback return values from default callbacksImport from kkrpc/remote-refs and pass proxy(callback)
Returning unmarked nested functions as remote handlesWrap the function leaf with proxy(fn) in kkrpc/remote-refs; unmarked functions are rejected
Using remote refs over broadcast message busesConfigure a point-to-point bus transport with remotePeerId
Passing a remote proxy through another channelKeep remote proxies on the channel that decoded them, or build an explicit bridge
Forgetting to dispose channelsKeep the controller/channel and call dispose() or destroy()
Using old blocking IO adapter namesUse native transport factories that return Transport<RPCMessage>
Treating validation as core behaviorAdd validationPlugin() explicitly through channel options

© kunkunsh, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/kkrpc of kunkunsh/kkrpc.

Open the folder on GitHubat commit e558873

Compare with similar skills

Kkrpc next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kkrpc compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kkrpc this skillkunkunsh/kkrpc174—~3.1kAutomated safety check: PassMIT
Fishjam JS Server SDKsoftware-mansion-labs/skills291—~1.4kAutomated safety check: PassMIT
HonoEpicenterHQ/epicenter4.8k—~513Automated safety check: PassCustom licence
Gemini Live API Devgoogle-gemini/gemini-skills4.3k—~4.6kAutomated safety check: PassApache-2.0
Trigger.dev Realtimepapermark/papermark9.2k—~1.7kAutomated safety check: PassCustom licence
Web3 PolymarketPolymarket/agent-skills1911 repos~2kAutomated safety check: PassNone

Similar skills

  • Fishjam JS Server SDK

    software-mansion-labs/skills

    Node.js / TypeScript server SDK for Fishjam — backends that create rooms, mint peer tokens, listen to server notifications, and run agents.

    291 GitHub stars~1.4k tokensUpdated 11 days ago
    Backend & APIsAuto-check passed
  • Hono

    EpicenterHQ/epicenter

    Hono patterns for TypeScript API routes, middleware, request and response typing, streaming, WebSockets, and Cloudflare Workers deployment.

    4.8k GitHub stars~513 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Trigger.dev Realtime

    papermark/papermark

    Shows how to subscribe to Trigger.dev task runs from the backend and from React for progress indicators, live dashboards, AI response streams and approval waits.

    9.2k GitHub stars~1.7k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Web3 Polymarket

    Polymarket/agent-skills

    Polymarket integration for prediction market trading on Polygon.

    191 GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed
  • Parchi Relay

    0xSero/parchi

    Use Parchi Relay to control a real browser via the Parchi extension agent (WebSocket) or directly via JSON-RPC from a CLI/tooling workflow.

    551 GitHub stars~1k tokensUpdated 22 days ago
    Backend & APIsAuto-check passed

More from kunkunsh/kkrpc

  • Kkrpc Interop

    kunkunsh/kkrpc

    A skill your agent uses when implementing kkrpc clients or servers in non-TypeScript languages, speaking the stable compact protocol, transports, and reference implementations in Go, Python, Rust…

    174 GitHub stars~1.8k tokensUpdated 27 days ago
    Auto-check passed
  • Kkrpc Migration

    kunkunsh/kkrpc

    A skill your agent uses when migrating kkrpc projects across breaking stable API changes, replacing classic IoInterface/IO adapters, next entries, validation/interceptor options, transport imports…

    174 GitHub stars~2.7k tokensUpdated 27 days ago
    Auto-check passed

Categories

Questions about Kkrpc

What does Kkrpc do?

A skill your agent uses when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage adapters, or integrating validation, middleware, transferables, streaming, remote…. Kkrpc is an agent skill from kunkunsh/kkrpc. Use when building TypeScript RPC with kkrpc stable APIs, choosing native Transport<RPCMessage adapters, or integrating validation, middleware, transferables, streaming, remote references, relay, or inspector tooling.

When should I use Kkrpc?

Kkrpc fits situations like: building TypeScript RPC with kkrpc stable APIs; choosing native Transport<RPCMessage adapters; integrating validation; remote references.

How do I install Kkrpc in Claude Code?

Run `npx skills add kunkunsh/kkrpc --skill kkrpc -a claude-code`. Or copy the skill folder (skills/kkrpc in kunkunsh/kkrpc) into .claude/skills/kkrpc in your project. Claude Code loads it when a task matches its description.

How do I install Kkrpc in Codex?

Run `npx skills add kunkunsh/kkrpc --skill kkrpc -a codex`. Or copy the skill folder (skills/kkrpc in kunkunsh/kkrpc) into .agents/skills/kkrpc in your project. Codex loads it when a task matches its description.

Can I use Kkrpc in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kunkunsh/kkrpc --skill kkrpc -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kkrpc, .gemini/skills/kkrpc, .github/skills/kkrpc and .opencode/skills/kkrpc in your project.

What does Kkrpc need to run?

SKILL.md names no scripts, command-line tools or credentials: Kkrpc is instructions for the agent only. Our summary lists: Node.js. Compatibility (from SKILL.md): Works in Node.js, Deno, Bun, browsers, Electron, Tauri, Chrome extensions, and queue-backed runtimes with the correct stable entry point and transport..

Does Kkrpc access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Kkrpc safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kkrpc use?

Kkrpc is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kkrpc use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kkrpc?

Skills that share tags, products or a category with Kkrpc: Fishjam JS Server SDK (software-mansion-labs/skills, 291 stars), Hono (EpicenterHQ/epicenter, 4.8k stars), Gemini Live API Dev (google-gemini/gemini-skills, 4.3k stars) and Trigger.dev Realtime (papermark/papermark, 9.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kkrpc?

kunkunsh (a GitHub organization) maintains it in kunkunsh/kkrpc, which has 174 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 11, 2026.

Source: kunkunsh/kkrpc on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.