@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.
Installation
Section titled “Installation”npm install @modernizespec/schemasImport in Node.js
Section titled “Import in Node.js”import { manifestSchema, domainsSchema, complexitySchema, extractionPlanSchema, parityTestsSchema, migrationStateSchema,} from "@modernizespec/schemas";Validate with ajv
Section titled “Validate with ajv”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);}Use with $schema URLs
Section titled “Use with $schema URLs”Reference schemas directly in your JSON files for editor support:
{ "$schema": "https://modernizespec.dev/schemas/manifest.schema.json", "modernizespec": "0.1.0", "project": "MyProject"}Available Schemas
Section titled “Available Schemas”| Schema | File | Description |
|---|---|---|
manifestSchema | manifest.schema.json | Project metadata and file inventory |
domainsSchema | domains.schema.json | Bounded contexts, entities, context map |
complexitySchema | complexity.schema.json | Extraction tiers and hotspots |
extractionPlanSchema | extraction-plan.schema.json | Phased extraction sequence |
parityTestsSchema | parity-tests.schema.json | Test suite inventory and acceptance criteria |
migrationStateSchema | migration-state.schema.json | Progress tracking and velocity |
Schema Format
Section titled “Schema Format”All schemas follow JSON Schema draft-07. They include:
titleanddescriptionfor every propertyrequiredarrays for mandatory fieldsenumconstraints for fixed-value fieldsminimum/maximumfor numeric rangesadditionalProperties: trueat root level for extensibility
Distribution
Section titled “Distribution”Schemas are available through three channels:
| Channel | URL/Package | Use Case |
|---|---|---|
| npm | @modernizespec/schemas | Import in code, CI validation |
| CDN | https://modernizespec.dev/schemas/ | $schema references in JSON files |
| GitHub | github.com/modernizespec/spec | Direct download, forking |
Next Steps
Section titled “Next Steps”- JSON Schemas Overview — Design principles and usage patterns
- @modernizespec/core — Types + schemas in one package
- Schema Validator — Interactive validation tool