principle-type-system-discipline
Apply when designing typed Luau state or function contracts. Model variants explicitly, narrow boundary data, avoid dishonest casts, and derive shared shapes from one authority.
- License 许可
- MIT
- 最近更新
- 2026-09-04
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- principle-type-system-discipline
- description
- Apply when designing typed Luau state or function contracts. Model variants explicitly, narrow boundary data, avoid dishonest casts, and derive shared shapes from one authority.
02 资源文件 1
- 参考文档agents/openai.yaml238 B
03 SKILL.md 正文
Typed Luau discipline
Use Luau types to expose domain choices and catch shape drift. Do not pretend Luau can prove runtime Instance classes, attributes, remote payloads, or persisted data without validation.
- Model mutually exclusive states as tagged table variants instead of a table full of optional fields and booleans.
- Give semantic identifiers and records distinct exported types when mixing them would cause a real bug.
- Treat remote payloads, DataStore values, attributes, configuration, and decoded JSON as unknown until the boundary validates and narrows them.
- Prefer narrow function signatures and total returns. Use explicit result variants when failure is part of the contract.
- Avoid
any, broad casts, and assertion helpers that merely silence the checker. Validate, narrow, or improve the model. - Handle every tagged variant. Add an explicit impossible-state failure so new variants do not disappear silently.
- Derive shared client/server types from the same definition module. Do not maintain parallel handwritten payload shapes.
- Strengthen a type where partial behavior appears. Stop when extra precision adds ceremony without preventing a failure.
The proof is a smaller set of representable bad states plus boundary checks for facts Luau cannot know.
04 同仓库更多 Skills
why
Recover why a Roblox design or implementation exists from project decisions, source history, current code, and authored context.
unslop
Cut AI tells from any writing. Must always apply.
technical-writing
Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for $technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.
teach
Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'.
tdd
Use for explicit TDD or when Roblox logic has a cheap deterministic Luau regression target that can fail before the fix.
swarm
Coordinate independent routine execution or exploration batches and return one reviewed report. Use for $swarm or large separable work that justifies parallel overhead.