roblox-luau-core
Use for Luau language semantics, tables, control flow, string patterns, scope, closures, and cross-language translation errors.
Install
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-luau-coreSKILL.md
Luau Core Language
When to Load
Load for pure Luau syntax and semantics: truthiness, tables, iteration, functions, scope, operators, string patterns, and ports from JavaScript or Python. Use roblox-luau-types for type annotations, roblox-luau-patterns for ownership and lifecycle, and domain skills for Roblox APIs.
Quick Reference
- Only
falseandnilare falsy.0,"", and{}are truthy. - Equality does not coerce types.
0 == "0"is false. Inequality is~=. - Array conventions are 1-based.
#arrayis meaningful only for a sequence without nil gaps. - Assigning
nilremoves a table key. Assigning a table copies the reference.table.cloneis shallow. - Dictionary iteration order is unspecified. Do not make behavior depend on it.
- Dynamic keys require brackets:
record[field]. Dot syntax uses a literal identifier. - Missing arguments become
nil; extra results and arguments can be discarded by context. - Prefer an
ifexpression overcondition and a or bwhenamay befalseornil. - Local names are scoped from their declaration onward. Forward-declare mutually recursive functions.
- Luau string patterns are not regular expressions. Their syntax and capabilities differ.
- Backtick interpolation and
..concatenation are both valid. Choose the clearer form; collect many fragments and join once in a hot loop. - NaN does not equal itself and defeats
</>comparisons; test withx ~= x. - Binary data uses the
bufferlibrary: fixed size, 0-based offsets, explicit-width reads/writes. Avoidbuffer.readinteger/writeinteger(stubs only, not released runtime). - For Base64, hashing, or compression use
EncodingService(buffers, not strings; JSON still viaHttpService). Details: see full reference.
local label = if enabled then "On" else "Off"
local message = `{name}: {score}`
local byId: {[number]: string} = {}
byId[userId] = name
for index, value in values do
print(index, value)
end
Translation traps
- JavaScript
===,!==,null, optional chaining, spread, arrow functions, and array methods are not Luau syntax. - Python
None, zero-based list assumptions, list comprehensions, exceptions, and implicit tuple behavior do not translate directly. x or fallbacktests truthiness, not only absence. It replaces a validfalsevalue.typeof(value)recognizes Roblox datatypes;type(value)reports the underlying Luau type category.
Review
Valid Luau, no nil gaps in sequences, no assumed dictionary order, no accidental aliases, no cross-language syntax, no boolean expressions hiding false or nil.
Detailed language traps and translation examples: references/full.md
Related skills
typescript-advanced-typeswshobson81KMaster TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.golang-code-stylesamber43KGolang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).golang-error-handlingsamber42KIdiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; fgolang-design-patternssamber41KIdiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, panic vs error decisions, resource management and lifecycle, graceful shutdown, timeouts and retries, streaming and iterators, and architecture styles (clean, hexagonal, DDD, flat). Apply when choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go
