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-optimize-anythinggit 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-optimize-anything)<a href="https://agentmods.dev/skills/omidzamani/dspy-skills/dspy-optimize-anything"><img src="https://agentmods.dev/badge/skills/omidzamani/dspy-skills/dspy-optimize-anything/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-optimize-anything"><img src="https://agentmods.dev/badge/skills/omidzamani/dspy-skills/dspy-optimize-anything.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.00036 | $0.02518 |
| Opus 5 | $0.00018 | $0.01259 |
| Sonnet 5 | $0.00007 | $0.00504 |
| Haiku 4.5 | $0.00004 | $0.00252 |
Grade A, and why
dspy-optimize-anything scanned grade A with 1 finding 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
proc = subprocess.run( How it starts
The opening of the file, as written. The whole thing — 305 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GEPA optimize_anything
Goal
Optimize any artifact representable as text — code, prompts, agent architectures, vector graphics, configurations — using a single declarative API powered by GEPA's reflective evolutionary search.
When to Use
- Beyond prompt optimization — optimizing code, configs, SVGs, scheduling policies, etc.
- Single hard problems — circle packing, kernel generation, algorithm discovery
- Batch related problems — CUDA kernels, code generation tasks with cross-transfer
- Generalization — agent skills, policies, or prompts that must transfer to unseen inputs
- When you can express quality as a score and provide diagnostic feedback (ASI)
Inputs
| Input | Type | Description |
|---|---|---|
seed_candidate |
str | dict[str, str] | None |
Starting artifact text, or None for seedless mode |
evaluator |
Callable |
Returns score (higher=better), optionally with ASI dict |
dataset |
list | None |
Training examples (for multi-task and generalization modes) |
valset |
list | None |
Validation set (for generalization mode) |
objective |
str | None |
Natural language description of what to optimize for |
background |
str | None |
Domain knowledge and constraints |
config |
GEPAConfig | None |
Engine, reflection, and tracking settings |
Outputs
| Output | Type | Description |
|---|---|---|
result.best_candidate |
str | dict |
Best optimized artifact |
Workflow
Phase 1: Install
pip install -U "gepa>=0.1.1,<0.2"
Phase 2: Define Evaluator with ASI
The evaluator scores a candidate and returns Actionable Side Information (ASI) — diagnostic feedback that guides the LLM proposer during reflection.
Simple evaluator (score only):
import gepa.optimize_anything as oa
from gepa.optimize_anything import EngineConfig, GEPAConfig
config = GEPAConfig(engine=EngineConfig(max_metric_calls=100))
def evaluate(candidate: str) -> float:
score, diagnostic = run_my_system(candidate)
oa.log(f"Error: {diagnostic}") # captured as ASI
return score
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 · 305 lines · 36 tokens per session scan A c5501c9d8252
dspy-optimize-anything is a skill published in the GitHub repository OmidZamani/dspy-skills (123 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 2,518 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). 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…