effect-rpc-cluster

Build typed RPC endpoints and cluster entities with Effect v4 schemas.

22|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-rpc-cluster
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-rpc-cluster
Source: https://github.com/mpsuesser/pi-effect-harness/tree/main/harnesses/effect/skills/effect-rpc-cluster
Command: npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-rpc-cluster

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building distributed RPC endpoints and actor-like stateful entities is error-prone when you must keep schemas, transport wiring, and concurrency/persistence guarantees consistent across client and server.

Core Features & Use Cases

  • Type-safe RPC definitions: define Rpc values with payload/success/error schemas and optional stream support, then reuse the exact same definitions everywhere.
  • Cluster-ready actor state: create Entity, sharded routing, Singleton, and cron-driven singletons with durable/dedup-friendly request identity via primaryKey.
  • Transport + middleware correctness: mount RPC servers across HTTP/WebSocket/Socket/Stdio transports and enforce cross-cutting concerns using RpcMiddleware (including client-side enforcement with layerClient).

Quick Start

Load this skill and ask your AI to design a sharded cluster Entity backed by durable message storage and expose it through typed Effect RPC over WebSocket, including middleware that validates a token from request headers and returns a wire-safe error schema.

Frequently Asked Questions about effect-rpc-cluster

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

FAQPage Schema
How do I build type-safe RPC endpoints with Effect v4?

Build type-safe Effect RPC endpoints by defining shared Rpc and RpcGroup schemas with payload, success, and error contracts, then wiring RpcServer and RpcClient transport layers to reuse those exact definitions across client and server.

How do I set up sharded cluster entities in Effect?

Set up sharded cluster entities in Effect by creating Entity definitions with sharded routing and durable request identity via Rpc primaryKey semantics, ensuring persistence dedupe across distributed cluster nodes.

Does Effect RPC support streaming responses over WebSocket?

Effect RPC supports streaming responses over WebSocket by defining Rpc values with optional stream support and mounting RpcServer transport layers configured with transport-specific layerProtocol and RpcSerialization settings.

How do I enforce validation middleware on Effect RPC servers?

Enforce validation middleware on Effect RPC servers by applying RpcMiddleware to handle cross-cutting concerns like token validation from request headers, including client-side enforcement using layerClient for wire-safe error schemas.

Can I run cron-driven singletons and durable workflows using Effect cluster APIs?

Effect cluster APIs support cron-driven singletons and durable workflow-style engines by defining Singleton entities and leveraging WorkflowProxy for client/server bridging under the effect/unstable/cluster package.

Why do my Effect RPC handlers fail with mismatched signatures?

Effect RPC handlers fail with mismatched signatures when handler signatures are not aligned with the defined Rpc schemas, requiring correct Rpc primaryKey semantics and strict adherence to the effect/unstable/rpc API contracts.