Agent skill

Dspy Optimizer Selection

by OmidZamani in OmidZamani/dspy-skills

A skill your agent uses to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.

MITAuto-check passed

Install Dspy Optimizer Selection

skills CLI
$ npx skills add OmidZamani/dspy-skills --skill dspy-optimizer-selection -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OmidZamani/dspy-skills dspy-optimizer-selection --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dspy-optimizer-selection .claude/skills/dspy-optimizer-selection && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dspy-optimizer-selection
GitHub stars
124
Token cost
~892 tokens
SKILL.md length
331 words
Files
2
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.

  • Works in 5 steps: Split data into train and validation sets. → Evaluate the uncompiled program with… → Start with the least expensive optimizer… → …
  • Compare DSPy optimizers including LabeledFewShot
  • SKILL.md covers Goal, Selection Matrix, Workflow and Common Paths, plus 2 more sections
  • Runs Python scripts from its folder; calls pip

What it does

Dspy Optimizer Selection is an agent skill from OmidZamani/dspy-skills. Use to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `example.py`).

The repository describes itself as: Collection of Claude Skills for DSPy framework - program language models, optimize prompts, and build RAG pipelines systematically. The licence is MIT.

When your agent uses it

  • Compare DSPy optimizers including LabeledFewShot
  • BootstrapFewShot
  • BootstrapFinetune

Example prompts

  • “/dspy-optimizer-selection”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Glob, Grep

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Split data into train and validation sets.
  2. Evaluate the uncompiled program with dspy-evaluation-suite.
  3. Start with the least expensive optimizer that matches the need.
  4. Save the compiled program and compare it against the baseline.
  5. Escalate only when the measured gain justifies extra LM calls, fine-tuning, or inference cost.

What it can do on your machine

Read from SKILL.md and the folder at commit f5db3b7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • dspy.ai
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dspy Optimizer Selection loads about 892 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 331 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~892

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OmidZamani/dspy-skills at commit f5db3b7, republished under its MIT licence (© OmidZamani). 331 words, ~892 tokens.

Download SKILL.mdSave it as .claude/skills/dspy-optimizer-selection/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
dspy-optimizer-selection
description
Use to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.
allowed-tools
Read, Write, Glob, Grep
version
1.0.0
dspy-compatibility
3.2.1
tags
optimizer

DSPy Optimizer Selection

Goal

Choose the smallest DSPy optimizer that matches the data, budget, and artifact being tuned. Establish a baseline before compiling anything.

Selection Matrix

NeedStart withNotes
Include a few labeled examplesdspy.LabeledFewShotRandom labeled demos; useful as a baseline
About 10 examplesdspy.BootstrapFewShotTeacher-generated demos with metric filtering
50+ examples and stronger demo searchdspy.BootstrapFewShotWithRandomSearchSearches multiple demo sets; alias: dspy.BootstrapRS
Per-input nearest demosdspy.KNNFewShotRetrieves nearby examples before bootstrapping
Instruction-only hill climbingdspy.COPROCoordinate ascent over instructions
Instruction and demo searchdspy.MIPROv2Bayesian search; install dspy[optuna]
Mini-batch introspective rules or demosdspy.SIMBAUses output variability and self-reflection
Rich textual feedback and trace reflectiondspy.GEPAMetric must accept five arguments
Distill prompts into model weightsdspy.BootstrapFinetuneRequires a fine-tunable LM and set_lm()
Combine candidate programsdspy.EnsembleTrades inference cost for robustness
Sequence prompt and weight optimizationdspy.BetterTogetherMeta-optimizer for configurable optimizer chains

Workflow

  1. Split data into train and validation sets.
  2. Evaluate the uncompiled program with dspy-evaluation-suite.
  3. Start with the least expensive optimizer that matches the need.
  4. Save the compiled program and compare it against the baseline.
  5. Escalate only when the measured gain justifies extra LM calls, fine-tuning, or inference cost.

Common Paths

Fast Demo Optimization

Use dspy-bootstrap-fewshot for the first optimization pass. Move to BootstrapFewShotWithRandomSearch when enough examples are available to search multiple demo sets.

Use dspy-miprov2-optimizer for instruction and demonstration search. Install its optional dependency first:

bash
pip install -U "dspy[optuna]>=3.2.1,<3.3"
Reflective Optimization

Use dspy-gepa-reflective when failures can be described with actionable text. Use dspy-simba-optimizer for a smaller mini-batch introspective loop with numeric metrics.

Prompt Plus Weight Optimization

Use dspy-better-together when a fine-tunable LM is available and prompt optimization alone has plateaued.

Best Practices

  1. Keep a held-out validation set.
  2. Track optimization cost and inference cost separately.
  3. Use reproducible seeds where supported.
  4. Avoid claiming one optimizer is universally best; compare measured results.
  5. Save intermediate candidates for expensive runs.

Official Documentation

© OmidZamani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/dspy-optimizer-selection of OmidZamani/dspy-skills.

  • SKILL.md
  • example.py

Open the folder on GitHubat commit f5db3b7

Compare with similar skills

Dspy Optimizer Selection next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dspy Optimizer Selection compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dspy Optimizer Selection this skillOmidZamani/dspy-skills124—~892Automated safety check: PassMIT
SQL Optimizationgithub/awesome-copilot40k2 repos~2.3kAutomated safety check: PassMIT
Agent Performance Optimizerruvnet/ruflo74k2 repos~3.6kAutomated safety check: PassMIT
Database Optimizerdavila7/claude-code-templates32k8 repos~2.5kAutomated safety check: PassMIT
Prompt Optimizeraffaan-m/ECC276k2 repos~2.4kAutomated safety check: PassMIT
Cost Optimizeruvnet/ruflo74k—~997Automated safety check: NotesMIT

Similar skills

  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed
  • Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

    74k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Database Optimizer

    davila7/claude-code-templates

    Expert database optimizer specializing in modern performance tuning, query optimization, and scalable architectures.

    32k GitHub starsUsed in 8 repos~2.5k tokens
    DatabasesAuto-check passed
  • Prompt Optimizer

    affaan-m/ECC

    分析原始提示,识别意图和差距,匹配ECC组件(技能/命令/代理/钩子),并输出一个可直接粘贴的优化提示。仅提供咨询角色——绝不自行执行任务。触发时机:当用户说“优化提示”、“改进我的提示”、“如何编写提示”、“帮我优化这个指令”或明确要求提高提示质量时。中文等效表达同样触发:“优化prompt”、“改进prompt”、“怎么写prompt”、“帮我优化这个指令”。不触发时机:当用户希望直接执行任…

    276k GitHub starsUsed in 2 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Cost Optimize

    ruvnet/ruflo

    Analyze token usage patterns and recommend cost optimizations with estimated savings

    74k GitHub stars~997 tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Caveman Optimization Evaluator

    JuliusBrussee/caveman

    Turns a Caveman report-only optimization observation into one minimal code change and a paired baseline evaluation, after the operator picks which to pursue.

    111k GitHub starsUsed in 1 repo~1.2k tokens
    AI & LLM EngineeringAuto-check passed

More from OmidZamani/dspy-skills

All 17 skills in this repo
  • Skill Perfection

    OmidZamani/dspy-skills

    A skill your agent uses when you need to QA audit and fix a plugin skill file.

    124 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Haystack Integration

    OmidZamani/dspy-skills

    A skill your agent uses for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.

    124 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Adapters Multimodal

    OmidZamani/dspy-skills

    A skill your agent uses for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.

    124 GitHub stars~864 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Advanced Module Composition

    OmidZamani/dspy-skills

    A skill your agent uses for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.

    124 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Better Together

    OmidZamani/dspy-skills

    A skill your agent uses for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p - w - p.

    124 GitHub stars~756 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Bootstrap Fewshot

    OmidZamani/dspy-skills

    A skill your agent uses for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.

    124 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Dspy Optimizer Selection

What does Dspy Optimizer Selection do?

A skill your agent uses to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether. Dspy Optimizer Selection is an agent skill from OmidZamani/dspy-skills. Use to choose or compare DSPy optimizers including LabeledFewShot, BootstrapFewShot, MIPROv2, SIMBA, GEPA, BootstrapFinetune, Ensemble, and BetterTogether.

When should I use Dspy Optimizer Selection?

Dspy Optimizer Selection fits situations like: compare DSPy optimizers including LabeledFewShot; bootstrapFewShot; bootstrapFinetune.

How do I install Dspy Optimizer Selection in Claude Code?

Run `npx skills add OmidZamani/dspy-skills --skill dspy-optimizer-selection -a claude-code`. Or copy the skill folder (skills/dspy-optimizer-selection in OmidZamani/dspy-skills) into .claude/skills/dspy-optimizer-selection in your project. Claude Code loads it when a task matches its description.

How do I install Dspy Optimizer Selection in Codex?

Run `npx skills add OmidZamani/dspy-skills --skill dspy-optimizer-selection -a codex`. Or copy the skill folder (skills/dspy-optimizer-selection in OmidZamani/dspy-skills) into .agents/skills/dspy-optimizer-selection in your project. Codex loads it when a task matches its description.

Can I use Dspy Optimizer Selection in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OmidZamani/dspy-skills --skill dspy-optimizer-selection -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dspy-optimizer-selection, .gemini/skills/dspy-optimizer-selection, .github/skills/dspy-optimizer-selection and .opencode/skills/dspy-optimizer-selection in your project.

What does Dspy Optimizer Selection need to run?

Going by SKILL.md and its folder, Dspy Optimizer Selection needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Glob, Grep.

Does Dspy Optimizer Selection access the network?

SKILL.md names 2 domains. As links in the text: dspy.ai and github.com. This is read from the text; nothing was executed.

Is Dspy Optimizer Selection safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dspy Optimizer Selection use?

Dspy Optimizer Selection is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dspy Optimizer Selection use?

About 892 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dspy Optimizer Selection?

Skills that share tags, products or a category with Dspy Optimizer Selection: SQL Optimization (github/awesome-copilot, 40k stars), Agent Performance Optimizer (ruvnet/ruflo, 74k stars), Database Optimizer (davila7/claude-code-templates, 32k stars) and Prompt Optimizer (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dspy Optimizer Selection?

OmidZamani (a GitHub user) maintains it in OmidZamani/dspy-skills, which has 124 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on June 23, 2026.

Source: OmidZamani/dspy-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.