What problem does it solve?
Type mismatches between microservices can lead to silent failures and unpredictable behavior. This Skill provides a robust framework for managing shared types and enforcing runtime validation, ensuring data integrity and preventing errors across your entire system.
Core Features & Use Cases
- Runtime Validation with Zod: Automatically validate data at service boundaries, infer TypeScript types, and generate clear, actionable error messages.
- Type Guards for Runtime Narrowing: Safely narrow TypeScript types at runtime, especially useful for handling dynamic data structures like Discord.js events.
- DTOs (Data Transfer Objects): Define explicit data shapes for cross-service communication, ensuring consistency in BullMQ job payloads and HTTP API requests/responses.
- Centralized Type Management: Organize and share all types, schemas, and constants from a single
common-types package, reducing duplication and improving maintainability.
Quick Start
Use the tzurot-shared-types skill to define a new Zod schema for user input, ensuring all required fields are present and correctly typed before processing.