effect-rpc-cluster

Build typed RPC endpoints and cluster-distributed entities with Effect v4 RPC and Cluster modules.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-rpc-cluster-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-rpc-cluster
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-rpc-cluster
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-rpc-cluster-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect, @effect/platform-node, @effect/platform-bun.

What problem does it solve? Building type-safe RPC services and distributed actor-style systems in Effect v4 requires navigating unstable APIs, differing handler signatures, transport protocols, and cluster persistence semantics that are easy to get wrong without deep source-level knowledge. ## Core Features & Use Cases - Typed RPC Definitions: Define rpcs with Rpc.make, compose them into RpcGroups, and serve them over HTTP, WebSocket, socket, stdio, or worker transports with json, ndjson, or msgpack serialization. - Cluster Distribution: Build sharded entities, singletons, cron jobs, and durable workflows using Entity, Sharding, Singleton, ClusterCron, and ClusterWorkflowEngine with Node or Bun all-in-one bundles. - Middleware and Streaming: Implement auth middleware with compile-time client enforcement, streaming rpcs, deferred responses, and connection hooks for reconnection handling. - Use Case: You need a distributed user service where requests are routed by shard to the owning runner, retried safely via primaryKey deduplication, and exposed to clients through a typed RpcClient with per-call headers. ## Quick Start Use the effect-rpc-cluster skill to define a typed RpcGroup with handlers and serve it over HTTP with Effect v4.

Frequently Asked Questions about effect-rpc-cluster

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a typed RPC endpoint in Effect v4?

Use Rpc.make with a tag and options for payload, success, and error schemas, either as a const value or via class extends for nominal typing. Collect rpcs with RpcGroup.make and implement handlers with group.toLayer.

How do I build a distributed entity with Effect Cluster?

Use Entity.make with a type and rpcs, then wire handlers via toLayer. Messages travel through MessageStorage and are routed by Sharding to the runner owning the entity's shard, with primaryKey enabling safe retries.

Does Effect v4 have separate @effect/rpc or @effect/cluster packages?

No, in Effect v4 everything ships from the effect package under effect/unstable/rpc and effect/unstable/cluster. There are no separate @effect/rpc or @effect/cluster packages, and APIs may move between betas.

What is the difference between RpcGroup handlers and Entity handlers?

RpcGroup handlers take (payload, options) with client, requestId, and headers, while Entity handlers take an envelope. Mixing these signatures is the most common mistake when combining RPC and Cluster modules.

Which transports does the Effect RPC server support?

RpcServer supports HTTP, WebSocket, raw socket, stdio, and worker transports via layerProtocol* layers. HTTP lacks streaming acks and span propagation, while WebSocket supports full duplex with acks and span propagation.

How do I enforce auth middleware on RPC clients at compile time?

Define middleware with RpcMiddleware.Service and set requiredForClient: true. Clients must then provide RpcMiddleware.layerClient for that middleware or RpcClient.make fails to compile.