Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add OmidZamani/dspy-skills
Or install specific skill: npx add-skill https://github.com/OmidZamani/dspy-skills
# Description
Collection of Claude Skills for DSPy framework - program language models, optimize prompts, and build RAG pipelines systematically
# README.md
DSPy Skills Collection
A comprehensive collection of AI-powered skills for programming and optimizing LLM applications using the DSPy framework. These skills enable you to move from manual prompt engineering to systematic, programmatic LLM development.
Version Compatibility: All skills target DSPy 3.1.2 (released January 19, 2026). All code examples and APIs have been verified against this version.
π― What is DSPy?
DSPy is a declarative framework that lets you program language models instead of prompting them. It provides:
- Modular architecture - Compose LLM programs from reusable components
- Automatic optimization - Tune prompts, examples, and weights algorithmically
- Self-improving pipelines - Systems that get better with data
π Skills Index
Optimizers
| Skill | Description | Best For |
|---|---|---|
| dspy-bootstrap-fewshot | Auto-generate few-shot examples | Quick optimization with ~10 examples |
| dspy-miprov2-optimizer | Bayesian instruction+demo optimization | 200+ examples, comprehensive tuning |
| dspy-gepa-reflective | LLM reflection on execution traces | Agentic systems, complex workflows |
| dspy-simba-optimizer | Mini-batch Bayesian optimization | Custom feedback, budget-friendly |
| dspy-finetune-bootstrap | Fine-tune model weights | Production deployment, efficiency |
Pipelines & Components
| Skill | Description | Best For |
|---|---|---|
| dspy-rag-pipeline | RAG with ColBERTv2 retrieval | Knowledge-grounded generation |
| dspy-signature-designer | Design type-safe I/O specs | Clean, validated outputs |
| dspy-evaluation-suite | Metrics and evaluation | Quality assessment |
| dspy-haystack-integration | DSPy + Haystack pipelines | Existing Haystack projects |
Agent Development
| Skill | Description | Best For |
|---|---|---|
| dspy-react-agent-builder | Build ReAct agents with tools | Multi-step reasoning tasks |
Output Validation
| Skill | Description | Best For |
|---|---|---|
| dspy-output-refinement-constraints | Refine outputs with constraints | Format/content validation |
Advanced Patterns
| Skill | Description | Best For |
|---|---|---|
| dspy-advanced-module-composition | Ensemble and multi-chain patterns | Complex multi-module programs |
| dspy-custom-module-design | Build custom DSPy modules | Reusable production components |
Debugging & Monitoring
| Skill | Description | Best For |
|---|---|---|
| dspy-debugging-observability | MLflow tracing and monitoring | Production debugging, cost tracking |
π― Choosing the Right Optimizer
| Your Situation | Recommended Skill | Why |
|---|---|---|
| 10-50 labeled examples | dspy-bootstrap-fewshot | Fast, cost-effective |
| 200+ examples, need best performance | dspy-miprov2-optimizer | State-of-the-art results |
| Building agents with tools | dspy-gepa-reflective | Optimizes execution traces |
| Production deployment, cost reduction | dspy-finetune-bootstrap | Creates efficient fine-tuned models |
π Typical Workflow
- Design β Signature Designer - Define inputs/outputs
- Build β RAG Pipeline or Agent Builder - Create your DSPy program
- Validate β Output Refinement - Add constraints
- Optimize β Choose optimizer based on your data
- Evaluate β Evaluation Suite - Measure improvements
- Debug β Debugging & Observability - Monitor performance
- Deploy β Fine-tune Bootstrap - Optional production optimization
π Documentation
- DSPy Framework Guide - Complete framework reference
π Installation
# Install DSPy 3.1.2 or later
pip install dspy-ai>=3.1.2
Optional Dependencies
# For ColBERTv2 retrieval
pip install colbert-ai
# For Haystack integration
pip install haystack-ai
# For fine-tuning
pip install transformers datasets
π‘ Quick Start
import dspy
# Configure LM
dspy.configure(lm=dspy.LM("openai/gpt-4o-mini"))
# Create a simple classifier
classify = dspy.Predict("text -> sentiment: bool")
result = classify(text="I love this product!")
print(result.sentiment) # True
π Examples
See examples/code-snippets.py for production-ready code.
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
π License
MIT License - see LICENSE for details.
π Acknowledgments
Built for the SkillsMP marketplace. Uses the DSPy framework by Stanford NLP.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.