Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox.

MITAuto-check passedBackend & APIs

Install Shopify Functions

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill shopify-functions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace shopify-functions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/shopify-functions .claude/skills/shopify-functions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shopify-functions
GitHub stars
2.8k
Token cost
~1.3k tokens
SKILL.md length
313 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox.

  • Works in 4 steps: Configure the Function Extension → Define the Input Query → Implement the Function → …
  • Creating custom discount rules
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Calls shopify and npm

What it does

Shopify Functions is an agent skill from jeremylongshore/tons-of-skills-marketplace. Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox. Use when creating custom discount rules, payment customizations, delivery options, or cart transformations that run server-side at checkout. Trigger with phrases like "shopify functions", "shopify discounts", "shopify wasm", "custom discount function", "shopify checkout customization".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/function-types.md`, `references/input-output-schemas.md` and `references/wasm-constraints.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Backend development. It works with Shopify and WebAssembly. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Creating custom discount rules
  • Payment customizations
  • Delivery options
  • Cart transformations that run server-side at checkout

Example prompts

  • “shopify functions”
  • “shopify discounts”
  • “shopify wasm”
  • “/shopify-functions”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Grep

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Configure the Function Extension
  2. Define the Input Query
  3. Implement the Function
  4. Test and Deploy

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • shopify
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • shopify.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Shopify Functions loads about 1.3k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 313 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 313 words, ~1,306 tokens.

Download SKILL.mdSave it as .claude/skills/shopify-functions/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
shopify-functions
description
Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox. Use when creating custom discount rules, payment customizations, delivery options, or cart transformations that run server-side at checkout. Trigger with phrases like "shopify functions", "shopify discounts", "shopify wasm", "custom discount function", "shopify checkout customization".
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
compatibility
Designed for Claude Code
version
2.7.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, ecommerce, shopify

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
toml
# extensions/product-discount/shopify.extension.toml
api_version = "2025-01"
type = "product_discounts"

[[targeting]]
target = "purchase.product-discount.run"
input_query = "extensions/product-discount/input.graphql"
export = "run"
Step 2: Define the Input Query

The input query declares what data your function receives at runtime:

graphql
# extensions/product-discount/input.graphql
query Input {
  cart {
    lines {
      quantity
      merchandise {
        ... on ProductVariant {
          id
          product { hasAnyTag(tags: ["VIP-DISCOUNT"]) }
        }
      }
    }
  }
  discountNode {
    metafield(namespace: "$app:discount-config", key: "percentage") { value }
  }
}
Step 3: Implement the Function
typescript
// extensions/product-discount/src/run.ts
import type { Input, FunctionRunResult } from "../generated/api";

export function run(input: Input): FunctionRunResult {
  const percentage = parseFloat(input.discountNode?.metafield?.value ?? "0");
  if (percentage === 0) return { discounts: [], discountApplicationStrategy: "FIRST" };

  const targets = input.cart.lines
    .filter((line) => line.merchandise.product.hasAnyTag)
    .map((line) => ({ productVariant: { id: line.merchandise.id } }));

  return {
    discounts: [{
      targets,
      value: { percentage: { value: percentage.toString() } },
      message: `${percentage}% VIP Discount`,
    }],
    discountApplicationStrategy: "FIRST",
  };
}
Step 4: Test and Deploy
bash
shopify app function typegen          # Generate types from input query
shopify app function build            # Build to WASM
shopify app function run --input test-input.json  # Test locally
shopify app deploy                    # Deploy with app

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

ErrorCauseSolution
FunctionErrorRuntime panic or unhandled exception in WASMAdd error handling; check optional fields for null
FUNCTION_TOO_LARGEWASM binary exceeds 256KBTree-shake deps; use Rust for smaller binaries
Input query validationQuery references unavailable fieldsMatch api_version to available schema fields
Timeout (>11ms)Function exceeds execution limitReduce 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.

See Input/Output Schemas for I/O shapes per function type.

Working Within WASM Sandbox Limits

Your function hits the 11ms execution timeout or 256KB binary size limit. Apply optimization strategies for the constrained WASM environment.

See WASM Constraints for sandbox limitations and workarounds.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/.curated/shopify-functions of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/function-types.md
  • references/input-output-schemas.md
  • references/wasm-constraints.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Shopify Functions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shopify Functions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shopify Functions this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.3kAutomated safety check: PassMIT
Phpericrisco/rsc-harness180—~4kAutomated safety check: PassMIT
Stash Edgecipherstash/stack157—~6.4kAutomated safety check: NotesMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT

Similar skills

  • Php

    ericrisco/rsc-harness

    A skill your agent uses when writing, reviewing or modernizing PHP (8.3-8.5) outside Laravel — strict types, union and intersection types, readonly classes, backed enums, property hooks and…

    180 GitHub stars~4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Stash Edge

    cipherstash/stack

    Run CipherStash encryption on edge and non-Node runtimes with the @cipherstash/stack/wasm-inline entry — Deno, Supabase Edge Functions, Cloudflare Workers, and Bun.

    157 GitHub stars~6.4k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Laravel Best Practices

    anonaddy/anonaddy

    Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code.

    4.9k GitHub starsUsed in 13 repos~1.2k tokens
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Shopify Functions

What does Shopify Functions do?

Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox. Shopify Functions is an agent skill from jeremylongshore/tons-of-skills-marketplace. Build Shopify Functions for custom discount, payment, and delivery logic in a WASM sandbox.

When should I use Shopify Functions?

Shopify Functions fits situations like: creating custom discount rules; payment customizations; delivery options; cart transformations that run server-side at checkout.

How do I install Shopify Functions in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill shopify-functions -a claude-code`. Or copy the skill folder (skills/.curated/shopify-functions in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/shopify-functions in your project. Claude Code loads it when a task matches its description.

How do I install Shopify Functions in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill shopify-functions -a codex`. Or copy the skill folder (skills/.curated/shopify-functions in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/shopify-functions in your project. Codex loads it when a task matches its description.

Can I use Shopify Functions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill shopify-functions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shopify-functions, .gemini/skills/shopify-functions, .github/skills/shopify-functions and .opencode/skills/shopify-functions in your project.

What does Shopify Functions need to run?

Going by SKILL.md and its folder, Shopify Functions needs the command-line tools its instructions call (shopify and npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Shopify Functions access the network?

SKILL.md names 1 domain. As links in the text: shopify.dev. This is read from the text; nothing was executed.

Is Shopify Functions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shopify Functions use?

Shopify Functions is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shopify Functions use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Shopify Functions?

Skills that share tags, products or a category with Shopify Functions: Php (ericrisco/rsc-harness, 180 stars), Stash Edge (cipherstash/stack, 157 stars), Configuring Horizon (coollabsio/coolify, 63k stars) and Fortify Development (coollabsio/coolify, 63k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shopify Functions?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.