Zod 4 模式验证库的综合指南。从 Zod 3 迁移、学习 Zod 4 习惯用法或构建新的验证模式时应该使用此技能。涵盖重大变更、新功能和迁移模式。
SKILL.md
Zod 4 is a major release with significant performance improvements, reduced TypeScript compilation times, and a cleaner API. This skill covers migration from v3 and idiomatic Zod 4 usage.
| Record schemas | z.record(z.string()) | z.record(z.string(), z.string()) | | Strict objects | .strict() | z.strictObject({...}) | | Passthrough | .passthrough() | z.looseObject({...}) | | Error formatting | err.format() | z.treeifyError(err) | | Coerce input type | string | unknown |
In Zod 4, .default() short-circuits if input is undefined and returns the default directly (without parsing). Use .prefault() for the old behavior:
Zod 4 模式验证库的综合指南。从 Zod 3 迁移、学习 Zod 4 习惯用法或构建新的验证模式时应该使用此技能。涵盖重大变更、新功能和迁移模式。 来源:kastalien-research/thoughtbox-dot-claude。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/kastalien-research/thoughtbox-dot-claude --skill zod4- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-01
- 更新时间
- 2026-02-18
快速解答
什么是 zod4?
Zod 4 模式验证库的综合指南。从 Zod 3 迁移、学习 Zod 4 习惯用法或构建新的验证模式时应该使用此技能。涵盖重大变更、新功能和迁移模式。 来源:kastalien-research/thoughtbox-dot-claude。
如何安装 zod4?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/kastalien-research/thoughtbox-dot-claude --skill zod4 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/kastalien-research/thoughtbox-dot-claude
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-01