instructor
Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream…
Skill by Tommy-yw
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/tommy-yw-instructor
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
instructor- Description
- Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream partial results with Instructor - battle-tested structured output library
- License
- MIT
- Instructions
- 732 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 732 lines (spec recommends under 500)
Files (4)
- SKILL.md
- examples.md · references/
- providers.md · references/
- validation.md · references/
SKILL.md (first lines)
# Instructor: Structured LLM Outputs
## When to Use This Skill
Use Instructor when you need to:
- **Extract structured data** from LLM responses reliably
- **Validate outputs** against Pydantic schemas automatically
- **Retry failed extractions** with automatic error handling
- **Parse complex JSON** with type safety and validation
- **Stream partial results** for real-time processing
- **Support multiple LLM providers** with consistent API
**GitHub Stars**: 15,000+ | **Battle-tested**: 100,000+ developers
## Installation
```bash
# Base installation
pip install instructor
# With specific providers
pip install "instructor[anthropic]" # Anthropic Claude
pip install "instructor[openai]" # OpenAI
pip install "instructor[all]" # All providers
```
## Quick Start
### Basic Example: Extract User Data
```python
import instructor
from pydantic import BaseModel
from anthropic import Anthropic
# Define output structure
class User(BaseModel):
name: str
age: int
email: str
# Create instructor client
client = instructor.from_anthropic(Anthropic())
# Extract structured data
user = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{
"role": "user",
"content": "John Doe is 30 years old. His email is john@example.com"
}],
response_model=User
)
print(user.name) # "John Doe"
print(user.age) # 30
print(user.email) # "john@example.com"
```
### With OpenAI
```python
from openai import OpenAI
client = instructor.from_openai(OpenAI())
user = client.chat.completions.create(
model="gpt-4o-mini",
response_model=User,
messages=[{"role": "user", "content": "Extract: Alice, 25, alice@email.com"}]
)
```
## Core Concepts
### 1. Response Models (Pydantic)
Response models define the structure and validation rules for LLM outputs.
#### Basic Model
```python
from pydantic import BaseModel, Field
class Article(BaseModel):
title: str = Field(description="Article title")
author: str = Field(description="Author name")
word_count: int = Field(description="Number of words", gt=0)
tags: list[str] = Field(description="List of relevant tags")
article = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{
"role": "user",
"content": "Analyze this article: [article text]"
}],
response_model=Article
)
```
**Benefits:**
- Type safety with Python type hints
- Automatic validation (word_count > 0)
- Self-documenting with Field descriptions
- IDE autocomplete support
#### Nested Models
```python
class Address(BaseModel):
street: str
city: str
country: str
class Person(BaseModel):
name: str
age: intFrom Tommy-yw/RunbookHermes, MIT.
More from Tommy-yw/RunbookHermes
- 0.609score
fastmcp
Tommy-yw
Build, test, inspect, install, and deploy MCP servers with FastMCP in Python.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
ascii-video
Tommy-yw
Production pipeline for ASCII art video — any format.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
fitness-nutrition
Tommy-yw
Gym workout planner and nutrition tracker.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
neuroskill-bci
Tommy-yw
Connect to a running NeuroSkill instance and incorporate the user's real-time cognitive and emotional state (focus, relaxation, mood, cognitive load…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
concept-diagrams
Tommy-yw
Generate flat, minimal light/dark-aware SVG diagrams as standalone HTML files, using a unified educational visual language with 9 semantic color ramps…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
hermes-atropos-environments
Tommy-yw
Build, test, and debug Hermes Agent RL environments for Atropos training.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-infographic
Tommy-yw
Generate professional infographics with 21 layout types and 21 visual styles.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
manim-video
Tommy-yw
Production pipeline for mathematical and technical animations using Manim Community Edition.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
drug-discovery
Tommy-yw
Pharmaceutical research assistant for drug discovery workflows.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
godmode
Tommy-yw
Jailbreak API-served LLMs using G0DM0D3 techniques — Parseltongue input obfuscation (33 techniques), GODMODE CLASSIC system prompt templates, ULTRAPLINIAN…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
oss-forensics
Tommy-yw
Supply chain investigation, evidence recovery, and forensic analysis for GitHub repositories.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-comic
Tommy-yw
Knowledge comic creator supporting multiple art styles and tones.
SkillCFreshness: C★ 510Claude Code +9
Signals
- Stars
- 510
- Forks
- 36
- Open issues
- 2
- Last commit (this folder)
- May 1, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Tommy-yw/RunbookHermes
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.673score
instructor
Orchestra-Research
Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream…
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.324score
instructor
Colin4k1024
Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream…
SkillCFreshness: C★ 14Claude Code +9 - 0.241score
instructor
future1314
Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream…
SkillDFreshness: DClaude Code +9
More from Tommy-yw
- 0.609score
godmode
Tommy-yw
Jailbreak API-served LLMs using G0DM0D3 techniques — Parseltongue input obfuscation (33 techniques), GODMODE CLASSIC system prompt templates, ULTRAPLINIAN…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
manim-video
Tommy-yw
Production pipeline for mathematical and technical animations using Manim Community Edition.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-infographic
Tommy-yw
Generate professional infographics with 21 layout types and 21 visual styles.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
drug-discovery
Tommy-yw
Pharmaceutical research assistant for drug discovery workflows.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
oss-forensics
Tommy-yw
Supply chain investigation, evidence recovery, and forensic analysis for GitHub repositories.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
concept-diagrams
Tommy-yw
Generate flat, minimal light/dark-aware SVG diagrams as standalone HTML files, using a unified educational visual language with 9 semantic color ramps…
SkillCFreshness: C★ 510Claude Code +9
Cite this page
instructor skill. Agent Mart. https://agentmart.dev/skills/tommy-yw-instructor (last updated 2026-10-24)