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 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_path file's structure
- For custom structures → derive from the written spec or identity file
- 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.yaml or router files are critical — they corrupt agent routing.
- Pair with
planning toolbox: if INVALID, generate a fix plan before retrying.
1---2name: validate-schema3description: Verifies data structures, files, YAML blocks, or agent output against their defined schema, producing a pass/fail report with actionable fix instructions.4---56# Validate Schema78This 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.910## Steps11121. **Locate and read the schema.** Find the authoritative schema definition:13 - For workspace YAML files → check `.db/.schemas/` for the appropriate schema14 - For toolbox files → check the toolbox `yaml_path` file's structure15 - For custom structures → derive from the written spec or identity file162. **Read the target fresh.** Apply Zero-Drift Audit Law — read the actual current file/data live, not from cached context.173. **Map required fields.** List every required field from the schema. Note which are optional.184. **Check field presence.** For each required field, verify it exists in the target.195. **Check field types.** Verify data types match (string vs int, list vs scalar, etc.).206. **Check value constraints.** Validate enum values, non-empty lists, valid paths, valid statuses, etc.217. **Check structural contract.** Verify nesting depth, key naming conventions, and ordering where prescribed.228. **Compile violations.** For every failure, record: field path, expected value/type, actual value/type, severity (blocking vs warning).239. **Determine verdict.**24 - Zero violations → **VALID ✅**25 - Warnings only → **VALID WITH WARNINGS ⚠️**26 - Any blocking violation → **INVALID ❌**2710. **Generate fix instructions.** For each violation, produce a specific, executable correction.2811. **Output** the validation report.2930## Output Format3132```yaml33validation_report:34 target: "<file or data description>"35 schema_source: "<where the schema was found>"36 verdict: "VALID | VALID_WITH_WARNINGS | INVALID"37 violations:38 - field_path: "<e.g. content.skills[0].maturity>"39 expected: "<expected type or value>"40 actual: "<what was found>"41 severity: "blocking | warning"42 fix: "<exact correction to apply>"43 summary: "<one-line verdict summary>"44```4546## Notes47- **Always validate before writing.** Any automated file write should be preceded by a schema validation of the content.48- If no schema exists for a target, flag this as a gap and generate a schema proposal before proceeding.49- Validation failures on `.db/.system.board.yaml` or router files are critical — they corrupt agent routing.50- Pair with `planning` toolbox: if INVALID, generate a fix plan before retrying.