/luau-kb:luau-testingfrom luau-kb
Writing and running Luau tests: luau CLI runner (exit codes, assert, pcall), -O1 vs -O2, golden files, mocks, time-dependent logic (debounce, timers, virtual clock) and GC. Use when writing specs or a runner, or a test fails only under -O2. Check results are luau-verify. 트리거: 테스트 러너 짜기, -O2 에서만 깨짐, 디바운스·타이머 시험.
Ships in luau-kb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
이 스킬은 "Luau 코드가 실행해서 맞는지 어떻게 시험하나"를 다룬다. 사실의 근거는 플러그인 루트의 snippets/test-*.luau(그리고 최적화 수준 쪽 opt-*, native-*)이고, 하네스는 tools/check_snippets.py 다. 절마다 status: verified(스니펫이 luau 0.734/0.742 에서 재현) 또는 described(원천 서술만)가 붙어 있다.
luau CLI 다(결정 D-03). Roblox 에 기대는 부분만 필요한 만큼 mock 으로 바꾸고, Studio 는 mock 이 맞는지 확인할 때만 쓴다.luau 와 luau -O2 로 두 번 돈다. -O1 테스트로는 인라인 때문에 생기는 실패가 영원히 안 보인다.debug.info(1, "l") + 1 로 잰다(헬퍼로 빼지 않는다).timeout·ulimit -v 안에서 한다.references/runners.md §1–3. 프레임워크를 고르려면 §6(Jest Roblox 만 활성, TestEZ·jest-lua 는 새로 쓰지 않음)references/assertions.md §1–2references/roblox-boundary.md §1–3 으로 경계를 긋고, mock 이 틀리기 쉬운 곳은 §4references/assertions.md §3–4 (사용자 줄 단언)references/gc-and-time.md-O2·Studio·--!native 에서만 깨진다 → references/optimize-levels.md §2–4references/negative-controls.md §1–3references/negative-controls.md §4–5, references/assertions.md §6references/repo-practices.md| 증상 / 질문 | 읽을 곳 |
|---|---|
luau CLI 의 종료 코드, -a 인자, arg 없음, require 반환 개수, --coverage | references/runners.md §2 |
테스트 엔트리를 init.luau 로 지었더니 require 가 엉뚱한 곳을 본다 | references/runners.md §3 |
io·fs 없이 픽스처·골든 파일 비교 | references/runners.md §4 |
| lute test, lune, Jest Roblox, jest-lua, TestEZ, run-in-roblox, Open Cloud 실행 | references/runners.md §5–7 |
pcall 에러 값에 파일:줄: 이 붙는지, error(tbl)·assert(nil, tbl) | references/assertions.md §2 |
에러 위치 단언이 -O2 에서 -1 이나 위치 없음 | references/assertions.md §3, references/optimize-levels.md §2 |
| blame 단언이 파일 이름만 본다 | references/assertions.md §4 |
eq<T>(a, b) 헬퍼가 타입이 달라도 에러가 없다 / pcall 의 err 가 any | references/assertions.md §5 |
| 경계 케이스, 데이터 고르기, 정확값 단언 | references/assertions.md §6 |
-O1 은 통과, -O2 는 실패 / traceback 의 함수 이름이 사라짐 | references/optimize-levels.md §1–2 |
--!optimize, --!native, @native 가 CLI -O 를 이기는가 | references/optimize-levels.md §3 |
getfenv 로 mock 을 주입한 스펙이 -O2 를 재현하나 | references/optimize-levels.md §4 |
| 러너가 케이스를 정말 돌렸나, 등록 누락, 돌연변이 검사 | references/negative-controls.md §1–3 |
| 차등 시험, 퍼즈, 퍼저 검증, 축소, 시드 | references/negative-controls.md §4–5 |
CLI 에 Vector3·Enum·task 가 없다 / 모듈 로드에서 죽는다 | references/roblox-boundary.md §3 |
| mock 과 엔진 결과가 다르다(같은 값 발화, 리스너 에러, Connect) | references/roblox-boundary.md §4 |
| Deferred 시그널을 CLI 에서 흉내 내기 | references/roblox-boundary.md §5 |
가짜 Instance 로 typeof(x) == "Instance" 분기를 못 탄다 | references/roblox-boundary.md §6 |
weak 표 정리·누수 검증, KB 가 흔들림, collectgarbage 가 Unknown global | references/gc-and-time.md §1–2 |
디바운스·스로틀·타이머 시험, task.wait 지터 | references/gc-and-time.md §3 |
Roblox 에서 collectgarbage("collect") 가 거부됨 | references/gc-and-time.md §4 |
| quad, stl-luau, table-sim, devplorer, tbox, moonwave, rbvm 의 테스트 방식 | references/repo-practices.md |
| mock 작성·주입 패턴, Studio MCP 로 확인하는 절차 | luau-roblox 스킬 references/mocks.md, references/studio-mcp.md |
| 타입 진단을 테스트로 고정(expect-error, bug-present) | luau-verify 스킬 references/snippet-markers.md |
| 최적화 수준·인라인 규칙·native 성능 자체 | luau-perf 스킬 |
status 를 함께 말한다. described 는 "원천 서술, 미재현"이라고 밝힌다.-O2 에서만").snippets/test-*.luau 에 최소 재현과 하네스 머리(--@run, --@run-opt=0,2, --@run-with … => ok|fail; out~…)를 먼저 넣고 python3 -I tools/check_snippets.py --luau 0.734,0.742 snippets/test-*.luau 로 돌린다.references/assertions.md (opens in a new tab)references/gc-and-time.md (opens in a new tab)references/negative-controls.md (opens in a new tab)references/optimize-levels.md (opens in a new tab)references/repo-practices.md (opens in a new tab)references/roblox-boundary.md (opens in a new tab)references/runners.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub qwreey/qwreey-harness --plugin luau-kb12 skills in this plugin
/luau-perfMeasured Luau performance: benchmark method, metatable, table, closure and string costs, -O2 and --!native effects, GC pressure. Use when Luau code is slow, optimization is asked, or a benchmark is written or read. Engine API cost is roblox-engine. 트리거: 코드가 느려, 최적화해 줘, 벤치마크./luau-robloxRoblox typing and test setup: luau-lsp definition files and sourcemap, typing GetService, Instance.new, FindFirstChild and IsA, luau CLI mocks vs Studio, Studio MCP. Use when Roblox API types fail or deciding mock vs Studio. Engine behavior is roblox-engine/net/world. 트리거: mock 으로 충분해?, Studio MCP, 정의 파일 설정./luau-runtimeLuau semantics without the Roblox engine: weak tables and GC leaks, swallowed coroutine errors, require-by-string in the luau CLI (init.luau, @self, aliases). Use when weak entries persist, a coroutine error vanishes, or require cannot resolve. In-engine behavior is roblox-engine. 트리거: weak table 안 사라짐, 코루틴 에러 삼킴, require 안 풀림./luau-styleLuau style and idioms with rationale: naming, modules and file splitting, error handling, comments, stylua, and traps the checker misses (table.insert, nil varargs, patterns). Use when writing or reviewing .luau files. Type defects are luau-types; require is luau-runtime. 트리거: 네이밍 기준, 파일 분리, 스타일 리뷰./luau-typesHow the Luau type system behaves and breaks: generic inference and f<<T>>, narrowing, recursive aliases, "Code is too complex to typecheck", type functions, false positives, old vs new solver. Use when a .luau type error is confusing or correct code is rejected. Tools are luau-verify; Roblox API types are luau-roblox. 트리거: 타입 에러 이해 안 됨, 제네릭 추론./luau-upstreamLuau ecosystem changes (releases, RFCs, luau-lsp, StyLua, rojo): whether a type limitation is fixed upstream, whether new syntax is safe, and the version-bump procedure. Use when bumping a tool, diagnostics change after an update, or asking if an RFC is usable. 트리거: 버전 올려도 돼?, 업스트림에서 고쳐져?, RFC.Other plugins' skills for the same job