structured-output
Installation
SKILL.md
Structured Output
Overview
LLMs love to ramble. When you need JSON, you get JSON wrapped in markdown. When you need a list, you get a paragraph. Structured output forces the model to return exactly the schema you define — validated, typed, and ready to use in code without parsing gymnastics.
When to Use
- Extracting structured data from unstructured text (invoices, emails, articles)
- Building API responses powered by LLMs that must match a schema
- Creating reliable data pipelines where LLM output feeds into databases
- Generating configuration files, test cases, or code from natural language
- Any time you need JSON from an LLM, not prose
Instructions
Strategy 1: OpenAI Structured Outputs (Native)
OpenAI's response_format with JSON Schema guarantees valid JSON matching your schema. The model literally cannot produce non-conforming output.
Related skills