Agent skill
json-schema
Generate and validate JSON Schema definitions. Use when asked to create schemas, validate JSON structure, or document API payloads.
Install this agent skill to your Project
npx add-skill https://github.com/beshkenadze/claude-skills-marketplace/tree/main/skills/document/json-schema
SKILL.md
JSON Schema Generator
Overview
Creates JSON Schema definitions for data validation and API documentation.
Instructions
When generating JSON Schema:
- Analyze the data structure or requirements
- Determine types for each field (string, number, object, array, etc.)
- Add constraints: required fields, patterns, min/max values
- Include descriptions for documentation
- Set appropriate
$schemaversion (draft-07 recommended)
Schema Components
Basic Types
string- Text valuesnumber/integer- Numeric valuesboolean- True/falseobject- Nested structuresarray- Lists of itemsnull- Null values
Common Constraints
required- Mandatory fieldsminLength/maxLength- String lengthminimum/maximum- Number boundspattern- Regex validationenum- Allowed valuesformat- Semantic formats (email, uri, date-time)
Examples
Example: User Schema
Input: "Create a schema for a user with name, email, age, and optional phone"
Output:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "User",
"type": "object",
"required": ["name", "email", "age"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "User's full name"
},
"email": {
"type": "string",
"format": "email",
"description": "User's email address"
},
"age": {
"type": "integer",
"minimum": 0,
"maximum": 150,
"description": "User's age in years"
},
"phone": {
"type": "string",
"pattern": "^\\+?[1-9]\\d{1,14}$",
"description": "Optional phone number in E.164 format"
}
},
"additionalProperties": false
}
Guidelines
Do
- Always include
$schemadeclaration - Add descriptions for all properties
- Use
additionalProperties: falsefor strict validation - Prefer specific formats over loose patterns
- Use
requiredarray for mandatory fields
Don't
- Use overly permissive types (avoid
{}ortrue) - Skip validation constraints on user input
- Mix draft versions in same schema
- Forget to handle nullable fields explicitly
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
skill-with-scripts
A template for skills that include executable code for deterministic operations.
your-skill-name
Brief description of what this Skill does and when to use it. This field is critical for Claude to discover when to invoke your skill.
jis-accessibility
Use when auditing websites for Japanese accessibility compliance, checking JIS X 8341-3 conformance, or advising on Japan's Act for Eliminating Discrimination against Persons with Disabilities.
meeting-notes
Structure meeting transcripts into organized notes with action items, decisions, and key points. Use when processing meeting recordings or creating meeting summaries.
global-accessibility
Use when determining which accessibility law applies to an organization, comparing requirements across jurisdictions (US, EU, Canada, Japan), or planning multi-country accessibility compliance strategy.
aoda-compliance
Use when auditing websites or apps for Canadian accessibility law compliance, checking AODA (Ontario) or Accessible Canada Act (federal) requirements, or advising on CAN/ASC-EN 301 549 obligations.
Didn't find tool you were looking for?