CheckedWork faster

A practical method for your work

Output Contract Pattern

Make the model return a predictable shape instead of a pretty but unusable answer.

Original sourceAnthropic: structure prompts with XML tagsChecked 2026-07-07
Use this whenAutomation · Handoffs · Reusable workflows
You will getA reusable way to start the work

Core idea

An output contract defines sections, order, fields, length, and forbidden behavior before the model writes. It is especially useful when humans or scripts consume the result.

Why it works

LLMs are flexible by default. A contract narrows that flexibility and turns the answer into an interface.

Weak

Summarize this research.

Better

Return exactly: 1) one-sentence claim, 2) evidence bullets with URLs, 3) confidence, 4) risks, 5) next action. Do not add extra sections.

Customize it

Required sectionsField namesLength limitsAllowed formatsForbidden extras

Working template

Goal: [what I am trying to accomplish] Context: [background, audience, constraints] Use this pattern: Output Contract Pattern Variables: Required sections, Field names, Length limits, Allowed formats, Forbidden extras Return: [exact output format] Before finalizing: state limits and one improvement

Operating recipe

  1. Start with the weak version so you know what problem you are fixing.
  2. Add the missing variables instead of making the instruction longer randomly.
  3. Ask the model to follow the output contract exactly once.
  4. Review the first answer against the checklist below.
  5. Save the improved version as your reusable pattern.

Quality checklist

  • Did I give the model the real goal, not just the task?
  • Did I define the output shape before asking for the answer?
  • Did I include examples, constraints, or a quality bar?
  • Did I ask for limits, uncertainty, or failure cases?
  • Can I reuse this as a pattern next time?

Model notes

Claude

Strong for long context, critique, and structured writing. Give it clear sections and examples.

ChatGPT

Strong for fast iteration and everyday templates. Be explicit about output format and assumptions.

Gemini

Useful for broad synthesis and Google-adjacent research. Keep source requirements explicit.

Limits

Too rigid a contract can hide nuance. Leave a notes field for uncertain research tasks.

Read next

Free downloads

Turn this into a reusable workflow.

Get the Prompt Debugging Checklist and Solo Builder AI Setup Pack as language-specific .md files.