json-schema

Write and review JSON Schema documents per the 2020-12 specification.

Updated Sep 9, 2026
One-click install
npx skills add https://github.com/DeepSpaceCartel/skills --skill json-schema-deepspacecartel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: json-schema
Source: https://github.com/DeepSpaceCartel/skills/tree/main/skills/json-schema
Command: npx skills add https://github.com/DeepSpaceCartel/skills --skill json-schema-deepspacecartel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing JSON Schemas that actually validate what you intend is error-prone: drafts changed keyword semantics (items, exclusiveMinimum, $ref siblings), format doesn't assert by default, and typos in keywords are silently ignored. This Skill provides accurate, spec-grounded guidance for authoring, reviewing, and debugging JSON Schema 2020-12 documents. ## Core Features & Use Cases - Schema authoring guidance: Covers boolean schemas, core identifiers ($id, $anchor, $ref, $dynamicRef, $defs), validation keywords for every JSON type, applicators (allOf/anyOf/oneOf/not, if/then/else), and annotations. - Reference documentation: Three in-depth references on validation keywords, identifiers and references, and vocabularies/annotations including unevaluatedProperties and format assertion behavior. - Gotcha detection: Flags common mistakes like draft-07-style tuple items, boolean exclusiveMinimum, unanchored patterns, and relying on format for validation. - Use Case: When defining a schema for an API request body, ask the agent to write a 2020-12 schema with required fields, closed properties via unevaluatedProperties, and correct $ref usage for shared subschemas. ## Quick Start Ask the agent to write a JSON Schema 2020-12 document that validates your JSON config file or API payload, including required fields and closed object semantics.

Frequently Asked Questions about json-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a JSON Schema to validate API request bodies?▼

Declare $schema as the 2020-12 dialect, set type to object, define properties with per-field constraints, list required property names as an array on the object schema, and use additionalProperties or unevaluatedProperties false to close the object.

What is the difference between $ref and $dynamicRef in JSON Schema?▼

$ref always resolves to one fixed schema chosen at authoring time, while $dynamicRef resolves through the dynamic evaluation scope so an extending schema can override the target via a matching $dynamicAnchor. Use plain $ref for ordinary recursion and $dynamicRef only for extensible base schemas.

Does JSON Schema format keyword validate emails and dates?▼

No, format is annotation-only by default under the Format-Annotation vocabulary. It only asserts when the dialect uses the Format-Assertion vocabulary or the validator is explicitly configured to enforce formats, so check your implementation before relying on it.

Why does my JSON Schema validate everything unexpectedly?▼

Unknown or misspelled keywords are silently ignored, so a typo like require instead of required produces a schema that constrains nothing. Validate the schema itself against the 2020-12 meta-schema to catch such errors.

How do I define tuple validation in JSON Schema 2020-12?▼

Use prefixItems with an array of schemas for per-index validation, and items with a single schema for elements beyond the tuple. The draft-07 style of passing an array to items and using additionalItems is not valid in 2020-12.

When should I use unevaluatedProperties instead of additionalProperties?▼

Use unevaluatedProperties false when composing schemas with allOf or $ref, because it sees properties evaluated across all applicators. additionalProperties false only sees the local properties and patternProperties, so it rejects properties claimed by sibling branches.