Skills

capnweb RPC Patterns

Applies capnweb stub lifecycle and disposal rules across RPC boundaries.

Install

npx skills add cloudflare/computer --skill capnweb -g -a claude-code -y
Repository
cloudflare/computer9.8k
Category
Engineering
Updated
6d ago
License
MIT
Context cost
Mediumabout 2,531 tokens
Runs scripts
No, instructions only

What it does

capnweb RPC patterns for this repo, with a heavy focus on stub lifecycle and disposal. Load when touching anything that crosses the Durable Object ↔ computerd boundary: packages/rpc, packages/computer, the computerd client, or the Durable Object server. Triggers include "capnweb", "RpcTarget", "stub", "RPC wire", "promise pipelining", "stub disposal", "RpcPromise".

capnweb in this repo

capnweb is the RPC framing between the Durable Object and computerd. It's an object-capability RPC system with promise pipelining, structured-clone-style transfer of stubs, and bidirectional calls. The wire format used here is text JSON over a long-lived WebSocket. That is the only carrier: capnweb's HTTP batch transport cannot deliver a stream returned from a call, which is what every read on this interface is.

Where things live

The mental model

Read the whole SKILL.md on GitHub

More in Engineering