tabooharmony/roblox-brain

roblox-luau-core

Use when writing, editing, or debugging any Luau: tables, control flow, string patterns, scope, closures, and errors ported from JS/Python.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-luau-core

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Luau Core Language

When to Load

Load for Luau semantics and JS/Python translation. Types: roblox-luau-types; lifecycle: roblox-luau-patterns; engine APIs: domain skills.

Quick Reference

  • Only false and nil are falsy. 0, "", and {} are truthy.
  • Equality does not coerce types. 0 == "0" is false. Inequality is ~=.
  • Array conventions are 1-based. #array is meaningful only for a sequence without nil gaps.
  • Assigning nil removes a table key; assigning a table copies the reference; table.clone is 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.
  • Prefer an if expression over condition and a or b when a may be falsy.
  • Locals start at their declaration; repeat locals reach until. Forward-declare mutual recursion.
  • Luau string patterns are not regular expressions. Their syntax and capabilities differ.
  • Backtick interpolation and .. are valid. Join many fragments once in hot loops.
  • NaN does not equal itself and defeats </>; test with x ~= x.
  • Binary data uses the buffer library: fixed size, 0-based offsets, explicit-width reads/writes. Avoid buffer.readinteger/writeinteger (stubs, not released runtime).
  • For Base64, hashing, or compression use EncodingService (buffers, not strings; JSON via HttpService). Details: see full reference.
luau
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 fallback tests truthiness, not only absence. It replaces a valid false value.
  • typeof(value) recognizes Roblox datatypes; type(value) reports the underlying Luau type category.

Review

Valid Luau, no nil gaps, no assumed dictionary order, no accidental aliases, no cross-language syntax, no fallbacks hiding false or nil.

Detailed language traps and translation examples: references/full.md

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills