validate-schema
This skill allows the agent to verify that any data structure, file, YAML block, or agent output conforms to its defined schema or structural contract — producing a precise, actionable pass/fail repor
SKILL.md_os/.os-toolboxes/agentic/validation/skills/validate-schema/SKILL.md
GitHubValidate Schema
This skill allows the agent to verify that any data structure, file, YAML block, or agent output conforms to its defined schema or structural contract — producing a precise, actionable pass/fail report before the data is acted upon or written to disk.
Steps
- Locate and read the schema. Find the authoritative schema definition:
- For workspace YAML files → check
.db/.schemas/for the appropriate schema - For toolbox files → check the toolbox
yaml_pathfile's structure - For custom structures → derive from the written spec or identity file
- For workspace YAML files → check
- Read the target fresh. Apply Zero-Drift Audit Law — read the actual current file/data live, not from cached context.
- Map required fields. List every required field from the schema. Note which are optional.
- Check field presence. For each required field, verify it exists in the target.
- Check field types. Verify data types match (string vs int, list vs scalar, etc.).
- Check value constraints. Validate enum values, non-empty lists, valid paths, valid statuses, etc.
- Check structural contract. Verify nesting depth, key naming conventions, and ordering where prescribed.
- Compile violations. For every failure, record: field path, expected value/type, actual value/type, severity (blocking vs warning).
- Determine verdict.
- Zero violations → VALID ✅
- Warnings only → VALID WITH WARNINGS ⚠️
- Any blocking violation → INVALID ❌
- Generate fix instructions. For each violation, produce a specific, executable correction.
- Output the validation report.
Output Format
validation_report:
target: "<file or data description>"
schema_source: "<where the schema was found>"
verdict: "VALID | VALID_WITH_WARNINGS | INVALID"
violations:
- field_path: "<e.g. content.skills[0].maturity>"
expected: "<expected type or value>"
actual: "<what was found>"
severity: "blocking | warning"
fix: "<exact correction to apply>"
summary: "<one-line verdict summary>"
Notes
- Always validate before writing. Any automated file write should be preceded by a schema validation of the content.
- If no schema exists for a target, flag this as a gap and generate a schema proposal before proceeding.
- Validation failures on
.db/.system.board.yamlor router files are critical — they corrupt agent routing. - Pair with
planningtoolbox: if INVALID, generate a fix plan before retrying.