/luau-kb:luau-typesfrom luau-kb
How 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. 트리거: 타입 에러 이해 안 됨, 제네릭 추론.
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.
모든 주장은 references/*.md 의 절에 있다. 절마다 status: verified(스니펫이 luau 0.734/0.742 에서 재현됨) 또는 described(원천 서술만 있음)가 붙어 있다. 스니펫은 플러그인 루트의 snippets/ 에 있고, 결과표는 snippets/RESULTS.md 다.
unknown/에러 타입으로 새면 검사가 조용히 통과한다. 일부러 틀린 줄(음성 대조군)이 잡히는지 확인한다. 방법은 luau-verify 스킬에 있다.luau-analyze 로 돌린다. 원천 기록의 여러 항목이 다시 재 보니 뒤집혔다(예: 싱글턴 보존, type function 안의 pcall·error()·바깥 별칭).any 로 여는 회피는 금지다. 한계를 문서화하고, 사용 관례를 적고, 되돌릴 링크(이슈·RFC)를 남긴다.--!strict 를 단다. .luaurc 한 단어에 기대지 않는다.unknown 으로 새는가(인자 없는 생성자, 테이블 리터럴, 반환에만 나오는 T)? → generics.md §2–3generics.md §4–5unions-singletons.md §4–5read 필드·제네릭 컨테이너가 끼어 있는가? → variance.md §3–5Foo<U> 를 돌려주거나 별칭 선언 순서가 걸리는가? → recursion-and-limits.md §1, §3pcall 이 끼어 있는가? → packs-and-varargs.md §6, §9–10solver-limits.md §2variance.md §7, generics.md §7solver-limits.md §4generics.md §4recursion-and-limits.md §5–6solver-limits.md §4-1variance.md §8type-functions.md §2(strip-nil, 키별 사상, 덮어쓰는 병합, 리터럴 계산 등)type-functions.md §1, 행별 근거는 type-functions-limits.mdsolver-limits.md §3, 그리고 snippets/ 를 새 버전으로 돌린다| 증상 / 질문 | 읽을 곳 |
|---|---|
주석을 달았는데 제네릭 호출이 Box<unknown, unknown> 불일치 | references/generics.md §1 |
{ a = 1 } 을 넘긴 뒤 아무 키·값이나 들어간다 | references/generics.md §2–3 |
f<<T>> 를 언제 쓰나, 일부만 주면 내부 에러 | references/generics.md §3, §10 |
...T 와 T..., select, table.pack/unpack, 팩 명시 인자 <<(T)>> | references/packs-and-varargs.md §1–5 |
받은 ... 를 저장했다 넘기기(defer, 시그널 큐) | references/packs-and-varargs.md §6 |
| 인자를 너무 많이 넘겼는데 에러가 없다 | references/packs-and-varargs.md §10 |
튜플 별칭, 반환 팩 유니온 (boolean, T...) | (false, E) | references/packs-and-varargs.md §7–8 |
M(5)(__call)·pcall(f, …) 경유에서 타입 인자 소실·거부 | references/generics.md §9 |
never 반환 뒤, table.freeze 필드, 콜백 반환 개수, 타입 가드 | references/generics.md §10 |
| 콜백 파라미터 주석이 무시된다(다른 타입이 통과) | references/generics.md §5 |
| 분기마다 다른 return 에서 "Expected 'nil', but got 'number'" | references/generics.md §4 |
제네릭 함수 몸통에서 return v 가 아무 타입이나 통과, 탐침 타입 | references/generics.md §6, §6-1 |
X<number> 를 X<number | string> 에 못 넣는다 / 넣으면 안 되는데 들어간다 | references/variance.md §1–2 |
| 빈 테이블이 표식 타입을 통과한다 | references/variance.md §3 |
제네릭 put(m, k, v) 에 틀린 값이 통과한다 | references/variance.md §4 |
| 파라미터 수가 다른 콜백 | references/variance.md §6 |
T1<number?> 에서 "No valid instantiation" (V 와 V? 필드) | references/variance.md §9 |
문자열 리터럴이 string 으로 넓어진다 / keyof·index 로 이름 인자 타이핑 | references/unions-singletons.md §1–2 |
if o.tag then 안에서 안 좁혀진다 | references/unions-singletons.md §3 |
~= nil, type(x) == "function" 뒤 호출 거부 | references/unions-singletons.md §6 |
| 함수이면서 필드가 있는 값(콜러블 테이블), 함수 자리에 넘기기 | references/unions-singletons.md §7 |
| 분기 대입 뒤 "Cannot call a value of the union type", 루프 안 "could be nil" | references/unions-singletons.md §6 |
유니온 파라미터에서 제네릭이 unknown, [string]: any 교집합 | references/unions-singletons.md §9–10 |
교집합·유니온 컨테이너 for … in 의 루프 변수 타입 | references/unions-singletons.md §11 |
Foo<T> 메소드가 Foo<U> 를 돌려줄 때 결과 검사 소실 | references/recursion-and-limits.md §1 |
| 별칭 순서를 바꾸니 진단이 생기거나 사라진다 | references/recursion-and-limits.md §3 |
| "Recursive type being used with different parameters" | references/recursion-and-limits.md §2, §4 |
too complex, LuauTarjanChildLimit 등 한도 플래그 | references/recursion-and-limits.md §5–6 |
| type function 을 써도 되나, 대안이 있나, 원천 서술 정정 | references/type-functions.md §1–§2, §5 |
type function 의 제약·부작용(print/error/pcall, 프라이밍, too complex, 직렬화 실패, hover) | references/type-functions-limits.md |
| 새 솔버 vs 옛 솔버, 0.734 vs 0.742, luau-lsp 와 판정 차이 | references/solver-limits.md §1–3 |
캐스트가 왜 통과하나, self: any 제네릭 메서드 결과 무검사 | references/solver-limits.md §4 |
for i in ipairs(t) 에 "expects 2 arguments, but 2 are specified" (위양성) | references/solver-limits.md §4-1 |
luau-analyze --fflags(불리언만), Studio 의 무표시 too complex | references/recursion-and-limits.md §5 |
| 업스트림에 보고할 만한 결함인가 | references/solver-limits.md §6 |
.luaurc, --!strict, luau-analyze/luau-lsp 호출법, 음성 대조군 | luau-verify 스킬 |
status 를 함께 말한다. described 인 주장은 "원천 서술, 미재현"이라고 밝힌다.last_confirmed 와 solver-limits.md §1–3).decisions/ 를 안내한다. type function 은 D-04 로 확정됐다(사안별 판단, type-functions.md §0).snippets/ 에 최소 재현과 표식(-- expect-error, -- bug-present)을 먼저 추가한다.references/generics.md (opens in a new tab)references/packs-and-varargs.md (opens in a new tab)references/recursion-and-limits.md (opens in a new tab)references/solver-limits.md (opens in a new tab)references/type-functions-limits.md (opens in a new tab)references/type-functions.md (opens in a new tab)references/unions-singletons.md (opens in a new tab)references/variance.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 안 풀림.Other plugins' skills for the same job