structured-output

structured-output is a skill for Claude Code from sigistry/marketplace. It costs 89 tokens per session (1,085 once invoked), scanned A, original, MIT.

A guide for getting dependable machine-readable results from large language models (LLMs), especially JSON. It explains how to use schema-constrained output, validate every response, and retry boundedly when a response is invalid.

In plain words
What is it for?
Use it when building JSON responses, tool arguments, function calls, or data-processing pipelines that must match a defined schema.
Why use it?
It prevents application errors caused by models returning malformed, incomplete, or incorrectly shaped data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the llm-app-hardener plugin — 4 skills, 4 commands, 2 agents shipped together

Good fit Use it when building JSON responses, tool arguments, function calls, or data-processing pipelines that must match a defined schema.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sigistry/marketplace/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 sigistry/marketplace --skill structured-output
Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Made for: Claude Code.

Or install llm-app-hardener, the plugin that ships this one along with the rest of its 4 skills, 4 commands, 2 agents.

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/sigistry/marketplace/structured-output.svg)](https://agentmods.dev/skills/sigistry/marketplace/structured-output)
Your own site
<a href="https://agentmods.dev/skills/sigistry/marketplace/structured-output"><img src="https://agentmods.dev/badge/skills/sigistry/marketplace/structured-output.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,085 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.
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.00089 $0.01085
Opus 5 $0.00044 $0.00543
Sonnet 5 $0.00018 $0.00217
Haiku 4.5 $0.00009 $0.00109

Measured 5d ago against content hash b3cd55cf1481, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 5d 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.

plugins/llm-app-hardener/skills/structured-output/SKILL.md · 44 lines

How it starts

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

Structured Output

Purpose

Standardize how an LLM app gets machine-readable output it can trust. Asking a model for JSON in the prompt and calling JSON.parse / json.loads on the result fails on a non-trivial fraction of calls, a stray markdown fence, a trailing comma, a hallucinated field, an unescaped quote, and those failures surface as production exceptions on a code path that "worked in testing." Provider-native structured output (schema-constrained decoding or strict tool schemas) drops the invalid-output rate by one to two orders of magnitude. This skill gives the decision order: use the strongest native mechanism the provider offers, validate every response against a schema, and wrap it in a bounded retry-with-error-feedback loop.

The reliability ladder (strongest first)

  1. Schema-constrained output: the provider constrains decoding to your JSON Schema, guaranteeing the response validates. Anthropic output_config.format (json_schema), OpenAI response_format: json_schema with strict: true, Gemini/Vertex responseSchema. Use this whenever the model supports it.
  2. Strict tool / function schema: when the value is really an argument to an action, route it through a tool with strict: true and additionalProperties: false. The provider validates the tool input against the schema.
  3. Bare JSON mode: {"type": "json_object"} / "json" mode guarantees syntactically valid JSON but not your schema. Only acceptable with validation + retry on top.
  4. Prompt-and-pray: "respond only with JSON" and hope. Never rely on this; it is the pattern this skill exists to replace.

Always add layers 1–3 with the validate-and-retry loop below, native constraints can still be interrupted by a length cap or a refusal.

The non-negotiable pair: validate, then retry with feedback

Even with native constraints, parse defensively:

  1. Define the schema once (Zod / Pydantic / JSON Schema) and reuse it for both the request constraint and the response check.
  2. Validate every response against it, never trust a raw parse.
  3. On a validation failure, retry a bounded number of times, feeding the validator's error message back into the next request ("your previous output failed validation: ; return output matching the schema"). This self-correction recovers most transient failures.
  4. Cap the attempts and surface a typed failure when exhausted, an unbounded correction loop is a cost and latency hazard.

Read the full file on GitHub · 44 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 44 lines · 89 tokens per session scan A b3cd55cf1481

Subscribe to this mod's changes

structured-output is a skill published in the GitHub repository sigistry/marketplace (3 stars, last pushed 4d ago), licensed MIT. It adds 89 tokens to every session and 1,085 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

nano-banana-prompting

This skill should be used when crafting prompts for Nano Banana Pro (Gemini image generation). Use when users want help writing image generation prompts, need guidance on prompt structure, or want to optimize their prompts for better results.

NikiforovAll/claude-code-rules · 51 tokens

nano-banana

This skill should be used for Python scripting and Gemini image generation. Use when users ask to generate images, create AI art, edit images with AI, or run Python scripts with uv. Trigger phrases include "generate an image", "create a picture", "draw", "make an image of", "nano banana", or any image generation…

NikiforovAll/claude-code-rules · 73 tokens

seedance-prompter

Expert prompt engineering for Seedance 2.0. Use when the user wants to generate a video with multimodal assets (images, videos, audio) and needs the best possible prompt.

wells1137/media-skills · 44 tokens

gemini-prompting

Internal guidance for composing Gemini prompts for coding, review, diagnosis, and research tasks inside the Gemini Claude Code plugin.

ByteLandTechnology/gemini-cc · 28 tokens

skill-meta-prompt

Craft better prompts using proven optimization techniques — use when your prompt needs refinement.

nyldn/claude-octopus · 19 tokens

architecture-optimization

Guided journey from a working codebase grown slow and tangled to one measurably fast, cleanly bounded, and readable. Orchestrates eight skills phase by phase - working-with-legacy-code, clean-architecture, software-design-philosophy, refactoring-patterns, system-design, ddia-systems, release-it, pragmatic-programmer …

wondelai/skills · 226 tokens