intertwine/dspy-agent-skills/dspy-evaluation-harness
Claude Code and agent skill by intertwine/dspy-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Build DSPy evaluation harnesses with rich-feedback metrics that are essential for GEPA optimization. Use when writing a metric function, calling dspy.Evaluate, splitting dev/val sets, debugging "why is my optimizer not improving?", or designing CI-ready DSPy eval suites.
Install
npx vskill@latest install intertwine/dspy-agent-skills/dspy-evaluation-harnessSKILL.md
DSPy Evaluation Harness (3.2.x)
The metric is usually more important than the program. For dspy.GEPA especially, the quality of textual feedback in your metric determines whether optimization converges.
Two rules
- Return a `dspy.Prediction(score=..., feedback=...)`, not a dict.
dspy.Evaluate's parallel executor aggregates scores via sum, which breaks on dict outputs (TypeError: unsupported operand type(s) for +: 'int' and 'dict').dspy.Predictionsupports__float__/__add__and is what GEPA's adapter natively unwraps. A bare float still works for puredspy.Evaluatescoring, but GEPA needs the score+feedback pair. - Separate valset. Never optimize and evaluate on the same examples. Optimizers overfit fast.
Canonical rich-feedback metric
Canonical harness
dspy.Evaluate returns an EvaluationResult with .score (aggregate float) and .results (list of (example, pred, score) tuples).
Dataset hygiene
- Size: 20–50 examples is enough for GEPA's reflective loop; 100–500 for MIPROv2-style bootstrapping.
- Split: hand-curate two disjoint sets —
trainset(for optimization) andvalset(for metric-on-optimized-program). A test set you never look at during development is gold. - Representativeness beats size. Include edge cases, ambiguity, adversarial inputs.
- Build
dspy.Example(...).with_inputs("question", "context")— thewith_inputscall marks which fields are inputs vs. gold outputs.
Multi-axis metrics (recommended)
Combine correctness, faithfulness, format adherence, latency, and cost. Each axis should be a 0–1 float with a written definition. Weight them explicitly; don't hide weights inside magic numbers — make them constants so optimizers can be told to trade off.
CI-ready eval suite
Run offline in CI with a cached LM (dspy.LM(..., cache=True)) + pre-populated DSPY_CACHEDIR.
Tracing & observability
track_usage=Trueondspy.configureaccumulates token counts on predictions (pred.get_lm_usage()).- MLflow:
import mlflow; mlflow.dspy.autolog()→ traces every prediction. - W&B: pass
use_wandb=Truetodspy.GEPAto log Pareto fronts. - Always log eval results to a versioned JSON file (
save_as_json=...) so you can diff runs.
Anti-patterns
- Scalar-only metrics (float but no feedback) when using GEPA — wasted signal.
- `return {"score": s, "feedback": f}` (dict) — crashes
dspy.Evaluate's parallel aggregator. Usedspy.Prediction(score=s, feedback=f). - Exact-match metrics on open-ended generation tasks — use semantic or LM-as-judge scoring.
- Evaluating on the trainset — optimistic by 10–30 points.
- Silently swallowing exceptions (
provide_traceback=False) — you'll blame the LM for a KeyError. - Changing the metric mid-experiment without re-baselining — prior numbers become incomparable.
Next
- Feed this metric into
dspy-gepa-optimizer. - Full harness pattern → reference.md.
- Runnable example → example_metric.py.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dspy-evaluation-harness/SKILL.md
Popularity
- Repository stars
- 263
- Repository forks
- 23
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 12 Jul 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/intertwine/dspy-agent-skills/dspy-evaluation-harness)