agentleFS
tolomtolom/prompt-xray-skills/skills/06-structured-output-designer/SKILL.md

structured-output-designer

Skill1 starsChanged 5 months agoMITView on GitHub

Design reliable structured outputs for LLM workflows, including JSON schemas, extraction objects, classification results, CRM fields, tables, and API-ready response contracts. Use this skill when the model output must be parsed, stored, validated, or consumed by software.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to design a stable output contract for LLM-generated data.

    line 10
  2. Distinctive:

    If an LLM output is consumed by software, the prompt should not rely on loosely formatted prose.

    line 14
  3. Distinctive:

    Use this skill when the user needs:

    line 18
  4. Distinctive:

    Use enums for classification fields.

    line 82
  5. Distinctive:

    Write the prompt instructions that force the model to follow the schema.

    line 128

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Structured Output Designer Skill

Purpose

Use this skill to design a stable output contract for LLM-generated data.

The goal is to make model output easier to parse, validate, store, and test.

If an LLM output is consumed by software, the prompt should not rely on loosely formatted prose.

When to use

Use this skill when the user needs:

  • JSON output;
  • schema-compliant output;
  • extraction fields;
  • classification labels;
  • CRM-ready data;
  • API response objects;
  • tables with fixed columns;
  • validation rules;
  • deterministic output structure.

Required input

Collect or infer:

  • what the output will be used for;
  • whether a human or software will consume it;
  • required fields;
  • optional fields;
  • field types;
  • allowed values;
  • validation rules;
  • error/fallback behavior.

Procedure

1. Identify the consumer

Determine who or what will consume the output:

  • human reader;
  • frontend UI;
  • backend service;
  • database;
  • CRM;
  • spreadsheet;
  • workflow automation;
  • another LLM.

2. Define the object purpose

State what the structured output represents.

Example:

This object represents a qualified sales lead extracted from a company website.

3. Define fields

For each field, define:

  • name;
  • type;
  • required/optional;
  • description;
  • allowed values;
  • fallback value;
  • validation rule.

4. Define enums

Use enums for classification fields.

Bad:

Return the lead quality as text.

Better:

lead_quality must be one of: low, medium, high, unknown.

5. Define uncertainty fields

Structured outputs should make uncertainty visible.

Useful fields:

  • confidence;
  • missing_information;
  • assumptions;
  • source_notes;
  • requires_human_review;

6. Define error output

Specify what to return when input is invalid or insufficient.

Example:

{
  "status": "insufficient_context",
  "missing_information": ["company website", "target offer"],
  "result": null
}

7. Add examples

Provide at least one valid output example and one insufficient-context example.

8. Add prompt instructions

Write the prompt instructions that force the model to follow the schema.

Output format

Return the result in this structure:

# Structured Output Contract

## Purpose

This output represents...

## Consumer

The output will be consumed by...

## Schema

```json
{
  "type": "object",
  "required": [],
  "properties": {}
}

Field Definitions

FieldTypeRequiredDescriptionFallback

Allowed Values

  • field_name: value_1 | value_2 | value_3

Invalid or Insufficient Input Behavior

If input is insufficient, return:

{
  "status": "insufficient_context",
  "missing_information": [],
  "result": null
}

Prompt Instructions

Return only a JSON object that matches the schema. Do not include markdown, prose, explanations, or extra keys.

Valid Example

{}

Insufficient Context Example

{}

Validation Checklist

  • All required fields are defined.
  • Optional fields have fallback behavior.
  • Enums are explicit.
  • Missing context is represented.
  • Output can be parsed by software.

## Quality checklist

A good structured output contract should be:

- parseable;
- minimal;
- explicit;
- validated;
- tolerant of missing context;
- stable across repeated calls.

## Boundaries

This skill designs output contracts. It does not guarantee runtime validation unless a parser or schema validator is implemented.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.