skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
tabooharmony/roblox-brain203 installs

roblox-luau

Use when writing, fixing or reviewing Luau: task scheduling, coroutines, connections and leaks, metatables, buffers, types and strict mode.

How do I install this agent skill?

npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-luau
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides technical guidance and best practices for Roblox Luau programming, including task scheduling, type checking, and performance optimization. It includes references to official Roblox and Luau documentation.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 1 issue

What does this agent skill do?

Roblox Luau

Scope

Luau where scheduling, cleanup, metatables, buffers or the type checker can bite. Run contexts, load order and require scope: roblox-architecture; hot paths: roblox-performance; luau-lsp/Selene/StyLua: roblox-tooling; bug hunts: roblox-debugging.

"Probed" = run on the Luau runtime or luau-analyze that date; "field case" = seen in the owner's projects.

Traps and review checklist (symptom -> cause -> fix)

  • Error in background code vanishes -> coroutine.resume catches it and returns false, err; an errored thread's status is "dead", same as a finished one. coroutine.wrap re-raises into the caller. Check resume's first return, or start work with task.spawn.
  • Queued worker handles one job per run, budget never trips -> task.spawn runs the function now, before the caller's next line; task.defer runs at the end of the current resumption cycle. Start batch workers with task.defer (field case, §1).
  • Loop slower than asked, or local a, b = wait() -> deprecated wait/spawn/delay throttle (29 ms minimum, more under load); wait returns (elapsed, engineTime). task.wait(t) resumes on the first due Heartbeat and returns elapsed only; task.wait() = Heartbeat:Wait(). Use the returned dt, not the requested time.
  • Duplicate handlers or growing memory after respawn -> a CharacterAdded handler connects to something long-lived (RunService, Players, a remote, the Player) and never disconnects. Destroy() disconnects only that instance's connections, and old characters are destroyed only with Workspace.PlayerCharacterDestroyBehavior enabled. Track connections per owner, disconnect on CharacterRemoving/Destroying; :Once() for one-shots.
  • Grid lookup returns nil, no error -> Vector3 keys hash by value, Vector2 keys by identity (field-measured). Key 2D cells by Vector3.new(x, 0, z).
  • table is already frozen kills a module at require -> re-freezing errors; table.freeze/table.clone are shallow and the clone is unfrozen. Freeze once at creation or check table.isfrozen.
  • Proxy table misbehaves -> __newindex fires only for keys absent from raw storage; pairs, table.insert, table.concat read raw storage, there is no __pairs (generalized for uses __iter); __eq runs only when both sides share one handler, and even for x == x (probed 2026-10). Keep the proxy empty, data in a backing table.
  • Buffer data silently wrong -> out-of-bounds errors, but an in-bounds wrong-width read succeeds (readu16 on a u32 slot), integer writes keep the low bits (writeu8(b, 0, 300) stores 44), f32 rounds (probed 2026-10). Little-endian, 0-based. Keep offsets and widths in named helpers.
  • Decompression bomb from a client -> EncodingService:DecompressBuffer trusts the size header (up to 1 GB). Call GetDecompressedBufferSize first; refuse nil or oversize.
  • --!native gives no client speedup -> it runs only for server scripts and Android clients; getfenv/setfenv and arguments violating annotated types drop to the interpreter; past the code-size limit the rest runs interpreted. Annotate hot Vector3 params; no official speedup figure, measure (roblox-performance).

Type checker traps

  • Type error "suddenly" in unchanged code -> the solver switched: Workspace.UseNewLuauTypeSolver is a RolloutState and Default follows the engine rollout (LuauTypeCheckMode is strictness, not solver). Repro under both solvers.
  • New-solver syntax flagged unknown -> keyof, setmetatable<T, M> as a type, type function, read/write properties need the new solver. Don't delete them to appease an old-solver tool, and don't add them to an old-solver project (there: typeof(setmetatable({} :: Data, Class))).
  • Narrowed field wrong after a call -> refinements on t.field are fragile and differ per solver. Copy to a local, narrow that.

Limits

ItemValue
Legacy wait/spawn/delay29 ms minimum
StringValue.Value200,000 chars (String too long)

What changed

ChangeUse now
tick() (untagged; off up to 1 s, varies by time zone/OS)os.clock(), os.time()/DateTime, workspace:GetServerTimeNow()
const (Luau 0.711) <!-- temporal: 2026-03 -->freezes the binding, not the table; older linters reject it
buffer.readvectorf32x3/writevectorf32x3, readvectorf32x2/writevectorf32x2 <!-- temporal: 2026-11 -->Vector3 as f32; x2 reads Z as 0
coroutine.finally(co, cb) <!-- temporal: 2026-10 -->cleanup on "finished"/"error"/"cancelled"; errors on a dead or wrap coroutine
EncodingService <!-- temporal: 2026-08 -->Base64Encode, CompressBuffer (Zstd), ComputeStringHash (not for passwords) on buffers

1. Frame-sliced work (field-measured)

  • Start a budgeted queue with task.defer; check the budget inside each step, not between big steps (worst frame 310 -> 57 ms).
  • A system pinned at its budget with 0 completions is a stuck loop: count completions, add a no-progress guard.
  • task.delay(0, ...) from a paced start-up lands on top of the next system; push it clearly past start-up.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/tabooharmony/roblox-brain/roblox-luau">View roblox-luau on skillZs</a>