ai-checking-outputs
Installation
SKILL.md
Check AI Output Before It Ships
Guide the user through adding verification and guardrails so bad AI outputs never reach users. The pattern: generate, check, fix or reject.
Step 1: Understand what to check
Ask the user:
- What could go wrong? (hallucinations, wrong format, offensive content, missing info, factual errors?)
- How strict does it need to be? (reject bad outputs vs. try to fix them?)
- What's the cost of a bad output reaching users? (annoyance vs. legal/safety risk)
Step 2: Quick wins — Pydantic validation + dspy.Refine
The simplest way to add checks combines Pydantic for structure and dspy.Refine for iterative self-correction. Define a reward function that returns a float (1.0 = pass, 0.0 = fail), then wrap the module:
import dspy