Loading...
Loading...
Found 3 Skills
Parse, don't validate - using sealed classes for type-safe validation and state representation. Model valid/invalid states explicitly, validate at boundaries, operate on valid types internally.
Domain modeling principles: parse-don't-validate, make invalid states unrepresentable, primitive obsession detection, semantic types, and domain veto authority. Activate when designing types, reviewing code for domain integrity, or when domain review is needed in a TDD cycle.
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".