validate-structured-model-output
Skill7 starsChanged 10 months agoMITView on GitHub
Validates JSON or tool-call model outputs without repair, separating parse, schema, supplied-identifier, semantic, replay, and safety failures. Use for first-attempt benchmarks, teacher-label pipelines, and bounded model tool selection.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- apple-cktool-jsSkill
- apple-cktoolSkill
- audit-training-experimentSkill
- awkSkill
- close-out-ml-experimentSkill
- compare-models-blindlySkill
- conventional-commitsSkill
- design-resumable-model-evaluationSkill
- gogopowermanagerSkill
- ios-design-reviewSkill
- mikrotik-routerosSkill
- obsidian-dailySkill
- orbstack-cliSkill
- package-private-ml-artifactsSkill
- prepare-training-corpusSkill
- proxmox-adminSkill
- review-ios-ui-apple-higSkill
- review-training-data-qualitySkill
- run-hugging-face-training-smokeSkill
- sedSkill
- select-and-verify-best-checkpointSkill
- send-to-minionSkill
- swift-reviewSkill
- technical-writerSkill
- tmuxinatorSkill
- topydoSkill
- unhobble-agent-contextSkill
- write-a-promptSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat model output as untrusted input.
- Distinctive: line 20
Keep failure categories separate.
- Distinctive: line 24
Use the bundled validator when each row contains supplied, ranked, and optional alternative IDs:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Validate Structured Model Output
Treat model output as untrusted input. Preserve raw bytes and validate a normalized copy through ordered gates.
Validation order
- Transport: A native structured response or the required JSON payload exists.
- Parse: Decode exactly once. In acceptance benchmarks, do not extract JSON from prose or retry malformed output.
- Schema: Enforce required fields, types, controlled values, and cardinality.
- Identifiers: Reject unknown, duplicate, overlapping, invented, or off-request IDs.
- Semantics: Reject equivalent choices where distinctness is required and verify classifications against supplied facts.
- Execution: Replay or otherwise validate the selected operation with the deterministic kernel.
- Safety: Reject continuation through terminal, unresolved, random, hidden, or otherwise unsupported effects.
Keep failure categories separate. A parse failure is not an abstention, and a legal identifier is not proof of a safe or useful result.
Validate JSONL ID contracts
Use the bundled validator when each row contains supplied, ranked, and optional alternative IDs:
python scripts/validate_jsonl_outputs.py results.jsonl \
--supplied-field request.planIDs \
--ranked-field response.rankedPlanIDs \
--alternative-field response.alternativePlanIDs \
--max-ranked 3 --output validation-report.jsonIt checks duplicate IDs within arrays, overlap between ranked and alternatives, unknown IDs, rank length, and alternatives without a ranked selection. Add project validators after this generic layer.
Benchmark discipline
For first-attempt acceptance, generate once and validate without repair, remediation, or deterministic fallback. Test production remediation separately. Persist raw output, normalized output, every gate result, timing, prompt/config revision, and validator revision so failures remain auditable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

