Data Validation
When to use this skill
Activate when the user wants to:
- Check a CSV file for missing headers, type mismatches, or duplicates
- Validate JSON against a schema
- Run data quality checks before a pipeline or import
Instructions
- Identify the file type (CSV or JSON) from the user's request
- For CSV files, run:
uv run scripts/validate_csv.py <file-path> - For JSON files, run:
Omituv run scripts/validate_json.py <file-path> --schema <schema-path>--schemaif no schema is provided — the script checks structural integrity only. - Parse the JSON output from stdout
- Report findings grouped by severity: errors first, then warnings
Output format
Both scripts output JSON to stdout:
{
"file": "data.csv",
"valid": false,
"errors": [
{ "line": 3, "column": "age", "message": "Expected integer, got 'abc'" }
],
"warnings": [
{ "line": 7, "column": "email", "message": "Empty value" }
],
"summary": { "rows": 100, "errors": 1, "warnings": 1 }
}
Gotchas
- Python 3.11+ is required — scripts use
tomlliband modern type hints - Use
uv run(notpip install) to execute scripts with inline dependencies - CSV files must have a header row — headerless files are rejected
- JSON schema validation uses JSON Schema draft-07
- For custom schema formats, read
references/SCHEMA-GUIDE.md