What problem does it solve? Unstructured TypeScript services often mix validation with business logic and throw unhandled exceptions, making errors unpredictable and testing difficult. This Skill enforces a strict Spec and Handler architecture where inputs are parsed into typed DTOs and errors are returned as values. ## Core Features & Use Cases - Spec and Handler Separation: Define contracts (Zod schemas, error unions, interfaces) in spec.ts and impure implementations in handler.ts. - Result Pattern Error Handling: Handlers never throw; all failures map to a discriminated union of typed error codes with recoverability flags. - Split Testing Strategy: Write data-driven contract tests for schema validation and mocked logic tests for handler behavior. - Use Case: When building a CLI that processes file paths, define a SafePathSchema that rejects traversal attempts, then implement a handler that returns FILE_NOT_FOUND results instead of crashing. ## Quick Start Ask the AI to scaffold a new service using the typed service contracts pattern with a Zod input schema, error union, and a handler that returns Result objects.