roblox-luau-types

Installation
SKILL.md

Luau Type System

When to Load

Load for Luau types: annotations, generics, unions, narrowing, sealed/unsealed tables, strictness (--!strict vs --!nonstrict), module type exports, metatable-backed object typing, and new-solver features (keyof, setmetatable<T, M>, type functions, read members). For syntax, use roblox-luau-core; for OOP/async, roblox-luau-patterns.

Quick Reference

Strictness: --!strict for maintained code, --!nonstrict while transitioning, --!nocheck only for legacy or generated code. Directives and project settings select the mode; never assume one global default.

New solver gate: keyof, rawkeyof, setmetatable<T, M>, type functions, and read members need the new type solver. It is on by default for nocheck/nonstrict projects; strict projects need Workspace.UseNewLuauTypeSolver = Enabled (Scripting category). Errors here usually mean the wrong solver, not wrong syntax.

Inference philosophy: Infer first; annotate boundaries (params, returns, exports). Don't annotate every local.

Sealed vs unsealed tables: An empty local t = {} stays open to new fields; annotating or passing it seals it, so later additions error. Build tables fully before annotating.

Unions: local id: string | number is a union; prefer tagged unions (type State<T> = {kind:"loading"} | {kind:"ready", value:T}) and discriminate on kind to narrow.

Narrowing: typeof(v) == "string" narrows primitives, instance:IsA("BasePart") narrows Instances, and assert(v, "msg") narrows away nil. Discriminant fields narrow tagged unions; see full reference for worked examples.

Installs
751
GitHub Stars
56
First Seen
May 28, 2026
roblox-luau-types — tabooharmony/roblox-brain