/engineering-paved-path:zodfrom engineering-paved-path
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 or OpenAPI client generation.
Ships in engineering-paved-path. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
Reference these guidelines when:
| 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- |
schema-use-primitives-correctly - Use correct primitive schemas for each typeschema-use-unknown-not-any - Use z.unknown() instead of z.any() for type safetyschema-avoid-optional-abuse - Avoid overusing optional fieldsschema-string-validations - Apply string validations at schema definitionschema-use-enums - Use enums for fixed string valuesschema-coercion-for-form-data - Use coercion for form and query dataparse-use-safeparse - Use safeParse() for user inputparse-async-for-async-refinements - Use parseAsync for async refinementsparse-handle-all-issues - Handle all validation issues not just firstparse-validate-early - Validate at system boundariesparse-avoid-double-validation - Avoid validating same data twiceparse-never-trust-json - Never trust JSON.parse outputtype-use-z-infer - Use z.infer instead of manual typestype-input-vs-output - Distinguish z.input from z.infer for transformstype-export-schemas-and-types - Export both schemas and inferred typestype-branded-types - Use branded types for domain safetytype-enable-strict-mode - Enable TypeScript strict modeerror-custom-messages - Provide custom error messageserror-use-flatten - Use flatten() for form error displayerror-path-for-nested - Use issue.path for nested error locationerror-i18n - Implement internationalized error messageserror-avoid-throwing-in-refine - Return false instead of throwing in refineobject-strict-vs-strip - Choose strict() vs strip() for unknown keysobject-partial-for-updates - Use partial() for update schemasobject-pick-omit - Use pick() and omit() for schema variantsobject-extend-for-composition - Use extend() for adding fieldsobject-optional-vs-nullable - Distinguish optional() from nullable()object-discriminated-unions - Use discriminated unions for type narrowingcompose-shared-schemas - Extract shared schemas into reusable modulescompose-intersection - Use intersection() for type combinationscompose-lazy-recursive - Use z.lazy() for recursive schemascompose-preprocess - Use preprocess() for data normalizationcompose-pipe - Use pipe() for multi-stage validationrefine-vs-superrefine - Choose refine() vs superRefine() correctlyrefine-transform-coerce - Distinguish transform() from refine() and coerce()refine-add-path - Add path to refinement errorsrefine-defaults - Use default() for optional fields with defaultsrefine-catch - Use catch() for fault-tolerant parsingperf-cache-schemas - Cache schema instancesperf-zod-mini - Use Zod Mini for bundle-sensitive applicationsperf-avoid-dynamic-creation - Avoid dynamic schema creation in hot pathsperf-lazy-loading - Lazy load large schemasperf-arrays - Optimize large array validationRead individual reference files for detailed explanations and code examples:
references/{prefix}-{slug}.mdFor the complete guide with all rules expanded: AGENTS.md
AGENTS.md (opens in a new tab)README.md (opens in a new tab)assets/templates/_template.md (opens in a new tab)references/_sections.md (opens in a new tab)references/compose-intersection.md (opens in a new tab)references/compose-lazy-recursive.md (opens in a new tab)references/compose-pipe.md (opens in a new tab)references/compose-preprocess.md (opens in a new tab)references/compose-shared-schemas.md (opens in a new tab)references/error-avoid-throwing-in-refine.md (opens in a new tab)references/error-custom-messages.md (opens in a new tab)references/error-i18n.md (opens in a new tab)references/error-path-for-nested.md (opens in a new tab)references/error-use-flatten.md (opens in a new tab)references/object-discriminated-unions.md (opens in a new tab)references/object-extend-for-composition.md (opens in a new tab)references/object-optional-vs-nullable.md (opens in a new tab)references/object-partial-for-updates.md (opens in a new tab)references/object-pick-omit.md (opens in a new tab)references/object-strict-vs-strip.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/frontend-architectureFolder structure and code organization for React + Next.js (App Router) projects. Use this skill whenever the user asks where files should live (components, hooks, utils, helpers, lib, services, constants, types), how to break a component into smaller pieces, how to organize a feature folder, where to put business logic, when to use a barrel index, or how to lay out app/ in Next.js (route groups, private folders). Trigger on phrases like 'folder structure', 'project structure', 'where should I put', 'how to organize', 'where do constants go', 'utils vs helpers', 'app router structure'. Covers organization decisions only — NOT React hook rules or render patterns (use engineering-paved-path:react-best-practices) and NOT Next-specific runtime behavior (use engineering-paved-path:next-best-practices)./mermaid-diagramCreate Mermaid diagrams in markdown. Use when the user wants to visualize workflows, architectures, API flows, data models, state machines, or system designs. Covers flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, and more./nestjs-best-practicesNestJS application patterns for TypeScript backends — modules and providers, dependency injection and injection tokens, the composition root, thin controllers, guards/interceptors/pipes/filters and their execution order, validation at the edge, ConfigModule and typed configuration, lifecycle hooks, exception filters, and testing with Test.createTestingModule. Use when building, wiring, reviewing or debugging a NestJS application: adding a module or a provider, resolving 'Nest can't resolve dependencies of X', choosing an injection scope, registering a global guard, shaping an error response, writing a testing module, or upgrading a NestJS major. Trigger terms: NestJS, Nest, @nestjs/common, @nestjs/core, app.module.ts, @Module, @Injectable, @Controller, provider, injection token, forwardRef, ValidationPipe, exception filter, APP_GUARD, Test.createTestingModule, nest build, nest start. NestJS runtime and wiring ONLY — NOT which layer a file belongs to (use engineering-paved-path:onion-architecture), NOT TypeORM query, migration or entity mechanics (use engineering-paved-path:typeorm-patterns), NOT PostgreSQL schema design (use engineering-paved-path:postgresql-table-design), NOT Zod schema mechanics (use engineering-paved-path:zod)./next-best-practicesNext.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling/onion-architectureLayering and dependency-rule conventions for TypeScript backends, with an optional pure-engine package. Use whenever editing or adding backend code; whenever adding a new module / use case / repository / adapter / outbound port / shared contract; whenever the question is *where should this live* on the backend (HTTP edge vs service vs repository vs adapter vs platform vs shared); whenever reviewing a backend PR for layer violations (ORM in a service, SDK import in a controller, `process.env` in a pure engine package, services importing other modules' services, SDK imports leaking past the adapter boundary). Trigger phrases: 'new endpoint', 'new module', 'where should this go', 'add a repository', 'add an adapter', 'wire up a port', 'consume X from a service', 'the engine needs to read', 'service is doing too much'. Layering and dependency placement ONLY — NOT NestJS runtime and wiring mechanics (use engineering-paved-path:nestjs-best-practices), NOT TypeORM query and migration mechanics (use engineering-paved-path:typeorm-patterns), NOT Zod schema mechanics (use engineering-paved-path:zod). For the client side use engineering-paved-path:frontend-architecture./postgresql-table-designUse this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced featuresnpx claudepluginhub yamchinsky/dev-digest-ai-marketplace --plugin engineering-paved-pathOther plugins' skills for the same job