OmidZamani

dspy-skills

20
4
# Install this skill:
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

  1. Design β†’ Signature Designer - Define inputs/outputs
  2. Build β†’ RAG Pipeline or Agent Builder - Create your DSPy program
  3. Validate β†’ Output Refinement - Add constraints
  4. Optimize β†’ Choose optimizer based on your data
  5. Evaluate β†’ Evaluation Suite - Measure improvements
  6. Debug β†’ Debugging & Observability - Monitor performance
  7. Deploy β†’ Fine-tune Bootstrap - Optional production optimization

πŸ“– Documentation

πŸš€ 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.