home / skills / aidotnet / moyucode / json-validator
This skill validates JSON files against JSON Schema, reports detailed errors, and offers auto-fix suggestions to streamline data integrity.
npx playbooks add skill aidotnet/moyucode --skill json-validatorReview the files below or copy the command above to add this skill to your agents.
---
name: json-validator
description: 根据JSON Schema验证JSON文件,提供详细错误报告和自动修复建议。
metadata:
short-description: 验证JSON/Schema
source:
repository: https://github.com/python-jsonschema/jsonschema
license: MIT
---
# JSON Validator Tool
## Description
Validate JSON files against JSON Schema with detailed error reporting and formatting.
## Trigger
- `/json-validate` command
- User needs to validate JSON
- User wants schema validation
## Usage
```bash
# Validate JSON syntax
python scripts/json_validator.py data.json
# Validate against schema
python scripts/json_validator.py data.json --schema schema.json
# Format JSON
python scripts/json_validator.py data.json --format --output formatted.json
# Minify JSON
python scripts/json_validator.py data.json --minify
```
## Tags
`json`, `validate`, `schema`, `format`, `lint`
## Compatibility
- Codex: ✅
- Claude Code: ✅
This skill validates JSON files against JSON Schema, offering precise error reporting and actionable fix suggestions. It also supports formatting and minifying JSON to enforce consistent style. Use it to catch schema mismatches, type errors, missing required fields, and structural problems before runtime.
The validator parses your JSON and runs it through a JSON Schema validator to identify violations, type mismatches, missing properties, and pattern/enum failures. It produces line-and-column-aware error messages, suggests specific fixes (for example: add missing property, change type, correct enum value), and can optionally auto-format or minify the JSON. You can validate against a provided schema file or run a syntax-only check when no schema is supplied.
Can the tool auto-fix all validation errors?
It provides automated suggestions and can apply simple fixes (formatting, adding missing optional fields) but complex semantic fixes require manual review.
What happens if no schema is provided?
The tool performs syntax validation and formatting/minifying but cannot check structural rules without a schema.
Does it report exact locations of errors?
Yes. Errors include line and column references and a human-friendly message with a recommended correction.