Roblox Architecture

TabooHarmony/roblox-brain/skills/core/roblox-architecture

作者 TabooHarmony38826be57ee37bcf023e9c2b85681bea3909281c无许可证收录于 2026年10月9日更新于 2026年10月9日

Use when assigning Roblox feature ownership, code location, dependencies, startup, or client-server boundaries without imposing a framework.

AI 生成的概览

指导 Roblox 项目在归属、代码位置、依赖、启动和客户端-服务器边界方面的架构决策。

功能
该技能为 Roblox 项目提供架构指导,涵盖功能归属、模块放置、依赖形态、启动顺序以及客户端-服务器权限边界。它建议每个行为从单一归属者开始,采用最小依赖形态,并且只有在生命周期、权限、持久化或可测试性边界需要时才拆分代码。它还涉及有界的 WaitForChild 用法、运行时权限执行,以及仅在证据支持时采用面向数据的 ECS 替代方案。它产出的是评审标准和布局指导,而不是代码。
适用场景
适用于分配 Roblox 功能归属、决定代码应放在何处、在直接调用与信号之间做选择、规划启动与清理,或定义客户端-服务器边界时。它也适合审查现有 Roblox 结构中的隐藏启动让出、复制信任决策或缺失清理。
运行要求
无需脚本或运行时依赖。它依赖代理的推理,并可选使用随附的参考文件 references/full.md 获取详细布局、依赖规则和启动示例。

Roblox Architecture

When to Load

Load for ownership, client-server boundaries, startup, or module splits. Do not add a framework without evidence.

Quick Reference

Start from one owner

For each behavior, name:

  • authoritative state and who may mutate it;
  • public operations and callers;
  • Roblox instances, connections, and tasks it owns;
  • persistence or network boundary;
  • startup and teardown conditions.

Group by feature when that keeps one change together. Split server, client, and shared code only where the runtime boundary requires it. Shared code has no secrets or authoritative mutable state.

Use the smallest dependency shape

Direct module calls are the default. Use a signal only when one publisher has genuinely independent observers. Do not add an event bus, dependency container, manager class, or Init/Start ceremony to hide an ordinary dependency.

Keep module top-level work cheap and non-yielding. A small bootstrap owns startup that needs ordering; call it sequentially and fail visibly. Concurrency must be explicit and safe, not automatic task.spawn everywhere.

Bound WaitForChild when a dependency arrives through replication; an unbounded wait turns a missing instance into a silent hang.

Enforce runtime authority

The client presents and predicts; the server validates and decides. Remotes are APIs with types, bounds, ownership, abuse controls, and failure behavior. Route details to roblox-networking and roblox-security.

Split only for evidence

Split when there is a separate lifecycle or authority boundary, a distinct persistence contract, an independently testable pure core, or unrelated reasons to change.

Data-oriented alternative: only on evidence

An ECS earns its cost only when many similar entities update every frame by order-independent logic, or cross-cutting queries replace tangled per-entity scripts; hooks enforce invariants, ordered systems decide. Version-specific pitfalls: full.md "ECS on Roblox".

Review

One canonical owner per mutation, no hidden startup yield or replicated trust decision, explicit cleanup, smallest traceable structure. Tags are discovery, attributes configuration, one owner for attach/remove cleanup.

Detailed layouts, dependency rules, and startup examples: references/full.md [blocked]

来源与署名

来源:TabooHarmony/roblox-brain位于skills/core/roblox-architecture提交38826be

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架