hydrogen
Shopify/hydrogen/AGENTS.md
When designing or adjusting APIs for the hydrogen package, closely follow the following principles:
What's in it
- Agent Guidelines
- API Design Principles
- Testing
- MiniOxygen
- Local HTTPS for Examples
# Agent Guidelines ## API Design Principles When designing or adjusting APIs for the `hydrogen` package, closely follow the following principles: - **No magic**: Prefer explicit over implicit. - **Composable blocks**: Keep domains and features separated by composable parts. - **Poka Yoke / Affordance**: Make it impossible to "hold it wrong". ## Testing - Tests and type tests may use type assertions, `import()` type annotations, explicit `any`, and higher-complexity setup when that keeps mocks or compile-time assertions clear. - Non-null assertions (`!`) are still forbidden in tests. Use an assertion helper instead so failures include a useful message. - In Hydrogen package tests, import `assert` from `packages/hydrogen/src/core/test-utils.ts` rather than using `!`. ## MiniOxygen - `packages/mini-oxygen` keeps its existing code style: `oxfmt` skips it, and `.oxlintrc.json` turns off the rules its code breaks, including the testing rules above. Don't reformat or restyle it as part of unrelated changes. ## Local HTTPS for Examples - Account-enabled framework examples use `https://local.tryhydrogen.dev:5173` for Customer Account OAuth callback testing. - Vite-based examples consume Hydrogen's default certificates. Certificates are provisioned automatically on `dev:https` startup. This downloads a pinned, checksum-verified mkcert release, trusts the local certificate authority, and creates the certificates under `~/.shopify/hydrogen/certs/`. Nuxt and SolidStart may need one restart after first-run provisioning so their outer dev servers can load the certificate files. - Outside CI, the local HTTPS plugin uses Shopify CLI to link an unlinked Hydrogen storefront and push the Customer Account callback, JavaScript origin, and logout URLs. Failures fall back to printing the values for manual configuration. - The Next.js example provisions its own certificate. The Hydrogen example uses the Shopify CLI tunnel flow. - Run the relevant example with `pnpm --filter @shopify/hydrogen-example-<name> dev:https` when that example provides the script. - Reproduce the trusted local HTTPS CI check with `pnpm run test:local-https`. It starts the React Router template, so first build the template's workspace packages (`pnpm turbo run build --filter='@shopify/hydrogen-template-react-router^...'`, or `pnpm run build:pkgs`) and make sure certificates exist under `~/.shopify/hydrogen/certs/` (any prior `dev:https` run, or `node packages/hydrogen/bin/hydrogen.mjs certs install`).
More agent context in Shopify/hydrogen
31 other files this repository gives its agents.
AGENTS.md
Skill
- hydrogen-analyticspackages/hydrogen/skills/hydrogen-analytics/SKILL.md
- hydrogen-cart-drawerpackages/hydrogen/skills/hydrogen-cart-drawer/SKILL.md
- hydrogen-cart-metafieldspackages/hydrogen/skills/hydrogen-cart-metafields/SKILL.md
- hydrogen-cart-uipackages/hydrogen/skills/hydrogen-cart-ui/SKILL.md
- hydrogen-collection-browserpackages/hydrogen/skills/hydrogen-collection-browser/SKILL.md
- hydrogen-customer-accountpackages/hydrogen/skills/hydrogen-customer-account/SKILL.md
- hydrogen-imagepackages/hydrogen/skills/hydrogen-image/SKILL.md
- hydrogen-local-httpspackages/hydrogen/skills/hydrogen-local-https/SKILL.md
- hydrogen-marketspackages/hydrogen/skills/hydrogen-markets/SKILL.md
- hydrogen-moneypackages/hydrogen/skills/hydrogen-money/SKILL.md
- hydrogen-oxygenpackages/hydrogen/skills/hydrogen-oxygen/SKILL.md
- hydrogen-predictive-searchpackages/hydrogen/skills/hydrogen-predictive-search/SKILL.md
- hydrogen-request-handlerspackages/hydrogen/skills/hydrogen-request-handlers/SKILL.md
- hydrogen-routingpackages/hydrogen/skills/hydrogen-routing/SKILL.md
- hydrogen-setuppackages/hydrogen/skills/hydrogen-setup/SKILL.md
- hydrogen-shop-paypackages/hydrogen/skills/hydrogen-shop-pay/SKILL.md
- hydrogen-smoke-testpackages/hydrogen/skills/hydrogen-smoke-test/SKILL.md
- hydrogen-storefront-clientpackages/hydrogen/skills/hydrogen-storefront-client/SKILL.md
- hydrogen-variant-formpackages/hydrogen/skills/hydrogen-variant-form/SKILL.md
- benchmark-canaryscripts/storefront-benchmark-harness/workspace-template/.opencode/skills/benchmark-canary/SKILL.md
- create-oxygen-templateskills/create-oxygen-template/SKILL.md
- error-reportingskills/error-reporting/SKILL.md
- playwright-testsskills/playwright-tests/SKILL.md
- pull-request-standardsskills/pull-request-standards/SKILL.md
Discussion
Talked about elsewhere, linking to Shopify/hydrogen
- Shopify Hydrogen - project no longer launches after updating to 2024.4
Stack Overflow · 1 votes · 1 answers · Apr 15, 2024
- If I need to build a storefront, I'd probably check out Medusa [1] or Shopify Hydrogen [2]. Otherwise, probably Elixir/Phoenix and LiveView…
Bluesky · @nezteb.net · 3 likes and reposts · Sep 13, 2025
- Remix to react-router and other dep upgrades
GitHub · Shopify/hydrogen-demo-store · 8 reactions · 1 comments · Nov 24, 2025
- Shopify Admin API Access
Stack Overflow · Jan 3, 2025
- CartProvider V2
GitHub · Shopify/hydrogen-v1 · 6 reactions · 15 comments · Aug 5, 2022
- Cannot use the builder/react sdk in the new version of shopify-hydrogen using Remix
GitHub · BuilderIO/builder-shopify-hydrogen · 5 reactions · 11 comments · Feb 14, 2023
- Use ESM for SSR builds
GitHub · vitejs/vite · 4 reactions · 3 comments · May 12, 2022
- Move cart queries to an API endpoint
GitHub · Shopify/hydrogen-v1 · 4 reactions · 9 comments · Apr 5, 2022
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
Reports can't be read right now.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

