Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Principle Type System Discipline?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jueyi6-principle-type-system-discipline)
---
name: principle-type-system-discipline
description: When designing types or signatures, make illegal states unrepresentable.
disable-model-invocation: true
---
# Type System Discipline
Make the compiler reject impossible states, mismatched primitives, and unhandled variants.
- **Brand semantic primitives.** If two arguments share a primitive type but mean different things, give each its own type. Validate once at creation.
- **External data is untyped until parsed.** JSON, RPC payloads, CLI args, config, environment variables, and database rows go through a parse function at the boundary that returns the typed model.
- **Derive types from authoritative schemas.** When a schema file owns a shape, derive the type from it instead of hand-rolling a parallel one.
For TypeScript syntax, see the **typescript-best-practices** skill.