effect-uai-structured-output

Return typed JSON objects validated locally against an Effect Schema.

30|4|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/betalyra/effect-uai --skill effect-uai-structured-output
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-uai-structured-output
Source: https://github.com/betalyra/effect-uai/tree/main/skills/effect-uai-structured-output
Command: npx skills add https://github.com/betalyra/effect-uai --skill effect-uai-structured-output

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables returning a typed JSON object from model outputs and validating it locally, replacing unreliable prose with verifiable structure.

Core Features & Use Cases

  • One turn produces a typed result by applying a defined Effect Schema and using a local decoder for validation.
  • Local decoding with Turn.toStructured ensures data conforms to the schema and provides clear error modes (JsonParseError, StructuredDecodeError, RefusalRejected).
  • Use cases include extracting structured data (recipes, forms, events), enforcing strict contracts between model and application, and supporting streaming or multi-object outputs.

Quick Start

Ask the model to produce a structured output that conforms to a predefined JSON Schema and verify it locally with the decoder.

Frequently Asked Questions about effect-uai-structured-output

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate typed JSON from model outputs locally?

To validate typed JSON locally, use an Effect Schema with StructuredFormat.fromEffectSchema and apply a local decoder via Turn.toStructured to verify model outputs against the schema.

What is the best way to enforce strict JSON schema contracts for AI responses?

Enforcing strict JSON schema contracts requires applying a predefined Effect Schema to model outputs and validating them locally with a decoder, replacing unreliable prose with verifiable structured data.

How does local decoding handle structured data validation errors?

Local decoding handles structured data validation errors by providing clear error modes, specifically JsonParseError, StructuredDecodeError, and RefusalRejected, ensuring data conforms to the schema.

Can I use Effect Schema for extracting structured data like forms and events?

Yes, you can use Effect Schema for extracting structured data such as forms, recipes, and events by applying the schema to model outputs and validating the resulting typed JSON object locally.

Does local validation support streaming or multi-object structured outputs?

Local validation does support streaming or multi-object outputs, allowing you to produce and verify multiple structured data objects from a single turn against a defined Effect Schema.