output: Skill for Claude Code

.claude/skills/llm-output-schema-constraints/SKILL.md

llm-output-schema-constraints is a skill for Claude Code from growthxai/output. It costs 53 tokens per session (584 once invoked), scanned A, original, Apache-2.0.

A reference for choosing Zod validation rules when a schema is sent to a language model as structured output. Zod is a TypeScript library for describing and checking data shapes.

In plain words
What is it for?
Use it when writing or reviewing Zod schemas passed to Output.object(), or when debugging structured-output validation problems.
Why use it?
Some numeric and array limits are rejected or ignored by Anthropic when converted into the schema format used for tools, which can cause errors or unreliable validation.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is growthxai/output's own configuration. It tells Claude Code how to work on output itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything output configures →

Reuse

Borrowing it

Nothing to install: this file belongs to growthxai/output. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/growthxai/output/main/.claude/skills/llm-output-schema-constraints/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/growthxai/output

Made for: Claude Code.

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 llm-output-schema-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/growthxai/output/llm-output-schema-constraints/github.svg)](https://agentmods.dev/skills/growthxai/output/llm-output-schema-constraints)
Your own site
<a href="https://agentmods.dev/skills/growthxai/output/llm-output-schema-constraints"><img src="https://agentmods.dev/badge/skills/growthxai/output/llm-output-schema-constraints/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 llm-output-schema-constraints

Your own site · 80×15
<a href="https://agentmods.dev/skills/growthxai/output/llm-output-schema-constraints"><img src="https://agentmods.dev/badge/skills/growthxai/output/llm-output-schema-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 584 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.00053 $0.00584
Opus 5 $0.00026 $0.00292
Sonnet 5 $0.00011 $0.00117
Haiku 4.5 $0.00005 $0.00058

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

Security

Grade A, and why

llm-output-schema-constraints 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 7d 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.

.claude/skills/llm-output-schema-constraints/SKILL.md · 48 lines

How it starts

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

Schema Constraints for LLM Structured Output

When using aiSdk.Output.object() with generateText, the Zod schema is converted to JSON Schema and sent to the LLM provider as a tool definition. Anthropic does not support many JSON Schema constraints, which means certain Zod methods will cause errors or be silently ignored when the schema is sent to the provider.

Unsupported constraints in LLM output schemas

Numbers: .min(), .max() on z.number() produce minimum/maximum — rejected by Anthropic.

Arrays: .min(), .max(), .length() on z.array() produce minItems/maxItems — Anthropic only supports minItems of 0 or 1. Any other value (e.g. .length(3), .min(2)) will be rejected.

Rule: Use .describe() instead of numeric/array constraints for LLM output schemas

import { aiSdk } from '@outputai/llm';

// LLM output schema - sent to provider via aiSdk.Output.object()
output: aiSdk.Output.object( {
  schema: z.object( {
    score: z.number().describe( 'Quality score 0-100' ),
    predictions: z.array( predictionSchema ).describe( 'Exactly 3 predictions' )
  } )
} )
// Workflow/evaluator validation schema - Zod-only, NOT sent to LLM
export const workflowOutputSchema = z.object( {
  score: z.number().min( 0 ).max( 100 ).describe( 'Quality score 0-100' ),
  predictions: z.array( predictionSchema ).length( 3 ).describe( 'Exactly 3 predictions' )
} );

When to use which

Context .min()/.max()/.length() .describe()
Schema passed to aiSdk.Output.object() No (numbers or arrays) Yes
inputSchema / outputSchema on workflows OK Optional
outputSchema on evaluators OK Optional
workflowOutputSchema in types.ts OK Optional

The .describe() annotation guides the LLM on expected ranges and counts. The .min()/.max()/.length() constraints are for runtime Zod validation only and should be used on schemas that validate data within your application, not schemas sent to LLM providers.

Read the full file on GitHub · 48 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. 7d ago Changed · +2 lines · +4 tokens per session e566bd1bff7d
  2. 11d ago First seen · 46 lines · 49 tokens per session scan A fcefd32c4e31

Subscribe to this mod's changes

llm-output-schema-constraints is a skill published in the GitHub repository growthxai/output (435 stars, last pushed today), licensed Apache-2.0. It adds 53 tokens to every session and 584 once invoked, about $0.0003 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

system-prompts

Write system prompts, tool docs, and agent definitions. Project tag conventions + RFC 2119 keywords + dense compression. Use when authoring or editing any prompt the model reads.

can1357/oh-my-pi · 40 tokens

ax-ai

This skill helps an LLM generate correct AI provider setup and configuration code using @ax-llm/ax. Use when the user asks about ai(), providers, models, routing, adaptive balancing, presets, embeddings, batch audio with ai.transcribe() or ai.speak(), extended thinking, context caching, or mentions…

ax-llm/ax · 100 tokens

ax-agent-rlm

This skill helps an LLM generate correct AxAgent RLM/runtime code using @ax-llm/ax. Use when the user asks about RLM code execution, AxJSRuntime, contextFields, contextPolicy, liveRuntimeState, promptLevel, stage prompt controls, executorModelPolicy, maxRuntimeChars, agent.test(...), llmQuery(...), recursionOptions…

ax-llm/ax · 88 tokens

ax-flow

This skill helps an LLM generate correct AxFlow workflow code using @ax-llm/ax. Use when the user asks about flow(), AxFlow, workflow orchestration, parallel execution, DAG workflows, conditional routing, map/reduce patterns, or multi-node AI pipelines.

ax-llm/ax · 59 tokens

ax-gen

This skill helps an LLM generate correct AxGen code using @ax-llm/ax. Use when the user asks about ax(), AxGen, generators, forward(), streamingForward(), validation, assertions, streaming assertions, field processors, step hooks, self-tuning, or structured outputs. For MCP clients, transports, prompts, resources…

ax-llm/ax · 86 tokens

ax-signature

This skill helps an LLM generate correct DSPy signature code using @ax-llm/ax. Use when the user asks about signatures, s(), f(), field types, string syntax, fluent builder API, validation constraints, or type-safe inputs/outputs.

ax-llm/ax · 57 tokens