Skip to content

typescript-best-practices: schema example uses z.string().uuid(), deprecated in Zod 4 #1165

Open

Description

@christofferbergj

pstack/skills/typescript-best-practices/references/patterns.md (line 142 at ae5650f) shows the recommended schema-first pattern with:

const UserSchema = z.object({
  id: z.string().uuid(),
  ...

Zod 4 moved string formats to top-level functions such as z.uuid(). Its v4 changelog (https://zod.dev/v4/changelog) says: "The method forms (z.string().email()) still exist and work as before, but are now deprecated." Because this example is the skill's model for new code, agents copy the deprecated form into Zod 4 projects.

Possible fix. Use id: z.uuid(), or note that z.string().uuid() is the Zod 3 form.

Activity

  1. WeAreResilience commented on Nov 4, 2026

    @WeAreResilience

    The schema-first example in pstack/skills/typescript-best-practices/references/patterns.md uses z.string().uuid(), which the Zod 4 changelog lists as deprecated in favor of the top-level z.uuid().

    I have a 2-line fix ready that updates the example and regenerates the harness/ copy with scripts/generate-pstack-harness-trees.mjs, and check-pstack-docs passes. Would you like a PR, or would you rather handle it yourself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions