skill-perfection
Use this skill when you need to QA audit and fix a plugin skill file. Provides a methodology for verifying skill content against official documentation, fixing…
Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.
$ npx -y skills add OmidZamani/dspy-skills --skill dspy-better-together --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dspy-better-togetherContext preview
The summary Claude sees to decide when to auto-load this skill.
Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.
name: dspy-better-together version: "1.0.0" dspy-compatibility: "3.2.1" tags: ["optimizer"] requires-extras: [] description: Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p. allowed-tools: - Read - Write - Glob - Grep
Sequence prompt and weight optimizers, evaluate intermediate programs, and return the best candidate.
import dspy
lm = dspy.LM("openai/gpt-4o-mini")
dspy.configure(lm=lm)
student = dspy.ChainOfThought("question -> answer")
student.set_lm(lm)
def metric(example, pred, trace=None):
return float(example.answer.lower() == pred.answer.lower())
optimizer = dspy.BetterTogether(
metric=metric,
p=dspy.GEPA(
metric=lambda gold, pred, trace=None, pred_name=None, pred_trace=None:
dspy.Prediction(score=metric(gold, pred), feedback="Check answer correctness."),
reflection_lm=dspy.LM("openai/gpt-4o"),
auto="light",
),
w=dspy.BootstrapFinetune(metric=metric),
)
compiled = optimizer.compile(
student,
trainset=trainset,
valset=valset,
strategy="p -> w -> p",
)| Strategy | Use it when | |----------|-------------| | `"p -> w"` | Start with a simple prompt-then-weight pass | | `"p -> w -> p"` | Re-optimize prompts after fine-tuning | | `"w -> p"` | Fine-tuning data is already strong | | Custom chains | Comparing prompt optimizers or conducting controlled experiments |
Optimizer names come from constructor keyword arguments. For example, `mipro=...` and `gepa=...` make `"mipro -> gepa"` valid.
Pass optimizer-specific arguments through `optimizer_compile_args`:
compiled = optimizer.compile(
student,
trainset=trainset,
valset=valset,
strategy="p -> w",
optimizer_compile_args={
"p": {"max_metric_calls": 150},
},
)Do not pass `student` inside `optimizer_compile_args`; `BetterTogether` manages the current program.
The returned program exposes:
A Claude Code plugin containing 22 focused skills for programming, optimizing, evaluating, and deploying LLM applications with DSPy. Stable DSPy baseline: 3.2.1, released May 5, 2026.
Use this skill when you need to QA audit and fix a plugin skill file. Provides a methodology for verifying skill content against official documentation, fixing…
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or…
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
Use for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.
Use for creating custom DSPy modules, extending dspy.Module, reusable components, stateful modules, serialization, and module testing.
Use for debugging DSPy programs, inspect_history, tracing LLM calls, custom callbacks, observability, monitoring, and cost tracking.