# Principle Type System Discipline

> Use variants, constructive types, branded primitives, parsed boundaries, schema derivation, and exhaustive matching to make invalid typed states hard to express.

- Skill: `njs14/principle-type-system-discipline` (Agent Skill)
- Install (CLI): `npx skillmds@latest add njs14/principle-type-system-discipline`
- Raw SKILL.md: https://api.skillmd.com/api/skills/njs14/principle-type-system-discipline/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: njs14 (https://skillmd.com/u/njs14)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/njs14/principle-type-system-discipline

---


# Let types carry invariants

Treat the request text that activated this skill as the typed boundary or data model to strengthen.

Apply [type-system discipline](../pkstack-principles/references/catalog.md#type-system-discipline). Identify
invalid combinations, semantically distinct primitives, external untyped input, and variants the
compiler does not exhaust. Redesign only where it makes an operation total or enforces a real
invariant; do not add precision for ceremony. Return the compiler-enforced property and type-check
evidence.

