Skip to content
Back to skills

Principle Type System Discipline

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 19, 2026
ai-agents

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add HungryKelvin123/dstack --skill principle-type-system-discipline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Type System Discipline?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Type System Discipline
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hungrykelvin123-principle-type-system-discipline/badge)](https://www.skillsdirectory.com/skills/hungrykelvin123-principle-type-system-discipline)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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."
---

# 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.

Files in this skill

  • SKILL.md1.5 KB
  • agents/openai.yaml238 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.