From shopify-commerce
Builds Shopify Functions: serverless Wasm extensions in JS/Rust for discounts, delivery/payment customization, cart validation/transforms, fulfillment constraints, and order routing.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin shopify-commerceThis skill is limited to using the following tools:
**Fetch live docs**:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
Fetch live docs:
https://shopify.dev/docs/apps/build/functions for Functions overviewsite:shopify.dev shopify functions input output for I/O schemassite:shopify.dev shopify functions api reference for function typesServerless extensions that run on Shopify's infrastructure:
| Type | Purpose | Example |
|---|---|---|
| Discount | Custom discount logic | Buy X get Y, tiered discounts |
| Delivery customization | Modify shipping options | Rename, reorder, hide methods |
| Payment customization | Modify payment methods | Hide, reorder, rename gateways |
| Cart validation | Block or warn on cart conditions | Quantity limits, product combos |
| Cart transform | Modify cart contents | Bundle expansion, auto-add items |
| Fulfillment constraints | Control fulfillment behavior | Location priority, restrictions |
| Order routing | Direct orders to locations | Closest warehouse, priority |
Functions receive structured JSON input and return structured JSON output:
{
"cart": {
"lines": [
{
"id": "gid://shopify/CartLine/1",
"quantity": 2,
"merchandise": {
"__typename": "ProductVariant",
"id": "gid://shopify/ProductVariant/123",
"product": {
"id": "gid://shopify/Product/456",
"hasAnyTag": true
}
},
"cost": {
"amountPerQuantity": { "amount": "29.99", "currencyCode": "USD" }
}
}
]
},
"discountNode": {
"metafield": {
"value": "{\"percentage\": 10}"
}
}
}
{
"discounts": [
{
"value": { "percentage": { "value": "10.0" } },
"targets": [
{ "productVariant": { "id": "gid://shopify/ProductVariant/123" } }
],
"message": "10% loyalty discount"
}
],
"discountApplicationStrategy": "FIRST"
}
extensions/my-discount/
├── src/
│ └── run.js # Function entry point
├── input.graphql # Defines what data the function receives
├── shopify.extension.toml # Extension configuration
└── package.json
api_version = "2025-01"
[[extensions]]
name = "My Discount"
handle = "my-discount"
type = "function"
[extensions.build]
command = "npm exec -- shopify app function build"
path = "dist/function.wasm"
[extensions.ui]
handle = "my-discount-ui"
[extensions.input.variables]
namespace = "my-app"
key = "discount-config"
Defines what Shopify data the function receives:
query Input {
cart {
lines {
id
quantity
merchandise {
... on ProductVariant {
id
product {
id
hasAnyTag(tags: ["vip"])
}
}
}
cost {
amountPerQuantity {
amount
currencyCode
}
}
}
}
discountNode {
metafield(namespace: "my-app", key: "discount-config") {
value
}
}
}
// src/run.js
export function run(input) {
const config = JSON.parse(input.discountNode.metafield?.value || '{}');
const percentage = config.percentage || 0;
const targets = input.cart.lines
.filter(line => line.merchandise?.product?.hasAnyTag)
.map(line => ({
productVariant: { id: line.merchandise.id }
}));
if (targets.length === 0) {
return { discounts: [], discountApplicationStrategy: "FIRST" };
}
return {
discounts: [{
value: { percentage: { value: String(percentage) } },
targets,
message: `${percentage}% VIP discount`,
}],
discountApplicationStrategy: "FIRST",
};
}
InstructionCountLimitExceededError if exceededshopify app function run locallyFetch the Shopify Functions documentation for exact I/O schemas, supported function types, and API version requirements before implementing.