Token导航 LogoToken导航TokenDH.com
AI 工具external-servicegithub未标认证来源可访问clear审计提醒

designing-zod-schemas设计 zod 模式

Agent Skill

designing-zod-schemas 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

528

周安装

22

GitHub Stars

28

下载量

176
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:designing-zod-schemas(设计 zod 模式)
来源仓库:https://github.com/saleor/configurator
仓库路径:skills/designing-zod-schemas
安装命令:
npx skills add https://github.com/saleor/configurator --skill designing-zod-schemas
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/saleor/configurator --skill designing-zod-schemas

简介

该技能指导 Zod-first 开发模式,先定义模式再实现业务逻辑。

  • 强调类型推导、验证共享与模式组合,提升代码类型安全性。
  • 适用于输入校验、配置 schema 与测试数据构建场景。
  • 安装前需确认 TypeScript 项目环境,注意 z.infer<> 类型提取规则,建议本地编译验证。
  • designing-zod-schemas 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Zod Schema Designer

Overview

Guide the design and implementation of Zod schemas following the project's Zod-first development approach, where schemas are defined before implementing business logic.

When to Use

  • Creating new data structures
  • Adding validation to inputs
  • Designing configuration schemas
  • Implementing type-safe transformations
  • Creating test data builders

Core Principles

Zod-First Development

  1. Define Schema First: Schema is the source of truth
  2. Infer Types: Use z.infer<> instead of manual type definitions
  3. Share Validation: Same schema for runtime validation and tests
  4. Compose Schemas: Build complex schemas from primitives

Decision Guide

NeedPatternExample
Basic validationPrimitivesz.string().min(1)
Domain safetyBranded typestransform((v) => v as EntitySlug)
Multiple typesDiscriminated unionz.discriminatedUnion('type', [...])
Cross-field rulesRefinement.refine((data) =>...)
Data normalizationTransform.transform((v) => v.trim())
Partial updatesPartial schemaSchema.partial()

Quick Reference

Project Schema Conventions

import { z } from 'zod';

// Slug-based entity (Categories, Products, Channels, etc.)
const SlugSchema = z.string().regex(/^[a-z0-9-]+$/);

// Name-based entity (ProductTypes, Attributes, TaxClasses, etc.)
const NameSchema = z.string().min(1).max(100).trim();

// Branded types for domain safety
const EntitySlugSchema = SlugSchema.transform((v) => v as EntitySlug);

// Standard entity shape
const EntitySchema = z.object({
  name: z.string().min(1),
  slug: z.string().regex(/^[a-z0-9-]+$/),
  description: z.string().optional(),
});

// Always infer types from schemas
type Entity = z.infer<typeof EntitySchema>;

Schema Patterns

For detailed patterns and examples, see:

Project Schema Location

src/modules/config/schema/
├── schema.ts           # Main configuration schema
├── primitives.ts       # Reusable primitive schemas
├── entities/           # Entity-specific schemas
│   ├── category.ts
│   ├── product.ts
│   └── ...
└── index.ts            # Schema exports

Validation Checkpoints

PhaseValidateCommand
Schema definedNo TS errorsnpx tsc --noEmit
Types inferredz.infer worksCheck type in IDE
Validation workssafeParse testspnpm test

Common Mistakes

MistakeIssueFix
Manual type definitionsType driftUse z.infer<typeof Schema>
Using .parse() directlyThrows on invalidUse .safeParse() for error handling
Missing .optional()Runtime errorsMark optional fields explicitly
Complex refinementsHard to debugBreak into smaller schemas
Not using branded typesType confusionUse .brand() or transform for domain safety

External Documentation

For up-to-date Zod patterns, use Context7 MCP:

mcp__context7__get-library-docs with context7CompatibleLibraryID: "/colinhacks/zod"

References

  • {baseDir}/src/modules/config/schema/schema.ts - Main schema definitions
  • {baseDir}/docs/CODE_QUALITY.md#zod-first-development - Quality standards
  • Zod documentation: https://zod.dev

Related Skills

  • Complete entity workflow: See adding-entity-types for full schema-to-service implementation
  • Testing schemas: See analyzing-test-coverage for test data builders
  • GraphQL type mapping: See writing-graphql-operations for schema-to-GraphQL patterns

Quick Reference Rule

For a condensed quick reference, see .claude/rules/config-schema.md (automatically loaded when editing src/modules/config/**/*.ts files).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.89%
按下载量换算49

Antigravity

22.81%
按下载量换算40

Codex

17.98%
按下载量换算32

Gemini CLI

14.09%
按下载量换算25

OpenCode

7.25%
按下载量换算13

Cursor

3.54%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills