structured-output

Installation
SKILL.md

Structured Output (Strict JSON)

Implement stable, schema-validated JSON outputs for agents. Use this when responses must be valid JSON, match a schema exactly, and be reliable under retries/streaming.

Core Workflow

  1. Define a strict schema (JSON Schema or Pydantic).
  2. Generate JSON-only output (no prose).
  3. Validate output against schema.
  4. If invalid, run a repair pass with a minimal error-focused prompt.
  5. For streaming, emit incremental JSON with a deterministic assembly buffer.

Prompt Pattern (Non-Streaming)

Use a strict system instruction and a minimal user prompt. Always require JSON only. Input can be empty; output must still match the schema.

Template:

Installs
1
GitHub Stars
17
First Seen
Aug 3, 2026
structured-output — xspoonai/spoon-awesome-skill