Schema
SKILL.md
Schema in Effect
Overview
Effect Schema provides:
- Type-safe validation - Runtime checks with TypeScript inference
- Bidirectional transformation - Decode from external, encode for output
- Composable schemas - Build complex types from primitives
- Error messages - Detailed, customizable validation errors
- Interop - JSON Schema, Pretty Printing, Arbitrary generation
Schema Best Practices
1. Tagged Unions Over Optional Properties
AVOID optional properties. USE tagged unions instead. This makes states explicit and enables exhaustive pattern matching.