coherence-rpc-routing

Guides selection of MessageTarget, ordering, and channels for coherence networked commands.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/cmitchellVFS/Scrabble --skill coherence-rpc-routing-cmitchellvfs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coherence-rpc-routing
Source: https://github.com/cmitchellVFS/Scrabble/tree/main/.claude/skills/coherence-rpc-routing
Command: npx skills add https://github.com/cmitchellVFS/Scrabble --skill coherence-rpc-routing-cmitchellvfs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Networked commands in coherence often double-fire, arrive out of order, drop large payloads, or fail on null arguments, leaving multiplayer state inconsistent and hard to debug. ## Core Features & Use Cases - MessageTarget Selection: Cheat sheets and decision rules for choosing between All, Other, StateAuthorityOnly, and InputAuthorityOnly, including self-forwarding single-method commands versus paired sender/handler patterns. - Ordering and Channels: Guidance on SendCommand versus SendOrderedCommand for paired state mutations, plus Channel.Fragmented and Channel.FragmentedOrdered for payloads above the ~1200 byte MTU. - Null-Safe Arguments: The (typeof(T), value) tuple form for nullable string, byte[], and entity-reference arguments, with receiver-side handling of empty defaults. - Use Case: A player claims a shared item and the icon stays stuck on for others. Use this Skill to diagnose the unordered Apply/Remove command pair and convert both to SendOrderedCommand so the state converges. ## Quick Start Ask the AI to review your coherence SendCommand calls and recommend the correct MessageTarget, ordering, and channel for each networked event.

Frequently Asked Questions about coherence-rpc-routing

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

FAQPage Schema
How do I choose the right MessageTarget in coherence?▼

Pick MessageTarget based on who must run the command: StateAuthorityOnly when a client asks the authority to act, Other when the authority broadcasts to remote viewers, All when everyone including the sender runs it, and InputAuthorityOnly for the controlling player.

When should I use SendOrderedCommand instead of SendCommand?▼

Use SendOrderedCommand for race-sensitive events and paired commands that mutate the same state, such as apply/remove or lock/unlock, so they arrive in send order. Use plain SendCommand for droppable visual effects like footstep dust or muzzle flashes.

How do I send large payloads over coherence commands?▼

Use SendCommandOverChannel with Channel.Fragmented for one-shot payloads above the ~1200 byte MTU, or Channel.FragmentedOrdered when multiple fragmented sends must arrive in send order. Reassembly of each payload is handled automatically.

Why does passing null to a coherence command throw an error?▼

Coherence infers the wire type from the runtime type of each argument, and a bare null carries no type. Pass nullable string, byte[], or entity-reference arguments as (typeof(T), value) tuples, and wrap every argument in the call once one uses the tuple form.

Why does my coherence command fire twice on the sender?▼

MessageTarget.All includes the sender, so local code runs twice if you also apply the effect before sending. Use MessageTarget.Other for broadcasts and invoke the local effect explicitly, or make the command idempotent.

When should I use a synced field instead of command pairs?▼

Use a [Sync] bool or enum whenever the state is just a value, because state replication self-heals on reconnect and converges by construction. Reserve paired ordered commands for transitions where receivers mutate derived state, such as reference counts or lifecycle locks.