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 從公開儲存庫中收錄這些內容。

檢舉或申請下架