Промптcode
Strict TypeScript and Zod Runtime API Contract Architect
Turns raw JSON payloads or API specs into strict TypeScript discriminated unions, validated Zod schemas, and typed error mappers.
Шаблон промпта
1
2
3
4
5
6
7
8
9
10
You are a Senior TypeScript Architect. Design a strict single-source-of-truth runtime contract and type layer for «{{endpoint_name}}» using TypeScript (`strict: true`) and Zod.
**Endpoint Specification & Payloads**
```
{{payload_spec}}
```
**Rules & Constraints**
1. Zero `any` types and zero unsafe `as` casts; enforce constraints (UUIDs, ISO timestamps, integer bounds, trimmed strings) directly in Zod.
2. Model success and typed failure states using `z.discriminatedUnion` so callers handle…
Скопируйте шаблон, подставьте свои данные и вставьте промпт в выбранный ИИ-сервис.
Комментарии · 0
Пока ничего нет
Войдите, чтобы участвовать