npx claudepluginhub crouton-labs/crouton-kit --plugin authoringThis skill uses the workspace's default tool permissions.
Structured output guarantees valid typed JSON from LLMs — the model can only emit tokens that conform to your schema. The question isn't how it works but when you need it.
Implements Playwright E2E testing patterns: Page Object Model, test organization, configuration, reporters, artifacts, and CI/CD integration for stable suites.
Guides Next.js 16+ Turbopack for faster dev via incremental bundling, FS caching, and HMR; covers webpack comparison, bundle analysis, and production builds.
Discovers and evaluates Laravel packages via LaraPlugins.io MCP. Searches by keyword/feature, filters by health score, Laravel/PHP compatibility; fetches details, metrics, and version history.
Structured output guarantees valid typed JSON from LLMs — the model can only emit tokens that conform to your schema. The question isn't how it works but when you need it.
Use when: data extraction, API responses, agent tool outputs, any downstream code that parses the response.
Don't use when: prose, creative writing, chat, or when the quality cost outweighs the reliability gain.
For code examples and provider-specific patterns, see reference.md.
Constrained decoding has a cost. Tam et al. (2024) showed JSON constraints dropped math accuracy by 26–32 percentage points across tested models. The mechanism: forced key ordering means the model must generate answer tokens before reasoning tokens, disrupting sequential reasoning.
The fix is schema design, not giving up on structured output. Enforcement is syntactic, not semantic — valid JSON can still be semantically wrong.
The PARSE paper (2025) found structural reorganization was the top optimization for extraction accuracy — more impactful than model choice or prompt engineering. A single ambiguous field name (final_choice alongside potential_final_choices) collapsed accuracy from 95% → 4.5% in Instructor's experiments.
Put a reasoning or thinking field first in your schema. LLMs generate keys in order — reasoning before answer tokens restores chain-of-thought within structured output. Instructor showed this alone recovers accuracy from 33% → 92% on GSM8K.
{
"type": "object",
"properties": {
"reasoning": { "type": "string", "description": "Step-by-step analysis before concluding" },
"answer": { "type": "string" },
"confidence": { "type": "string", "enum": ["high", "medium", "low"] }
},
"required": ["reasoning", "answer", "confidence"],
"additionalProperties": false
}
minimum/maximum/pattern — neither Anthropic nor OpenAI enforces these at the grammar level. Validate post-generation.These patterns apply directly to tool-design — tool schemas are structured output schemas.
Type system (Zod/Pydantic)
→ JSON Schema
→ LLM with constrained decoding
→ Validate (syntactic: already guaranteed; semantic: your validators)
→ Retry with error feedback on failure
Libraries doing this loop:
max_retries.zodResponseFormat + beta.chat.completions.parse() — returns .parsed typed directly.zodOutputFormat helper from @anthropic-ai/sdk/helpers/zod.generateObject / streamObject with a Zod schema.Zod v4 has native z.toJSONSchema() for converting schemas to JSON Schema format.
For mechanism details, provider comparison, streaming patterns, and failure modes, see reference.md.