Design the output before the prompt
The cleanest prompts are written after the consumer's data shape is known. If the next step in your pipeline expects {verdict, reason_codes, sla_tier}, write that schema first, then write the prompt that produces it. This prevents the common bug where the prompt produces what the writer thought sounded helpful but the parser can't use.
Schema as the source of truth
- Schemas live in source control alongside prompts.
- The schema is shared between the prompt, the validator, and the consumer (TypeScript types, Python pydantic, etc.).
- Schema changes force prompt changes — a feature, not a bug.
- Optional fields are explicit, not implied. The model needs to know which can be omitted.
From schema to prompt
For each field, the prompt should explain meaning, allowed values, and absence behavior. Don't let the schema's enum carry semantics that the model can't learn from a name alone.