hydrogen / cookbook
CLAUDE.md2.1k starsChanged 8 months agoMITView on GitHub
The Hydrogen Cookbook transforms the skeleton template into specific scenarios through reproducible recipes. IMPORTANT: This file provides quick reference and common patterns. For comprehensive command documentation, implementation details, and additional context, read cookbook/README.md. YOU MUST validate before committing: Recipe requirements: - Step values are quoted strings: step: "1" not step: 1 (YAML coerces unquoted integers to numbers, but the Zod schema expects strings) - Every step has a description (non-null, non-empty) - Step names are unique within the same step…
- Installs packages
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
- e2e/CLAUDE.mdCLAUDE.md
- templates/skeleton/CLAUDE.mdCLAUDE.md
- templates/skeleton/.cursor/rules/hydrogen-react-router.mdcCursor rule
- e2e-test-writingSkill
- hydrogen-dev-workflowSkill
- hydrogen-release-processSkill
- hydrogen-versioningSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Every step has a description (non-null, non-empty)
- Distinctive: line 28
All referenced patch/ingredient files exist
- Very specific: line 62
Fix: Remove file or add reference to recipe.yaml
- Very specific: line 68
Fix: Add description to step in recipe.yaml
- Distinctive: line 254
Update recipe to remain compatible with latest main branch.
- Distinctive: line 272
Create temporary update branch
- Distinctive: line 338
Update LLM prompts when recipe logic changes
- Distinctive: line 350
Update recipes when skeleton template changes significantly
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
Cookbook System
The Hydrogen Cookbook transforms the skeleton template into specific scenarios through reproducible recipes.
IMPORTANT: This file provides quick reference and common patterns. For comprehensive command documentation, implementation details, and additional context, read cookbook/README.md.
Quick Reference
pnpm run cookbook -- validate # Validate all recipes
pnpm run cookbook -- validate --recipe {name} # Validate one recipe
pnpm run cookbook -- apply --recipe {name} # Apply recipe to skeleton
pnpm run cookbook -- generate --recipe {name} # Generate recipe from changes
pnpm run cookbook -- render # Render all documentationIMPORTANT: Critical Rules
YOU MUST validate before committing:
pnpm run cookbook -- validate --recipe {name}Recipe requirements:
- Step values are quoted strings:
step: "1"notstep: 1(YAML coerces unquoted integers to numbers, but the Zod schema expects strings) - Every step has a description (non-null, non-empty)
- Step names are unique within the same step number
- All referenced patch/ingredient files exist
- README.md exists and is up-to-date
- LLM prompt file exists at
llms/{recipe-name}.prompt.md
After modifying recipe.yaml, regenerate docs:
pnpm run cookbook -- render --recipe {name}Common Errors
Unquoted Step Numbers
❌ recipe.yaml:52 steps.0.step RecipeSchema: Invalid input: expected string, received number (actual value: 1)Fix: Quote step numbers so YAML preserves them as strings:
- step: 1
+ step: "1"Outdated README
❌ README.md validateReadmeExists: README.md not foundFix: Regenerate documentation:
pnpm run cookbook -- render --recipe {name}Orphaned Files
❌ patches/old-file.patch validatePatchFiles: Orphaned patch file not referenced in recipeFix: Remove file or add reference to recipe.yaml
Null Descriptions
❌ recipe.yaml:65 steps.2.description validateStepDescriptions: Step 2 has null descriptionFix: Add description to step in recipe.yaml
Code Style
- Step values: Quoted strings (
step: "1") — unquoted integers fail Zod validation - Step names: Unique within same step number, kebab-case for file paths
- Descriptions: Non-null, non-empty strings explaining what the step does
- Comments: Use
@descriptionin code to explain why, not what - Naming: Follow existing recipe patterns (kebab-case)
Testing
# Run all cookbook tests
pnpm test
# Run validation tests only
pnpm test -- validate.test.ts
# Full validation pipeline (what CI runs)
pnpm run cookbook -- validate --recipe {name}Architecture
Four key concepts:
- Recipe: Reproducible sequence of steps applied to skeleton template
- Ingredients: New files introduced by the recipe
- Patches: Modifications to existing skeleton files
- LLM Prompts: AI-assisted coding prompts paired with recipes
File structure:
cookbook/
├── src/
│ ├── commands/ # Command implementations
│ ├── lib/ # Core functionality (validate.ts, generate.ts, etc.)
│ └── index.ts # CLI entry point
├── recipes/{recipe-name}/
│ ├── recipe.yaml # Machine-readable definition
│ ├── ingredients/ # New files to add
│ ├── patches/ # File modifications
│ └── README.md # Generated documentation
├── llms/{recipe-name}.prompt.md # LLM prompts
└── recipe.schema.json # JSON schema for validationCommands
apply
Apply recipe to skeleton template.
pnpm run cookbook -- apply --recipe infinite-scrollOptions:
--recipe(required): Recipe name
Result: Skeleton template modified with all recipe changes
generate
Generate recipe from skeleton template changes.
# Generate from all changes
pnpm run cookbook -- generate --recipe my-feature
# Generate from specific file only
pnpm run cookbook -- generate --recipe my-feature --filePath app/routes/products.tsx
# Generate against different branch
pnpm run cookbook -- generate --recipe hotfix --referenceBranch origin/2025-01Options:
--recipe(required): Recipe name--filePath: Generate patch for single file only--onlyFiles: Skip recipe.yaml generation--referenceBranch: Branch to compare against (default: "origin/main")--recipeManifestFormat: yaml or json (default: "yaml")
Result: Recipe folder with recipe.yaml, ingredients/, patches/, README.md
Process:
- Detects changes vs reference branch
- New files → ingredients/
- Modified files → patches/
- Deleted files → marked for deletion
- Extracts dependencies from package.json
- Validates generated recipe
validate
Validate recipe integrity and functionality.
# Validate all recipes
pnpm run cookbook -- validate
# Validate single recipe
pnpm run cookbook -- validate --recipe infinite-scroll
# Validate against specific Hydrogen version
pnpm run cookbook -- validate --recipe my-recipe --hydrogenPackagesVersion 2025.1.0Options:
--recipe: Recipe name (validates all if omitted)--hydrogenPackagesVersion: Specific version to test against
Pipeline:
- Schema validation → Verifies recipe.yaml
- Recipe application → Applies to skeleton
- Dependency installation → pnpm install
- TypeScript check → Verifies types
- Build → Ensures project builds
- Cleanup → Resets skeleton
Error format:
❌ Recipe 'gtm' - 5 error(s):
recipe.yaml:52 steps.0.step RecipeSchema: Invalid input: expected string, received number (actual value: 1)
README.md validateReadmeExists: README.md not found. Run: pnpm run cookbook render gtmrender
Generate README documentation from recipe.yaml.
# Render all recipes (GitHub format)
pnpm run cookbook -- render
# Render single recipe for shopify.dev
pnpm run cookbook -- render --recipe infinite-scroll --format shopify.devOptions:
--recipe: Recipe name (renders all if omitted)--format: "github" or "shopify.dev" (default: "github")
Result: README.md or README.shopify.md in recipe folders
Formats:
- github: Collapsible sections, emoji, GitHub-flavored Markdown
- shopify.dev: Platform-specific syntax and formatting
regenerate
Complete refresh: apply → generate → render.
# Regenerate single recipe
pnpm run cookbook -- regenerate --recipe infinite-scroll --format github
# Regenerate all recipes
pnpm run cookbook -- regenerate --format github
# Regenerate files only (preserve manual recipe.yaml edits)
pnpm run cookbook -- regenerate --recipe my-recipe --onlyFiles --format githubOptions:
--recipe: Recipe name (regenerates all if omitted)--format(required): Documentation format--onlyFiles: Regenerate ingredients/patches only--referenceBranch: Reference for generation (default: "origin/main")
Use when: Cookbook tooling updates or skeleton template changes
update
Update recipe to remain compatible with latest main branch.
# Update recipe to latest main
pnpm run cookbook -- update --recipe infinite-scroll
# Update against specific branch
pnpm run cookbook -- update --recipe legacy-feature --referenceBranch origin/2024-12Options:
--recipe(required): Recipe name--referenceBranch: Target branch (default: "origin/main")--recipeManifestFormat: yaml or json (default: "yaml")
Process:
- Checkout recipe's original commit
- Apply recipe to historical state
- Create temporary update branch
- Merge target branch (interactive if conflicts)
- Regenerate recipe from merged state
- Cleanup temporary branches
Conflict resolution: Process pauses if merge fails. Resolve conflicts in your editor, confirm when prompted, then process continues.
schema
Generate JSON schema from Zod definitions for recipe.yaml validation and IDE support.
pnpm run cookbook -- schemaResult: Updated recipe.schema.json
Common Workflows
# New recipe development
pnpm run cookbook -- generate --recipe my-feature
pnpm run cookbook -- validate --recipe my-feature
pnpm run cookbook -- render --recipe my-feature
# Recipe maintenance
pnpm run cookbook -- update --recipe existing-feature
pnpm run cookbook -- validate --recipe existing-feature
# Bulk operations
pnpm run cookbook -- validate
pnpm run cookbook -- render
pnpm run cookbook -- regenerate --format githubRecipe YAML Structure
gid: 'uuid-v4-identifier'
title: 'Recipe Display Name'
summary: 'Brief description'
description: 'Detailed explanation'
commit: 'git-sha-hash'
ingredients:
- path: 'templates/skeleton/app/components/NewFile.tsx'
description: 'Component description'
steps:
- step: "1" # IMPORTANT: Quoted string, not bare integer
type: PATCH
name: 'app/root.tsx'
description: 'What this step does' # IMPORTANT: Required, non-null
diffs:
- file: 'app/root.tsx'
patchFile: 'root.tsx.abc123.patch'Repository Etiquette
Before committing recipes:
- Run validation:
pnpm run cookbook -- validate --recipe {name} - Fix all errors before pushing
- Include recipe changes in PR descriptions
- Update LLM prompts when recipe logic changes
Commit messages:
- Format:
feat(cookbook): add {recipe-name} recipe - Include what the recipe does and why it's useful
Integration Notes
- Recipes guide development in any Hydrogen project
- Template scaffolding: Apply recipes to skeleton for new projects
- Feature implementation: Use recipes as implementation guides
- Pattern reference: Demonstrate best practices for specific scenarios
- Update recipes when skeleton template changes significantly
- New Hydrogen features need new recipes
- Recipe validation ensures compatibility with current Hydrogen versions
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.

