Skip to content

JSON Schemas

JSON Schemas form Layer 2 of ModernizeSpec. They validate the file convention (Layer 1) and enable tooling, compliance checking, and editor support.

Each core ModernizeSpec file has a corresponding JSON Schema:

FileSchemaPurpose
manifest.jsonmanifest.schema.jsonValidates project metadata and file inventory
domains.jsondomains.schema.jsonValidates bounded contexts, entities, and context map
complexity.jsoncomplexity.schema.jsonValidates extraction tiers and hotspot data
extraction-plan.jsonextraction-plan.schema.jsonValidates phased extraction sequence
parity-tests.jsonparity-tests.schema.jsonValidates test suite inventory and acceptance thresholds
migration-state.jsonmigration-state.schema.jsonValidates progress tracking and velocity data

Add a $schema reference at the top of your ModernizeSpec files to get autocomplete and validation in VS Code, JetBrains, and other JSON Schema-aware editors:

{
"$schema": "https://modernizespec.dev/schemas/manifest.schema.json",
"modernizespec": "0.1.0",
"project": "MyProject"
}

The validate command checks all files against their schemas:

Terminal window
npx modernizespec validate

This reports typed validation errors — missing required fields, incorrect types, values outside allowed ranges.

import { ModernizeSpec } from "@modernizespec/sdk";
const spec = await ModernizeSpec.load("/path/to/project");
const errors = spec.validate();
if (errors.length > 0) {
console.error("Validation errors:", errors);
}

Add schema validation to your CI pipeline to ensure spec files stay valid as the project evolves:

# GitHub Actions example
- name: Validate ModernizeSpec
run: npx modernizespec validate --strict

Required fields are minimal — enough to be useful without being burdensome. Optional fields provide depth for projects that need it. Unknown properties are allowed at the top level to support future extensions.

Every field includes a description in the schema, so editor tooltips explain what each property means without needing to check the documentation.

Schemas are versioned alongside the specification. The modernizespec field in manifest.json declares which version of the spec the files conform to.

Schemas are available through multiple channels:

npm Package

@modernizespec/schemas — importable JSON Schema files for Node.js projects

CDN

Hosted at https://modernizespec.dev/schemas/ — use $schema URLs directly

GitHub

Raw schema files in the specification repository