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…
Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models.
Claude Code
$ npx -y skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval --agent claude-code
Codex
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a codex -y
Cursor
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a cursor -y
Gemini CLI
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a gemini-cli -y
GitHub Copilot
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a github-copilot -y
OpenCode
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a opencode -y
Windsurf
$ npx skills add OmidZamani/dspy-skills --skill dspy-embedding-retrieval -a windsurf -y
name: dspy-embedding-retrieval version: "1.0.0" dspy-compatibility: "3.2.1" tags: ["retrieval"] requires-extras: ["faiss-cpu"] description: Use for DSPy retrieval with dspy.Embedder, dspy.Embeddings, FAISS indexes, semantic search, and local or hosted embedding models. allowed-tools: - Read - Write - Glob - Grep
Build semantic retrieval over an application-owned text corpus with `dspy.Embedder` and `dspy.Embeddings`.
import dspy
corpus = [
"DSPy programs are composed from modules.",
"MIPROv2 optimizes instructions and demonstrations.",
"RLM explores large contexts with a sandboxed REPL.",
]
embedder = dspy.Embedder("openai/text-embedding-3-small")
search = dspy.Embeddings(corpus=corpus, embedder=embedder, k=2)
result = search("Which optimizer tunes prompts?")
print(result.passages)
print(result.indices)class LocalRAG(dspy.Module):
def __init__(self, retriever):
super().__init__()
self.retriever = retriever
self.answer = dspy.ChainOfThought("context: list[str], question -> answer")
def forward(self, question: str):
context = self.retriever(question).passages
return self.answer(context=context, question=question)Wrap any callable that accepts `list[str]` and returns a 2D numeric array:
from sentence_transformers import SentenceTransformer
import dspy
model = SentenceTransformer("sentence-transformers/static-retrieval-mrl-en-v1")
embedder = dspy.Embedder(model.encode)
search = dspy.Embeddings(corpus=corpus, embedder=embedder, k=5)Use `dspy.EmbeddingsWithScores` when downstream logic needs similarity thresholds or reranking.
For corpora at or above the `brute_force_threshold` default of `20_000`, DSPy builds a FAISS index. Install FAISS first:
pip install faiss-cpu
Persist the index when embedding the corpus is expensive:
search.save("./retrieval-index")
loaded = dspy.Embeddings.from_saved("./retrieval-index", embedder=embedder)1. Evaluate retrieval quality separately from answer quality. 2. Keep corpus chunking deterministic and versioned. 3. Persist expensive indexes. 4. Use `EmbeddingsWithScores` when debugging relevance. 5. Measure memory and latency before enabling FAISS for large corpora.
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…
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal…
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program…
Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.
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…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.