Agent skill · AI & Agents

llm-structured-output

Get reliable JSON, enums, and typed objects from LLMs using response_format, tool_use, and schema-constrained decoding across OpenAI, Anthropic, and Google APIs.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill llm-structured-output --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 15 KB
Bundled scripts: none
Path: skills/ai-llm/llm-structured-output/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# LLM Structured Output ## What This Skill Does Extract typed, validated data from LLM API responses instead of parsing free-text. This skill covers the three main approaches: OpenAI's `response_format` with JSON Schema, Anthropic's `tool_use` block for structured extraction, and Google's `responseSchema` in Gemini. You will learn when each approach works, when it breaks, and how to build retry logic around schema validation failures that every production system encounters. ## When to Use This Skill - The user needs to extract structured data (JSON objects, arrays, enums) from an LLM response - The user is building a pipeline where LLM output feeds directly into code (database writes, API calls, UI rendering) - The user asks about `response_format`, `json_mode`, `json_object`, or `json_schema` in OpenAI - The user asks about using Anthropic's `tool_use` or `tool_result` blocks for data extraction (not for actual tool execution) - The user asks about Zod schemas with `zodResponseFormat()` from the `openai` npm package - The user needs to parse LLM output into Pydantic models using `instructor`, `marvin`, or manual validation - The user is getting malformed JSON, missing fields, or w

What's inside
Steps it walks through
  1. What This Skill Does
  2. When to Use This Skill
  3. Core Workflow
  4. Examples
  5. Example 1: OpenAI Structured Outputs with Pydantic (Python)
  6. Example 2: Anthropic tooluse for Structured Extraction (Python)
  7. Example 3: TypeScript with Zod + zodResponseFormat
  8. Never Do This
  9. Edge Cases
  10. Best Practices
  11. Limitations
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the llm-structured-output skill do?

Get reliable JSON, enums, and typed objects from LLMs using response_format, tool_use, and schema-constrained decoding across OpenAI, Anthropic, and Google APIs.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill llm-structured-output --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.

Keep going