Skip to content

validate

Validate all ModernizeSpec files in a project against their JSON Schemas.

Terminal window
npx modernizespec validate [options]
  1. Locates .agents/modernization/manifest.json
  2. Reads the files section to discover all spec files
  3. Validates each file against its corresponding JSON Schema
  4. Reports errors with file path, field path, and error message
FlagDescriptionDefault
--dir <path>Project directoryCurrent directory
--strictFail on warnings (not just errors)Errors only
--jsonOutput errors as JSONHuman-readable
--file <name>Validate a specific file onlyAll files
Terminal window
npx modernizespec validate
Terminal window
npx modernizespec validate --strict
Terminal window
npx modernizespec validate --file domains.json
Terminal window
npx modernizespec validate --json
Validating ModernizeSpec files...
manifest.json ✓ valid
domains.json ✗ 2 errors
- contexts[0].coupling.internal: must be <= 1
- contexts[1].type: must be "core", "supporting", or "generic"
complexity.json ✓ valid
extraction-plan.json ✓ valid
parity-tests.json ⚠ 1 warning
- acceptance.parity_threshold: value 2.0 is unusually high (expected 0-1 range)
migration-state.json ✓ valid
Result: 2 errors, 1 warning
{
"valid": false,
"errors": [
{
"file": "domains.json",
"path": "contexts[0].coupling.internal",
"message": "must be <= 1",
"severity": "error"
}
],
"warnings": [
{
"file": "parity-tests.json",
"path": "acceptance.parity_threshold",
"message": "value 2.0 is unusually high (expected 0-1 range)",
"severity": "warning"
}
]
}
CodeMeaning
0All files valid (no errors; warnings present only if --strict not set)
1Validation errors found
2Spec files not found
# GitHub Actions
- name: Validate ModernizeSpec
run: npx modernizespec validate --strict
# GitLab CI
validate-spec:
script: npx modernizespec validate --strict