scenario-roblox-luau
Use when writing, reviewing or debugging Luau in a Roblox experience: task.spawn vs task.defer vs task.wait, replacing wait() or spawn(), Deferred events and…
от scenario-labs★ 4 422 звезды на GitHub
Установить scenario-roblox-luau в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Roblox Luau Engineering
Roblox Studio (October 2026 build) on macOS, driven through the scenario-roblox-expert toolkit.
Expert Luau here means code that stays correct under Deferred events and the task scheduler, type-checks on both solvers, releases everything it creates, and earns each optimization with a number measured on this build. Prove behavior in a playtest data model instead of reasoning from Immediate-era habits.
If a sibling skill named here is missing from your available skills, load it with skill_get
(Scenario MCP) or ask the user to install it (https://github.com/scenario-labs/skills#install);
unattended, proceed from tool schemas and flag the gap.
REQUIRED BACKGROUND: scenario-roblox-expert (channels, review loop, toolkit, current-Roblox traps).
Stance (the expert delta)
task.spawnis not concurrency. It runs the body up to its first yield before the caller continues (Crusherfire). Usetask.deferfor "after this step": a queue that keeps call order.task.wait()andtask.delay(0)resume at the next Heartbeat: the same frame from PreSimulation, the next frame from Heartbeat (Crusherfire; measured 0.07 ms vs 16.4 ms).- Write Deferred-safe code. Handlers run at the next resumption point, never inside
:Fire()or a property set (deferred events docs). Nested fires run in queue order, a listener connected inside a handler misses fires from the same step, andDestroyingorCharacterRemovinghandlers seeParentnil (Crusherfire; all measured). Read state inside the handler, use:Once(), and capture what cleanup needs beforeDestroy. Deferred alone cut one game's frame time from 6 to 8 ms to 4 to 5 ms (Drew Hamilton, RDC 2026). - Yield only where it is legal and cheap. Never yield in
__indexor other metamethods,table.sortcomparators orgsubcallbacks: "attempt to yield across metamethod/C-call boundary". Never yield in per-frame handlers:task.wait(0.25)in Heartbeat stacked 16 threads in 1 s [added, measured].pcallis no fix: a failedtask.waitunderpcallleft its thread registered with the scheduler [added, measured]. - Type for both solvers. New modules start
--!strict. Define methods asfunction Class.name(self: Class, ...): colon methods let field typos through on both solvers [added, tested]. Prefer composition: typed metatable inheritance raises false errors on both. Narrow withIsAorFindFirstChildOfClassinstead of:: any. Gate on the old and the new solver, because strict scripts followWorkspace.UseNewLuauTypeSolver, which scripts cannot read. - Every object owns its cleanup.
Destroyis idempotent and disconnects every connection it made (Roblox Learn, OOP). Tables keyed by player are cleared onPlayerRemoving. Old characters are destroyed: at the Default setting a respawned character was unparented but kept its connections (measured). A leak is memory that never comes down; growth alone is not (Roblox Learn, memory leaks). - Parallel Luau computes; serial code writes. One Actor per independent unit,
requirebefore the parallel phase, writes aftertask.synchronize()(docs; Suphi Kaner; Stewiepfing). Each Actor is its own Luau VM, so module state is not shared. Read-modify-write on a SharedTable goes throughSharedTable.incrementorupdate: a plain+= 1from 8 Actors lost 79% of updates (measured). - Native code and buffers only after measurement.
--!nativewins on typed numeric code: 3.3x on a number loop, 4.9x on a typedVector3loop, nothing when theVector3parameter is untyped (measured; docs say annotate). Native everywhere costs startup and a global memory budget (Roblox Learn, native). Buffers pay past about 50 KB/s sustained (Crusherfire), with range checks because integer writes wrap silently. - The injected chunk is not the game. An
execute_luauchunk on the Server has its own module cache: it sawCounter.n = 0where game Scripts saw 41 [added, measured]. Read game state through attributes or a BindableFunction hook.
Establish first
- Signal mode: Workspace > SignalBehavior. Scripts cannot read it; check the Properties panel,
the Rojo project file, or
rbx_luau.audit(place).Defaultmeans Immediate. A Rojo-built place without the property is Default. - Server Authority:
Workspace.AuthorityMode = Serverforces Deferred and fixed-step simulation; game logic then belongs to scenario-roblox-gameplay. - Type setup:
Workspace.LuauTypeCheckMode,UseNewLuauTypeSolver, and whether a Rojo project gives a sourcemap. - Where code runs: Server, Client, or under an Actor. Native code helps server scripts only.
- Baseline numbers before any optimization: ms per frame of the hot path, KB/s on the wire, heap slope per cycle.
- PlayerCharacterDestroyBehavior (Properties panel; not scriptable).
- Defaults when unknown: Deferred
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/critique.md
- references/expert-notes.md
- references/gui-paths.md
- references/procedures.md
- references/sources.md
- scripts/agentkit/luau/Bench.luau
- scripts/agentkit/luau/BufferCodec.luau
- scripts/agentkit/luau/Leak.luau
- scripts/agentkit/luau/LuauAudit.luau
- scripts/agentkit/luau/Parallel.luau
- scripts/agentkit/luau/Probe.luau
- scripts/agentkit/luau/lune_luau_audit.luau
- scripts/agentkit/luau/templates/Class.luau
- scripts/agentkit/luau/templates/ParallelWorker.server.luau
- scripts/rbx_luau.py
FAQ
Что делает скилл scenario-roblox-luau?
Use when writing, reviewing or debugging Luau in a Roblox experience: task.spawn vs task.defer vs task.wait, replacing wait() or spawn(), Deferred events and SignalBehavior, handlers running in the wrong order or not at all, 'attempt to yield across metamethod/C-call boundary', --!strict and the new type solver, typed classes and metatables, Destroy and cleanup, 'server memory keeps growing' or memory leaks, Parallel Luau with Actors and SharedTable, 'not safe to write in parallel', --!native or 'make this script faster', buffers, coroutines.
Как установить скилл scenario-roblox-luau?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scenario-roblox-luau запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…