Agent skill

Kkrpc Interop

by kunkunsh in 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…

MITAuto-check passedBackend & APIs

Install Kkrpc Interop

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

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

GitHub CLI
$ gh skill install kunkunsh/kkrpc kkrpc-interop --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/interop .claude/skills/kkrpc-interop && 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-interop
GitHub stars
174
Token cost
~1.8k tokens
SKILL.md length
644 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 6 steps: Convert a dotted method name such as… → Encode arguments, replacing callables… → Send a request record with t: "q",… → …
  • Implementing kkrpc clients
  • SKILL.md covers Reference Implementations, Core Protocol, Callback Argument Encoding and Opt-in Advanced Protocols, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kkrpc Interop is an agent skill from kunkunsh/kkrpc. Use when implementing kkrpc clients or servers in non-TypeScript languages, speaking the stable compact protocol, transports, and reference implementations in Go, Python, Rust, or Swift.

Its SKILL.md is about 1.8k 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 with any language that can parse JSON and implement stdio/WebSocket transports

It sits in Backend & APIs, covering iOS development and Realtime and WebSockets. It works with Python, Rust, TypeScript and Hono. 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

  • Implementing kkrpc clients
  • Servers in non-TypeScript languages
  • Speaking the stable compact protocol
  • Reference implementations in Go

Example prompts

  • “/kkrpc-interop”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Works with any language that can parse JSON and implement stdio/WebSocket transports

Workflow steps

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

  1. Convert a dotted method name such as math.add to p: ["math", "add"].
  2. Encode arguments, replacing callables with callback marker objects.
  3. Send a request record with t: "q", unique id, op, p, and optional a or v.
  4. Store a pending completion keyed by request ID.
  5. In the read loop, resolve pending calls for t: "r" records.
  6. In the read loop, dispatch t: "cb" records to stored callbacks.

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 json and python).

    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 with any language that can parse JSON and implement stdio/WebSocket transports

    From compatibility in the SKILL.md frontmatter.

Context cost

Kkrpc Interop loads about 1.8k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 644 words of instructions outside code blocks.

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

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). 644 words, ~1,765 tokens.

Download SKILL.mdSave it as .claude/skills/kkrpc-interop/SKILL.md (or your agent's skills folder).
name
kkrpc-interop
description
Use when implementing kkrpc clients or servers in non-TypeScript languages, speaking the stable compact protocol, transports, and reference implementations in Go, Python, Rust, or Swift.
compatibility
Works with any language that can parse JSON and implement stdio/WebSocket transports
version
1.0.0
license
MIT
metadata.author
kkrpc
metadata.domain
cross-language-rpc
metadata.tags
rpc, interop, protocol, go, python, rust, swift

kkrpc Language Interop

Implement kkrpc clients and servers in non-JS languages by speaking the stable compact JSON protocol used by TypeScript kkrpc endpoints. Start with the default value-oriented protocol. Async iterable streaming and remote references are opt-in advanced protocols; implement them only when the interop boundary explicitly needs them.

Reference Implementations

LanguageLocationTransports
Gointerop/go/kkrpc/stdio, WebSocket
Pythoninterop/python/kkrpc/stdio, WebSocket
Rustinterop/rust/src/stdio, WebSocket
Swiftinterop/swift/Sources/kkrpc/stdio, WebSocket

Core Protocol

Interop uses JSON records. Stdio transports send newline-delimited UTF-8 JSON. WebSocket transports send the same JSON in text frames.

Request
json
{
	"t": "q",
	"id": "a1b2-c3d4",
	"op": "call",
	"p": ["math", "add"],
	"a": [1, 2]
}

Fields:

  • t: message tag, always q for requests.
  • id: unique request identifier.
  • op: one of call, get, set, or new.
  • p: method or property path as string segments.
  • a: argument array for calls and constructors.
  • v: value for property writes.
Response
json
{
	"t": "r",
	"id": "a1b2-c3d4",
	"v": 3
}

Errors use e with compact error fields:

json
{
	"t": "r",
	"id": "a1b2-c3d4",
	"e": {
		"n": "Error",
		"m": "Division by zero",
		"s": "optional stack"
	}
}
Callback Invocation
json
{
	"t": "cb",
	"id": "callback-id",
	"a": ["progress", 50]
}

Callback Argument Encoding

When sending a callable argument, generate an ID, store the callable locally, and replace the argument with a marker object.

json
{
	"__kkrpc_next_arg__": "callback",
	"id": "callback-id"
}

When receiving this marker, create a wrapper function. Invoking the wrapper sends t: "cb" with the marker ID and argument array.

When receiving callback arguments from JS, unwrap value envelopes before invoking local callbacks.

json
{
	"__kkrpc_next_arg__": "value",
	"v": "actual value"
}

Default callback invocation is fire-and-forget. If a non-JS implementation needs callback return values, object handles, or releaseProxy() behavior, it must also implement the kkrpc/remote-refs envelope and internal op: "ref" request flow.

Opt-in Advanced Protocols

kkrpc/streaming adds async iterable stream records:

  • t: "sq" for stream pull/return/throw control requests
  • t: "sr" for stream value/completion/error responses

kkrpc/remote-refs adds explicit proxy(value) envelopes with "__kkrpc_ref__": true plus internal op: "ref" requests for apply/get/set/call/release. Do not assume these features are present when connecting to a default kkrpc endpoint.

UUID Generation

Use any ID generator with low collision risk. IDs only need to match requests and responses within one connection.

python
import uuid

def generate_uuid() -> str:
    return str(uuid.uuid4())

Transport Layer

Every transport should provide these operations:

text
read() -> string?   # Read one message, null/None if closed
write(message)      # Write one JSON string
close()             # Close connection

Stdio transports append \n and flush immediately. WebSocket transports send and receive text frames containing a single JSON record.

Client Algorithm

  1. Convert a dotted method name such as math.add to p: ["math", "add"].
  2. Encode arguments, replacing callables with callback marker objects.
  3. Send a request record with t: "q", unique id, op, p, and optional a or v.
  4. Store a pending completion keyed by request ID.
  5. In the read loop, resolve pending calls for t: "r" records.
  6. In the read loop, dispatch t: "cb" records to stored callbacks.
Show full SKILL.md (241 more words)Show less

Server Algorithm

  1. Read JSON messages from the transport.
  2. Ignore records that are not t: "q" unless your server also stores callbacks.
  3. Dispatch op: "call" by joining p into the registered method name.
  4. Dispatch op: "get" and op: "set" against registered property handlers if supported.
  5. Encode successful results as { "t": "r", "id": requestId, "v": result }.
  6. Encode failures as { "t": "r", "id": requestId, "e": { "n": name, "m": message } }.

Minimal Client Pseudocode

python
def call(method, *args):
    request_id = generate_uuid()
    payload = {
        "t": "q",
        "id": request_id,
        "op": "call",
        "p": method.split("."),
        "a": [encode_arg(arg) for arg in args],
    }
    transport.write(json.dumps(payload))
    response = wait_for_response(request_id)
    if "e" in response:
        raise RpcError(response["e"].get("m", "RPC error"))
    return response.get("v")

Minimal Server Pseudocode

python
def handle(message):
    if message.get("t") != "q":
        return
    try:
        method = ".".join(message.get("p", []))
        args = [decode_arg(arg) for arg in message.get("a", [])]
        result = api[method](*args)
        transport.write(json.dumps({"t": "r", "id": message["id"], "v": result}))
    except Exception as exc:
        transport.write(json.dumps({
            "t": "r",
            "id": message["id"],
            "e": {"n": exc.__class__.__name__, "m": str(exc)},
        }))

Testing Checklist

  • Call JS server methods from the non-JS client.
  • Call non-JS server methods from a JS client.
  • Verify nested method paths.
  • Verify property get and set if implemented.
  • Verify callback marker encoding and t: "cb" dispatch.
  • If implemented, verify streaming t: "sq"/t: "sr" flow control.
  • If implemented, verify remote-reference op: "ref" apply/get/set/call/release behavior.
  • Verify error responses preserve name and message.
  • Verify stdio newline framing and WebSocket text framing.

Common Pitfalls

  • Do not send dotted method names in the wire message. Use path arrays in p.
  • Do not wrap responses in custom result objects. Put successful values in v.
  • Do not use binary WebSocket frames for the JSON interop protocol.
  • Do not forget to unwrap { "__kkrpc_next_arg__": "value", "v": ... } callback arguments.
  • Do not rely on JS-specific transfer slots or structured clone in language interop.
  • Do not assume async iterables or remote references are part of the default core protocol.
  • Do not send op: "ref" to a default-core endpoint; only kkrpc/remote-refs endpoints implement those requests.

© 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/interop of kunkunsh/kkrpc.

Open the folder on GitHubat commit e558873

Compare with similar skills

Kkrpc Interop 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 Interop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kkrpc Interop this skillkunkunsh/kkrpc174—~1.8kAutomated safety check: PassMIT
Implementing Realtime Syncancoleman/ai-design-components526—~2.3kAutomated safety check: PassMIT
Build Teaql Appteaql/teaql-agent-kit2.8k—~4.6kAutomated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
MCP SDK Tier Auditmodelcontextprotocol/conformance129—~4.4kAutomated safety check: PassCustom licence
Gemini Live API Devgoogle-gemini/gemini-skills4.3k—~4.6kAutomated safety check: PassApache-2.0

Similar skills

  • Implementing Realtime Sync

    ancoleman/ai-design-components

    Real-time communication patterns for live updates, collaboration, and presence.

    526 GitHub stars~2.3k tokensUpdated 10 mo ago
    Backend & APIsAuto-check passed
  • Build Teaql App

    teaql/teaql-agent-kit

    Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries.

    2.8k GitHub stars~4.6k tokensUpdated 12 days ago
    MobileAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • MCP SDK Tier Audit

    modelcontextprotocol/conformance

    Official

    Comprehensive tier assessment for an MCP SDK repository against SEP-1730.

    129 GitHub stars~4.4k tokensUpdated 4 days ago
    MobileAuto-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 3 days 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

More from kunkunsh/kkrpc

  • Kkrpc

    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…

    174 GitHub stars~3.1k tokensUpdated 28 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 28 days ago
    Auto-check passed

Questions about Kkrpc Interop

What does Kkrpc Interop do?

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…. Kkrpc Interop is an agent skill from kunkunsh/kkrpc. Use when implementing kkrpc clients or servers in non-TypeScript languages, speaking the stable compact protocol, transports, and reference implementations in Go, Python, Rust, or Swift.

When should I use Kkrpc Interop?

Kkrpc Interop fits situations like: implementing kkrpc clients; servers in non-TypeScript languages; speaking the stable compact protocol; reference implementations in Go.

How do I install Kkrpc Interop in Claude Code?

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

How do I install Kkrpc Interop in Codex?

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

Can I use Kkrpc Interop 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-interop -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-interop, .gemini/skills/kkrpc-interop, .github/skills/kkrpc-interop and .opencode/skills/kkrpc-interop in your project.

What does Kkrpc Interop need to run?

SKILL.md names no scripts, command-line tools or credentials: Kkrpc Interop is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): Works with any language that can parse JSON and implement stdio/WebSocket transports.

Does Kkrpc Interop 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 Interop 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 Interop use?

Kkrpc Interop 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 Interop use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 Interop?

Skills that share tags, products or a category with Kkrpc Interop: Implementing Realtime Sync (ancoleman/ai-design-components, 526 stars), Build Teaql App (teaql/teaql-agent-kit, 2.8k stars), Dbg (theodo-group/debug-that, 158 stars) and MCP SDK Tier Audit (modelcontextprotocol/conformance, 129 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kkrpc Interop?

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.