instructor
Structured outputs with Instructor. Extract typed data from LLMs using Pydantic models and validation. Use for data extraction, structured generation, and type-safe LLM responses.
npx skills add majiayu000/claude-skill-registry --skill instructor-housegarofalo-claude-code-base-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Instructor Expert guidance for structured LLM outputs with Pydantic validation. ## Triggers Use this skill when: - Extracting structured data from LLM responses - Building type-safe LLM applications - Validating LLM outputs with Pydantic - Implementing data extraction pipelines - Working with structured generation - Keywords: instructor, structured output, pydantic, data extraction, validation, typed responses ## Installation ```bash pip install instructor ``` ## Quick Start ```python import instructor from pydantic import BaseModel from openai import OpenAI # Patch OpenAI client client = instructor.from_openai(OpenAI()) class User(BaseModel): name: str age: int # Extract structured data user = client.chat.completions.create( model="gpt-4o", response_model=User, messages=[ {"role": "user", "content": "John is 25 years old"} ] ) print(user) # User(name='John', age=25) ``` ## Pydantic Models ### Basic Models ```python from pydantic import BaseModel, Field from typing import Optional, List from enum import Enum class Priority(str, Enum): LOW = "low" MEDIUM = "medium" HIGH = "high" class Task(BaseModel): title: str = Field(description="Task title") description: str = Field(descriptio
- Triggers
- Installation
- Quick Start
- Pydantic Models
- Basic Models
- Nested Models
- Validation
- Field Validators
- Model Validators
- Retries
- Streaming
- Iterable Extraction
- Multiple Providers
- Anthropic
pip install instructor
What does the instructor skill do?
Structured outputs with Instructor. Extract typed data from LLMs using Pydantic models and validation. Use for data extraction, structured generation, and type-safe LLM responses.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill instructor-housegarofalo-claude-code-base-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
