bambu-studio-ai
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
Zod v4 best practices, patterns, and API guidance for schema validation, parsing, error handling, and type inference in TypeScript applications. Covers safeParse, object composition, refinements, transforms, codecs, branded types, and v3→v4 migration. Baseline: zod ^4.0.0. Triggers on: zod imports, z.object, z.string, z.infer, safeParse, mentions of "zod", "schema validation", "zod v4", or "z.enum".
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install anivar/zod-skillInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
IMPORTANT: Your training data about zod may be outdated or incorrect — Zod v4 introduces breaking changes to string formats, enums, error handling, and recursive types. Always rely on this skill's rule files and the project's actual source code as the source of truth. Do not fall back on memorized v3 patterns when they conflict with the retrieved reference.
Zod is for runtime type validation — parsing untrusted data at system boundaries (API input, form data, env vars, external services). For compile-time-only types, plain TypeScript is sufficient.
| Need | Recommended Tool |
|---|---|
| API input/output validation | Zod |
| Form validation (React, Vue) | Zod (with react-hook-form, formik, etc.) |
| Env var parsing | Zod (with t3-env or manual) |
| Compile-time types only | Plain TypeScript |
| Smaller bundle (~1kb) | Valibot |
| Maximum type inference | ArkType |
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Parsing & Type Safety | CRITICAL | parse- |
| 2 | Schema Design | CRITICAL | schema- |
| 3 | Refinements & Transforms | HIGH | refine- |
| 4 | Error Handling | HIGH | error- |
| 5 | Performance & Composition | MEDIUM | perf- |
| 6 | v4 Migration | MEDIUM | migrate- |
| 7 | Advanced Patterns | MEDIUM | pattern- |
| 8 | Architecture & Boundaries | CRITICAL/HIGH | arch- |
| 9 | Observability | HIGH/MEDIUM | observe- |
parse-use-safeParse — Use safeParse() for user input instead of parse() which throwsparse-async-required — Must use parseAsync()/safeParseAsync() when schema has async refinementsparse-infer-types — Use z.infer<typeof Schema> for output types; never manually duplicate typesschema-object-unknowns — z.object() strips unknown keys; use strictObject or looseObject
-...These signals come from indexed source analysis and may lag behind changes. Check the current source files.
Created by Anivar Aravind
An AI agent skill for writing, validating, and debugging Zod v4 schemas with modern best practices.
AI agents often generate outdated Zod v3 patterns — z.string().email() instead of z.email(), z.nativeEnum() instead of z.enum(), required_error instead of the error parameter — and miss critical parsing pitfalls like using parse() instead of safeParse(), forgetting parseAsync for async refinements, or assuming z.object() preserves unknown keys. These produce schemas that compile but silently misbehave at runtime.
27 rules with incorrect→correct code examples that teach agents Zod v4's actual API behavior, schema design patterns, error handling, architectural placement, observability, and TypeScript integration. Each rule targets a specific mistake and shows exactly how to fix it.
npx skills add anivar/zod-skill -g
Or with full URL:
npx skills add https://github.com/anivar/zod-skill
| Priority | Category | Rules | Impact |
|---|---|---|---|
| 1 | Parsing & Type Safety | 3 | CRITICAL |
| 2 | Schema Design | 4 | CRITICAL |
| 3 | Refinements & Transforms | 3 | HIGH |
| 4 | Error Handling | 3 | HIGH |
| 5 | Performance & Composition | 3 | MEDIUM |
| 6 | v4 Migration | 3 | MEDIUM |
| 7 | Advanced Patterns | 3 | MEDIUM |
| 8 | Architecture & Boundaries | 3 | CRITICAL/HIGH |
| 9 | Observability | 2 | HIGH/MEDIUM |
Each rule file contains:
| Reference | Covers |
|---|---|
schema-types.md |
All primitives, string formats, numbers, enums, dates, files, JSON |
parsing-and-inference.md |
parse, safeParse, parseAsync, z.infer, z.inpu... |
# Zod **IMPORTANT:** Your training data about `zod` may be outdated or incorrect — Zod v4 introduces breaking changes to string formats, enums, error handling, and recursive types. Always rely on this skill's rule files and the project's actual source code as the source of truth. Do not fall back on memorized v3 patterns when they conflict with the retrieved reference. ## When to Use Zod Zod is for **runtime type validation** — parsing untrusted data at system boundaries (API input, form data, env vars, external services). For compile-time-only types, plain TypeScript is sufficient. | Need | Recommended Tool | |------|-----------------| | API input/output validation | **Zod** | | Form validation (React, Vue) | **Zod** (with react-hook-form, formik, etc.) | | Env var parsing | **Zod** (with t3-env or manual) | | Compile-time types only | Plain TypeScript | | Smaller bundle (~1kb) | Valibot | | Maximum type inference | ArkType | ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Parsing & Type Safety | CRITICAL | `parse-` | | 2 | Schema Design | CRITICAL | `schema-` | | 3 | Refinements & Transforms | HIGH | `refine-` | | 4 | Error Handling | HIGH | `error-` | | 5 | Performance & Composition | MEDIUM | `perf-` | | 6 | v4 Migration | MEDIUM | `migrate-` | | 7 | Advanced Patterns | MEDIUM | `pattern-` | | 8 | Architecture & Boundaries | CRITICAL/HIGH | `arch-` | | 9 | Observability | HIGH/MEDIUM | `observe-` | ## Quick Reference ### 1. Parsing & Type Safety (CRITICAL) - `parse-use-safeParse` — Use `safeParse()` for user input instead of `parse()` which throws - `parse-async-required` — Must use `parseAsync()`/`safeParseAsync()` when schema has async refinements - `parse-infer-types` — Use `z.infer<typeof Schema>` for output types; never manually duplicate types ### 2. Schema Design (CRITICAL) - `schema-object-unknowns` — `z.object()` strips unknown keys; use `strictObject` or `looseObject` -...
# Zod Skill Created by **[Anivar Aravind](https://anivar.net)** An AI agent skill for writing, validating, and debugging Zod v4 schemas with modern best practices. ## The Problem AI agents often generate outdated Zod v3 patterns — `z.string().email()` instead of `z.email()`, `z.nativeEnum()` instead of `z.enum()`, `required_error` instead of the `error` parameter — and miss critical parsing pitfalls like using `parse()` instead of `safeParse()`, forgetting `parseAsync` for async refinements, or assuming `z.object()` preserves unknown keys. These produce schemas that compile but silently misbehave at runtime. ## This Solution 27 rules with incorrect→correct code examples that teach agents Zod v4's actual API behavior, schema design patterns, error handling, architectural placement, observability, and TypeScript integration. Each rule targets a specific mistake and shows exactly how to fix it. ## Install ```bash npx skills add anivar/zod-skill -g ``` Or with full URL: ```bash npx skills add https://github.com/anivar/zod-skill ``` ## Baseline - zod ^4.0.0 - TypeScript ^5.5 ## What's Inside ### 27 Rules Across 9 Categories | Priority | Category | Rules | Impact | |----------|----------|-------|--------| | 1 | Parsing & Type Safety | 3 | CRITICAL | | 2 | Schema Design | 4 | CRITICAL | | 3 | Refinements & Transforms | 3 | HIGH | | 4 | Error Handling | 3 | HIGH | | 5 | Performance & Composition | 3 | MEDIUM | | 6 | v4 Migration | 3 | MEDIUM | | 7 | Advanced Patterns | 3 | MEDIUM | | 8 | Architecture & Boundaries | 3 | CRITICAL/HIGH | | 9 | Observability | 2 | HIGH/MEDIUM | Each rule file contains: - Why it matters - Incorrect code with explanation - Correct code with explanation - Decision tables and additional context ### 9 Deep-Dive References | Reference | Covers | |-----------|--------| | `schema-types.md` | All primitives, string formats, numbers, enums, dates, files, JSON | | `parsing-and-inference.md` | parse, safeParse, parseAsync, z.infer, z.inpu...
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...
OpenClaw Skill for stock data analysis
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...
Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.