llm-structured-output
Skill by sickn33
Gets typed JSON, enums and objects from LLM responses instead of free-text parsing. Covers OpenAI response_format, Anthropic tool_use and Google Gemini responseSchema for developers building pipelines.
Install llm-structured-output
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/llm-structured-output ~/.claude/skills/llm-structured-outputRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/llm-structured-output ~/.gemini/antigravity-cli/skills/llm-structured-outputAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install llm-structured-output in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill extracts typed, validated data from LLM API responses instead of parsing free text. It covers three main approaches: OpenAI's response_format with JSON Schema, Anthropic's tool_use block used for extraction, and Google's responseSchema in Gemini. It also covers local models that use GBNF grammars or constrained decoding.
The skill guides schema design, including field descriptions, system prompts and validation with Pydantic or Zod. It includes a retry loop for validation failures, capped at three attempts, and guidance on logging. It is aimed at developers building pipelines where LLM output feeds code, such as database writes, API calls or UI rendering. Examples show Python and TypeScript code for each approach.
Written from the project's SKILL.md and checked against it.
What it can do
- OpenAI Structured OutputsUses response_format with json_schema and strict mode for schema-conformant output.
- Anthropic tool_use extractionForces a single tool so the data comes back in the tool_use content block.
- Gemini responseSchemaSets a JSON Schema and application/json MIME type for Gemini responses.
- Pydantic and Zod schemasDefines models in Python or TypeScript and converts Zod schemas with zodResponseFormat.
- Validation and retry loopValidates output in application code and retries failed extractions up to three times.
- Local constrained decodingDescribes GBNF grammars and the --json-schema flag for llama.cpp and vLLM.
What you need
- Access to OpenAI, Anthropic or Google Gemini APIs
- Pydantic for Python or Zod for TypeScript
Try asking
- Extract sentiment, topics and purchase intent from these reviews as JSON.
- Pull vendor, total and line items from this invoice text into a typed object.
- Build a Pydantic model for event details and parse this text into it.
Good to know
- Examples use historical model IDs and need verification before deployment.
- Strict output support and schema subsets differ by provider and API.
- Not for free-form text generation or calling real external tools.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/llm-structured-output/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md16 KB
Alternatives to llm-structured-output
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
llm-structured-output: common questions
Does this skill call external tools or APIs?
No. The source says it uses Anthropic's tool_use only as a structured output method, not for actual tool orchestration.
Is JSON mode enough to get reliable output?
The source says json_object mode without a schema only guarantees valid JSON syntax, not schema conformance. It recommends json_schema with a full schema definition.
Can I trust a schema-valid LLM result?
The source says a schema-valid value is untrusted data. It should not authorize a database write or external call without checks in application code.
How do I install llm-structured-output?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is llm-structured-output free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is llm-structured-output safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to llm-structured-output?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
