parse-dont-validate

Transform unstructured data into structured types at system boundaries.

8|1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/caidanw/skills --skill parse-dont-validate-caidanw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: parse-dont-validate
Source: https://github.com/caidanw/skills/tree/main/parse-dont-validate
Command: npx skills add https://github.com/caidanw/skills --skill parse-dont-validate-caidanw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers avoid common pitfalls in input validation and data modeling by promoting a "parse, don't validate" approach, leading to more robust and maintainable code.

Core Features & Use Cases

  • Type Safety: Transforms unstructured data into strongly-typed structures at system boundaries, making illegal states unrepresentable.
  • Refactoring Guidance: Provides principles for improving data types, function signatures, error handling, and domain logic.
  • Use Case: When reviewing code that uses numerous boolean flags for validation or handles loosely typed string data, this Skill can guide the refactoring towards a more type-safe and less error-prone design.

Quick Start

Use the parse-dont-validate skill to refactor a function that currently validates user input with boolean flags into one that uses discriminated unions.

Frequently Asked Questions about parse-dont-validate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does parse don't validate improve TypeScript type safety at system boundaries?

Type safety at system boundaries improves by parsing unstructured data into structured types, making illegal states unrepresentable and shifting error detection to compile time.

What is the best way to refactor functions with multiple boolean flags for input validation?

Refactoring input validation functions involves replacing boolean flags with discriminated unions, ensuring data types correctly represent domain logic and preventing invalid states.

When do I need type-driven design for data modeling in software engineering?

Type-driven design is needed when handling loosely typed string data or modeling domain logic, ensuring robust data integrity and reducing runtime errors through compile-time guarantees.

Can I use parse don't validate to guide code review for error handling and function signatures?

Yes, this approach applies to code review by providing principles to improve function signatures, error handling, and data type design for more maintainable software.

What are the limitations of using type-driven design for input validation in TypeScript?

Type-driven design requires careful upfront data modeling and may not eliminate all runtime errors; it focuses on preventing illegal states through compile-time guarantees rather than dynamic checks.

Does parse don't validate work for refactoring domain logic and data types?

Yes, it provides refactoring guidance for improving domain logic modeling and data types, transforming unstructured inputs into strongly-typed structures to reduce error-prone designs.