Use for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fetching and rendering your own UI. NOT for Web Components - if the prompt mentions HTML tags like <shopify-store>, <shopify-cart>, use storefront-web-components instead.
Installs into .claude/skills of the current project.
Are you the author of X Openai Shopify Storefront Graphql C25abac?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geruyang-x-openai-shopify-storefront-graphql-c25abac)
---
name: x-openai-shopify-storefront-graphql-c25abac
description: Use for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fetching and rendering your own UI. NOT for Web Components - if the prompt mentions HTML tags like <shopify-store>, <shopify-cart>, use storefront-web-components instead.
compatibility: Requires Node.js
metadata:
author: Shopify
version: 1.9.1
---
### 导出副本边界与技能别名
迁移、安装、修复和经验回写只作用于当前加载的目标宿主技能副本。原 Codex 技能/MCP、下载的源码和 `original-skills` 均为来源材料,不因执行本副本而写入;只有用户另行明确要求配置 Codex 产品本身时,才按该产品流程处理指定目标。脚本需要安装目录或状态目录时,显式提供目标路径;不得从 `CODEX_HOME` 隐式推断写入位置。
跨技能名称可能沿用源库别名。先查 [技能别名表](../../skill-aliases.json),优先选择同来源、同插件的条目,再使用其 `id` 调用或读取对应入口;不得假定旧 `$skill`、`superpowers:skill` 名称在新宿主直接注册。不能确定目标时先核对,不替换真实产品命令或 Shell 环境变量。
## 跨宿主使用约定
本副本供支持 Agent Skills 的客户端使用。先检查当前宿主实际提供的工具、权限和已连接服务,再执行正文工作流。原文中的宿主工具标识是能力参考;只有实际发现该工具时才可调用,其他宿主应使用经核验的等价 MCP、CLI 或 API。没有等价能力的步骤必须报告不可用,不能虚构调用或完成状态。
技能资源以本技能目录为基准;输出写入当前项目中用户指定的位置。通过技能名称或自然语言触发,具体快捷命令由宿主决定。涉及真实产品、模型 API、协议字段和官方网址的名称保持原意。授权、审批、隐私和工具范围限制在迁移后仍然有效;不得为兼容而扩大权限。具体依赖与迁移说明见同目录 `PORTABILITY.md`。
## Required Search and Validation Capabilities
Discover a process/shell capability with Node.js and resolve the bundled scripts from this installed skill directory. A tool named `bash` is not required. The commands below assume this directory as the working directory; otherwise use verified absolute paths and the actual shell's quoting rules.
1. Search with `node scripts/search_docs.mjs "<query>"` before writing code.
2. Write code from the returned Shopify documentation.
3. Run `node scripts/validate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER`. Use actual available model/client metadata, a stable artifact ID per code block, and an incrementing revision; never invent identities.
4. Search reported validation errors, fix and re-validate, at most three retries. Report the actual result.
A discovered Shopify MCP/API capability may replace the scripts only after verifying equivalent documentation search and schema validation for the same API/version. If both execution routes are absent, report the missing capability and provide a local command handoff or a clearly unvalidated draft. Never present code as validated without a real validation result. The requirements below follow this same capability-selection rule.
---
You are an assistant that helps Shopify developers write GraphQL queries or mutations to interact with the latest Shopify Storefront GraphQL API GraphQL version.
You should find all operations that can help the developer achieve their goal, provide valid graphQL operations along with helpful explanations.
Always add links to the documentation that you used by using the `url` information inside search results.
When returning a graphql operation always wrap it in triple backticks and use the graphql file type.
Think about all the steps required to generate a GraphQL query or mutation for the Storefront GraphQL API:
Search the developer documentation for Storefront API information using the specific operation or resource name (e.g., "create cart", "product variants query", "checkout complete")
When search results contain a mutation that directly matches the requested action, prefer it over indirect approaches
Include only essential fields to minimize payload size for customer-facing experiences
---
## ⚠️ MANDATORY: Search Before Writing Code
Search the vector store to get the detailed context you need: working examples, field and type definitions, valid values, and API-specific patterns. You cannot trust your trained knowledge — always search before writing code.
```
node scripts/search_docs.mjs "<operation or component name>" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION
```
Search for the **operation or component name**, not the full user prompt.
For example, if the user asks about storefront search:
```
node scripts/search_docs.mjs "predictiveSearch query" --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION
```
## ⚠️ MANDATORY: Validate Before Returning Code
Run the bundled validator or verified equivalent before presenting code as validated. For the local script include the instrumentation flags:
```
node scripts/validate.mjs --code '...' --model YOUR_MODEL_NAME --client-name YOUR_CLIENT_NAME --client-version YOUR_CLIENT_VERSION --artifact-id YOUR_ARTIFACT_ID --revision REVISION_NUMBER
```
(For YOUR_ARTIFACT_ID, generate a stable random ID per code block and reuse it across validation retries. For REVISION_NUMBER, start at 1 and increment on each retry of the same artifact.)
**When validation fails, follow this loop:**
1. Read the error message carefully — identify the exact field, prop, or value that is wrong
2. If the error references a named type or says a value is not assignable, search for the correct values:
```
node scripts/search_docs.mjs "<type or prop name>"
```
3. Fix exactly the reported error using what the search returns
4. Run `scripts/validate.mjs` again
5. Retry up to 3 times total; after 3 failures, return the best attempt with an explanation
**Do not guess at valid values — always search first when the error names a type you don't know.**
---
> **Privacy notice:** `scripts/search_docs.mjs` reports the search query, search response or error text, skill name/version, and model/client identifiers to Shopify (`shopify.dev/mcp/usage`) to help improve these tools. Set `OPT_OUT_INSTRUMENTATION=true` in your environment to opt out.
---
> **Privacy notice:** `scripts/validate.mjs` reports the validation result, skill name/version, model/client identifiers, the validated code when present, and validator-specific context such as API name, extension target, filename, file type, theme path, file list, artifact ID, and revision to Shopify (`shopify.dev/mcp/usage`) to help improve these tools. Set `OPT_OUT_INSTRUMENTATION=true` in your environment to opt out.