·dspy-output-refinement-constraints
</>

dspy-output-refinement-constraints

omidzamani/dspy-skills

This skill should be used when the user asks to "refine DSPy outputs", "enforce constraints", "use dspy.Refine", "select best output", "use dspy.BestOfN", mentions "output validation", "constraint checking", "multi-attempt generation", "reward function", or needs to improve output quality through iterative refinement or best-of-N selection with custom constraints.

7Installs·0Trend·@omidzamani

Installation

$npx skills add https://github.com/omidzamani/dspy-skills --skill dspy-output-refinement-constraints

SKILL.md

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

| module | dspy.Module | Module to refine | | rewardfn | callable | Constraint validation function | | N | int | Number of attempts | | threshold | float | Minimum reward to accept |

DSPy 2.6+ deprecates dspy.Assert/dspy.Suggest. Use Refine with reward functions:

This skill should be used when the user asks to "refine DSPy outputs", "enforce constraints", "use dspy.Refine", "select best output", "use dspy.BestOfN", mentions "output validation", "constraint checking", "multi-attempt generation", "reward function", or needs to improve output quality through iterative refinement or best-of-N selection with custom constraints. Source: omidzamani/dspy-skills.

View raw

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/omidzamani/dspy-skills --skill dspy-output-refinement-constraints
Category
</>Dev Tools
Verified
First Seen
2026-02-01
Updated
2026-02-18

Quick answers

What is dspy-output-refinement-constraints?

This skill should be used when the user asks to "refine DSPy outputs", "enforce constraints", "use dspy.Refine", "select best output", "use dspy.BestOfN", mentions "output validation", "constraint checking", "multi-attempt generation", "reward function", or needs to improve output quality through iterative refinement or best-of-N selection with custom constraints. Source: omidzamani/dspy-skills.

How do I install dspy-output-refinement-constraints?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/omidzamani/dspy-skills --skill dspy-output-refinement-constraints Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor

Where is the source repository?

https://github.com/omidzamani/dspy-skills