structured-outputs

structured-outputs is a skill for Claude Code, Codex from VoDaiLocz/kilo-kit-mcp. It costs 48 tokens per session (1,003 once invoked), scanned A, original, Apache-2.0.

A guide for making AI-generated data match a defined schema, using tools such as JSON Schema, Pydantic, or Zod, with validation and recovery when output is invalid.

In plain words
What is it for?
Use it to extract fields from documents, logs, invoices, or emails, validate model responses, and enforce the shape of arguments passed to tools.
Why use it?
It prevents unreliable model text from breaking software that needs predictable data for APIs, databases, user interfaces, or tool calls.

Skill for Claude CodeCodex

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

Good fit Use it to extract fields from documents, logs, invoices, or emails, validate model responses, and enforce the shape of arguments passed to tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vodailocz/kilo-kit-mcp/structured-outputs
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 VoDaiLocz/kilo-kit-mcp --skill structured-outputs
Clone the repo
git clone --depth 1 https://github.com/VoDaiLocz/kilo-kit-mcp

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-outputs

README.md
[![agentmods](https://agentmods.dev/badge/skills/vodailocz/kilo-kit-mcp/structured-outputs/github.svg)](https://agentmods.dev/skills/vodailocz/kilo-kit-mcp/structured-outputs)
Your own site
<a href="https://agentmods.dev/skills/vodailocz/kilo-kit-mcp/structured-outputs"><img src="https://agentmods.dev/badge/skills/vodailocz/kilo-kit-mcp/structured-outputs/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-outputs

Your own site · 80×15
<a href="https://agentmods.dev/skills/vodailocz/kilo-kit-mcp/structured-outputs"><img src="https://agentmods.dev/badge/skills/vodailocz/kilo-kit-mcp/structured-outputs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,003 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.00048 $0.01003
Opus 5 $0.00024 $0.00502
Sonnet 5 $0.00010 $0.00201
Haiku 4.5 $0.00005 $0.00100

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

Security

Grade A, and why

structured-outputs 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 8d 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/engineering/structured-outputs/SKILL.md · 73 lines

How it starts

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

Structured Outputs & Type-Safe Extraction

Overview

The structured-outputs skill provides a framework for ensuring that language models produce data in deterministic, valid, and type-safe formats. This is essential for building robust AI-driven systems where LLM outputs must be consumed by downstream services, databases, or UI components.

When To Use

  • When extracting structured data from unstructured text (e.g., invoices, logs, emails).
  • When controlling tool call arguments to guarantee they meet internal API specifications.
  • When you need to bridge the gap between non-deterministic LLM generation and deterministic software logic.
  • Whenever you see developers relying on regex parsing of unstructured model text.

Core Concepts

  1. Schema Definition: Defining the expected structure using JSON Schema, Pydantic (Python), or Zod (TypeScript).
  2. Validation: Enforcing schema constraints at generation time or post-generation.
  3. Recovery: Handling failures gracefully using self-healing loops.
  4. Constraint Generation: Using techniques to force compliance during the generation process itself.

Patterns

1. Strict Schema Contracts

  • Use Pydantic v2 for Python and Zod for TypeScript to create strongly-typed classes that represent your domain entities.
  • Ensure all fields are explicitly defined with types and, where necessary, constraints (e.g., Field(min_length=1, ...)).

2. Parse-Validate-Retry (Instructor Pattern)

When an LLM fails to match the schema:

  • Catch the validation error.
  • Extract the specific path of the error (e.g., user.address.zipcode).
  • Re-prompt the model by injecting the original prompt, the failed output, and the validation error traceback.
  • Goal: Enable the model to "self-heal" by correcting its own structural mistakes.

3. Token-Level Constrained Decoding (Outlines/CFG)

Instead of relying on retries, constrain the generation at the token level:

  • Use Finite State Machines (FSM) to mask invalid tokens during the generation process.
  • This guarantees 100% schema compliance by definition, effectively eliminating "JSON parsing errors".

Read the full file on GitHub · 73 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. 8d ago First seen · 73 lines · 48 tokens per session scan A b8190557c111

Subscribe to this mod's changes

structured-outputs is a skill published in the GitHub repository VoDaiLocz/kilo-kit-mcp (26 stars, last pushed 4d ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,003 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-09-03.