Parse Dont Validate

Type-driven design principle: transform unstructured data into structured types at system boundaries, making illegal states unrepresentable. Use when writing or reviewing code that validates input, designs data types, defines function signatures, handles errors, or models domain logic. Use when you see validation functions that return void/undefined, redundant null checks, stringly-typed data, boolean flags controlling behavior, or functions that can receive data they shouldn't. Triggers on: "parse don't validate", "type-driven design", "make illegal states unrepresentable", "input validation", "data modeling", "refactor types", "strengthen types", "smart constructor", "newtype", "branded type".

caidanw 7ebda48 7.5 KB Updated

File contents

caidanw/skills/tree/main/parse-dont-validate commit 7ebda48e2e

Frequently asked questions

npx skillmds@latest add caidanw/parse-dont-validate