Architecture principle. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, refuse to lie to the compiler, exhaust variants, derive from authoritative schemas.

Applies when designing types, reviewing a function signature, or writing code in any statically-typed language. The one principle with a dedicated language companion: pstack-typescript-best-practices turns each clause into a TypeScript rule and auto-attaches on any .ts or .tsx file.

See Also

  • pstack-poteto-mode — indexes this principle inline and reads the index at task start.
  • pstack — the twenty-three-principle set this belongs to.