agentsclimarketplace

Llm output schema generator

Skill imtiazrayhan/agentscamp-library/skills/llm-output-schema-generator

Turn an example of the data you want from an LLM into a precise, validated output schema (Pydantic / Zod / JSON Schema) and wire it into structured-output calls. Use when adding typed LLM output, replacing brittle JSON parsing, or designing an extraction shape.From its SKILL.md

Install
npx -y skills add imtiazrayhan/agentscamp-library --skill llm-output-schema-generator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.0 KB, 584 tokens by cl100k_base, as published. Nobody here has run it

The reliable way to get data (not prose) from an LLM is to give it a schema and validate against it. This skill builds that schema from a concrete example of what you want back, then wires it into a structured-output call — so the model returns typed, validated objects and your code stops parsing free-form JSON by hand.

This is distinct from generating test fixtures (that's a mock-data factory) and from documenting an existing API (that's an OpenAPI doc writer): here the output is the schema the LLM must conform to.

When to use this skill

  • Adding typed/structured output to an LLM feature (extraction, classification, form-filling).
  • Replacing fragile JSON.parse + try/catch around model output with a validated schema.
  • Designing the exact shape for an extraction or tool-output contract.

Instructions

  1. Start from a real example. Take a representative sample of the desired output (or a few). Infer fields and types from the data, not from a guess — and gather a couple of edge-case examples so optionality and unions are right.
  2. Type precisely. Choose specific types (int vs. float, date vs. string), mark genuinely optional fields optional and required fields required, and use enums for closed sets rather than free strings.
  3. Add model-facing descriptions. Field descriptions are prompt surface in structured-output libraries — say what each field means, with units and formats ("ISO 8601", "USD cents"). This improves the model's accuracy, not just documentation.
  4. Constrain to make bad output impossible. Add bounds, patterns, and enums so invalid values can't validate. Prefer a flatter shape where it doesn't lose meaning — deeply nested schemas are harder for models to fill correctly.
  5. Emit in the target stack. Generate the schema as Pydantic (Python), Zod (TypeScript), a .baml type, or JSON Schema — matching the structured-output tool in use (Instructor, BAML, or the Vercel AI SDK).
  6. Wire and validate. Hook it into the structured-output call with retry-on-validation-failure, and test it against the original examples plus the edge cases.

[!TIP] Let the schema carry the instructions. A well-named field with a clear description and an enum often replaces a paragraph of prompt — see Structured Output vs JSON Mode vs Function Calling.

Output

A validated output schema in the target language, with typed/constrained fields and descriptions, wired into a structured-output call with retry — verified against the example outputs.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.