Instructor Structured LLM Outputs
Orchestra-Research/AI-Research-SKILLs
Shows how to pull validated, typed data out of LLM responses with Instructor and Pydantic models, including retries on failure and partial streaming.
A skill your agent uses for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dspy-signature-designer .claude/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .claude/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/dspy-signature-designer .agents/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .agents/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/dspy-signature-designer .cursor/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .cursor/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/OmidZamani/dspy-skills.git --path skills/dspy-signature-designer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/dspy-signature-designer .gemini/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .gemini/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/dspy-signature-designer .github/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .github/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/OmidZamani/dspy-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/dspy-signature-designer .opencode/skills/dspy-signature-designer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "dspy-signature-designer" agent skill from https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-signature-designer into .opencode/skills/dspy-signature-designer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-signature-designer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
dspy-signature-designerA skill your agent uses for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
Dspy Signature Designer is an agent skill from OmidZamani/dspy-skills. Use for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `example.py`).
It sits in AI & LLM Engineering, covering Type safety. It works with Pydantic. The repository describes itself as: Collection of Claude Skills for DSPy framework - program language models, optimize prompts, and build RAG pipelines systematically. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit f5db3b7. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteGlobGrepFrom allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
dspy.aigithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Dspy Signature Designer loads about 1.9k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 182 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from OmidZamani/dspy-skills at commit f5db3b7, republished under its MIT licence (© OmidZamani). 182 words, ~1,883 tokens.
.claude/skills/dspy-signature-designer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Design clear, type-safe signatures that define what your DSPy modules should do.
| Input | Type | Description |
|---|---|---|
task_description | str | What the module should do |
input_fields | list | Required inputs |
output_fields | list | Expected outputs |
type_constraints | dict | Type hints for fields |
| Output | Type | Description |
|---|---|---|
signature | dspy.Signature | Type-safe signature class |
import dspy
# Basic
qa = dspy.Predict("question -> answer")
# With types
classify = dspy.Predict("sentence -> sentiment: bool")
# Multiple fields
rag = dspy.ChainOfThought("context: list[str], question: str -> answer: str")from typing import Literal, Optional
import dspy
class EmotionClassifier(dspy.Signature):
"""Classify the emotion expressed in the text."""
text: str = dspy.InputField(desc="The text to analyze")
emotion: Literal['joy', 'sadness', 'anger', 'fear', 'surprise'] = dspy.OutputField()
confidence: float = dspy.OutputField(desc="Confidence score 0-1")from typing import Literal, Optional, List
from pydantic import BaseModel
# Basic types
field: str = dspy.InputField()
field: int = dspy.OutputField()
field: float = dspy.OutputField()
field: bool = dspy.OutputField()
# Collections
field: list[str] = dspy.InputField()
field: List[int] = dspy.OutputField()
# Optional
field: Optional[str] = dspy.OutputField()
# Constrained
field: Literal['a', 'b', 'c'] = dspy.OutputField()
# Pydantic models
class Person(BaseModel):
name: str
age: int
field: Person = dspy.OutputField()class Summarize(dspy.Signature):
"""Summarize the document into key points."""
document: str = dspy.InputField(desc="Full document text")
max_points: int = dspy.InputField(desc="Maximum bullet points", default=5)
summary: list[str] = dspy.OutputField(desc="Key points as bullet list")
word_count: int = dspy.OutputField(desc="Total words in summary")from pydantic import BaseModel
from typing import List
class Entity(BaseModel):
text: str
type: str
start: int
end: int
class ExtractEntities(dspy.Signature):
"""Extract named entities from text."""
text: str = dspy.InputField()
entity_types: list[str] = dspy.InputField(
desc="Types to extract: PERSON, ORG, LOC, DATE",
default=["PERSON", "ORG", "LOC"]
)
entities: List[Entity] = dspy.OutputField()class MultiLabelClassify(dspy.Signature):
"""Classify text into multiple categories."""
text: str = dspy.InputField()
categories: list[str] = dspy.OutputField(
desc="Applicable categories from: tech, business, sports, entertainment"
)
primary_category: str = dspy.OutputField(desc="Most relevant category")
reasoning: str = dspy.OutputField(desc="Explanation for classification")class GroundedAnswer(dspy.Signature):
"""Answer questions using retrieved context with confidence."""
context: list[str] = dspy.InputField(desc="Retrieved passages")
question: str = dspy.InputField()
answer: str = dspy.OutputField(desc="Factual answer from context")
confidence: Literal['high', 'medium', 'low'] = dspy.OutputField(
desc="Confidence based on context support"
)
source_passage: int = dspy.OutputField(
desc="Index of most relevant passage (0-based)"
)import dspy
from typing import Literal, Optional
import logging
logger = logging.getLogger(__name__)
class AnalyzeSentiment(dspy.Signature):
"""Analyze sentiment with detailed breakdown."""
text: str = dspy.InputField(desc="Text to analyze")
sentiment: Literal['positive', 'negative', 'neutral', 'mixed'] = dspy.OutputField()
score: float = dspy.OutputField(desc="Sentiment score from -1 to 1")
aspects: list[str] = dspy.OutputField(desc="Key aspects mentioned")
reasoning: str = dspy.OutputField(desc="Explanation of sentiment")
class SentimentAnalyzer(dspy.Module):
def __init__(self):
self.analyze = dspy.ChainOfThought(AnalyzeSentiment)
def forward(self, text: str):
try:
result = self.analyze(text=text)
# Validate score range
if hasattr(result, 'score'):
result.score = max(-1, min(1, float(result.score)))
return result
except Exception as e:
logger.error(f"Analysis failed: {e}")
return dspy.Prediction(
sentiment='neutral',
score=0.0,
aspects=[],
reasoning="Analysis failed"
)
# Usage
analyzer = SentimentAnalyzer()
result = analyzer(text="The product quality is great but shipping was slow.")
print(f"Sentiment: {result.sentiment} ({result.score})")
print(f"Aspects: {result.aspects}")desc parameterLiteral for categorical outputs# Constraints (available in 3.2.1+)
class ConstrainedSignature(dspy.Signature):
"""Example with validation constraints."""
text: str = dspy.InputField(
min_length=5,
max_length=100,
desc="Input text between 5-100 chars"
)
number: int = dspy.InputField(
gt=0,
lt=10,
desc="Number between 0 and 10"
)
score: float = dspy.OutputField(
ge=0.0,
le=1.0,
desc="Score between 0 and 1"
)
count: int = dspy.OutputField(
multiple_of=2,
desc="Even number count"
)
# Prefix and format
class FormattedSignature(dspy.Signature):
"""Example with custom prefix and format."""
goal: str = dspy.InputField(prefix="Goal:")
text: str = dspy.InputField(format=lambda x: x.upper())
action: str = dspy.OutputField(prefix="Action:")© OmidZamani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/dspy-signature-designer of OmidZamani/dspy-skills.
Open the folder on GitHubat commit f5db3b7
Dspy Signature Designer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Dspy Signature Designer this skillOmidZamani/dspy-skills | 123 | — | ~1.9k | Automated safety check: Pass | MIT | |
| Instructor Structured LLM OutputsOrchestra-Research/AI-Research-SKILLs | 13k | 6 repos | ~4.2k | Automated safety check: Pass | MIT | |
| Pydantic AIdavila7/claude-code-templates | 33k | 3 repos | ~2.9k | Automated safety check: Pass | MIT | |
| Outlines Structured GenerationOrchestra-Research/AI-Research-SKILLs | 13k | 9 repos | ~4k | Automated safety check: Pass | MIT | |
| Adk Stylegoogle/adk-python | 22k | — | ~769 | Automated safety check: Pass | Apache-2.0 | |
| Mastering Python SkillSpillwaveSolutions/agent-brain | 119 | — | ~1.4k | Automated safety check: Notes | MIT |
Orchestra-Research/AI-Research-SKILLs
Shows how to pull validated, typed data out of LLM responses with Instructor and Pydantic models, including retries on failure and partial streaming.
davila7/claude-code-templates
Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.
Orchestra-Research/AI-Research-SKILLs
Uses the Outlines library to constrain model output to a JSON schema, Pydantic model, regex or fixed set of choices when running local models.
google/adk-python
Python style and codebase conventions for ADK (Agent Development Kit): private-by-default file visibility, imports, type hints, Pydantic v2 models, formatting, docstrings, logging, async I/O, file…
SpillwaveSolutions/agent-brain
Modern Python coaching covering language foundations through advanced production patterns.
vectorize-io/hindsight
Review changed code against project standards. An agent skill from vectorize-io/hindsight.
OmidZamani/dspy-skills
A skill your agent uses when you need to QA audit and fix a plugin skill file.
OmidZamani/dspy-skills
A skill your agent uses for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.
OmidZamani/dspy-skills
A skill your agent uses for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.
OmidZamani/dspy-skills
A skill your agent uses for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
OmidZamani/dspy-skills
A skill your agent uses for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p - w - p.
OmidZamani/dspy-skills
A skill your agent uses for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.
Works with
Categories
A skill your agent uses for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas. Dspy Signature Designer is an agent skill from OmidZamani/dspy-skills. Use for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
Dspy Signature Designer fits situations like: DSPy signatures; typed inputs and outputs; signature classes; pydantic-style structured schemas.
Run `npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a claude-code`. Or copy the skill folder (skills/dspy-signature-designer in OmidZamani/dspy-skills) into .claude/skills/dspy-signature-designer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a codex`. Or copy the skill folder (skills/dspy-signature-designer in OmidZamani/dspy-skills) into .agents/skills/dspy-signature-designer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dspy-signature-designer, .gemini/skills/dspy-signature-designer, .github/skills/dspy-signature-designer and .opencode/skills/dspy-signature-designer in your project.
Going by SKILL.md and its folder, Dspy Signature Designer needs Python for the scripts in its folder. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Glob, Grep.
SKILL.md names 2 domains. As links in the text: dspy.ai and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Dspy Signature Designer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Dspy Signature Designer: Instructor Structured LLM Outputs (Orchestra-Research/AI-Research-SKILLs, 13k stars), Pydantic AI (davila7/claude-code-templates, 33k stars), Outlines Structured Generation (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Adk Style (google/adk-python, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
OmidZamani (a GitHub user) maintains it in OmidZamani/dspy-skills, which has 123 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on June 23, 2026.
Source: OmidZamani/dspy-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.