hydrogen-predictive-search
Skill by Shopify
Guides developers building predictive search, the autocomplete UI, in Shopify Hydrogen storefronts. It covers the route handler, client store, tracked result links and custom fragments, and is for anyone adding or reviewing search-as-you-type features.
Install hydrogen-predictive-search
Built from the published package, never by AI.
git clone --depth 1 https://github.com/Shopify/hydrogen /tmp/hydrogen && mkdir -p ~/.claude/skills && cp -r /tmp/hydrogen/packages/hydrogen/skills/hydrogen-predictive-search ~/.claude/skills/hydrogen-predictive-searchRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install hydrogen-predictive-search in Claude Code
git clone --depth 1 https://github.com/Shopify/hydrogen /tmp/hydrogen && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/hydrogen/packages/hydrogen/skills/hydrogen-predictive-search ~/.gemini/antigravity-cli/skills/hydrogen-predictive-searchAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install hydrogen-predictive-search in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill describes how to build predictive search with the @shopify/hydrogen package. Hydrogen predictive search has four layers: a Storefront API query helper, a same-origin route at /api/predictive-search, a framework-neutral client store, and framework provider or hook bindings. Rendering stays app-owned, because Hydrogen supplies data, state, request lifecycle and URL helpers rather than a dropdown template.
The skill explains how to register the packaged route handler, build result links with getPredictiveSearchItemUrl() so tracking parameters are kept, and add custom fragments for extra result fields. It also sets rules, such as keeping search usable without JavaScript through a /search link or GET form, using the q parameter, and returning empty UI for blank terms. It is intended for developers building or reviewing search in Hydrogen storefronts.
Written from the project's SKILL.md and checked against it.
What it can do
- Server route handlerRegisters the packaged predictive search route handler at /api/predictive-search in the app's request wiring.
- Tracking URLsBuilds predictive result links with getPredictiveSearchItemUrl() so Storefront API trackingParameters are preserved.
- Custom fragmentsAdds extra result fields to predictive search queries through additive fragments.
- Typed client stateDerives client state types from the server handlers so the UI sees custom fields.
- Framework bindingsPoints framework providers and hooks or composables at the shared predictive search route and store.
- No-JavaScript fallback rulesRequires a real /search link or GET form so search results render server-side without JavaScript.
- Modal dismiss guidanceExplains how to close a native dialog modal on backdrop clicks without accidental closes from drags.
What you need
- @shopify/hydrogen package
- Storefront API client for the app
- Hydrogen request handler setup from the hydrogen-request-handlers skill
Try asking
- Add predictive search with the packaged /api/predictive-search route to my Hydrogen app.
- Build predictive result links with getPredictiveSearchItemUrl() that keep tracking parameters.
- Add a custom product vendor field to my predictive search results using a fragment.
Good to know
- Hydrogen provides no dropdown template; the UI is app-owned.
- The client does not validate route responses.
- Predictive autocomplete must enhance a working /search page, not replace it.
- Custom Shopify resource paths need the hydrogen-routing skill for result URLs.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: packages/hydrogen/skills/hydrogen-predictive-search/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to hydrogen-predictive-search
All alternatives →Shopify skill that lets an AI assistant set up and run a Shopify store through Shopify's official MCP server. It is for people who want to sell online, start a store, or manage an existing Shopify store.
Guides an AI assistant through building Shopify apps, extensions and themes. It covers the GraphQL Admin API, Shopify CLI, Polaris UI and Liquid. Intended for Shopify developers.
Searches Ticketmaster events and seat listings with pricing for people looking for event tickets. It returns Ticketmaster checkout links but cannot complete a purchase itself.
Analyzes ecommerce SEO for product pages, product schema, Google Shopping visibility, Amazon marketplace signals and keyword gaps. Built for stores, catalogs and product listings. Live Shopping and Amazon data needs the optional DataForSEO Merchant API.
Drafts replies to customer emails and tickets using order, refund, CRM and support desk data, in the owner's writing voice. Refunds and sends need the owner's approval, and with Shopify it also flags orders needing attention.
Reviews generated or changed WooCommerce code before it ships. It is for developers building extensions, payment and shipping integrations, checkout customizations, and order or product logic.
Compare with shopify, shopify-development or ticketmaster
hydrogen-predictive-search: common questions
Does Hydrogen predictive search work without JavaScript?
The skill requires a real /search link or role="search" GET form so shoppers reach server-rendered results. Predictive autocomplete is an enhancement on top of that path.
How are predictive result links built?
Use getPredictiveSearchItemUrl(), which infers the standard storefront route from the item type and keeps tracking parameters without double-encoding.
Can I add custom fields to predictive search results?
Yes. The skill recommends additive fragments over full query overrides, and Hydrogen composes them with required base fields.
How do I install hydrogen-predictive-search?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is hydrogen-predictive-search free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is hydrogen-predictive-search safe to use?
It scores 85 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to hydrogen-predictive-search?
Similar skills: shopify, shopify-development, ticketmaster, seo-ecommerce.
