agentleFS
blushneybusiness-glitchblushneybusiness-glitch/roblox-omniskills/skills/rbx-architecture/SKILL.md

rbx-architecture

Skill0 starsChanged 3 months agoMITView on GitHub

The map of where code lives and who owns truth — container law, the client/server split, and the seven foundational patterns that keep a game navigable at 50+ scripts. Use when the user asks "where should this script go", "client or server?", "how do I structure my game", or when a place has gone spaghetti — Scripts loose in Workspace, logic duplicated on both sides, nothing findable. Do not use for picking a framework — load rbx-frameworks — or for syncing individual values — load rbx-state-replication instead.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every new game skeleton, every "where does this go" question, every feature that crosses the client/server line, and every rbx-comprehend …

    line 21
  2. Very specific:

    Two-phase startup: Every module gets init() (wire references, no cross-module calls yet) then start() (begin behavior).

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

rbx-architecture

When to load

Every new game skeleton, every "where does this go" question, every feature that crosses the client/server line, and every rbx-comprehend pass over an unfamiliar place. rbx-frameworks sits on top of this foundation; this file is true no matter which framework wins.

Container law

ContainerHoldsRule
ServerScriptServiceServer Scripts + server modulesGame logic defaults here; clients cannot see inside
ServerStorageServer-only assets and modulesMaps, NPC templates, data schemas — never downloaded by clients
ReplicatedStorageRemotes folder, shared modules/assetsExploiters read everything here — constants, types, utils only
ReplicatedFirstLoading screenKeep minimal; its contents delay everything behind them
StarterGuiUI templatesCloned into PlayerGui per spawn; set ResetOnSpawn = false on persistent screens
StarterPlayerScriptsClient controllersCloned once at join, survives respawn
StarterCharacterScriptsPer-life behaviorCloned each spawn, destroyed at death — reset-on-death logic belongs here
WorkspaceThe 3D worldNo loose Scripts; server code stays out (see Sharp edges)

RunContext bends container rules: a Script with RunContext = Client runs on every client from anywhere (workspace-local spinners, ambient FX); RunContext = Server runs server-side from any container; the default Legacy lets the container decide. LocalScript has no RunContext — client containers only, always.

The client/server split

  • The server owns every gameplay-relevant value: currency, health, inventory, cooldowns, odds. Clients render, predict, and request.
  • A client may ask ("use ability 2 on target X"); the server computes the result. A damage or price number arriving over a remote is already an exploit — payload rules in rbx-net-remotes.
  • Client-made world changes stay local unless the server handed that instance's physics to the client via network ownership. "Only I can see it" is the replication model working.
  • PlayerGui, Backpack, and PlayerScripts are per-player clones — editing the StarterGui template at runtime does nothing for players already spawned.

The seven foundational patterns

  1. Thin bootstrapper. One Main Script server-side, one client-side; each requires and boots modules and stays under ~20 lines. All logic lives in ModuleScripts.
  2. Two-phase startup. Every module gets init() (wire references, no cross-module calls yet) then start() (begin behavior). Startup-order bugs die here.
  3. Centralized remotes. One server script builds every RemoteEvent/RemoteFunction into ReplicatedStorage/Remotes before any client can fire — never scattered Instance.new across feature scripts.
  4. One shared Constants + Types pair. Both sides compile against the same numbers and shapes from ReplicatedStorage; no magic values duplicated per script.
  5. Server owns state; clients mirror it. Mechanics of the mirror: rbx-state-replication.
  6. Configure, then parent. Set every property first, .Parent last. Instance.new("Part", workspace) replicates a half-built part and yields mid-construction.
  7. Events over polling. .Died, GetPropertyChangedSignal, CollectionService tags — never a while true do task.wait(0.1) scan doing an event's job.

Sharp edges

  • CRITICAL — Server rule logic in ReplicatedStorage: exploiters decompile it and reverse your validation and drop odds. Fix: anything with rules, odds, or secrets moves to ServerScriptService/ServerStorage; ReplicatedStorage keeps only what both sides genuinely share.
  • CRITICAL — Server applies client-sent numbers (damage, price, quantity). Fix: the server recomputes from its own state; treat the client's number as a hint at best.
  • HIGH — Scripts buried inside Workspace models: exploiter-visible if not server-run, invisible to audits either way. Fix: one script in ServerScriptService, CollectionService tag to find its model.
  • HIGH — RemoteFunction:InvokeClient() from the server: a client that errors or leaves hangs the server thread forever. Fix: one-way RemoteEvent, or client-initiated invoke.
  • MEDIUM — God script: 500+ lines doing data, combat, and UI. Fix: split along rbx-module-design boundaries; the entry Script goes back to being a bootstrapper.

Load with

rbx-frameworks (which pattern scales past this foundation), rbx-module-design (boundaries inside the skeleton), rbx-state-replication (the sync mechanics), rbx-net-remotes (the remote layer), rbx-comprehend before touching any existing game.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.