hydrogen-dev-workflow
Skill2.1k starsChanged 8 months agoMITView on GitHub
Development workflow guide for Shopify's Hydrogen framework. Covers testing, upgrading, recipes, PR conventions, analytics architecture, CLI tooling, and project scaffolding. Use when developing the Hydrogen framework. Also activates when someone mentions "recipes", "patch files", "customer account testing", "hydrogen upgrade", "skeleton template", "hydrogen CLI", "create-hydrogen", "hydrogen init", or "shopify-cli-update" in the headless context.
Trending
Quiet since June.about the whole repository
Who's talking about Shopify/hydrogen
- Shopify/hydrogen-demo-store“Remix to react-router and other dep upgrades”GitHub · Nov 24, 2025 · 8 reactions
- Shopify/hydrogen-v1“CartProvider V2 ”GitHub · Aug 5, 2022 · 6 reactions
- BuilderIO/builder-shopify-hydrogen“Cannot use the builder/react sdk in the new version of shopify-hydrogen using Remix”GitHub · Feb 14, 2023 · 5 reactions
- vitejs/vite“Use ESM for SSR builds”GitHub · May 12, 2022 · 4 reactions
- Shopify/hydrogen-v1“Move cart queries to an API endpoint”GitHub · Apr 5, 2022 · 4 reactions
The biggest 5 of 29 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 29
Talked about on GitHub and Bluesky (29 times).
On GitHub · 28
- Nov 24, 2025Remix to react-router and other dep upgrades — Shopify/hydrogen-demo-store8 reactions · 1 comment
- Aug 5, 2022CartProvider V2 — Shopify/hydrogen-v16 reactions · 15 comments
- Feb 14, 2023Cannot use the builder/react sdk in the new version of shopify-hydrogen using Remix — BuilderIO/builder-shopify-hydrogen5 reactions · 11 comments
- May 12, 2022Use ESM for SSR builds — vitejs/vite4 reactions · 3 comments
- Apr 5, 2022Move cart queries to an API endpoint — Shopify/hydrogen-v14 reactions · 9 comments
23 more on GitHub
- Mar 30, 2022Introduce Link prefetch behavior — Shopify/hydrogen-v14 reactions
- Dec 7, 2021Default preloading queries — Shopify/hydrogen-v14 reactions · 5 comments
- Jun 30, 2023Adds Hydrogen 2.0 (via Remix) Adapter — netlify/remix-compute3 reactions · 16 comments
- Apr 27, 2023createWithCache_unstable not working on Oxygen — sanity-io/hydrogen-sanity-demo3 reactions · 5 comments
- Oct 24, 2022[BUG] Environment variables in `hydrogen.config.ts` don't work with `npm run preview` — Shopify/hydrogen-v13 reactions
- Sep 1, 2022Cloudflare adapter disables known cloudflare worker "compatible" dependencies — solidjs/solid-start3 reactions · 24 comments
- May 19, 2022Consider implementing Link prefetching for mobile — Shopify/hydrogen-v13 reactions · 3 comments
- May 18, 2022Bug [Flight]: Hydration fails when suspended components introduce new client components — react/react3 reactions · 4 comments
- Apr 20, 2022[Hydrogen docs]: Content fixes in source files — Shopify/hydrogen-v13 reactions · 1 comment
- Mar 28, 2022Do not cache GraphQL errors — Shopify/hydrogen-v13 reactions · 2 comments
- Feb 8, 2022Standardize `data` prop across components — Shopify/hydrogen-v13 reactions · 2 comments
- Jan 18, 2022Improvements to API Routing — Shopify/hydrogen-v13 reactions · 2 comments
- Jun 4, 2026chore(deps): bump turbo-stream and @shopify/hydrogen in /packages/tokpulse-hydrogen — Hardonian/TokPulse2 reactions · 5 comments
- Feb 7, 2023[BUG] CartLineQuantityAdjustButton clears lineItem attributes — Shopify/hydrogen-react2 reactions · 5 comments
- Nov 14, 2022Fix preload cache ballooning — Shopify/hydrogen-v12 reactions · 5 comments
- Aug 17, 2022Expose the private token and storefrontId within Hydrogen config — Shopify/hydrogen-v12 reactions · 7 comments
- Jul 14, 2022Improve CSS support in server components — Shopify/hydrogen-v12 reactions · 8 comments
- Jul 12, 2022HMR in server components — Shopify/hydrogen-v12 reactions · 1 comment
- Jul 11, 2022Add assets proxy in Oxygen — Shopify/hydrogen-v12 reactions · 1 comment
- Jun 14, 2022Upgrade to React v18.2 — Shopify/hydrogen-v12 reactions · 2 comments
- May 23, 2022Replace `graphql-tag` with internal `gql` utility — Shopify/hydrogen-v12 reactions · 4 comments
- Mar 10, 2022Support mutations & refreshing RSC responses from API endpoints — Shopify/hydrogen-v12 reactions · 2 comments
- Dec 31, 2021React Server Components — vikejs/vike2 reactions · 7 comments
On Bluesky · 1
- Sep 13, 2025If I need to build a storefront, I'd probably check out Medusa [1] or Shopify Hydrogen [2]. Otherwise, probably Elixir/Phoenix and LiveView… — @nezteb.net3 likes and reposts
In this repository9 other files it gives its agents.
- templates/skeleton/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cookbook/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- templates/skeleton/CLAUDE.mdCLAUDE.md
- templates/skeleton/.cursor/rules/hydrogen-react-router.mdcCursor rule
- e2e-test-writingSkill
- hydrogen-release-processSkill
- hydrogen-versioningSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
After placing an order, you can log in and view orders in the customer account section.
- Distinctive: line 64
Create a new branch locally
- Distinctive: line 85
Best practice: When upgrading across multiple major versions, upgrade one major version at a time and verify everything works between each …
- Very specific: line 92
New project scaffolding: When a user scaffolds a new Hydrogen project (via shopify hydrogen init or npm create @shopify/hydrogen), they get …
- Very specific: line 99
Should always be up to date before a Hydrogen CLI release
- Very specific: line 108
Always include a link to the GitHub issue in your PR.
- Very specific: line 128
Do NOT add consent gating to publish() — it causes events to be dropped (not queued) before consent resolves, creating a race condition …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hydrogen Development Workflow
Development practices and workflow guide for engineers working on Shopify's headless storefront ecosystem. The Hydrogen framework repo is Shopify/hydrogen. For domain context, see the headless-storefronts-context skill. For repo locations, see the shopify-repos skill.
Testing Customer Accounts Locally
To test anything in Hydrogen that requires a customer login (order history, account page, etc.):
- Start the dev server with the customer account push flag:
Note the# Using npm pnpm run dev -- --customer-account-push # Using Hydrogen CLI directly (h2 is the Hydrogen CLI binary) h2 dev --customer-account-push--separator when usingpnpm run dev. - Place a test order using the bogus gateway test payment details.
- Create a customer account using any email and password.
- After placing an order, you can log in and view orders in the customer account section.
Hydrogen Recipes
Recipes are documented cookbook entries for adding features to a Hydrogen storefront. They exist as markdown files in the dev docs. The "apply" command and related tooling are purely for internal use to test or update the recipes -- merchants cannot programmatically apply recipes to their storefronts.
Cookbook Architecture: Ingredients and Generated Docs
Each recipe has two layers that need to stay in sync:
Ingredient files (cookbook/recipes/{name}/ingredients/templates/skeleton/app/routes/*.tsx): These are real, standalone .tsx route implementations — not patches or diffs. They are applied when a merchant follows the recipe. When the skeleton has a bug (e.g., a missing await), the corresponding cookbook ingredient files may have the same bug independently and need to be fixed separately.
Generated documentation (cookbook/recipes/{name}/README.md and cookbook/llms/{name}.prompt.md): These files are auto-generated from the ingredient source files. They inline the full route source code, so if you fix the ingredient .tsx files, you MUST also regenerate the docs:
pnpm run cookbook -- render --recipe {name}
pnpm run cookbook -- validate --recipe {name}Both the README.md and llms/{name}.prompt.md must be committed as part of the same fix. Failing to regenerate means the docs teach the wrong pattern even after the ingredient files are correct.
Example: The markets recipe has ($locale).account.$.tsx, ($locale).account.addresses.tsx, and ($locale).account.profile.tsx as ingredient files. These are independent of the skeleton and don't automatically inherit skeleton fixes.
Fixing Broken Recipes (Patch Files)
Recipe patch files can break when the skeleton template changes. Two approaches:
For trivial 1-line changes: Edit the patch files directly.
For nontrivial changes:
- Create a new branch locally
- Hard reset to the latest commit where the recipes DID apply cleanly
- For each recipe:
a. Apply the recipe
b. Use Claude/LLM to apply all changes from that commit to latest
mainon the skeleton template with recipe applied c. Generate new patch files d. Un-apply the recipe and repeat for the next one
Upgrading Hydrogen
The best way to upgrade a Hydrogen storefront is the upgrade CLI command:
pnpm exec shopify hydrogen upgradeThis command:
- Automatically bumps and installs all necessary dependencies
- For manual changes, generates a markdown file containing all required changes
- The markdown file is excellent for feeding to Claude or other LLMs to apply changes
Best practice: When upgrading across multiple major versions, upgrade one major version at a time and verify everything works between each bump. This is smoother than attempting multiple major version bumps at once.
Skeleton Template
The skeleton template serves two purposes:
- Internal testing: It is the single Hydrogen storefront we use to test and validate changes to Hydrogen. Located at
templates/skeletonin the Hydrogen repo. - New project scaffolding: When a user scaffolds a new Hydrogen project (via
shopify hydrogen initornpm create @shopify/hydrogen), they get a copy of the skeleton template.
Key facts:
- Lives in the Hydrogen monorepo at
templates/skeleton - Uses built versions of Hydrogen packages from the monorepo (not from npm)
- Bundled and released with the Hydrogen CLI
- Should always be up to date before a Hydrogen CLI release
- Can be updated before a release even if the Hydrogen CLI version isn't being bumped
Any change to the skeleton template requires a changeset — see the Changeset Rules in CLAUDE.md for details.
PR Conventions
Link Issues to PRs
Always include a link to the GitHub issue in your PR. Use Closes <issue> or Fixes <issue> so the issue automatically closes when the PR merges.
Hydrogen Analytics Architecture
The analytics system in packages/hydrogen/src/analytics-manager/ has several non-obvious design constraints worth knowing before debugging.
Module-scoped singletons
subscribers, registers, and waitForReadyQueue are module-scoped (not instance-scoped). This means:
- They persist across React renders and React tree unmounts/remounts
- In tests, they accumulate state across test cases — a test that calls
register()withoutready()will block all subsequent tests - There is exactly one analytics bus per JS context; multiple
<Analytics.Provider>instances share state
Consent enforcement is in the subscriber, not the publisher
publish() always enqueues events regardless of consent state. Consent is enforced at three downstream layers:
ShopifyAnalyticsonly callsshopifyAnalyticsReady()afterprivacyReadyis true (privacy SDK loaded)prepareBasePageViewPayloadevaluatescustomerPrivacy.analyticsProcessingAllowed()at handler invocation timesendShopifyAnalytics(inhydrogen-react) drops the event ifpayload.hasUserConsentis false
Do NOT add consent gating to publish() — it causes events to be dropped (not queued) before consent resolves, creating a race condition where events fired during initialization are permanently lost.
Hydrogen CLI
The Hydrogen CLI source code lives at packages/cli-hydrogen in the Hydrogen repo. It is released to npm as its own package.
Bundling in Shopify CLI: Merchants typically do not use the Hydrogen CLI directly. Instead, it is bundled inside the Shopify CLI (in the Shopify/cli repo). After releasing a new version of the Hydrogen CLI to npm, you must also bump its version in the Shopify CLI.
Timing: The Shopify CLI releases a new minor version on a regular cadence. Hydrogen CLI bumps should NOT wait for the next Shopify CLI minor — release the bump as a patch of the current Shopify CLI minor version to get it out sooner.
How to update: A shopify-cli-update command exists in the Hydrogen repo at .claude/commands/shopify-cli-update.md. This is a Claude Code command — invoke it with /shopify-cli-update when working in the Hydrogen repo. It documents the full, nuanced, multi-step process. Always reference this command when performing the update — do not try to wing it from memory.
Project Scaffolding
There are two ways to scaffold a new Hydrogen project:
shopify hydrogen init— via the Shopify CLI (which bundles the Hydrogen CLI)npm create @shopify/hydrogen— via thecreate-hydrogenpackage
Both ultimately use the skeleton template. The create-hydrogen package uses the Hydrogen CLI's init function under the hood.
Version Tags
@latest: The most recent official release@next: Contains all Hydrogen changes that have been merged to main (with changesets), even before they have been officially released. A newnextversion is auto-published every time code is pushed to main.
The next tag is useful for merchant bug-fix validation: after merging a fix to main, the merchant can test with npm create @shopify/hydrogen@next to confirm the fix resolves their issue — before waiting for an official release.
Scaffolding a Specific Version
create-hydrogen uses SemVer while Hydrogen uses CalVer — see the hydrogen-versioning skill for details on the relationship. Scaffolding a specific historical Hydrogen version requires a lookup step to find which create-hydrogen SemVer version includes the desired Hydrogen CalVer skeleton.
Related Skills
hydrogen-release-process— Release process, back-fixes, changelog.json, release failure recoveryhydrogen-versioning— CalVer formats, version support policies, release cadenceCLAUDE.md— Changeset rules (apply to every PR), skeleton/CLI bundling chain
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

