unity-netcode-design

A set of design rules for Unity Netcode for GameObjects 2.x, the Unity networking library used to build multiplayer games. The rules are based on the library’s source code and include references that support each recommendation.

In plain words
What is it for?
Use them when writing, reviewing, designing, or debugging Unity multiplayer code involving network behaviours, ownership, spawning, scene changes, transports, remote procedure calls, or network variables.
Why use it?
They help prevent common mistakes when networking game objects, synchronizing values, sending remote procedure calls, or deciding which computer controls game state.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/besty0728/unity-skills/netcode-design
Any agent
npx skills add Besty0728/Unity-Skills --skill netcode-design
Clone the repo
git clone --depth 1 https://github.com/Besty0728/Unity-Skills

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,224 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.01224
Opus 5 $0.00010 $0.00612
Sonnet 5 $0.00004 $0.00245
Haiku 4.5 $0.00002 $0.00122

Measured 2d ago against content hash 330ba44428ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unity-netcode-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Writing or reviewing multiplayer code
  • Designing server/distributed authority
  • Wiring RPCs or NetworkVariables
  • Debugging netcode
  • 编写或审查多人联机代码、设计服务器/分布式权威、连接 RPC 或网络变量、排查 netcode 问题

Netcode for GameObjects - Design Rules

Advisory module. Every rule is distilled from com.unity.netcode.gameobjects 2.x source. Each rule cites a concrete file/line so the reasoning is auditable.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • NetworkBehaviour scripts (OnNetworkSpawn / OnNetworkDespawn / RPCs / NetworkVariables)
  • NetworkManager startup / shutdown / scene switching
  • NetworkObject Spawn / Despawn / ChangeOwnership / TrySetParent
  • UnityTransport configuration (direct connect / Relay)
  • Any code that branches on IsHost / IsServer / IsClient / IsOwner

Critical Rule Summary (memorize even if you skip the sub-docs)

# Rule Source anchor
1 Spawn() / Despawn() must be called on Server/Host only; client-side calls fail. Runtime/Core/NetworkObject.cs:1884, 1921
2 OnNetworkSpawn() runs before Unity Start() and after Awake/OnEnable. Runtime/Core/NetworkBehaviour.cs:704 + InvokeBehaviourNetworkSpawn callers
3 Legacy [ServerRpc] method names must end with ServerRpc; [ClientRpc] must end with ClientRpc (ILPP enforced at compile time). Editor/CodeGen/ ILPP validators
4 New [Rpc(SendTo.X)] has no naming constraint; SendTo has 11 values. Runtime/Messaging/RpcTargets/RpcTarget.cs:9-80
5 PlayerPrefab must exist in NetworkPrefabsList or NetworkConfig.Prefabs or 2.x runtime rejects it. Runtime/Configuration/NetworkConfig.cs:40 + NetworkPrefabsList.cs:14
6 Nested NetworkObjects are forbidden (NetworkObject inside another NetworkObject prefab). Re-parent at runtime via TrySetParent. Runtime/Core/NetworkObject.cs:2135-2215
7 NetworkVariable<T> requires T to be unmanaged or implement INetworkSerializable. string, List<>, class are rejected. Runtime/NetworkVariable/NetworkVariable.cs:12 + ILPP
8 NetworkList<T> requires T: unmanaged, IEquatable<T>. It is NOT NetworkVariable<List<T>>. Runtime/NetworkVariable/Collections/NetworkList.cs:14
9 NetworkSceneManager.LoadScene/UnloadScene is Server-only. Runtime/SceneManagement/NetworkSceneManager.cs:1496, 1252
10 UnityTransport.SetRelayServerData and SetConnectionData are mutually exclusive; use one or the other. Runtime/Transports/UTP/UnityTransport.cs:776-897

Read the full file on GitHub · 67 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 67 lines · 20 tokens per session scan A 330ba44428ab

Subscribe to this mod's changes

unity-netcode-design is a skill published in the GitHub repository Besty0728/Unity-Skills (1,695 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,224 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

2dimg2motion

Use when a user provides one baseline image and requests game animation frames, sprite sequences, attack/walk/idle/hit/death/casting motion, transparent PNG frames, a spritesheet, keyframe prompts, or consistent whole-character pose animation.

WU-HAOTIAN34/2dimg2motion · 55 tokens

dotcraft-unity

Use when dotcraft-unity MCP or unityexecutecsharp is available, or when the user asks to inspect, automate, capture, or debug Unity Editor state, scenes, assets, Console logs, or GameView output. Provides background-first Unity Editor automation rules.

DotHarness/dotcraft-unity · 58 tokens

img2mo-learn

Learn reusable 2D motion-generation knowledge from user-specified action resources with /img2mo-learn . Use when the user provides videos, extracted frame sequences, spritesheets, Spine assets, generated outputs, failed attempts, or reference motion folders and wants to summarize animation timing, pose beats, style…

WU-HAOTIAN34/2dimg2motion · 104 tokens

img2mo-std

Standardize a 2D animation baseline image with /img2mo-std xxx.png/pos. Use when preparing a character, creature, prop, or weapon baseline before motion generation, especially if the source image is too large, tightly cropped, lacks transparent action margin, has a white background, or later walk/attack/idle frames…

WU-HAOTIAN34/2dimg2motion · 87 tokens

zu-article-image-skill

为已完成的 Markdown 文章设计语义配图位置,按内置 preset/type/style/palette 样式体系生成可编辑自然语言生图 Prompt,并作为隐藏标签插入文章;用户确认后扫描标签,调用当前运行时原生 imagegen 生成图片并插回文章。用于用户要求为文章配图、规划正文插图、调整文章插图风格或根据文章内 Prompt 标签生成图片时。.

wwenj/zu-article-image-skill · 100 tokens

msh-exam-analysis

名师汇出国自动化工具集。两个功能:(1) 模考错题分析——用户提供 mingshihuichuguo.com/homework/student/ 网址,按"手写版"人味风格产出阅读/听力错题分析 txt;(2) 单词听写自动化——用户要求完成 list 听写/单词测试时,用 playwright-cli + runv5.js 自动答题。根据用户意图自动判断用哪个。When the user mentions 错题分析 / 模考 / 听写 / 单词 / list / mingshihuichuguo URL, use this skill.

JiHuiYiYou/msh-skill · 144 tokens