---
name: "json-schema-output-enforcer"
description: "Guarantee 100% valid JSON responses conforming strictly to predefined JSON Schemas."
metadata:
  author: "OpenAI"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "enforce structured json output"
  - "validate json schema response"
  - "generate valid json from llm"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# JSON Schema Constrained Structured Outputs

Configures strict schema decoding (OpenAI json_schema, Anthropic tool schemas, Ollama grammar): eliminating Markdown code fence wrapping, invalid commas, and missing required properties.

## When to Invoke
Invoke this skill whenever you need to:
- enforce structured json output
- validate json schema response
- generate valid json from llm

## Execution SOP & Rules
1. Set strict: true and provide complete JSON Schema definitions with additionalProperties: false.
2. Ensure all object fields are listed in the required array.
3. Avoid asking for Markdown fences when strict JSON output mode is enabled.
4. Handle JSON parse errors with automated corrective schema feedback loops.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
