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:

  1. What could go wrong? (hallucinations, wrong format, offensive content, missing info, factual errors?)
  2. How strict does it need to be? (reject bad outputs vs. try to fix them?)
  3. 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

class GenerateResponse(dspy.Signature):
Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
15
GitHub Stars
5
First Seen
Feb 8, 2026