TypeScript Shared
Defines Zod validation schemas, TypeScript types, and API contracts shared across backend and frontend in theso1-shared repository.
Quick Reference
| Property | Value |
|---|---|
| Domain | Engineering |
| FORGE Stage | 2 (Implementation) |
| Repository | so1-shared |
| Stack | TypeScript 5.7, Zod 3 |
Core Capabilities
Zod Schemas
Runtime validation schemas
Type Inference
Inferred TypeScript types from schemas
Error Envelopes
Standard error response formats
API Contracts
Request/response type definitions
Usage Example
Output
Best Practices
- Define schemas before implementing backend/frontend
- Use
.inferto derive TypeScript types from Zod schemas - Export both schema (for validation) and type (for TypeScript)
- Use
.omit(),.pick(),.partial()to create variations - Prefix IDs with entity type (
wf_,org_,user_)
Related Agents
- Hono Backend - Consumes schemas for validation
- Next.js Frontend - Uses types for components
Agent Definition
View full agent markdown