Agent skill · software engineering · jeremylongshore
shopify-functions
Build Shopify Functions for custom discount, payment, and delivery logic
Why this skill is useful
Adds executable scripts for deploying custom Shopify Functions that implement complex business logic not covered in general documentation.
What it needs
Requires shopify-cli installed locally. Requires shopify-partners account access. About 2k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Shopify Functions Overview Shopify Functions execute custom business logic in a WebAssembly sandbox at checkout: discounts, payment filtering, delivery customization, and cart transforms. They run server-side with strict constraints (11ms execution, 1MB memory, no network access) and replace Shopify Scripts. Prerequisites Shopify CLI 3.x+ installed (npm install -g @shopify/cli) Shopify Partners account with a development store App configured for the target function API type Instructions Step 1: Configure the Function Extension Step 2: Define the Input Query The input query declares what data your function receives at runtime: Step 3: Implement the Function Step 4: Test and Deploy See function-types.md for all function types, input-output-schemas.md for I/O shapes, and wasm-constraints.md for sandbox limitations. Output WASM binary deployed as a Shopify Function extension Custom discount/payment/delivery logic running server-side at checkout Type-safe input/output via generated TypeScript types Configurable via metafields (merchant-editable without code changes) Error Handling Error Cause Solution ------- ------- ---------- FunctionError Runtime panic or unhandled exception in WASM Add error handling; check optional fields for null FUNCTIONTOOLARGE WASM binary exceeds 256KB Tree-shake deps; use Rust for smaller binaries Input query validation Query references unavailable fields Match apiversion to available schema fields Timeout (>11ms) Function exceeds execution limit Reduce iterations; pre-compute in metafields Examples Creating a VIP Discount Function Build a product discount function that applies a configurable percentage off for items tagged "VIP-DISCOUNT" using metafield-driven configuration. See Function Types for all available function types and their targeting. Defining Input Queries and Output Schemas Design the GraphQL input query that declares what cart data your function receives, and return the correctly shaped FunctionRunResult. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/shopify-functions