重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
skill-creator by zaggino/z-schema
npx skills add https://github.com/zaggino/z-schema --skill skill-creator创建技能,帮助人们和 AI 代理通过 z-schema 实现目标——一个支持 draft-04 到 draft-2020-12 的 JSON Schema 验证器。
技能位于 skills/<技能名称>/ 目录下,它们教导 Claude 如何可靠地执行 z-schema 任务:验证数据、编写模式、处理错误、使用自定义格式、为代码库做贡献等。
使你的沟通风格与用户的技术水平相匹配。大多数 z-schema 用户是开发者,但技能创建本身对他们来说可能是新事物。在首次引入技能特定概念(如 frontmatter、渐进式披露、触发描述)时,请简要解释。不要假设每个人都知道 YAML frontmatter 是什么——用一句话解释就足够了。
保持对话风格和实用性。除非用户明显熟悉,否则避免使用过多的专业术语。
理解用户希望技能实现什么目标。对话中可能已经包含了需要捕捉的工作流程——如果是这样,在提问之前尽可能从中提取信息。
确定:
询问边界情况、输入多样性和成功标准。探究具体细节:
docs/ 目录中是否有涵盖此领域的现有文档?在重新发明轮子之前先检查。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
skills/ 目录中是否存在重叠的现有技能?查阅它以避免重复并保持一致性。阅读相关的 z-schema 文档,使技能基于准确、最新的信息:
研究现有的 skills/validating-json-schema/SKILL.md 作为语气、结构和详细程度的参考。
完整结构指南、z-schema 约定和示例请参见 references/skill-structure.md。
核心原则:
name 和 description 是必需的。描述是主要的触发机制——使其具体并略带“强制性”,以确保技能在相关时被激活。references/ 文件中。从主 SKILL.md 中清晰地指向它们,并指导何时阅读每个文件。ZSchema.create() 创建验证器”,而不是“你应该创建验证器...”。ZSchema.create()(永远不要用 new ZSchema()),始终使用正确的导入风格,并在重要时指定示例针对的草案版本。src/index.ts 导出、docs/options.md 和 src/errors.ts 进行交叉验证。如果技能需要详细的补充材料,请在 <技能名称>/references/ 下添加文件:
技能名称/
├── SKILL.md # 主要说明(<500 行)
└── references/ # 详细的参考材料
├── topic-a.md # 按需加载
└── topic-b.md # 按需加载
适合作为参考文件的内容:
skills/validating-json-schema/references/options.md)skills/validating-json-schema/references/error-codes.md)对于超过 150 行的参考文件,请包含目录。
对于具有可验证输出的技能,创建 2-3 个真实的测试提示——真实用户会说的话。在运行它们之前,与用户分享以确认。
z-schema 技能的测试提示示例:
$ref 来引用共享地址定义,验证失败并显示无法解析的引用错误”运行测试:
自己执行每个测试提示,按照技能的说明完成任务。验证:
保存测试结果供用户审查。按测试用例组织:
<技能名称>-workspace/
└── iteration-1/
├── test-1/
│ └── output/ # 生成的代码、模式等
├── test-2/
│ └── output/
└── notes.md # 哪些有效,哪些无效
与用户一起审查测试结果后:
oneOf 的嵌套错误”,那么修复不仅仅是添加那个示例——而是确保错误处理部分全面覆盖组合关键字。更改后重新运行测试。重复直到用户满意或反馈全部为正面。
当用户想要改进一个已存在的技能时:
src/ 验证所有代码示例、选项名称、错误代码和类型。description。使其更具体地说明何时激活。包含同义词和相关短语。src/index.ts 导出和 docs/usage.md 进行交叉验证。确保使用了 ZSchema.create(),导入正确,并且草案版本与示例匹配。references/ 文件中。保持 SKILL.md 专注于最常见的工作流程。此仓库的每个技能都应遵循以下约束:
ZSchema.create(options?) — 永远不要用 new ZSchema()。这会根据选项返回类型化的变体(ZSchema、ZSchemaSafe、ZSchemaAsync、ZSchemaAsyncSafe)。draft2020-12。如果重要,在示例中始终明确指定草案。import ZSchema from 'z-schema'(默认)或 import { ZSchema } from 'z-schema'(命名)。对于仅类型导入,使用 import type { ... }。ValidateError 有 .details(不是 .errors)——一个包含 message、code、params、path、keyword、inner 的 SchemaErrorDetail 数组。技能应演示适合用例的模式:
validator.validate(data, schema) — 抛出 ValidateErrorvalidator.validateSafe(data, schema) — 返回 { valid, err? }{ async: true } — 用于异步格式验证器{ async: true, safe: true } — 返回 Promise<{ valid, err? }>如果技能涉及特定草案的功能,请明确说明哪些草案支持它们:
prefixItems — 仅 draft-2020-12(替换数组形式的 items)$dynamicRef/$dynamicAnchor — 仅 draft-2020-12$recursiveRef/$recursiveAnchor — 仅 draft-2019-09unevaluatedProperties/unevaluatedItems — draft-2019-09 和 draft-2020-12if/then/else — draft-07+$id、const、contains — draft-06+针对 z-schema 贡献者(不仅仅是消费者)的技能必须遵循代码库约定:
strict: true 的 TypeScript,src/ 中使用带 .js 导入扩展名的 ESMimport typetest/spec/ 中,后缀为 .spec.ts / .node-spec.ts / .browser-spec.tssrc/index.ts 导出src/errors.ts 中使用 UPPER_SNAKE_CASE完整规则请参见 docs/conventions.md 和 docs/contributing.md。
在编写新的参考材料之前,检查 docs/ 是否已经涵盖:
docs/usage.md — 完整的库 API 指南docs/options.md — 每个选项的描述和默认值docs/features.md — 带代码示例的功能目录docs/architecture.md — 模块结构和验证流水线docs/testing.md — 测试框架和模式docs/contributing.md — PR 工作流程和代码更改指南指向现有文档,而不是复制它们。只有当技能需要不同的角度或信息聚合时才创建技能特定的参考文件。
SKILL.md frontmatter 中的 description 字段决定了技能是否被激活。创建或改进技能后,请审查描述的触发准确性。
好的描述:
示例 — 弱:
description: 如何使用 z-schema 验证 JSON 数据。
示例 — 强:
description: 使用 z-schema 根据 JSON Schema 验证 JSON 数据。当用户需要验证 JSON、定义模式、处理验证错误、使用自定义格式或处理 JSON Schema 草案 04 到 2020-12 时使用。涵盖同步/异步模式、安全错误处理、模式编译、远程引用和 TypeScript 类型。
调整描述:
关于编写 z-schema 技能的完整结构指南、约定和示例:
将这些分解为可跟踪的任务,以免遗漏任何步骤。花时间写好草稿,然后以全新的视角审视并在分享前改进它。
每周安装次数
55
仓库
GitHub Stars
342
首次出现
2026年2月27日
安全审计
安装于
github-copilot55
opencode13
antigravity13
codebuddy13
codex13
kimi-cli13
Create skills that help people and AI agents accomplish goals with z-schema — a JSON Schema validator supporting draft-04 through draft-2020-12.
Skills live in skills/<skill-name>/ and teach Claude how to perform z-schema tasks reliably: validating data, writing schemas, handling errors, using custom formats, contributing to the codebase, and more.
Match your communication style to the user's technical level. Most z-schema users are developers, but skill creation itself may be new to them. Briefly explain skill-specific concepts (frontmatter, progressive disclosure, trigger descriptions) when first introduced. Don't assume everyone knows what YAML frontmatter is — one sentence of explanation is enough.
Keep things conversational and practical. Avoid heavy jargon unless the user is clearly comfortable with it.
Understand what the user wants the skill to accomplish. The conversation may already contain a workflow to capture — if so, extract what you can from it before asking questions.
Determine:
Ask about edge cases, input variety, and success criteria. Probe for specifics:
docs/ that cover this territory? Check before reinventing.skills/ that overlaps? Review it to avoid duplication and maintain consistency.Read the relevant z-schema documentation to ground the skill in accurate, current information:
Study the existing skills/validating-json-schema/SKILL.md as a reference for tone, structure, and level of detail.
See references/skill-structure.md for the full structural guide, z-schema conventions, and examples.
Core principles:
Start with frontmatter — name and description are required. The description is the primary trigger mechanism — make it specific and slightly "pushy" to ensure the skill activates when relevant.
Keep SKILL.md under 500 lines. Move detailed reference material (option tables, error code lists, schema examples) into references/ files. Point to them clearly from the main SKILL.md with guidance on when to read each one.
Use imperative instructions. Write "Create a validator with ZSchema.create()" not "You should create a validator...".
Explain the why. Instead of rigid MUST/NEVER rules, explain reasoning. Today's LLMs respond better to understanding motivation than to heavy-handed directives.
Include working code examples. z-schema skills are most useful when they contain copy-paste-ready TypeScript snippets. Always use ZSchema.create() (never new ZSchema()), always use the correct import style, and specify which draft the example targets if it matters.
If the skill needs detailed supplementary material, add files under <skill-name>/references/:
skill-name/
├── SKILL.md # Main instructions (<500 lines)
└── references/ # Detailed reference material
├── topic-a.md # Loaded on demand
└── topic-b.md # Loaded on demand
Good candidates for reference files:
skills/validating-json-schema/references/options.md)skills/validating-json-schema/references/error-codes.md)Include a table of contents in reference files over 150 lines.
For skills with verifiable outputs, create 2–3 realistic test prompts — things a real user would say. Share them with the user for confirmation before running them.
Test prompt examples for a z-schema skill:
$ref to reference a shared address definition and validation is failing with an unresolvable reference error"Running tests:
Execute each test prompt yourself, following the skill's instructions to complete the task. Verify:
Save test results for the user to review. Organize by test case:
<skill-name>-workspace/
└── iteration-1/
├── test-1/
│ └── output/ # Generated code, schemas, etc.
├── test-2/
│ └── output/
└── notes.md # What worked, what didn't
After reviewing test results with the user:
Generalize from feedback. Don't overfit to test cases. If a user says "the error handling example doesn't show nested errors from oneOf", the fix isn't just adding that one example — it's ensuring the error handling section covers combiner keywords comprehensively.
Keep it lean. Remove instructions that aren't pulling their weight. If test runs show the skill causing unnecessary steps, trim.
Explain the why. If you find yourself writing "ALWAYS do X", reframe: explain why X matters so the model (or human) understands the reasoning.
Look for repeated patterns. If every test case required the same boilerplate setup, the skill should include that setup as a template.
Re-verify accuracy. After changes, re-check API names, option defaults, error codes, and types against the source code.
Rerun tests after changes. Repeat until the user is satisfied or feedback is all positive.
When the user wants to improve a skill that already exists:
src/.description in frontmatter. Make it more specific about when to activate. Include synonyms and related phrases.src/index.ts exports and docs/usage.md. Ensure ZSchema.create() is used, imports are correct, and the draft version matches the example.references/ files. Keep SKILL.md focused on the most common workflows.Every skill for this repository should respect these constraints:
ZSchema.create(options?) — never new ZSchema(). This returns typed variants based on options (ZSchema, ZSchemaSafe, ZSchemaAsync, ZSchemaAsyncSafe).draft2020-12. Always specify the draft explicitly in examples if it matters.import ZSchema from 'z-schema' (default) or import { ZSchema } from 'z-schema' (named). Use import type { ... } for type-only imports.Skills should demonstrate the mode appropriate to the use case:
validator.validate(data, schema) — throws ValidateErrorvalidator.validateSafe(data, schema) — returns { valid, err? }{ async: true } — for async format validators{ async: true, safe: true } — returns Promise<{ valid, err? }>If a skill involves draft-specific features, be explicit about which drafts support them:
prefixItems — draft-2020-12 only (replaces array-form items)$dynamicRef/$dynamicAnchor — draft-2020-12 only$recursiveRef/$recursiveAnchor — draft-2019-09 onlyunevaluatedProperties/unevaluatedItems — draft-2019-09 and draft-2020-12if/then/else — draft-07+Skills targeting z-schema contributors (not just consumers) must follow the codebase conventions:
strict: true, ESM with .js import extensions in src/import type for type-only importstest/spec/ with .spec.ts / .node-spec.ts / .browser-spec.ts suffixessrc/index.tsUPPER_SNAKE_CASE in src/errors.tsSee docs/conventions.md and docs/contributing.md for the full rules.
Before writing new reference material, check if docs/ already covers it:
docs/usage.md — full library API guidedocs/options.md — every option with description and defaultdocs/features.md — feature catalog with code examplesdocs/architecture.md — module structure and validation pipelinedocs/testing.md — test framework and patternsdocs/contributing.md — PR workflow and code change guidesPoint to existing docs rather than duplicating them. Only create skill-specific reference files when the skill needs a different angle or aggregation of information.
The description field in SKILL.md frontmatter determines whether the skill gets activated. After creating or improving a skill, review the description for triggering accuracy.
Good descriptions:
Example — weak:
description: How to validate JSON data with z-schema.
Example — strong:
description: Validates JSON data against JSON Schema using z-schema. Use when the user needs to validate JSON, define schemas, handle validation errors, use custom formats, or work with JSON Schema drafts 04 through 2020-12. Covers sync/async modes, safe error handling, schema compilation, remote references, and TypeScript types.
Tuning the description:
For the full structural guide, conventions, and examples for writing z-schema skills:
Break these into tracked tasks so nothing gets skipped. Take your time writing a good draft, then look at it with fresh eyes and improve it before sharing.
Weekly Installs
55
Repository
GitHub Stars
342
First Seen
Feb 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot55
opencode13
antigravity13
codebuddy13
codex13
kimi-cli13
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
125,600 周安装
React Spring Physics:基于物理的React动画库教程,实现自然UI动画与手势交互
183 周安装
Docker/Kubernetes容器调试指南:解决启动失败、性能瓶颈与网络问题
181 周安装
Three.js与WebGL开发专家 | 3D网页图形、React Three Fiber(R3F)与GLSL着色器开发
180 周安装
Readwise Reader 读者画像构建技能 - 基于阅读历史分析,实现个性化内容推荐与体验优化
186 周安装
SwiftUI专家技能指南:iOS 26+开发、状态管理与性能优化最佳实践
183 周安装
Stitch DESIGN.md 技能:AI设计系统分析与文档生成工具,提升UI一致性
183 周安装
Ground in z-schema reality. Every API call, option name, error code, and type name in the skill must be accurate. Cross-reference against src/index.ts exports, docs/options.md, and src/errors.ts to verify.
ValidateError has .details (not .errors) — an array of SchemaErrorDetail with message, code, params, path, keyword, inner.$id, const, contains — draft-06+