json-schema-manual
它能做什么
这个工具可以为数据创建一份“契约”(即 JSON Schema),确保数据格式正确,比如符合已经定义好的字段列表,而且不会擅自添加规则。
适用场景
- ✓当你需要定义某个系统的数据应该是什么样子时。
- ✓当你需要验证进入系统的数据是否正确时。
- ✓当你要为即将导入的文件编写说明文档时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/json-schema-manual/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“根据我们已经确定的客户字段列表,帮我创建一份数据契约。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具会以你已确认的字段列表为基础,生成一份验证模式(schema)。它会沿用已经设定好的规则(比如哪些字段是必填的),不会添加新的规则。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
JSON Schema Manual
What it is: a draft 2020-12 schema over a field list someone already confirmed - validating structure, never inventing business rules.
Overview
Produces JSON Schema from a confirmed canonical field list, for validation, API contracts, import and export structures, form generation, and schema documentation.
JSON Schema validates structure. It does not compute, decide or imply. This is a helper: it defines no table of its own and renders whatever field list the active module already confirmed, so the property names here are the names that module uses in its CSV, SQL, spreadsheet and Notion mapping.
Layer: n/a. Fits: every stage. Table code: n/a - it renders the active module's table.
When to Use This Skill
- I need a JSON Schema
- validate this payload before it goes in
- make an API contract for this table
- document the shape of this import file
- generate a form from this schema
- turn the agreed fields into a schema
Also use it when a module has confirmed a field list and the user wants the contract for the system that will read it, rather than the table itself.
Do not use it to add validation the business has not asked for. A schema is a promise about what a payload may contain, and every restriction in it rejects real data.
How It Works
Follow the shared execution contract. The module-specific rules below define only domain fields, decisions, calculations, and safety constraints.
Step 1 - Identify intent
Read the request and pick the intent before asking anything.
- "I need a schema" -> a strict or permissive schema, per Step 5.
- "something rejected my payload" -> review or fix: only the rule that caused it.
- "which fields are required" -> advice: answer from the confirmed field list, and offer the schema rather than emitting one.
Build only what was requested. A fix does not become a rewrite, and advice does not become a file.
Step 2 - Ask only what is missing
Reuse everything already confirmed, including by the module that owns the field list: the property names and types, the select options, the date and currency fields, the calculated fields, the statuses and the IDs. Never ask again for information the user has already supplied.
Ask one short question per message, and only when the answer changes the schema:
Q: Should the schema reject unknown fields, or allow them?
Nothing else is worth a question. Requiredness, options and formats come from the confirmed field list, not from a new round of asking.
Step 3 - Hold the internal context
Hold the answers in this shape. It stays internal - it is not shown to the user unless they ask, and it never carries a value the user did not give.
module: json-schema-manual
intent: null # set in Step 1, one of: schema, review, fix, advice
source_module: null # the module whose field list this renders
draft: "https://json-schema.org/draft/2020-12/schema"
additional_properties: null # false | true - asked once, then held
example_instances: false
confirmed_facts: [] # only what the user actually said
open_questions: [] # the unanswered ones, in the order worth asking
source_module is the one field this skill needs that a module skill does not have. If it
is unknown, ask which table the contract is for, because a schema built from a guess
rejects the real data.
Step 4 - Recommend the smallest workflow
Build an already requested artifact without asking again. For advice-only requests, give a short recommendation and offer the relevant artifact.
Recommended approach: one object schema, one property per confirmed field, no
required entry the field list does not mark as required, and no enum the field list
does not define. Strictness only where the contract is closed.
Why this one: a schema's damage is asymmetric. A property it omits passes data nobody
reviewed; a property it marks required, or an enum it invents, rejects data that was
perfectly valid. Confirm the closed rules and stay silent on the rest.
Workflow: Field list confirmed -> Properties typed -> Requiredness applied from the source -> (validated) -> Published as the contract
Step 5 - Build only on request
Once the user asks, emit the schema as data only. Keep prose outside machine-readable data; provide file links and material limitations separately. Property names come from the confirmed field list, identical to the CSV, SQL,
…
常见问题
什么是 JSON Schema?
它是一种描述 JSON 数据结构和预期数据类型的格式,就像 JSON 数据的蓝图或模板。
为什么要使用“数据契约”?
为了确保交换数据的系统之间能够相互理解,并保证数据的正确性,从而避免出错。
这个工具会自己编造验证规则吗?
不会。它只会使用事先已经确认并定义好的规则,包括字段、数据类型和是否必填。
详情
作者的原始描述
JSON Schema Manual: draft 2020-12 validation schema from a confirmed field list, with required and enum values only where confirmed. Use for an API or import contract.
热度
- GitHub 星标
- 48k
- 排名
- #4998
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。