/roblox-dev:roblox-performancefrom roblox-dev
Diagnoses Roblox performance issues: connection leaks, per-frame allocation, network traffic, and instance budgets. Use when fixing lag, memory growth, or RunService loops.
Ships in roblox-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Most "Roblox lag" is one of four things: leaked event connections, per-frame garbage, unbatched network traffic, or too many instances doing too little. Find which one before optimizing anything.
Every :Connect() holds its closure (and everything the closure captures)
alive until disconnected. Destroying an Instance disconnects its own signals
— but not connections you made on other objects on its behalf, and not
threads you spawned.
--!strict
-- LEAK: fires forever after the mob dies; captures `mob` forever
RunService.Heartbeat:Connect(function()
updateHealthbar(mob)
end)
Pattern: every object that makes connections owns a cleanup list, executed exactly once on destruction:
--!strict
type Cleanup = () -> ()
local function makeMaid()
local tasks: { Cleanup } = {}
return {
add = function(c: RBXScriptConnection | Cleanup | Instance)
table.insert(tasks, function()
if typeof(c) == "RBXScriptConnection" then c:Disconnect()
elseif typeof(c) == "Instance" then c:Destroy()
else c() end
end)
end,
clean = function()
for _, t in tasks do t() end
table.clear(tasks)
end,
}
end
(Or adopt a library: Trove / Janitor / Maid. The point is the discipline, not the implementation.)
Checklist for every system:
Players.PlayerRemoving clears everything keyed by that Player (tables
keyed by Player instances leak the whole Player otherwise).CharacterRemoving / respawn.Instance.Destroying (or your maid) tears down per-instance loops.GetDebugId() strings) and guarantee removal on Destroying, or use weak
tables knowingly.PreRender / Heartbeat)PreRender (the documented replacement for RenderStepped, which is now
marked superseded) blocks the frame: only camera/input-critical work belongs
there. Other per-frame updates go in Heartbeat.dt and early-return.task.wait() in a tight loop as a scheduler; drive off Heartbeat with
accumulated time.Debris:AddItem or task.delay(n, function() part:Destroy() end) for
temporary objects — and cap concurrent VFX instances; pooled reuse beats
create/destroy churn for frequent effects (bullets, damage numbers).Modern default; assume it's on:
WaitForChild (with timeout + nil handling) or react to streaming
signals, never workspace.Map.Chest directly.ModelStreamingMode on models players interact with
(Persistent for critical, Atomic to stream as a unit).Player:RequestStreamAroundAsync before
the teleport so geometry is present on arrival.debug.profilebegin("MobAI") ... debug.profileend() so they're visible.PlaceMemory categories; steady
growth in LuaHeap while idle = leaked closures/tables; growth in
Instances = undestroyed objects.| Pattern | Problem |
|---|---|
:Connect inside PlayerAdded/CharacterAdded without matching cleanup | Leak per respawn/rejoin. |
while true do task.wait() end polling for a condition | Event exists for almost everything; poll at low Hz only as a last resort. |
FindFirstChild chains every frame | Cache references outside the loop; they don't change per frame. |
Server-side TweenService on world objects | Replicates continuously; tween on clients. |
Remote fired inside PreRender/RenderStepped/mouse-move | Batch to ≤10 Hz. |
Tables keyed by Player or Instance with no removal path | Leaks the instance and everything under it. |
Per-frame Instance.new for effects | Pool them. |
#part:GetChildren() > 0 style calls in loops | GetChildren() allocates a fresh table each call. |
When you (Claude) write frame loops, mob spawners, VFX, or anything that connects to events, include the cleanup path in the same edit — cleanup added "later" is a leak shipped now.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
roblox, luau, memory-leaks, connection-leaks, profiling, runservice
npx claudepluginhub ivar-anon/roblox-dev --plugin roblox-dev10 skills in this plugin
/luau-strict-typingLuau strict mode typing patterns — annotations, narrowing Instance? results, forward declarations, typed remotes, generics, and fixing common --!strict type errors. Use when writing Luau code, enabling --!strict, or resolving Luau type-checker warnings in Roblox projects./new-systemGenerate a complete, secure client/server gameplay system for Roblox — shared types, validated server module, client controller, and remote registration in one pass. Use when adding a feature like a shop, inventory, combat ability, quest, or any system that spans client and server./reviewRun a structured security, data-safety, performance and typing review of Roblox/Luau code using the roblox-reviewer agent. Use when asked to review Roblox code, audit a game for exploits or leaks, or before shipping a system./roblox-architectureRoblox project architecture — ModuleScript patterns over _G, client/server/shared layout, bootstrapping, CollectionService managers, remote organization, and Rojo-friendly structure. Use when starting a Roblox project, adding a new system, restructuring spaghetti scripts, or deciding where code should live./roblox-datastoresSafe player data persistence in Roblox — DataStore retry/backoff, session locking, autosaves, BindToClose, schema versioning and migration. Use when writing or reviewing any code that touches DataStoreService, player profiles, saving/loading, or data loss bugs./roblox-securityServer-authoritative security patterns for Roblox games — validating RemoteEvents/RemoteFunctions, preventing exploits, rate limiting, and never trusting the client. Use when writing or reviewing any code that touches RemoteEvents, RemoteFunctions, player input, currency, damage, inventory, or purchases.Other plugins' skills for the same job