Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add OmidZamani/dspy-skills --skill dspy-miprov2-optimizergit clone --depth 1 https://github.com/OmidZamani/dspy-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/omidzamani/dspy-skills/dspy-miprov2-optimizer)<a href="https://agentmods.dev/skills/omidzamani/dspy-skills/dspy-miprov2-optimizer"><img src="https://agentmods.dev/badge/skills/omidzamani/dspy-skills/dspy-miprov2-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/omidzamani/dspy-skills/dspy-miprov2-optimizer"><img src="https://agentmods.dev/badge/skills/omidzamani/dspy-skills/dspy-miprov2-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.01459 |
| Opus 5 | $0.00016 | $0.00730 |
| Sonnet 5 | $0.00007 | $0.00292 |
| Haiku 4.5 | $0.00003 | $0.00146 |
Grade A, and why
dspy-miprov2-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DSPy MIPROv2 Optimizer
Goal
Jointly optimize instructions and few-shot demonstrations using Bayesian Optimization for maximum performance.
When to Use
- You have 200+ training examples
- You can afford longer optimization runs (40+ trials)
- You need state-of-the-art performance
- Both instructions and demos need tuning
Related Skills
- For limited data (10-50 examples): dspy-bootstrap-fewshot
- For agentic systems: dspy-gepa-reflective
- Measure improvements: dspy-evaluation-suite
Inputs
| Input | Type | Description |
|---|---|---|
program |
dspy.Module |
Program to optimize |
trainset |
list[dspy.Example] |
200+ training examples |
metric |
callable |
Evaluation function |
auto |
str |
"light", "medium", or "heavy" |
num_trials |
int |
Optimization trials (40+) |
Outputs
| Output | Type | Description |
|---|---|---|
compiled_program |
dspy.Module |
Fully optimized program |
Workflow
Install the optional Optuna dependency before using MIPROv2:
pip install -U "dspy[optuna]>=3.2.1,<3.3"
Three-Stage Process
- Bootstrap - Generate candidate demonstrations
- Propose - Create grounded instruction candidates
- Search - Bayesian optimization over combinations
Phase 1: Setup
import dspy
from dspy.teleprompt import MIPROv2
lm = dspy.LM('openai/gpt-4o-mini')
dspy.configure(lm=lm)
Phase 2: Define Program
class RAGAgent(dspy.Module):
def __init__(self):
self.retrieve = dspy.Retrieve(k=3)
self.generate = dspy.ChainOfThought("context, question -> answer")
def forward(self, question):
context = self.retrieve(question).passages
return self.generate(context=context, question=question)
Phase 3: Optimize
from dspy.teleprompt import MIPROv2
optimizer = MIPROv2(
metric=dspy.evaluate.answer_exact_match,
auto="medium", # Balanced optimization
num_threads=24
)
compiled = optimizer.compile(RAGAgent(), trainset=trainset)
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 213 lines · 33 tokens per session scan A a29f3fe39285
dspy-miprov2-optimizer is a skill published in the GitHub repository OmidZamani/dspy-skills (123 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 1,459 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
prompt-master
Generates optimized prompts for AI tools. Activates only when the user explicitly asks to write, fix, improve, or adapt a prompt for a specific AI tool (LLM, Cursor, Midjourney, image AI, video AI, coding agents, etc.). Does not activate for general conversation, coding tasks, document writing, or other…
dspy
Build complex AI systems with declarative programming, optimize prompts automatically, create modular RAG systems and agents with DSPy - Stanford NLP's framework for systematic LM programming.
dspy
Build complex AI systems with declarative programming, optimize prompts automatically, create modular RAG systems and agents with DSPy - Stanford NLP's framework for systematic LM programming.
Prompt Refiner
Improves AI prompts to be clearer, more specific, and produce more consistent outputs.
dspy
DSPy: declarative LM programs, auto-optimize prompts, RAG.
encargo
Use when a raw prompt needs rewriting or sharpening, when the user says "rewrite this prompt", "make this prompt better", or asks for a prompt to hand to another agent. Also use before launching any autonomous, long-running, parallel or expensive run (/loop, subagent fan-out, worktrees, overnight work), and whenever a…