dspy-output-refinement-constraints

Installation
SKILL.md

DSPy Output Refinement & Constraints

Goal

Improve output quality using iterative refinement (dspy.Refine) and best-of-N selection (dspy.BestOfN) with custom constraint validation.

When to Use

  • Outputs need format validation (JSON, specific structure)
  • Length constraints (max tokens, word count)
  • Content requirements (must include X, avoid Y)
  • Quality improvement through multiple attempts
  • Replacing deprecated Assert/Suggest patterns

Related Skills

Related skills

More from omidzamani/dspy-skills

Installs
24
GitHub Stars
74
First Seen
Jan 27, 2026