shopify-functions — Codex skill for Shopify Functions
A Codex and ChatGPT skill for building Shopify Functions backend logic, from discounts to cart validation. It searches the docs first and validates the code before handing it over.
npx skills add openai/plugins --skill shopify-functions -a codexWhat shopify-functions does
The skill covers ten Shopify Functions APIs: Discount, Cart and Checkout Validation, Cart Transform, Delivery Customization, Payment Customization, Fulfillment Constraints, Order Routing Location Rule, plus the pickup and pickup point generators. For each one it picks a target, such as cart.lines.discounts.generate.run for line-item discounts.
The workflow is fixed. The agent runs scripts/search_docs.mjs "<query>", writes the code, then calls scripts/validate.mjs with --model, --client-name, --client-version, --artifact-id and --revision. A failed check sends it back to search by error type, up to three attempts. Nothing reaches you until validation passes.
Shopify functions are pure: no network, no filesystem, no random numbers, no clock. Everything arrives through the input GraphQL query, fields in camelCase, and UNION types need __typename. Rust is the default language; pick JavaScript or TypeScript explicitly if you want them. Node.js is required, and building or running happens through shopify app function build and shopify app function run inside the function folder.
What it helps with
- pick the right Shopify Functions API for a task
- write a target for line-item discounts
- build an input GraphQL query with the fields you need
- validate function code before it reaches the user
- move off the deprecated Order Discount API
Example prompts for the agent
- Write a cart line discount function in Rust
- Generate a cart and checkout validation function in TypeScript
- Create a function that renames payment methods
How to install shopify-functions
1Skills CLI (Vercel)
npx skills add openai/plugins --skill shopify-functions -a codex2Manually: put the files in place
.agents/skills/shopify-functions/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openai/plugins --skill shopify-functions -a claude-code2Manually: put the files in place
~/.claude/skills/shopify-functions/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/shopify-functions/
Manually: put the files in place
.cursor/skills/shopify-functions/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openai/plugins shopify-functions2Manually: put the files in place
.github/skills/shopify-functions/SKILL.mdPlatform CLI
gemini skills install https://github.com/openai/plugins --path plugins/shopify/skills/shopify-functionsManually: put the files in place
.devin/skills/shopify-functions/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: Codex skills: how to install, where they live, how to call them
Questions about shopify-functions
How do I install shopify-functions in Claude?
Run npx skills add openai/plugins --skill shopify-functions, then npx skills add openai/plugins --skill shopify-functions -a codex. The skill file lands at .agents/skills/shopify-functions/SKILL.md.
What does shopify-functions do?
It helps you write Shopify Functions backend logic: it selects the API and target, searches the developer docs for examples, generates the code and validates it before returning.
Which language does it use by default?
Rust. Ask for JavaScript or TypeScript explicitly, otherwise the skill goes with Rust.