# 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.

- skill · `type=skill` · Codex, ChatGPT · 1 install · ★ 7604
- Author: Shopify · official OpenAI repository
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/openai/plugins/tree/HEAD/plugins/shopify/skills/shopify-functions/SKILL.md
- Updated: 2026-10-08
- HTML: https://affpapa.org/en/nevibecode/skills/shopify-functions

## What it 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.

## Install

### Codex (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add openai/plugins --skill shopify-functions -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/shopify-functions/SKILL.md` — For all projects use ~/.agents/skills/

### Claude Code

1. **Skills CLI (Vercel)**
```bash
npx skills add openai/plugins --skill shopify-functions -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/shopify-functions/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/shopify-functions/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/shopify-functions/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install openai/plugins shopify-functions
```

2. **Manually: put the files in place**
- File: `.github/skills/shopify-functions/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/openai/plugins --path plugins/shopify/skills/shopify-functions
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/shopify-functions/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/openai/plugins/tree/HEAD/plugins/shopify/skills/shopify-functions/SKILL.md

## When to use it
- 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
- Write a cart line discount function in Rust
- Generate a cart and checkout validation function in TypeScript
- Create a function that renames payment methods

## Similar
- [shopify-setup](https://affpapa.org/en/nevibecode/skills/shopify-setup.md) — skill · 1200 installs
- [shopify](https://affpapa.org/en/nevibecode/skills/mrgoonie-shopify.md) — skill · 450 installs
- [shopify-expert](https://affpapa.org/en/nevibecode/skills/shopify-expert.md) — skill · 5000 installs
- [shopify-development](https://affpapa.org/en/nevibecode/skills/shopify-development.md) — skill · 1900 installs
- [shopify-products](https://affpapa.org/en/nevibecode/skills/shopify-products.md) — skill · 1400 installs
- [shopify-apps](https://affpapa.org/en/nevibecode/skills/sickn33-shopify-apps.md) — skill · 1000 installs

From the same set: [openai/plugins](https://affpapa.org/en/nevibecode/by/openai/plugins.md) — 528 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
