luau-core
Skill12 starsChanged 8 months agoMITView on GitHub
Use this skill when the task is primarily about plain Luau language behavior: Do not use this skill when the task is mainly about:
In this repository8 other files it gives its agents.
- luau-performanceSkill
- luau-typesSkill
- roblox-apiSkill
- roblox-cloudSkill
- roblox-coreSkill
- roblox-dataSkill
- roblox-networkingSkill
- roblox-oauthSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 14 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when the task is primarily about plain Luau language behavior:
- Distinctive: line 19
Do not use this skill when the task is mainly about:
- Distinctive: line 27
Use this skill if the answer can stay within pure Luau syntax, semantics, idioms, and standard library usage.
- Very specific: line 28
If the task centers on type aliases, annotations, generics, exported types, or analyzer behavior, hand off to luau-types.
- Very specific: line 29
If the task centers on allocation patterns, hot loops, benchmarking, profiling, or optimization strategy, hand off to luau-performance.
- Very specific: line 30
If the task depends on game, Instance, services, remotes, datastores, UI, physics, or other Roblox runtime concepts, use the appropriate …
- Distinctive: line 31
If a request mixes core language work with out-of-scope topics, answer only the pure Luau portion and explicitly exclude the rest.
- Distinctive: line 32
If unsure, prefer the narrower interpretation and omit material that could overlap another skill.
- Distinctive: line 36
Treat Luau as Lua 5.1 plus selected Luau extensions.
- Very specific: line 37
Prefer local variables and local function declarations by default.
- Very specific: line 38
Keep control flow direct. Prefer normal if, elseif, else, loops, break, and continue over clever boolean tricks.
- Distinctive: line 39
Use Luau-specific syntax when it improves correctness or readability:
- Very specific: line 47
Use : for method definitions and calls that conceptually pass self.
- Distinctive: line 48
Prefer built-in library functions over handwritten helpers when the standard library already expresses the operation clearly.
- Distinctive: line 49
Use metatables sparingly and explicitly.
- Very specific: line 50
When discussing compatibility, call out unsupported assumptions early, such as goto, bitwise operators, integer-only reasoning, or full Lua …
- Distinctive: line 51
Keep all examples host-agnostic and pure Luau.
- Distinctive: line 60
Do not open or cite references outside this skill unless the task clearly crosses into another skill's scope.
- Distinctive: line 71
No deep type-system material is included.
- Distinctive: line 72
No performance-tuning guidance is included.
- Distinctive: line 73
No Roblox engine APIs or architecture advice is included.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
luau-core
When to Use
Use this skill when the task is primarily about plain Luau language behavior:
- Writing or fixing pure Luau syntax.
- Choosing idiomatic control flow, variable scope, or function structure.
- Working with tables as arrays, dictionaries, or object-like values.
- Using the standard library correctly.
- Applying metatables for indexing, operators, iteration, or object-like patterns.
- Checking whether a Lua feature or idiom is compatible with Luau.
Do not use this skill when the task is mainly about:
- Luau type annotations, generics, inference, refinements, or strictness policy.
- Profiling, optimization strategy, or performance tradeoffs.
- Roblox engine APIs, services, events, classes, networking, data, or gameplay architecture.
Decision Rules
- Use this skill if the answer can stay within pure Luau syntax, semantics, idioms, and standard library usage.
- If the task centers on type aliases, annotations, generics, exported types, or analyzer behavior, hand off to
luau-types. - If the task centers on allocation patterns, hot loops, benchmarking, profiling, or optimization strategy, hand off to
luau-performance. - If the task depends on
game,Instance, services, remotes, datastores, UI, physics, or other Roblox runtime concepts, use the appropriateroblox/*skill instead. - If a request mixes core language work with out-of-scope topics, answer only the pure Luau portion and explicitly exclude the rest.
- If unsure, prefer the narrower interpretation and omit material that could overlap another skill.
Instructions
- Treat Luau as Lua 5.1 plus selected Luau extensions. Do not assume Lua 5.2+ features unless Luau explicitly supports them.
- Prefer
localvariables andlocal functiondeclarations by default. Use globals only when the broader scope is required by the task. - Keep control flow direct. Prefer normal
if,elseif,else, loops,break, andcontinueover clever boolean tricks. - Use Luau-specific syntax when it improves correctness or readability:
if ... then ... else ...expressions instead ofa and b or cternary emulation.- Compound assignment such as
+=when the left side should only be evaluated once. - Generalized iteration
for k, v in table dowhen iterating a table directly is the clearest form.
- Model tables intentionally:
- Arrays for ordered numeric sequences.
- Dictionaries for keyed lookup.
- Metatable-backed records only when custom behavior materially improves the API.
- Use
:for method definitions and calls that conceptually passself; use.for plain function access. - Prefer built-in library functions over handwritten helpers when the standard library already expresses the operation clearly.
- Use metatables sparingly and explicitly. Define only the metamethods needed for the abstraction and avoid surprising behavior.
- When discussing compatibility, call out unsupported assumptions early, such as
goto, bitwise operators, integer-only reasoning, or full Lua standard library access. - Keep all examples host-agnostic and pure Luau. Do not rely on Roblox engine objects or services.
Using References
- Open
references/getting-started-and-syntax.mdfor syntax forms, literals, assignments, expression forms, and Luau-only syntax additions. - Open
references/functions-tables-operators-scope-and-control-structures.mdfor the core execution model: functions, closures, tables, truthiness, iteration, and control flow. - Open
references/metatables-and-userdata-concepts.mdfor metamethod behavior, object-like table patterns, raw operations, and userdata boundaries. - Open
references/library-and-grammar-reference.mdfor standard-library selection and compact grammar reminders for statements and expressions. - Open
references/compatibility-notes.mdwhen a request compares Luau with Lua or depends on version-specific behavior. - Do not open or cite references outside this skill unless the task clearly crosses into another skill's scope.
Checklist
- The solution is valid Luau syntax.
- Scope is explicit and defaults to
local. - Control flow is clear and uses the simplest correct construct.
- Table usage is intentional: array, dictionary, or metatable-backed record.
- Iteration choice matches the data shape.
- Standard library usage is correct and simpler than a custom helper.
- Any metatable behavior is minimal, predictable, and documented in code if non-obvious.
- No deep type-system material is included.
- No performance-tuning guidance is included.
- No Roblox engine APIs or architecture advice is included.
Common Mistakes
- Treating
0or""as falsy. In Luau, onlyfalseandnilare falsy. - Using
a and b or cas a ternary replacement whenbcan befalseornil. - Assuming arrays are zero-based instead of one-based.
- Mixing method and function syntax, such as defining with
:and calling with.. - Relying on dictionary iteration order.
- Forgetting that missing function arguments become
niland extra arguments are ignored. - Using globals where locals or closures are the correct fit.
- Overusing metatables for simple data containers.
- Assuming newer Lua features like
goto, bitwise operators, or integer semantics exist in Luau.
Examples
Use if expressions instead of boolean ternary tricks
local function labelScore(score)
return if score >= 100 then "high" else "normal"
endPrefer locals and straightforward control flow
local function firstPositive(values)
for _, value in values do
if value > 0 then
return value
end
end
return nil
endUse tables intentionally
local queue = {}
queue[#queue + 1] = "a"
queue[#queue + 1] = "b"
local first = table.remove(queue, 1)Use method syntax for object-like tables
local Counter = {}
Counter.__index = Counter
function Counter.new()
return setmetatable({ value = 0 }, Counter)
end
function Counter:increment()
self.value += 1
return self.value
endAdd metatables only when behavior is deliberate
local Range = {}
Range.__index = Range
function Range.new(minimum, maximum)
return setmetatable({ minimum = minimum, maximum = maximum }, Range)
end
function Range:contains(value)
return value >= self.minimum and value <= self.maximum
end
function Range:__tostring()
return string.format("[%d, %d]", self.minimum, self.maximum)
endDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

