{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "store-brief.schema.json",
  "title": "Store brief",
  "description": "Everything an AI assistant must know before it configures a store with the Handoff theme. The assistant fills this file first, by asking the merchant and reading the merchant's documents, then applies every setting and every metafield from it. Rule: a value that is not verified stays out. An absent value shows nothing on the store, a guessed value shows something false. \"x-applies-to\" names the theme setting, the metafield, or the Shopify field each value goes to.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "brand",
    "legal",
    "delivery",
    "returns"
  ],
  "properties": {
    "brand": {
      "type": "object",
      "description": "Who the store is.",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "The name shoppers see.",
          "x-applies-to": "Shopify store name"
        },
        "tagline": {
          "type": "string",
          "description": "One short line. Optional.",
          "maxLength": 80,
          "x-applies-to": "home page, hero heading"
        },
        "description": {
          "type": "string",
          "description": "One or two sentences that say what the store sells and for whom. 40 words max.",
          "maxLength": 300,
          "x-applies-to": "theme setting brand_description"
        },
        "voice": {
          "type": "string",
          "description": "How the store writes, in a few words: for example \"plain, technical, no superlatives\".",
          "x-applies-to": "every text the assistant writes"
        },
        "logo_file": {
          "type": "string",
          "description": "File name of the logo the merchant provided.",
          "x-applies-to": "theme setting logo"
        },
        "social_profiles": {
          "type": "array",
          "description": "Official social media profiles.",
          "items": {
            "type": "string",
            "description": "Full address of an official profile.",
            "format": "uri"
          },
          "x-applies-to": "theme settings social_*_link"
        }
      },
      "required": [
        "name",
        "description"
      ]
    },
    "style": {
      "type": "object",
      "description": "How the store looks.",
      "additionalProperties": false,
      "properties": {
        "preset": {
          "type": "string",
          "description": "Name of the theme style closest to the brand, chosen from setup/presets.json.",
          "x-applies-to": "theme preset"
        },
        "colors": {
          "type": "object",
          "description": "Brand colors as six-digit hex codes. Leave out a color to keep the one of the style.",
          "additionalProperties": false,
          "properties": {
            "background": {
              "type": "string",
              "description": "Page background.",
              "pattern": "^#[0-9A-Fa-f]{6}$",
              "x-applies-to": "theme setting color_background"
            },
            "text": {
              "type": "string",
              "description": "Text on the page background. Contrast 4.5:1 or more.",
              "pattern": "^#[0-9A-Fa-f]{6}$",
              "x-applies-to": "theme setting color_text"
            },
            "accent": {
              "type": "string",
              "description": "The one accent color: primary buttons, sale prices.",
              "pattern": "^#[0-9A-Fa-f]{6}$",
              "x-applies-to": "theme setting color_accent"
            },
            "accent_text": {
              "type": "string",
              "description": "Text on the accent color. Contrast 4.5:1 or more.",
              "pattern": "^#[0-9A-Fa-f]{6}$",
              "x-applies-to": "theme setting color_accent_text"
            }
          }
        },
        "fonts": {
          "type": "object",
          "description": "Fonts from the Shopify font library. Leave out to keep the fonts of the style. Prefer a font listed as covered in setup/fonts.json: it loads after the main image without moving the text.",
          "additionalProperties": false,
          "properties": {
            "heading": {
              "type": "string",
              "description": "Font for headings.",
              "x-applies-to": "theme setting type_heading_font"
            },
            "body": {
              "type": "string",
              "description": "Font for body text.",
              "x-applies-to": "theme setting type_body_font"
            }
          }
        }
      }
    },
    "legal": {
      "type": "object",
      "description": "Legal identity and contact. It feeds the structured data of the home page.",
      "additionalProperties": false,
      "properties": {
        "legal_name": {
          "type": "string",
          "description": "Registered company name.",
          "x-applies-to": "theme setting brand_legal_name"
        },
        "email": {
          "type": "string",
          "description": "Address customers can write to.",
          "format": "email",
          "x-applies-to": "theme setting brand_email"
        },
        "phone": {
          "type": "string",
          "description": "International format. Optional.",
          "x-applies-to": "theme setting brand_phone"
        },
        "address": {
          "type": "object",
          "description": "Registered business address. Leave out when it is not public.",
          "additionalProperties": false,
          "properties": {
            "street": {
              "type": "string",
              "description": "Number and street.",
              "x-applies-to": "theme setting brand_address_street"
            },
            "city": {
              "type": "string",
              "description": "City.",
              "x-applies-to": "theme setting brand_address_city"
            },
            "region": {
              "type": "string",
              "description": "State, province, or county. Optional.",
              "x-applies-to": "theme setting brand_address_region"
            },
            "postal_code": {
              "type": "string",
              "description": "Postal code.",
              "x-applies-to": "theme setting brand_address_postal_code"
            },
            "country_code": {
              "type": "string",
              "description": "Two-letter ISO 3166-1 code.",
              "pattern": "^[A-Z]{2}$",
              "x-applies-to": "theme setting brand_address_country_code"
            }
          },
          "required": [
            "street",
            "city",
            "country_code"
          ]
        }
      },
      "required": [
        "legal_name"
      ]
    },
    "delivery": {
      "type": "object",
      "description": "Delivery, exactly as the shipping policy and the Shopify shipping settings state it.",
      "additionalProperties": false,
      "properties": {
        "countries": {
          "type": "array",
          "description": "Countries the store delivers to.",
          "items": {
            "type": "string",
            "description": "Two-letter ISO 3166-1 code.",
            "pattern": "^[A-Z]{2}$"
          },
          "x-applies-to": "theme setting shipping_countries"
        },
        "handling_days_min": {
          "type": "integer",
          "description": "Working days between order and dispatch, minimum.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_handling_days_min"
        },
        "handling_days_max": {
          "type": "integer",
          "description": "Working days between order and dispatch, maximum.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_handling_days_max"
        },
        "transit_days_min": {
          "type": "integer",
          "description": "Working days between dispatch and delivery, minimum.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_transit_days_min"
        },
        "transit_days_max": {
          "type": "integer",
          "description": "Working days between dispatch and delivery, maximum.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_transit_days_max"
        },
        "business_days": {
          "type": "string",
          "description": "Days counted as working days.",
          "enum": [
            "mon_fri",
            "mon_sat",
            "every_day"
          ],
          "x-applies-to": "theme setting shipping_business_days"
        },
        "rate": {
          "type": "number",
          "description": "Shipping rate in the store currency. 0 for free shipping. Leave out when rates vary.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_rate"
        },
        "free_threshold": {
          "type": "number",
          "description": "Order value from which shipping is free. Leave out when there is none.",
          "minimum": 0,
          "x-applies-to": "theme setting shipping_free_threshold"
        },
        "source": {
          "type": "string",
          "description": "Where this fact was verified: a document name and page, a policy URL, or \"merchant, <date>\". A fact without a source is left out."
        }
      },
      "required": [
        "countries",
        "source"
      ]
    },
    "returns": {
      "type": "object",
      "description": "Returns, exactly as the refund policy states them.",
      "additionalProperties": false,
      "properties": {
        "days": {
          "type": "integer",
          "description": "Days a customer has to return an item. 0 when returns are not accepted.",
          "minimum": 0,
          "x-applies-to": "theme setting returns_days"
        },
        "fees": {
          "type": "string",
          "description": "Who pays for the return.",
          "enum": [
            "free",
            "customer_pays",
            "fixed_fee"
          ],
          "x-applies-to": "theme setting returns_fees"
        },
        "shipping_fee": {
          "type": "number",
          "description": "Only with fixed_fee: the return shipping fee in the store currency.",
          "minimum": 0,
          "x-applies-to": "theme setting returns_shipping_fee"
        },
        "method": {
          "type": "string",
          "description": "How an item is returned.",
          "enum": [
            "by_mail",
            "in_store",
            "at_kiosk"
          ],
          "x-applies-to": "theme setting returns_method"
        },
        "source": {
          "type": "string",
          "description": "Where this fact was verified: a document name and page, a policy URL, or \"merchant, <date>\". A fact without a source is left out."
        }
      },
      "required": [
        "days",
        "source"
      ]
    },
    "markets": {
      "type": "array",
      "description": "Markets the store sells in. Information for the assistant: markets are set up in the Shopify admin, not in the theme.",
      "items": {
        "type": "object",
        "description": "One market.",
        "additionalProperties": false,
        "properties": {
          "country_code": {
            "type": "string",
            "description": "Two-letter ISO 3166-1 code.",
            "pattern": "^[A-Z]{2}$"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 code.",
            "pattern": "^[A-Z]{3}$"
          },
          "language": {
            "type": "string",
            "description": "ISO 639-1 code.",
            "pattern": "^[a-z]{2}$"
          }
        },
        "required": [
          "country_code"
        ]
      }
    },
    "navigation": {
      "type": "object",
      "description": "Menus.",
      "additionalProperties": false,
      "properties": {
        "main_menu": {
          "type": "array",
          "description": "Top-level items of the main menu.",
          "items": {
            "type": "string",
            "description": "Title of a top-level item, in order."
          },
          "x-applies-to": "menu main-menu"
        },
        "footer_menu": {
          "type": "array",
          "description": "Items of the footer menu.",
          "items": {
            "type": "string",
            "description": "Title of an item, in order."
          },
          "x-applies-to": "menu footer"
        }
      }
    },
    "products": {
      "type": "array",
      "description": "One entry per product.",
      "items": {
        "type": "object",
        "description": "Verified facts about one product. Every fact needs a source.",
        "additionalProperties": false,
        "properties": {
          "handle": {
            "type": "string",
            "description": "Handle of the product in Shopify."
          },
          "category": {
            "type": "string",
            "description": "The most precise category of Shopify's product taxonomy.",
            "x-applies-to": "product category"
          },
          "brand": {
            "type": "string",
            "description": "The real brand of the product. Leave out when the store is the brand and it should not be declared.",
            "x-applies-to": "product metafield custom.brand"
          },
          "quick_answer": {
            "type": "string",
            "description": "One or two sentences: what it is, who it is for, what is included.",
            "maxLength": 400,
            "x-applies-to": "product metafield custom.quick_answer"
          },
          "size": {
            "type": "string",
            "description": "Main size with its unit.",
            "x-applies-to": "product metafield custom.size"
          },
          "material": {
            "type": "string",
            "description": "Main materials.",
            "x-applies-to": "product metafield custom.material"
          },
          "in_the_box": {
            "type": "array",
            "description": "What is in the box.",
            "items": {
              "type": "string",
              "description": "One item the buyer receives."
            },
            "x-applies-to": "product metafield custom.in_the_box"
          },
          "specifications": {
            "type": "array",
            "description": "Measurable facts: dimensions, weight, capacity.",
            "items": {
              "type": "object",
              "description": "One measurable fact.",
              "additionalProperties": false,
              "properties": {
                "label": {
                  "type": "string",
                  "description": "Name of the fact, for example \"Diameter\"."
                },
                "value": {
                  "type": "string",
                  "description": "Value with its unit, for example \"58.5 mm\"."
                },
                "source": {
                  "type": "string",
                  "description": "Where this fact was verified: a document name and page, a policy URL, or \"merchant, <date>\". A fact without a source is left out."
                }
              },
              "required": [
                "label",
                "value",
                "source"
              ]
            },
            "x-applies-to": "one product metafield per fact, listed in the Specifications block"
          },
          "compatibility": {
            "type": "array",
            "description": "What the product fits and does not fit.",
            "items": {
              "type": "object",
              "description": "One model or family.",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The machine, model, or family."
                },
                "model_codes": {
                  "type": "array",
                  "description": "Model codes.",
                  "items": {
                    "type": "string",
                    "description": "A code printed on the product."
                  }
                },
                "status": {
                  "type": "string",
                  "description": "fits or does_not_fit only when the source says so. ask otherwise.",
                  "enum": [
                    "fits",
                    "does_not_fit",
                    "ask"
                  ]
                },
                "note": {
                  "type": "string",
                  "description": "A short note, for example the adapter that is needed."
                },
                "source": {
                  "type": "string",
                  "description": "Where this fact was verified: a document name and page, a policy URL, or \"merchant, <date>\". A fact without a source is left out."
                }
              },
              "required": [
                "name",
                "status"
              ]
            },
            "x-applies-to": "compatibility_item entries linked in product metafield custom.compatibility"
          },
          "who_its_for": {
            "type": "array",
            "description": "Who the product suits. Two to four points.",
            "items": {
              "type": "string",
              "description": "One short point."
            },
            "x-applies-to": "product metafield custom.who_its_for"
          },
          "not_for": {
            "type": "array",
            "description": "When another product is a better choice. One to three points.",
            "items": {
              "type": "string",
              "description": "One short point."
            },
            "x-applies-to": "product metafield custom.not_for"
          },
          "questions": {
            "type": "array",
            "description": "Three to six questions shoppers really ask.",
            "items": {
              "type": "object",
              "description": "One real customer question.",
              "additionalProperties": false,
              "properties": {
                "question": {
                  "type": "string",
                  "description": "In the words customers use."
                },
                "answer": {
                  "type": "string",
                  "description": "Starts with the answer itself."
                },
                "source": {
                  "type": "string",
                  "description": "Where this fact was verified: a document name and page, a policy URL, or \"merchant, <date>\". A fact without a source is left out."
                }
              },
              "required": [
                "question",
                "answer",
                "source"
              ]
            },
            "x-applies-to": "faq_item entries linked in product metafield custom.faq"
          },
          "images": {
            "type": "array",
            "description": "Image descriptions.",
            "items": {
              "type": "object",
              "description": "One image.",
              "additionalProperties": false,
              "properties": {
                "file": {
                  "type": "string",
                  "description": "File name."
                },
                "alt": {
                  "type": "string",
                  "description": "One sentence that says what the image shows."
                }
              },
              "required": [
                "file",
                "alt"
              ]
            },
            "x-applies-to": "alt text of product media"
          }
        },
        "required": [
          "handle"
        ]
      }
    },
    "collections": {
      "type": "array",
      "description": "One entry per collection shown in a menu.",
      "items": {
        "type": "object",
        "description": "One collection.",
        "additionalProperties": false,
        "properties": {
          "handle": {
            "type": "string",
            "description": "Handle of the collection in Shopify."
          },
          "description": {
            "type": "string",
            "description": "Two sentences.",
            "x-applies-to": "collection description"
          },
          "buying_guide": {
            "type": "string",
            "description": "Three to five sentences on how to choose among these products, from the product facts only.",
            "x-applies-to": "collection metafield custom.buying_guide"
          }
        },
        "required": [
          "handle"
        ]
      }
    },
    "guides": {
      "type": "array",
      "description": "One guide per big customer question.",
      "items": {
        "type": "object",
        "description": "One guide article.",
        "additionalProperties": false,
        "properties": {
          "question": {
            "type": "string",
            "description": "The customer question the guide answers. It becomes the title."
          },
          "short_answer": {
            "type": "string",
            "description": "The answer in one or two sentences. It becomes the excerpt, shown in bold."
          },
          "products": {
            "type": "array",
            "description": "Products named in the guide.",
            "items": {
              "type": "string",
              "description": "Handle of a product the guide names."
            },
            "x-applies-to": "article metafield custom.related_products"
          },
          "sources": {
            "type": "array",
            "description": "Where the content of the guide comes from.",
            "items": {
              "type": "string",
              "description": "A document or a page."
            }
          }
        },
        "required": [
          "question",
          "short_answer"
        ]
      }
    }
  }
}
