The Authoritative Guide to JSON Specs

Context: If we can work with an LLM to define and describe elements of a prompt in a structured way, then we can make our prompting more reliable and repeatable. 

One way to unlock this is by structuring our prompts using JSON.

  • The Problem: AI communications are usually in “English” (using somewhat vague descriptions). But often your business systems and processes (image generators, coding systems, system prompts, data transformations, brand guidelines etc.) prefer Structured input (rows, columns, properties or specific settings).
  • The Solution: Use JSON as a bridge. It both guides the AI to follow structured prompts that can help with more predictable outputs and can output data in a structured format that other software can understand instantly.

The Experiment: “Create an image spec”. We are going to use JSON to move from “vibe prompting” (e.g., “Make a cool dashboard”) to “spec prompting” for Google Gemini (Nano Banana Pro), ChatGPT (DALL·E 3) or Flux 2 Pro.

The Steps:

  1. Step 1: Copy and paste the prompt below into Gemini or ChatGPT.
  2. Step 2:
    • After the prompt type: “I need a marketing hero shot for a new lime seltzer called ‘Aurora’.”
    • The AI will ask: “What kind of environment? Any props? What is the lighting style?” (It is running the clarification loop).
    • You answer: “It’s on a wet bar counter, night time, neon lights in the background. I need lime slices and ice.”
  3. Step 3: The AI will output a clean block of JSON code.
    • It won’t give you a paragraph. It will give you a “Spec Sheet” (like the example below) defining the Subject, Lighting, Camera Angle, and Props as data fields.
  4. Step 4: Open a new chat and set the chat window to “Create Image”.
    • Paste the JSON you generated in Step 3 into the chat window. 
    • You now have a perfectly reproducible spec that you can tweak (e.g., change “key_light_intensity”: “high” to “low”) without rewriting the whole prompt.


The Prompt for Step 1: (Paste this into a new chat to turn your AI into a Spec Writer)

"You are the JSON_PROMPT_TRANSLATOR. GOAL: Take a human idea for a Marketing Image and convert it into a structured JSON Spec. 

PROCESS:

  1. Ask me clarification questions about the Product, Props, Lighting, and Camera Angle until you have a clear mental image.
  2. Once clear, output ONLY a JSON object with this structure: { “marketing_image”: { “subject”: { “name”: “String”, “type”: “String” }, “props”: { “foreground”: [], “background”: [] }, “lighting”: { “direction”: “String”, “mood”: “String” }, “camera”: { “angle”: “String”, “framing”: “String” } } }RULE: Output NO conversational text in the final response. Only the JSON code.”

Goal: Create one “Perfect Spec” this week that you can save and reuse for consistent brand imagery.

Example JSON output from Step 3: 

{
"marketing_image": {

    "subject": {

      "name": "Aurora Lime Seltzer",

      "type": "Glass bottle with neon green branding, heavy condensation"

    },

    "props": {

      "foreground": [

        "fresh lime wedges",

        "scattered ice"

      ],

      "background": [

        "soft focus morning sunrise sky",

        "warm orange and pink gradients"

      ]

    },

    "lighting": {

      "direction": "Bright natural sunlight",

      "mood": "Daytime picnic, fresh, energetic"

    },

    "camera": {

      "angle": "Straight-on eye-level",

      "framing": "Clean catalogue close-up"

    }

  }

}

  

Keep the momentum going.

Simon, Unathi, and our LLM friends