Generate Strict JSON Spec From Description
You get a clean, machine-readable JSON object that matches your rules on the first try. It works because the model reads the rules first, then checks its own answer against each one before replying.
The prompt
Act as a careful generator of structured data that must pass a strict validator.
Task: Turn the plain-language description below into a single JSON object that follows the contract exactly.
Description: {item_description}
Contract: {json_contract}
Steps:
1. List every field in the contract and note its type, allowed range and whether it is required.
2. Choose concrete values for each field that match the description, keeping all numbers inside the stated ranges.
3. Build the JSON object using only the fields in the contract, with no extra keys or comments.
4. Check your object against each rule in the contract one by one, and fix any breach before replying.
Output: Reply with one valid JSON code block and nothing else. After it, add a single line starting "Checked:" that lists any rule you had to correct, or says "none".
Change the parts in curly braces. Use it when you need a chat model to produce config, data or design files that a validator or program will read without edits.
What happened when we ran it
We sent
Act as a careful generator of structured data that must pass a strict validator. Task: Turn the plain-language description below into a single JSON object that follows the contract exactly. Description: A friendly mascot for our bakery's chat widget: a round loaf of bread, slightly wider than it is tall, with the eyes sitting in the upper middle of the loaf so it looks cheerful. It should feel chunky and simple, with no fine detail. Contract: Fields: version (integer, must be 1), id (lowercase string, letters and hyphens only), name (string, up to 30 characters), body.path (one SVG path string, drawn inside a 0 0 100 100 box, closed with Z), eyes.x and eyes.y (numbers 0 to 100, the centre of the eyes), eyes.spacing (number 5 to 40, distance between the eyes), eyes.scale (number 0.5 to 2, eye size). The eyes must sit inside the body outline. No other keys are allowed. Steps: 1. List every field in the contract and note its type, allowed range and whether it is required. 2. Choose concrete values for each field that match the description, keeping all numbers inside the stated ranges. 3. Build the JSON object using only the fields in the contract, with no extra keys or comments. 4. Check your object against each rule in the contract one by one, and fix any breach before replying. Output: Reply with one valid JSON code block and nothing else. After it, add a single line starting "Checked:" that lists any rule you had to correct, or says "none".
The model replied
Run on Claude Sonnet 5.5, 12 Nov 2026. Automatic check: 5 out of 5.
Mentioned for
Claude, ChatGPT, Gemini
Where it came from
Found on GitHub, shared by DominikScholz: DominikScholz/open-bot-avatar.
This is our own version of the idea, written and tested by us. The original may differ.