ai-following-rules

Installation
SKILL.md

Make Your AI Follow the Rules

Guide the user through defining and enforcing rules their AI must follow. The key insight: don't ask the AI to follow rules — program constraints that enforce them automatically.

Step 1: Identify your rules

Ask the user:

  1. What rules does the AI break? (too long? wrong format? forbidden content? missing fields?)
  2. Which rules are hard requirements vs nice-to-haves? (Refine with threshold vs lower reward weight)
  3. What should happen when a rule is broken? (retry with feedback, pick best attempt, fail loudly)

Step 2: The two enforcement patterns

DSPy 3.x provides two constraint primitives — dspy.Refine and dspy.BestOfN:

Installs
20
GitHub Stars
11
First Seen
Feb 8, 2026
ai-following-rules — lebsral/dspy-programming-not-prompting-lms-skills