Skip to content

@modernizespec/schemas

@modernizespec/schemas provides the JSON Schema files as an importable npm package. Use it for validation in CI pipelines, editor autocomplete, or custom tooling.

Terminal window
npm install @modernizespec/schemas
import {
manifestSchema,
domainsSchema,
complexitySchema,
extractionPlanSchema,
parityTestsSchema,
migrationStateSchema,
} from "@modernizespec/schemas";
import Ajv from "ajv";
import { manifestSchema } from "@modernizespec/schemas";
const ajv = new Ajv();
const validate = ajv.compile(manifestSchema);
const data = JSON.parse(fs.readFileSync(".agents/modernization/manifest.json", "utf-8"));
const valid = validate(data);
if (!valid) {
console.error(validate.errors);
}

Reference schemas directly in your JSON files for editor support:

{
"$schema": "https://modernizespec.dev/schemas/manifest.schema.json",
"modernizespec": "0.1.0",
"project": "MyProject"
}
SchemaFileDescription
manifestSchemamanifest.schema.jsonProject metadata and file inventory
domainsSchemadomains.schema.jsonBounded contexts, entities, context map
complexitySchemacomplexity.schema.jsonExtraction tiers and hotspots
extractionPlanSchemaextraction-plan.schema.jsonPhased extraction sequence
parityTestsSchemaparity-tests.schema.jsonTest suite inventory and acceptance criteria
migrationStateSchemamigration-state.schema.jsonProgress tracking and velocity

All schemas follow JSON Schema draft-07. They include:

  • title and description for every property
  • required arrays for mandatory fields
  • enum constraints for fixed-value fields
  • minimum / maximum for numeric ranges
  • additionalProperties: true at root level for extensibility

Schemas are available through three channels:

ChannelURL/PackageUse Case
npm@modernizespec/schemasImport in code, CI validation
CDNhttps://modernizespec.dev/schemas/$schema references in JSON files
GitHubgithub.com/modernizespec/specDirect download, forking