agentleFS
DobroslavRadosavljevicDobroslavRadosavljevic/cabrakan/.agents/skills/zod/SKILL.md

zod

Skill1 starsChanged 3 months agoMITView on GitHub

Build, review, debug, migrate, or plan Zod v4 validation and TypeScript schema code with current docs. Use for zod, zod/v4, zod/mini, zod/v4/core, parse, safeParse, parseAsync, safeParseAsync, z.infer, z.input, z.output, object schemas, records, enums, unions, refinements, check, transforms, codecs, preprocess, defaults, prefaults, catch, brands, readonly, error customization, error formatting, metadata, registries, JSON Schema, Zod Mini, library-author APIs, and Zod 3 to Zod 4 migrations.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tailwind-css-patterns, typescript-advanced-types and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • midudevSkill

    tailwind-css-patterns

    Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

    Also in 3 projects that use this

  • xfstudioSkill

    typescript-advanced-types

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.

    Also in 5 projects that use this

  • VercelSkill

    ai-sdk

    Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 4 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when work touches Zod validation, schema design, type inference, error handling, JSON Schema output, Zod Mini, Zod Core, or …

    line 8
  2. Very specific:

    Prefer explicit boundary schemas over broad z.any() or unchecked casts.

    line 24
  3. Distinctive:

    Keep parsing and transformation behavior visible at API, form, environment, and storage boundaries.

    line 25
  4. Distinctive:

    Do not introduce canary-only behavior unless the project explicitly uses canary Zod.

    line 26
  5. Distinctive:

    Treat schemas as runtime contracts, not just TypeScript type factories.

    line 30
  6. Very specific:

    Use safeParse for recoverable user/input failures and parse when invalid data is exceptional.

    line 31
  7. Very specific:

    Use parseAsync or safeParseAsync whenever any refinement, transform, or codec path is async.

    line 32
  8. Very specific:

    Prefer top-level Zod 4 string format APIs such as z.email(), z.uuid(), and z.iso.datetime() over deprecated method forms when writing new …

    line 34
  9. Very specific:

    Prefer object spread or .extend() for object composition.

    line 37
  10. Distinctive:

    Use codecs for bidirectional serialization and transforms for one-way parsing.

    line 38
  11. Distinctive:

    Prefer the repo's existing checks.

    line 43

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Zod

Use this skill when work touches Zod validation, schema design, type inference, error handling, JSON Schema output, Zod Mini, Zod Core, or Zod 3 to Zod 4 migration.

Workflow

  1. Inspect the local Zod surface before changing code:
    • Package versions for zod, validation adapters, form libraries, API layers, code generators, and TypeScript.
    • Imports: zod, zod/v4, zod/mini, zod/v4/core, or zod/v3.
    • Schema role: untrusted boundary validation, API contract, form values, environment parsing, persistence, JSON Schema/OpenAPI generation, library integration, or migration.
    • Type flow: where z.input<>, z.output<>, and z.infer<> are consumed, especially around transforms, codecs, coercion, defaults, and preprocessors.
  2. Refresh docs when the user asks for latest/current behavior, the installed version is unclear, or the work touches migration-sensitive APIs. Start from source-map.md.
  3. For installation, imports, parse methods, inference, package variants, and boundary design, use setup-core.md.
  4. For schema primitives, strings, numbers, objects, records, arrays, unions, recursive schemas, functions, brands, and readonly schemas, use schema-api.md.
  5. For refinements, .check(), transforms, pipes, preprocess, codecs, defaults, prefaults, catch values, and errors, use effects-errors.md.
  6. For metadata, registries, JSON Schema conversion, Zod Mini, Zod Core, library-author support, and Zod 4 migration checks, use metadata-jsonschema-migration.md.
  7. Implement in the existing project style:
    • Match local import conventions unless a version boundary requires a different subpath.
    • Prefer explicit boundary schemas over broad z.any() or unchecked casts.
    • Keep parsing and transformation behavior visible at API, form, environment, and storage boundaries.
    • Do not introduce canary-only behavior unless the project explicitly uses canary Zod.

Zod Judgment

  • Treat schemas as runtime contracts, not just TypeScript type factories.
  • Use safeParse for recoverable user/input failures and parse when invalid data is exceptional.
  • Use parseAsync or safeParseAsync whenever any refinement, transform, or codec path is async.
  • Distinguish z.input<> from z.output<> when using coerce, preprocess, transform, pipe, codec, default, prefault, or catch.
  • Prefer top-level Zod 4 string format APIs such as z.email(), z.uuid(), and z.iso.datetime() over deprecated method forms when writing new code.
  • Remember that z.object() strips unknown keys by default; use z.strictObject(), z.looseObject(), or .catchall() deliberately.
  • For enum-keyed records, Zod 4 checks exhaustiveness. Use z.partialRecord() for optional enum-keyed maps.
  • Prefer object spread or .extend() for object composition; use .safeExtend() when extending schemas with refinements.
  • Use codecs for bidirectional serialization and transforms for one-way parsing.
  • For library authors, use zod/v4/core and top-level parse helpers when supporting both Zod and Zod Mini.

Verification

Prefer the repo's existing checks. For meaningful Zod work, include the relevant subset:

  • Typecheck for inferred input/output types, schema composition, brands, and library generic constraints.
  • Focused tests for valid input, invalid input, unknown keys, defaults/prefaults, transforms, async paths, and error paths.
  • Runtime smoke for boundary parsers such as API handlers, env loaders, forms, server actions, CLIs, and persistence adapters.
  • Snapshot or contract tests for JSON Schema/OpenAPI output when schema metadata or conversion behavior changes.
  • Migration checks for deprecated Zod 3 APIs, changed error customization, object defaults, enum records, functions, and removed internals.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.