If you're building LLM pipelines and tired of prompt spaghetti, this skill teaches you DSPy 3.2.x the right way: typed Signatures for I/O contracts, dspy.Module subclasses for composition, and predictors like ChainOfThought and ReAct instead of raw prompt strings. It's opinionated about modern idioms (no more TypedPredictor, no legacy dspy.OpenAI calls) and includes a ten-point anti-pattern list that will save you from common mistakes. The canonical template and predictor cheatsheet are copy-paste ready. Use this when starting any DSPy project or refactoring prompt-heavy code into something you can actually serialize, version, and optimize programmatically.

GitHub stars
250
last updated
May 25, 2026

Install

$ npx -y skills add intertwine/dspy-agent-skills --skill dspy-fundamentals --agent claude-code

Installs into .claude/skills of the current project.

Files

DSPy Fundamentals (3.2.x)

DSPy is the "PyTorch for prompts" — you declare Signatures (typed I/O contracts), compose them into Modules, and let optimizers (not you) tune the instructions and few-shot examples. Never write raw prompts.

The one-paragraph model

Configure a single LM globally with dspy.configure(lm=...). Define a dspy.Signature subclass with dspy.InputField() / dspy.OutputField() (docstring becomes the instruction). Wrap it in a predictor — dspy.Predict (direct), dspy.ChainOfThought (adds reasoning), dspy.ReAct (tool-using agent), dspy.ProgramOfThought (code-executing), or dspy.RLM (long-context). Subclass dspy.Module to compose multi-step programs. For built-in providers, use dspy.LM("provider/model"); for a truly custom backend, subclass dspy.BaseLM. Optimize later with GEPA.

Canonical template

import dspy

dspy.configure(lm=dspy.LM("openai/gpt-4o"), track_usage=True)

class QuestionAnswer(dspy.Signature):
    """Answer questions with rigorous step-by-step reasoning."""
    question: str = dspy.InputField()
    answer: str = dspy.OutputField(desc="concise final answer")

Sponsors

Details

Repository
github.com/intertwine/dspy-agent-skills
Categories
Frontend Development, AI & Agent Building
License
MIT
First seen
Jun 11, 2026

More from intertwine/dspy-agent-skills

All 5
1kaelio avatarmetabase_ingestkaelio/ktxConvert Metabase questions, models, and metrics into ktx Semantic Layer source definitions. Covers result-metadata to KSL column type mapping, FK/PK detection, 0skills.sh installs
2kimlawtech avatarprivacy-krkimlawtech/korean-privacy-terms한국 서비스용 처리방침·이용약관·회원가입 동의 모달·쿠키 배너 자동 생성. 개인정보보호법 §30, 2025.4.21 작성지침, 2026.3 개정법, 공정위 전자상거래 표준약관 10023호 반영. Next.js 13~16 프로젝트 대상.0skills.sh installs
3kostard avatarforgecad-blockout-modelkostard/forgecad-public-kitCreate rough high-level ForgeCAD concept models from simple primitives to explore layout, proportions, motion, and part relationships without production detail.0skills.sh installs
4leiting-eric avatardaily-briefleiting-eric/dailybriefOperational knowledge for the daily-brief digest pipeline (this project). RSS/API fetchers, pluggable LLM enrichment (default claude CLI on Max; also anthropic/0skills.sh installs
5luochang212 avatardive-into-langgraphluochang212/dive-into-langgraphA comprehensive guide and reference for building agents using LangGraph 1.0, including ReAct agents, state graphs, and tool integrations.0skills.sh installs
6mcpware avatarorganizemcpware/cross-code-organizerOpen the Cross-Code Organizer (CCO) dashboard — view and manage all memories, skills, MCP servers, hooks, and configs across scopes0skills.sh installs