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 fcsouza/agent-skills --skill game-backend-architecturegit clone --depth 1 https://github.com/fcsouza/agent-skillsWrote 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/fcsouza/agent-skills/game-backend-architecture)<a href="https://agentmods.dev/skills/fcsouza/agent-skills/game-backend-architecture"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/game-backend-architecture/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/fcsouza/agent-skills/game-backend-architecture"><img src="https://agentmods.dev/badge/skills/fcsouza/agent-skills/game-backend-architecture.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.00100 | $0.03164 |
| Opus 5.5 | $0.00040 | $0.01266 |
| Sonnet 5.5 | $0.00020 | $0.00633 |
| Haiku 4.5 | $0.00010 | $0.00316 |
Grade A, and why
game-backend-architecture 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 19d 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.
How it starts
The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Game backend architecture
The boilerplate targets elysia 1.4.32. Use the elysiajs skill if it is installed, otherwise https://elysiajs.com, and check which Elysia major the project runs: the Elysia 2 beta rewrites the WebSocket API, so the .ws() code here does not carry over unchanged.
Requires
betterauth-integrationfor the Better Auth instance, roles and trusted originsredis-game-patternsfor presence keys and per-action rate limits
Decisions
- The server is the authority. A client sends what it wants to do (
move north), never the result (I am at 100, 200). The server validates the action against its own state, applies it, and tells clients what happened. - Game logic runs on a fixed timestep, separate from network I/O. Every tick sees the same
dt, so the same inputs give the same result. - A room owns its state, its action queue, its player set and its
GameLoop. Rooms share nothing, and one room runs on one server instance. This holds for session games, where a match has a fixed, small player count. It stops holding when one space must carry more players or entities than one process can tick in its budget; see "When one space outgrows a process". - REST for durable, request-response work (create a room, read a profile, buy an item). WebSocket for the match: actions in, state deltas out.
- Authenticate once, on the WebSocket upgrade, from the Better Auth session. The player id comes from that session for the life of the socket, never from a message. Browsers are checked by
Originplus the session cookie. Native clients (game-godot,game-unity) send noOriginand are checked by a bearer session. - Default to 20 ticks per second. One tick then has a 50 ms budget for every room on the instance. Pick another rate per room when the genre needs it.
Wiring the server
- Define the protocol first in
templates/message-types.ts. Every message is a member of a discriminated union ontype. Client messages are one TypeBox schema,clientMessage;ClientMessageis derived from it withStatic, andserver.tsvalidates with it, so malformed messages are rejected before your code sees them and the type cannot drift from the check. - Create the server with
createGameServer(auth, trustedOrigins), passing the Better Auth instance and the game client origins. Put the same origins in Better Auth'strustedOriginsoption. - The upgrade check is the function
authorizeUpgrade, called from.derive()on its own Elysia instance, so it does not run on the mounted auth routes. The route never upgrades on a failure. A directauth.apicall skips Better Auth's own origin checks, which is why the server checksOriginitself.- With an
Originheader (a browser): the origin must be intrustedOrigins, else 403. The session comes from the cookie or a bearer token, asgetSessionreads it. No session is 401. - Without an
Originheader (a native client): the request must carryAuthorization: Bearer <token>, and the session must come from that token alone, else 403. A cookie on such a request does not count. RFC 6455 says only browser clients must sendOrigin(section 4.1), and that the check is not meant to keep non-browsers out (section 10.2). - An
Originthe client sets proves nothing, because only a browser guarantees it. An untrustedOriginis 403 even with a valid token. - The token is read from the
Authorizationheader only, never from the query string: a URL ends up in access logs and proxies. - This needs the
bearer()plugin on the Better Auth instance (betterauth-integration). The token is a session credential: a native client keeps it in the OS secure store (Keychain, Android Keystore), never in a URL, a log line or a crash report.
- With an
- Put per-request values (the player id) in
.derive(), not instore.storeis one object shared by every request. - Write game logic in
RoomManager.tickRoomandprocessAction. The pattern for one action:
What ships with it
7 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.
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.
- 19d ago Changed · -174 lines · +46 tokens per session 07e3cd40b5e8
- 3mo ago First seen · 297 lines · 54 tokens per session scan A 90ee616da2bd
game-backend-architecture is a skill published in the GitHub repository fcsouza/agent-skills (29 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 3,164 once invoked, about $0.0004 per session on Opus 5.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.
game-backend-architecture compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| game-backend-architecturefcsouza/agent-skills | Skill | 29 | today | MIT | A | 100 | Claude Code |
| scenario-godot-multiplayerscenario-labs/skills | Skill | 4.7k | yesterday | MIT | A | 132 | Claude Code |
| league-akari-sgp-data-sourceLeagueAkari/LeagueAkari | Skill | 4.9k | yesterday | MIT | A | 50 | Claude Code, Codex |
| csharp-godotjame581/GodotPrompter | Skill | 1.0k | 2d ago | MIT | A | 34 | Claude Code |
| web-servicesjame581/GodotPrompter | Skill | 1.0k | 2d ago | MIT | A | 64 | Claude Code |
| gamedev-multiplayerericrisco/rsc-harness | Skill | 707 | yesterday | MIT | A | 86 | Claude Code, Codex |
| cloudflare-durable-objectssecondsky/claude-skills | Skill | 257 | 3d ago | MIT | A | 43 | Claude Code |