Skip to content

Hydrogen Developer

The hydrogen-developer agent carries all conventions for building Shopify Hydrogen storefronts using React, Remix (React Router v7), TypeScript, the Storefront API, and Sanity CMS. Activate it at the start of every Hydrogen project session.

activate_agent("hydrogen-developer")
  • Monorepo structure: Storefront (app/), Sanity Studio (admin/)
  • Component taxonomy: UI primitives, commerce components, CMS-driven sections, routes
  • Build order: Tokens, UI primitives, commerce components, sections, routes
  • GraphQL organization: Fragments, queries, mutations separated by data source (Shopify / Sanity)
  • Sanity integration: Schema naming conventions, section pattern across both workspaces, type generation, multi-dataset config
  • Token system: CSS custom properties or Tailwind config
  • TypeScript: Strict mode, Props interfaces, JSDoc, no any
  • Server-first rendering: Default to server components, loaders for data
  • Validation: tsc --noEmit, ESLint, pnpm build
  • Performance patterns: Streaming, caching strategies, code splitting, parallel data loading
  • Figma config: clientLanguages: "typescript,css,react", clientFrameworks: "remix,hydrogen"
.
├── app/ # Hydrogen storefront
│ ├── components/
│ │ ├── ui/ # Primitive UI (Button, Icon, Input)
│ │ ├── commerce/ # Commerce composites (ProductCard, CartLineItem)
│ │ └── sections/ # CMS-driven sections (HeroBanner, FeaturedCollection)
│ ├── graphql/
│ │ ├── shopify/ # Storefront API (fragments, queries, mutations)
│ │ └── sanity/ # Sanity GROQ (fragments, queries)
│ ├── helpers/
│ ├── hooks/
│ ├── routes/
│ ├── styles/
│ └── root.tsx
├── admin/ # Sanity CMS Studio
│ ├── src/schemas/
│ │ ├── documents/ # Singleton and collection content
│ │ ├── objects/ # Reusable field groups
│ │ ├── pages/ # Page-level content types
│ │ ├── sections/ # CMS section schemas
│ │ ├── settings/ # Global settings
│ │ └── templates/ # Page templates
│ ├── sanity.config.ts
│ └── package.json
├── pnpm-workspace.yaml
├── .mcp.json
├── CONVENTIONS.md
└── INSTRUCTIONS.md

Every CMS-driven section spans both workspaces:

  1. Schema in admin/src/schemas/sections/section{Name}.js
  2. Component in app/src/components/Sections/{Name}/
  3. Fragment in app/src/graphql/sanity/fragments/sections/
  4. Type in app/src/types/Sections/

When building a new section, create all four files.

TypePurposeLocationHas Loader
UI PrimitiveReusable atomic elementapp/components/ui/{Name}.tsxNo
Commerce ComponentBusiness-logic compositeapp/components/commerce/{Name}.tsxNo
SectionCMS-driven page sectionapp/components/Sections/{Name}/No
RouteURL-mapped page with data loadingapp/routes/{path}.tsxYes
TaskCommand
Set up or onboard a projectsetup
Extract tokens, icons, logos from Figmadesign-system
Build components, sections, routesbuild
Visual QA against design referencerefine
Accessibility auditaccessibility
Performance optimisationperformance
SEO auditseo
Code auditaudit
Dependency updates and version upgradesmaintenance
Commit changescommit

Before writing any code, the agent instructs:

  1. Load get_conventions for universal rules and MCP toolchain
  2. Read the project’s CONVENTIONS.md for tokens, component APIs, GraphQL fragments, overrides
  3. Call get_project_context for project memory