json-schema-design

Design and validate JSON Schemas for API contracts, configuration files, and data exchange formats. Covers schema composition, conditional validation, and code generation from schemas. Triggers on JSON Schema creation, data validation, or API contract design requests.

Best use case

json-schema-design is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Design and validate JSON Schemas for API contracts, configuration files, and data exchange formats. Covers schema composition, conditional validation, and code generation from schemas. Triggers on JSON Schema creation, data validation, or API contract design requests.

Teams using json-schema-design should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/json-schema-design/SKILL.md --create-dirs "https://raw.githubusercontent.com/organvm-iv-taxis/a-i--skills/main/distributions/claude/skills/json-schema-design/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/json-schema-design/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How json-schema-design Compares

Feature / Agentjson-schema-designStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Design and validate JSON Schemas for API contracts, configuration files, and data exchange formats. Covers schema composition, conditional validation, and code generation from schemas. Triggers on JSON Schema creation, data validation, or API contract design requests.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# JSON Schema Design

Define precise data contracts with JSON Schema for validation, documentation, and code generation.

## Schema Fundamentals

### Basic Types

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://organvm.dev/schemas/repo.json",
  "title": "Repository",
  "description": "An ORGANVM repository entry",
  "type": "object",
  "required": ["name", "organ", "tier", "status"],
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$",
      "minLength": 2,
      "maxLength": 64
    },
    "organ": {
      "type": "string",
      "enum": ["I", "II", "III", "IV", "V", "VI", "VII", "META"]
    },
    "tier": {
      "type": "string",
      "enum": ["flagship", "standard", "infrastructure"]
    },
    "status": {
      "type": "string",
      "enum": ["LOCAL", "CANDIDATE", "PUBLIC_PROCESS", "GRADUATED", "ARCHIVED"]
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "uniqueItems": true
    }
  },
  "additionalProperties": false
}
```

### Numeric Constraints

```json
{
  "priority": {
    "type": "integer",
    "minimum": 1,
    "maximum": 10
  },
  "score": {
    "type": "number",
    "exclusiveMinimum": 0,
    "maximum": 1.0
  }
}
```

## Composition

### $ref (Reuse)

```json
{
  "$defs": {
    "organ": {
      "type": "string",
      "enum": ["I", "II", "III", "IV", "V", "VI", "VII", "META"]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    }
  },
  "properties": {
    "source_organ": { "$ref": "#/$defs/organ" },
    "target_organ": { "$ref": "#/$defs/organ" },
    "created_at": { "$ref": "#/$defs/timestamp" }
  }
}
```

### allOf (Intersection / Extension)

```json
{
  "allOf": [
    { "$ref": "#/$defs/base-entity" },
    {
      "properties": {
        "extra_field": { "type": "string" }
      }
    }
  ]
}
```

### oneOf (Discriminated Union)

```json
{
  "oneOf": [
    {
      "properties": {
        "type": { "const": "skill" },
        "category": { "type": "string" }
      },
      "required": ["type", "category"]
    },
    {
      "properties": {
        "type": { "const": "bundle" },
        "includes": { "type": "array", "items": { "type": "string" } }
      },
      "required": ["type", "includes"]
    }
  ],
  "discriminator": { "propertyName": "type" }
}
```

### if/then/else (Conditional)

```json
{
  "if": {
    "properties": { "tier": { "const": "flagship" } }
  },
  "then": {
    "required": ["ci_url", "docs_url"]
  }
}
```

## Patterns for Common Needs

### Extensible Enums

```json
{
  "status": {
    "anyOf": [
      { "enum": ["active", "archived", "draft"] },
      { "type": "string", "pattern": "^x-" }
    ]
  }
}
```

### Maps / Dictionaries

```json
{
  "metadata": {
    "type": "object",
    "additionalProperties": { "type": "string" },
    "propertyNames": { "pattern": "^[a-z_]+$" }
  }
}
```

### Nullable Fields

```json
{
  "description": {
    "oneOf": [
      { "type": "string" },
      { "type": "null" }
    ]
  }
}
```

## Validation in Python

```python
import jsonschema
import json
from pathlib import Path

def validate_entry(data: dict, schema_path: str) -> list[str]:
    schema = json.loads(Path(schema_path).read_text())
    validator = jsonschema.Draft202012Validator(schema)
    errors = sorted(validator.iter_errors(data), key=lambda e: list(e.path))
    return [f"{'.'.join(str(p) for p in e.path)}: {e.message}" for e in errors]
```

## Schema Evolution

| Change | Safe? | Strategy |
|--------|-------|----------|
| Add optional field | Yes | No version bump needed |
| Add required field | No | Major version, provide default |
| Remove field | No | Deprecate first, then remove |
| Widen type (string → string\|number) | Yes | Backward compatible |
| Narrow type | No | Major version |
| Add enum value | Yes | Consumers should handle unknown |
| Remove enum value | No | Deprecate first |

## Anti-Patterns

- **No `additionalProperties: false`** — Typos in field names pass silently
- **Overly permissive types** — Use specific types and constraints
- **Inline definitions everywhere** — Extract to `$defs` for reuse
- **No `$id` or `$schema`** — Always specify schema version and identity
- **Validating only on write** — Validate on both read and write boundaries

Related Skills

taxonomy-modeling-design

5
from organvm-iv-taxis/a-i--skills

Phase 2 of the pentaphase structural-overhaul protocol. Classifies entities, standardizes attributes, establishes relationships, and designs the access framework. Use when the user invokes phase 2 of an overhaul, asks to "design the taxonomy" or "model the structure", or has completed a landscape audit and is ready to redesign. Consumes phase-1-landscape-report.md; produces phase-2-taxonomy-model.md.

workshop-presentation-design

5
from organvm-iv-taxis/a-i--skills

Design engaging workshops, conference talks, and educational presentations. Covers learning objectives, activity design, slide craft, and facilitation techniques. Triggers on workshop design, presentation prep, talk structure, or training session requests.

rust-systems-design

5
from organvm-iv-taxis/a-i--skills

Provides expert guidance on Rust programming, focusing on memory safety, concurrency patterns, and idiomatic architectural choices for systems software.

responsive-design-patterns

5
from organvm-iv-taxis/a-i--skills

Mobile-first responsive design patterns with breakpoints, fluid layouts, and adaptive components

product-requirements-designer

5
from organvm-iv-taxis/a-i--skills

Comprehensive product requirements documentation from problem definition through launch planning. Supports both enterprise PRD (full specs, cross-functional alignment) and lean/startup style (hypothesis-driven one-pagers). Framework-agnostic with templates for Agile, Jobs-to-Be-Done, and hybrid approaches. Scaffolds related artifacts including user stories, acceptance criteria, wireframes brief, and technical handoff specs. Triggers on PRD creation, product specs, feature requirements, or product design documentation.

interactive-theatre-designer

5
from organvm-iv-taxis/a-i--skills

Designs interactive theatrical experiences with branching narratives, audience participation systems, and immersive environmental storytelling.

game-mechanics-designer

5
from organvm-iv-taxis/a-i--skills

Designs engaging gameplay loops, economies, and progression systems, balancing challenge and reward for interactive experiences.

frontend-design-systems

5
from organvm-iv-taxis/a-i--skills

Systematic approach to building consistent, maintainable frontend UI components with design systems and component libraries

enc1101-curriculum-designer

5
from organvm-iv-taxis/a-i--skills

Design and generate curriculum materials for college composition courses (ENC1101 and similar). Use when creating syllabi, assignment prompts, rubrics, lesson plans, scaffolded writing sequences, peer review guides, or D2L/LMS-formatted content. Triggers on requests for composition pedagogy, writing assignment design, grading criteria, or freshman writing course materials.

cli-tool-design

5
from organvm-iv-taxis/a-i--skills

Design command-line interfaces with clear argument parsing, subcommands, help text, output formatting, and exit codes. Covers Click, Typer, argparse, and shell completion. Triggers on CLI tool development, argument parsing, or terminal UX design requests.

canvas-design

5
from organvm-iv-taxis/a-i--skills

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

api-design-patterns

5
from organvm-iv-taxis/a-i--skills

Design robust APIs with RESTful patterns, GraphQL schemas, versioning strategies, and error handling conventions. Supports OpenAPI/Swagger documentation and SDK generation patterns. Triggers on API design, schema definition, endpoint architecture, or developer experience requests.