structured-output

structured-output is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 38 tokens per session (1,420 once invoked), scanned A, original, MIT.

Guidance for making a language model return machine-readable data, such as validated JSON with the right fields and types. It covers schemas, built-in structured-output methods, validation, repair, retries, and missing information.

In plain words
What is it for?
Use it for extracting fields from text, fixed-label classification, or any workflow where model output is consumed by a program rather than read only by a person.
Why use it?
Simply asking for JSON can still produce malformed or incorrect results that break software. This helps represent missing values clearly and check outputs before code uses them.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for extracting fields from text, fixed-label classification, or any workflow where model output is consumed by a program rather than read only by a person.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/structured-output
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nimadorostkar/Claude-Skills-collection --skill structured-output
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for structured-output

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/structured-output/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/structured-output)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/structured-output"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/structured-output/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for structured-output

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/structured-output"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/structured-output.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,420 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01420
Opus 5 $0.00019 $0.00710
Sonnet 5 $0.00008 $0.00284
Haiku 4.5 $0.00004 $0.00142

Measured 11d ago against content hash 41fbd6d0e07c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

structured-output scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai/structured-output/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Structured Output

Purpose

Get reliably parseable, correctly typed data out of a language model. The naive approach — asking for JSON in the prompt and calling json.loads — fails often enough to be a production incident.

When to Use

  • Extracting fields from unstructured text.
  • Classification with a fixed set of labels.
  • Any LLM output consumed by code rather than read by a human.
  • A pipeline that fails intermittently on parse errors.

Capabilities

  • Schema design that models follow reliably.
  • Native structured output: JSON schema mode, tool calling, constrained decoding.
  • Validation, repair, and retry.
  • Confidence and abstention: letting the model say it does not know.
  • Extraction from long, messy, or partially irrelevant documents.

Inputs

  • The target schema and the semantics of each field.
  • The input text and how messy it actually is.
  • What should happen when a field is genuinely absent.

Outputs

  • Validated, typed objects.
  • An explicit representation of absence, distinct from a guess.
  • A measured extraction accuracy per field.

Workflow

  1. Use the API's native mechanism — JSON schema mode or tool calling constrains the decoder so that malformed output is structurally impossible. Asking for JSON in prose does not.
  2. Design the schema for a model, not a database — Descriptive field names, enums instead of free strings, and a description on every field explaining what belongs in it. The schema is documentation the model reads.
  3. Make absence representable — A nullable field with a clear meaning. Without one, the model will invent a plausible value rather than leave it out, because that is what the schema demanded.
  4. Validate, then repair, then fail — Parse against the schema. On a semantic failure (a valid date that is in the future when it must be past), send the error back for one repair attempt, then give up cleanly.
  5. Measure per field — Aggregate extraction accuracy hides the one field that is wrong 40% of the time.

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 138 lines · 38 tokens per session scan A 41fbd6d0e07c

Subscribe to this mod's changes

structured-output is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 23d ago), licensed MIT. It adds 38 tokens to every session and 1,420 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

prompt-engineer

Expert prompt engineering for AI systems. Use when the user wants to write or review prompts for AI, create instructions for AI systems, build system prompts, review or improve existing prompts, optimize AI instructions, or create any form of written communication intended for AI consumption (Claude, GPT, or other…

SZoloth/skill-pack · 66 tokens

few-shot-quality-prompting

Master guide for crafting prompts that make AI models produce professional-quality code and UI consistently. Trigger whenever the user asks about prompt engineering, improving AI output quality, building system prompts, few-shot examples, making AI write better code, prompt optimization, or says "how to prompt"…

mahmoud20138/Tradecraft · 102 tokens

huashu-prompt-save

Automatically identifies the prompt type and saves it to the appropriate category (Technical / Content / Teaching / Product / General). Use when the user mentions "save prompt", "record prompt", or "organise prompts".

Biraj2004/huashu-skills-english · 49 tokens

agent-orchestration-improve-agent

Systematic improvement of existing agents through performance analysis, prompt engineering, and continuous iteration.

lingxling/awesome-skills-cn · 25 tokens

prompt-optimizer

A guide for reviewing and rewriting prompts intended for Claude, an AI assistant, including Claude Code. It focuses on making instructions clearer and more specific.

imamirezaei/Product-Team-Claude-Skills · 167 tokens

agent-platform-prompt-management

Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.

google/skills · 55 tokens