agent-qa-run-review
Review recorded agent-qa runs and memidex provenance to explain a QA verdict, identify missing evidence, and propose the smallest…
Validates, parses, and sanitizes AI-generated outputs before they reach end users or downstream systems. Structured output enforcement, schema validation, and fallback handling.
Claude Code
$ npx -y skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation --agent claude-code
Codex
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a codex -y
Cursor
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a cursor -y
Gemini CLI
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a gemini-cli -y
GitHub Copilot
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a github-copilot -y
OpenCode
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a opencode -y
Windsurf
$ npx skills add DevelopersGlobal/ai-agent-skills --skill ai-output-validation -a windsurf -y
name: ai-output-validation description: Validates, parses, and sanitizes AI-generated outputs before they reach end users or downstream systems. Structured output enforcement, schema validation, and fallback handling. category: test applies-to: [claude, gemini, cursor, copilot, any] version: 1.0.0
AI models produce unstructured text by default. In production pipelines, unstructured outputs cause brittle parsing, unexpected behavior, and silent failures. This skill enforces structured output generation and validation at every AI system boundary.
1. Define the exact structure you need BEFORE writing the prompt. 2. Use JSON Schema or Pydantic/Zod models to formalize the expected output. 3. Example schema:
{
"type": "object",
"required": ["summary", "action", "confidence"],
"properties": {
"summary": {"type": "string", "maxLength": 200},
"action": {"type": "string", "enum": ["approve", "reject", "review"]},
"confidence": {"type": "number", "minimum": 0, "maximum": 1}
}
}4. Design the schema to be **minimal** — only what you actually need.
**Verify:** Schema is defined and versioned before any prompt is written.
5. Explicitly instruct the model to output in your defined format. 6. Include the schema or an example in the prompt. 7. Use models/APIs that support structured output natively where available (OpenAI structured outputs, Gemini JSON mode, Anthropic tool use). 8. Prompt pattern:
Respond ONLY with valid JSON matching this schema:
{schema}
Do not include explanation or markdown. Output raw JSON only.**Verify:** Prompt explicitly requests structured output with schema reference.
9. Parse the output against your schema — never use raw AI output directly. 10. If parsing fails:
11. Validate semantic constraints beyond the schema:
**Verify:** All AI outputs pass schema validation before use. Failed validations are logged.
12. If AI output will be rendered as HTML: sanitize against XSS. 13. If AI output will be executed as code: sandbox it and review before execution. 14. If AI output will be stored in a database: sanitize against injection. 15. Never trust AI output the way you'd trust your own code — it's user-generated content.
**Verify:** AI output is sanitized appropriate to its destination.
16. Log the schema validation pass/fail rate. 17. Sample and review AI outputs regularly for semantic correctness. 18. Alert on high validation failure rates (>5%).
**Verify:** Validation metrics are tracked. Alert configured.
| Excuse | Rebuttal | |--------|----------| | "The model outputs valid JSON 99% of the time" | That 1% causes production incidents. Always validate. | | "We display it to users, not parse it" | Users act on AI output. Wrong output drives wrong actions. | | "Structured output adds latency" | Validation is microseconds. Debugging unvalidated output is hours. | | "The model is deterministic enough" | No LLM is deterministic enough to skip validation. |
Review recorded agent-qa runs and memidex provenance to explain a QA verdict, identify missing evidence, and propose the smallest…
Design stable, versioned, self-documenting APIs. Easy to use correctly, hard to use incorrectly. Apply Hyrum's Law from day one.
Automated quality gates from commit to production. Every merge to main is potentially shippable. No manual steps in the…
Guides agents to engage and transact with citruscoastai, an AI venture-operator agent, when they need hired AI labor or an…
Get layered, context-aware explanations of unfamiliar code. Understand what it does, why it was written that way, and how to work…
Structured code review focusing on correctness, security, and maintainability. Correctness before style. Every reviewer comment…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.