Zod

From Aniket-a14/SRA · View interactive version

Zod is an AI agent skill from the GitHub repository Aniket-a14/SRA. Zod schema validation best practices for type safety, parsing, and error handling. This skill should be used when defining z.object schemas, using z.string validations, safeParse, or z.infer. This skill does NOT cover React Hook Form integration patterns (use react-hook-form skill) or OpenAPI client

How to use this skill

Skill file

Zod Best Practices

Comprehensive schema validation guide for Zod in TypeScript applications. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

|----------|----------|--------|--------|

| 1 | Schema Definition | CRITICAL | schema- |

| 2 | Parsing & Validation | CRITICAL | parse- |

| 3 | Type Inference | HIGH | type- |

| 4 | Error Handling | HIGH | error- |

| 5 | Object Schemas | MEDIUM-HIGH | object- |

| 6 | Schema Composition | MEDIUM | compose- |

| 7 | Refinements & Transforms | MEDIUM | refine- |

| 8 | Performance & Bundle | LOW-MEDIUM | perf- |

Quick Reference

1. Schema Definition (CRITICAL)

2. Parsing & Validation (CRITICAL)

3. Type Inference (HIGH)

4. Error Handling (HIGH)

5. Object Schemas (MEDIUM-HIGH)

6. Schema Composition (MEDIUM)

7. Refinements & Transforms (MEDIUM)

8. Performance & Bundle (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Related Skills

Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.