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.
npx skills add ouzlifaneyassine1-dot/onyx-engine --skill peer-to-peer-multiplayergit clone --depth 1 https://github.com/ouzlifaneyassine1-dot/onyx-engineWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ouzlifaneyassine1-dot/onyx-engine/peer-to-peer-multiplayer)<a href="https://agentmods.dev/skills/ouzlifaneyassine1-dot/onyx-engine/peer-to-peer-multiplayer"><img src="https://agentmods.dev/badge/skills/ouzlifaneyassine1-dot/onyx-engine/peer-to-peer-multiplayer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ouzlifaneyassine1-dot/onyx-engine/peer-to-peer-multiplayer"><img src="https://agentmods.dev/badge/skills/ouzlifaneyassine1-dot/onyx-engine/peer-to-peer-multiplayer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00089 | $0.04017 |
| Opus 5 | $0.00044 | $0.02008 |
| Sonnet 5 | $0.00018 | $0.00803 |
| Haiku 4.5 | $0.00009 | $0.00402 |
Grade A, and why
peer-to-peer-multiplayer 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 10d 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.
This is a copy
95% identical to peer-to-peer-multiplayer — 17 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 379 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/peer-to-peer-multiplayer — Build a P2P Game From the Ground Up
Overview
Multiplayer is architecture, not a feature. Bolting it onto a single-player game is 5× harder than starting multiplayer-first. This skill walks the four layers in order. Skip any of them and you'll spend the rest of development paying for it in cheat-vulnerable state, desync bugs, and "why is the other player teleporting" reports.
The four layers, top-down:
- NetworkManager — the autoload that owns peer IDs, connection lifecycle, message routing.
- Authoritative state — the decision matrix for which fields the host owns vs. which the client renders.
- Three routing patterns — host→client, client→host, client→client. Each has different rules.
- Real-time rendering — prediction + interpolation so the local player feels responsive while remote state catches up.
Build them in that order. Don't write a single piece of game logic until layers 1 + 2 exist.
Step 0 — Should it be P2P at all?
Ask the user before anything else:
Are players connecting through Steam friends / Epic friends / a private invite link, or do they need matchmaking at scale (1000s of concurrent matches)?
| Answer | Architecture |
|---|---|
| Friend-invite / small lobby (≤8 players) | P2P with host authority. This skill. |
| Matchmaking + anti-cheat + scale | Dedicated client-server. Different skill (/onyx:client-server-multiplayer). |
| MMO / persistent world | Custom server. Out of scope for this skill. |
If P2P is right, continue. Otherwise, stop and route to the right skill.
Layer 1 — NetworkManager
A single autoload that owns the network. Nothing else in the game touches MultiplayerAPI directly.
May I create autoloads/network_manager.gd and register it as a Godot autoload?
class_name NetworkManager
extends Node
# ── Signals (all game systems listen here, not to MultiplayerAPI directly) ──
signal connection_succeeded
signal connection_failed(reason: String)
signal peer_joined(peer_id: int)
signal peer_left(peer_id: int)
signal session_ended
const DEFAULT_PORT := 7777
const MAX_PEERS := 8
var is_host: bool = false
var local_peer_id: int = 0
var peers: Dictionary = {} # peer_id -> { name, ready, ... }
func host(port: int = DEFAULT_PORT) -> Error:
var peer := ENetMultiplayerPeer.new()
var err := peer.create_server(port, MAX_PEERS)
if err != OK:
connection_failed.emit("create_server failed: %s" % error_string(err))
return err
multiplayer.multiplayer_peer = peer
is_host = true
local_peer_id = 1
_wire_signals()
connection_succeeded.emit()
return OK
func join(address: String, port: int = DEFAULT_PORT) -> Error:
var peer := ENetMultiplayerPeer.new()
var err := peer.create_client(address, port)
if err != OK:
connection_failed.emit("create_client failed: %s" % error_string(err))
return err
multiplayer.multiplayer_peer = peer
is_host = false
_wire_signals()
return OK
func leave() -> void:
if multiplayer.multiplayer_peer:
multiplayer.multiplayer_peer.close()
multiplayer.multiplayer_peer = null
is_host = false
local_peer_id = 0
peers.clear()
session_ended.emit()
func _wire_signals() -> void:
multiplayer.peer_connected.connect(_on_peer_connected)
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
multiplayer.connected_to_server.connect(_on_connected_to_server)
multiplayer.connection_failed.connect(_on_connection_failed)
multiplayer.server_disconnected.connect(_on_server_disconnected)
func _on_peer_connected(id: int) -> void:
peers[id] = { "name": "Player %d" % id, "ready": false }
peer_joined.emit(id)
func _on_peer_disconnected(id: int) -> void:
peers.erase(id)
peer_left.emit(id)
func _on_connected_to_server() -> void:
local_peer_id = multiplayer.get_unique_id()
connection_succeeded.emit()
func _on_connection_failed() -> void:
connection_failed.emit("connection refused or timed out")
func _on_server_disconnected() -> void:
leave()
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.
- 10d ago First seen · 379 lines · 89 tokens per session scan A 595bedbc263b
peer-to-peer-multiplayer is a skill published in the GitHub repository ouzlifaneyassine1-dot/onyx-engine (0 stars, last pushed 2mo ago), licensed MIT. It adds 89 tokens to every session and 4,017 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to peer-to-peer-multiplayer, differing in 17 lines, and is treated as a copy.
Other skills, from other repositories
host-authoritative-state
Use when designing the state layer of a multiplayer Summer game: deciding what the host owns, how clients request changes, and how the host validates and broadcasts. Pairs with /peer-to-peer-multiplayer. Trigger on "host authority", "authoritative state", "state ownership", "MP cheating", "client validation", "RPC…
peer-to-peer-multiplayer
Use when starting a multiplayer Summer game from scratch with peer-to-peer host authority. Build the network architecture top-down so authoritative state, routing rules, and real-time rendering are not bolted on later. Use before writing game logic, not after. Trigger on "multiplayer", "peer-to-peer", "p2p", "co-op"…
setup-multiplayer
Use when the user wants to add multiplayer to an existing Summer game: co-op LAN, co-op online, competitive PvP, or a lobby. Start with Summer Engine's high-level MultiplayerAPI plus MultiplayerSpawner and MultiplayerSynchronizer; use custom networking only with a justified reason. Walks peer authority, RPC patterns…
gameobject-component-destroy
Destroy one or more Components from a target GameObject. Missing (null) components are skipped — they cannot be destroyed. Use 'gameobject-find' and 'gameobject-component-get' to identify the components first.
unity-version-split
Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).
godot-signals-groups
Build event-driven, decoupled Godot 4.7 gameplay with signals and node groups: declare and emit custom signals, connect with Callables (incl. bind/one-shot), and broadcast to many nodes via groups and callgroup. Use when wiring node communication in a Godot project, replacing tight references with signals…