Agent skill

Dspy Signature Designer

by OmidZamani in OmidZamani/dspy-skills

A skill your agent uses for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.

MITAuto-check passedAI & LLM Engineering

Install Dspy Signature Designer

skills CLI
$ npx skills add OmidZamani/dspy-skills --skill dspy-signature-designer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OmidZamani/dspy-skills dspy-signature-designer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
dspy-signature-designer
GitHub stars
123
Token cost
~1.9k tokens
SKILL.md length
182 words
Files
2
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.

  • Works in 5 steps: Descriptive docstrings - The class… → Field descriptions - Guide the model… → Constrain outputs - Use Literal for… → …
  • DSPy signatures
  • SKILL.md covers Goal, When to Use, Inputs and Outputs, plus 7 more sections
  • Runs Python scripts from its folder

What it does

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.

When your agent uses it

  • DSPy signatures
  • Typed inputs and outputs
  • Signature classes
  • Pydantic-style structured schemas

Example prompts

  • “/dspy-signature-designer”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Glob, Grep

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Descriptive docstrings - The class docstring becomes the task instruction
  2. Field descriptions - Guide the model with desc parameter
  3. Constrain outputs - Use Literal for categorical outputs
  4. Default values - Provide sensible defaults for optional inputs
  5. Validate types - Pydantic models ensure structured output

What it can do on your machine

Read from SKILL.md and the folder at commit f5db3b7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • dspy.ai
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from OmidZamani/dspy-skills at commit f5db3b7, republished under its MIT licence (© OmidZamani). 182 words, ~1,883 tokens.

Download SKILL.mdSave it as .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.
name
dspy-signature-designer
description
Use for DSPy signatures, InputField, OutputField, typed inputs and outputs, signature classes, and Pydantic-style structured schemas.
allowed-tools
Read, Write, Glob, Grep
version
1.0.0
dspy-compatibility
3.2.1
tags
reasoning

DSPy Signature Designer

Goal

Design clear, type-safe signatures that define what your DSPy modules should do.

When to Use

  • Defining new DSPy modules
  • Need structured/validated outputs
  • Complex input/output relationships
  • Multi-field responses

Inputs

InputTypeDescription
task_descriptionstrWhat the module should do
input_fieldslistRequired inputs
output_fieldslistExpected outputs
type_constraintsdictType hints for fields

Outputs

OutputTypeDescription
signaturedspy.SignatureType-safe signature class

Workflow

Inline Signatures (Simple)
python
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")
Class-based Signatures (Complex)
python
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")

Type Hints Reference

python
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()

Production Examples

Summarization
python
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")
Entity Extraction
python
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()
Multi-Label Classification
python
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")
RAG with Confidence
python
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)"
    )
Complete Module with Signature
python
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}")

Best Practices

  1. Descriptive docstrings - The class docstring becomes the task instruction
  2. Field descriptions - Guide the model with desc parameter
  3. Constrain outputs - Use Literal for categorical outputs
  4. Default values - Provide sensible defaults for optional inputs
  5. Validate types - Pydantic models ensure structured output

Advanced Field Options

python
# 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:")

Limitations

  • Complex nested types require Pydantic models
  • Some LLMs struggle with strict type constraints
  • Field descriptions and constraints add to prompt length
  • Default values only work for InputField, not OutputField

Official Documentation

© OmidZamani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/dspy-signature-designer of OmidZamani/dspy-skills.

  • SKILL.md
  • example.py

Open the folder on GitHubat commit f5db3b7

Compare with similar skills

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.

Dspy Signature Designer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dspy Signature Designer this skillOmidZamani/dspy-skills123—~1.9kAutomated safety check: PassMIT
Instructor Structured LLM OutputsOrchestra-Research/AI-Research-SKILLs13k6 repos~4.2kAutomated safety check: PassMIT
Pydantic AIdavila7/claude-code-templates33k3 repos~2.9kAutomated safety check: PassMIT
Outlines Structured GenerationOrchestra-Research/AI-Research-SKILLs13k9 repos~4kAutomated safety check: PassMIT
Adk Stylegoogle/adk-python22k—~769Automated safety check: PassApache-2.0
Mastering Python SkillSpillwaveSolutions/agent-brain119—~1.4kAutomated safety check: NotesMIT

Similar skills

  • 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.

    13k GitHub starsUsed in 6 repos~4.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Pydantic AI

    davila7/claude-code-templates

    Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.

    33k GitHub starsUsed in 3 repos~2.9k tokens
    AI & LLM EngineeringAuto-check passed
  • Outlines Structured Generation

    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.

    13k GitHub starsUsed in 9 repos~4k tokens
    AI & LLM EngineeringAuto-check passed
  • Adk Style

    google/adk-python

    Official

    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…

    22k GitHub stars~769 tokensUpdated today
    DevelopmentAuto-check passed
  • Mastering Python Skill

    SpillwaveSolutions/agent-brain

    Modern Python coaching covering language foundations through advanced production patterns.

    119 GitHub stars~1.4k tokensUpdated 21 days ago
    DevelopmentAuto-check: notes
  • Code Review

    vectorize-io/hindsight

    Review changed code against project standards. An agent skill from vectorize-io/hindsight.

    48k GitHub stars~12k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from OmidZamani/dspy-skills

All 17 skills in this repo
  • Skill Perfection

    OmidZamani/dspy-skills

    A skill your agent uses when you need to QA audit and fix a plugin skill file.

    123 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Haystack Integration

    OmidZamani/dspy-skills

    A skill your agent uses for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.

    123 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Adapters Multimodal

    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.

    123 GitHub stars~864 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Advanced Module Composition

    OmidZamani/dspy-skills

    A skill your agent uses for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.

    123 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Better Together

    OmidZamani/dspy-skills

    A skill your agent uses for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p - w - p.

    123 GitHub stars~756 tokensUpdated 3 mo ago
    Auto-check passed
  • Dspy Bootstrap Fewshot

    OmidZamani/dspy-skills

    A skill your agent uses for BootstrapFewShot, bootstrapped demonstrations, teacher-model demos, and low-data DSPy prompt optimization.

    123 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Dspy Signature Designer

What does Dspy Signature Designer do?

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.

When should I use Dspy Signature Designer?

Dspy Signature Designer fits situations like: DSPy signatures; typed inputs and outputs; signature classes; pydantic-style structured schemas.

How do I install Dspy Signature Designer in Claude Code?

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.

How do I install Dspy Signature Designer in Codex?

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.

Can I use Dspy Signature Designer in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Dspy Signature Designer need to run?

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.

Does Dspy Signature Designer access the network?

SKILL.md names 2 domains. As links in the text: dspy.ai and github.com. This is read from the text; nothing was executed.

Is Dspy Signature Designer safe to install?

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.

What licence does Dspy Signature Designer use?

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.

How many tokens does Dspy Signature Designer use?

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.

What are the alternatives to Dspy Signature Designer?

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.

Who maintains Dspy Signature Designer?

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.