# Setup kit

Everything an AI agent needs to configure a store that uses the Handoff theme, and to prove the result.

| File | Use |
|---|---|
| `AI-SETUP.md` | The guide in six short steps, each with its check, with prompts in English and in French. Start here. |
| `store-brief.schema.json` | The store brief: the single source the assistant fills first, then applies. Every value names the setting or metafield it goes to. |
| `presets.json` | The styles of the theme, with what each one suits. The assistant picks the closest one. |
| `fonts.json` | Fonts the theme can load late without moving the text. Generated: do not edit. |
| `metafields.json` | Definitions of the metafields and metaobjects the theme reads by default. |
| `CHECKS.md` | Eight checks written as read-only GraphQL Admin queries, for an assistant that only has a Shopify connector. |
| `checks/run.mjs` | Checks of the rendered pages, for a developer with a terminal: content without JavaScript, structured data, image descriptions. |

The kit is documentation. It is not part of the theme files and the theme works without it.

## Creating the definitions

`metafields.json` lists two groups. Create them in this order, with the GraphQL Admin API (through the Shopify AI Toolkit, a Shopify connector, or `shopify store execute`):

1. `metaobject_definitions`: one `metaobjectDefinitionCreate` call per entry. Each entry is the `definition` input as is.
2. `metafield_definitions`: one `metafieldDefinitionCreate` call per entry. Pass `ownerType`, `namespace`, `key`, `name`, `type`, `description`, and `access`. When the entry has `metaobjectType`, look up the id of that metaobject definition and add `validations: [{ name: "metaobject_definition_id", value: "<id>" }]`.

```graphql
mutation ($definition: MetaobjectDefinitionCreateInput!) {
  metaobjectDefinitionCreate(definition: $definition) {
    metaobjectDefinition { id type }
    userErrors { field message code }
  }
}

mutation ($definition: MetafieldDefinitionInput!) {
  metafieldDefinitionCreate(definition: $definition) {
    createdDefinition { id }
    userErrors { field message code }
  }
}
```

Rules for the agent:

- Ask the merchant before you change anything in the store. Say what you will create, then wait for a yes.
- A definition that already exists is not an error: keep it and go on.
- The definitions need storefront read access (`access.storefront: PUBLIC_READ`), or the theme cannot show the values.
- Required API scopes: `write_products`, `write_metaobject_definitions`, `write_metaobjects`, and `write_content` for article and page metafields.

## Changing a key

Each block names its metafield in a setting written `namespace.key`. To use other keys, create your own definitions and change that setting in the theme editor. The readiness panel of the theme editor checks the default keys only.

## Theme settings

Theme settings (logo, colors, brand identity, shipping, returns) are not metafields. They live in the theme file `config/settings_data.json`, in the `current` object, keyed by the setting ids of `config/settings_schema.json` (for example `shipping_transit_days_max`, `returns_days`, `brand_legal_name`). Every setting id says what it holds, and its `info` text gives the unit and the format.

An agent changes them in one of two ways:

- in the theme editor (Sidekick does this);
- by writing `config/settings_data.json` on an **unpublished** copy of the theme (`themeFilesUpsert` in the GraphQL Admin API, or `shopify theme push --theme <id of an unpublished theme>`). The merchant then reviews the copy and publishes it. Never write to the published theme without the merchant's written yes.

## What a rehearsal showed (23/11/2026)

On a development store with no definition, an agent that followed this file created the 2 metaobject definitions and the 16 metafield definitions in 18 seconds, and filled one product, one collection, and one guide in 11 seconds, without an error. The time that counts in real use is the merchant's: gathering the manufacturer documents and approving each step.
