Home › Shopify › Shopify app AGENTS.md

Shopify app AGENTS.md

AGENTS.md for Shopify apps built with Shopify CLI and the React Router template: auth, GraphQL Admin API, and webhooks.

AGENTS.mdShopify

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

AGENTS.mdDownload  
# AGENTS.md: Shopify app

## Commands
- `shopify app dev` (tunnels to a dev store) · `shopify app deploy` (only when asked) · `npm run typecheck` · `npm test`
- Config: `shopify.app.toml` (scopes, webhooks, app proxy). Run `shopify app config link` once per environment.

## Rules
- Every loader/action in admin routes starts with `const { admin, session } = await authenticate.admin(request);`. Webhook routes use `authenticate.webhook(request)`; app proxy routes use `authenticate.public.appProxy(request)`.
- Use the GraphQL Admin API (`admin.graphql(query, { variables })`) with a pinned API version. REST Admin API is legacy; don't add new REST calls.
- Request only the access scopes you need; changing scopes requires merchants to re-approve, so call it out.
- Handle GraphQL `userErrors` in mutation responses, not just HTTP errors. Respect rate limits (query cost) and paginate with cursors.
- Webhooks are declared in `shopify.app.toml`; handlers verify via the library, respond fast, and queue heavy work. Mandatory privacy webhooks (customer data request/redact, shop redact) must be implemented.
- Store shop data keyed by `session.shop`; never trust a shop domain from query params without authentication.
- Embedded admin UI uses Polaris (web components or React, matching the template) and App Bridge for navigation, toasts, and modals.
- Extensions (checkout UI, theme app extensions, functions) live in `extensions/` and are generated with `shopify app generate extension`.

## Don't
Don't deploy, change billing config, or hit a production store from the agent.

More: all Shopify rules · all AGENTS.md rules

Related rules

Shopify Liquid theme rules

Cursor rules for Shopify Online Store 2.0 themes: sections and blocks, JSON templates, Liquid performance, Theme Check.

CursorShopify

WordPress block theme & blocks rules

Cursor rules for WordPress block themes and custom blocks: theme.json v3, block.json, patterns, and @wordpress/scripts.

CursorWordPress

WordPress plugin CLAUDE.md

CLAUDE.md for WordPress plugin development: prefixes, hooks, nonces and capabilities, sanitizing, escaping, and wp-env.

Claude Code (CLAUDE.md)WordPress

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Bevy game engine AGENTS.md

AGENTS.md for Bevy (0.16+) games in Rust: ECS systems, plugins, required components, and fast dev builds.

AGENTS.mdBevy (Rust)

Blazor (.NET 10) AGENTS.md

AGENTS.md for Blazor Web Apps on .NET 10: render modes, components, forms and validation, state, and bUnit tests.

AGENTS.md.NET / ASP.NET Core

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.