> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router 7 or 8 (Pilot uses 8): import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# Agent instructions (agents.md, llms.txt)

> Serve /agents.md and /llms.txt on a headless storefront so AI agents can find and shop your store.

# Agent instructions (agents.md, llms.txt)

AI agents and agent-readiness scanners look for a Markdown file at `/agents.md` or `/llms.txt` that tells them how to browse and shop a store. Shopify generates `/agents.md` for every Online Store, with `/llms.txt` and `/llms-full.txt` as mirrors, but serves it only on the store's primary Online Store domain. A Hydrogen or Next.js storefront answers these paths with a 404 unless it serves them itself.

`serveAgentsMd` from `@weaverse/hydrogen` serves all three files from one route.

## Prerequisites

* `@weaverse/hydrogen` **6.7.0** or later:

  ```bash theme={null}
  npm install @weaverse/hydrogen@^6.7.0
  ```

## What it serves

* **Shopify's file**, when Shopify serves it: every link points at your storefront's domain instead of the Online Store domain.
* **A built file** when Shopify doesn't, for example on a password-protected development store (or on an error, rate limit or timeout). It comes from the Storefront API: the shop's name and description, how to reach its [UCP](https://ucp.dev) profile at `/.well-known/ucp`, the sitemap and browsing paths, and the published policies.

The response is always `200` with `content-type: text/markdown; charset=utf-8`, never HTML. Browsers cache it for 5 minutes and shared caches (CDNs) for an hour, then serve the stale copy for up to a day while they refresh it (`public, max-age=300, s-maxage=3600, stale-while-revalidate=86400`). A file built after a failure gets `public, max-age=60`, so Shopify's file replaces it within a minute once Shopify answers again.

## React Router (Hydrogen)

Add the routes at the top level of `app/routes.ts`, next to `robots.txt`, not under a locale prefix. The routes share one module, so each extra route needs its own `id`:

```ts app/routes.ts theme={null}
import { type RouteConfig, route } from '@react-router/dev/routes'

export default [
  route('agents.md', 'routes/agents-md.ts'),
  route('llms.txt', 'routes/agents-md.ts', { id: 'llms-txt' }),
  route('llms-full.txt', 'routes/agents-md.ts', { id: 'llms-full-txt' }), // optional
  // ...your other routes
] satisfies RouteConfig
```

Then create the route module:

```ts app/routes/agents-md.ts theme={null}
import type { LoaderFunctionArgs } from 'react-router'
import { serveAgentsMd } from '@weaverse/hydrogen/react-router'

export function loader({ request, context }: LoaderFunctionArgs) {
  return serveAgentsMd({ request, storefront: context.storefront })
}
```

## Next.js

Add `app/agents.md/route.ts` and `app/llms.txt/route.ts`, each exporting a `GET` handler. Pass your theme's Storefront API client, the one you create with `createStorefrontClient`. In this example, `getStorefront` stands for your theme's own helper that returns it; it is not part of the SDK:

```ts app/agents.md/route.ts theme={null}
import { serveAgentsMd } from '@weaverse/hydrogen/next/server'
import { getStorefront } from '@/lib/storefront' // your own helper

export function GET(request: Request) {
  return serveAgentsMd({ request, storefront: getStorefront() })
}
```

## Behind a proxy

Links use the origin of the incoming request. If a proxy in front of your app changes the request URL, pass your public origin:

```ts theme={null}
serveAgentsMd({ request, storefront, origin: 'https://shop.example.com' })
```

## robots.txt

`serveAgentsMd` does not touch `robots.txt`; it stays in your theme. Make sure it doesn't block AI search and user-triggered agents (such as `OAI-SearchBot`, `Claude-SearchBot` or `ChatGPT-User`) from `/` and `/products/`, and that it has a `Sitemap:` line.

## Verification checklist

* [ ] `curl -i https://<your-storefront>/agents.md` returns `200` with `content-type: text/markdown`.
* [ ] `/llms.txt` returns the same file.
* [ ] Links in the file point at your storefront's domain.

See the [`serveAgentsMd` reference](https://weaverse.io/docs/api-reference/functions/serveAgentsMd) for the full API.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.