Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

shopify-app-developmentShopify 应用开发

Agent Skill

shopify-app-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

423

周安装

18

GitHub Stars

19

下载量

148
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shopify-app-development(Shopify 应用开发)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/shopify-app-development
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill shopify-app-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill shopify-app-development

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在需要围绕仓库状态或代码变更进行整理时使用。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装命令:npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill shopify-app-development。
  • 建议确认权限范围、维护状态及是否触发联网或命令执行。

SKILL.md

Shopify App Development

Overview

Build Shopify apps using the Shopify CLI 3.x Remix template, which handles OAuth token exchange, session storage, and App Bridge initialization automatically. Embedded apps run inside the Shopify Admin iframe and use Polaris for a native-feeling UI. The modern approach uses the Remix-based @shopify/shopify-app-remix package rather than the legacy Express template.

When to Use This Skill

  • When building a public or custom Shopify app that extends Admin functionality
  • When creating an embedded app that merchants install from the Shopify App Store
  • When implementing OAuth for the first time with session persistence across reinstalls
  • When needing to access the Admin API on behalf of authenticated merchants
  • When building merchant-facing tooling with Shopify's Polaris design system
  • When replacing an older Express/koa-based Shopify app with the modern Remix stack

Core Instructions

  1. Scaffold the app with Shopify CLI npm install -g @shopify/cli @shopify/theme shopify app init my-shopify-app # Choose: Remix template cd my-shopify-app shopify app dev This scaffolds a Remix app with OAuth, session storage (SQLite by default), and App Bridge already wired up. The dev command tunnels your local server via Cloudflare and installs the app on your Partner development store.
  2. Understand the OAuth flow and session handling The scaffold uses @shopify/shopify-app-remix which handles the OAuth dance. In app/shopify.server.ts: import "@shopify/shopify-app-remix/adapters/node"; import {AppDistribution, DeliveryMethod, shopifyApp, LATEST_API_VERSION,} from "@shopify/shopify-app-remix/server"; import {PrismaSessionStorage} from "@shopify/shopify-app-session-storage-prisma"; import {PrismaClient} from "@prisma/client"; const prisma = new PrismaClient(); const shopify = shopifyApp({apiKey: process.env.SHOPIFY_API_KEY, apiSecretKey: process.env.SHOPIFY_API_SECRET || "", apiVersion: LATEST_API_VERSION, scopes: process.env.SCOPES?.split(","), appUrl: process.env.SHOPIFY_APP_URL || "", authPathPrefix: "/auth", sessionStorage: new PrismaSessionStorage(prisma), distribution: AppDistribution.AppStore, webhooks: {APP_UNINSTALLED: {deliveryMethod: DeliveryMethod.Http, callbackUrl: "/webhooks",},}, hooks: {afterAuth: async ({session}) => {shopify.registerWebhooks({session});},},}); export default shopify; export const authenticate = shopify.authenticate;
  3. Protect routes and call the Admin API Any loader or action that needs Admin API access calls authenticate.admin: ` // app/routes/app._index.tsx import {json} from "@remix-run/node"; import {useLoaderData} from "@remix-run/react"; import {authenticate} from "../shopify.server"; export const loader = async ({request}: LoaderFunctionArgs) => {const {admin, session} = await authenticate.admin(request); // GraphQL Admin API call const response = await admin.graphql( query {shop {name email primaryDomain {url}}} ); const {data} = await response.json(); return json({shop: data.shop});}; export default function Index() {const {shop} = useLoaderData<typeof loader>(); return <Page title={Hello, ${shop.name}} />;} `
  4. Build UI with Polaris components // app/routes/app.products.tsx import {Page, Layout, Card, DataTable, Button, Banner,} from "@shopify/polaris"; import {TitleBar, useAppBridge} from "@shopify/app-bridge-react"; export default function ProductsPage() {const shopify = useAppBridge(); const handleSave = async () => {// Use App Bridge Toast for notifications inside the iframe shopify.toast.show("Products updated successfully");}; return (<Page> <TitleBar title="Products" primaryAction={{content: "Save", onAction: handleSave}} /> <Layout> <Layout.Section> <Card> <DataTable columnContentTypes={["text", "numeric", "numeric"]} headings={["Product", "Price", "Inventory"]} rows={[["Widget A", "$19.99", 42]]} /> </Card> </Layout.Section> </Layout> </Page>);}
  5. Configure scopes and handle app reinstallation Define required scopes in shopify.app.toml: name = "my-shopify-app" client_id = "your_api_key" application_url = "https://your-app.fly.dev" embedded = true [access_scopes] scopes = "read_products,write_products,read_orders" [webhooks] api_version = "2025-01" [[webhooks.subscriptions]] topics = ["app/uninstalled"] uri = "/webhooks" Handle the GDPR mandatory webhooks (customers/data_request, customers/redact, shop/redact) even if your app does not store personal data — Shopify requires these endpoints.
  6. Deploy to production shopify app deploy # Deploys to Shopify (functions/extensions) # Deploy the Remix server separately (Fly.io, Railway, Render) fly launch fly deploy

Examples

Mutation via Admin GraphQL API

// Create a product via the Admin API inside a Remix action
export const action = async ({ request }: ActionFunctionArgs) => {
  const { admin } = await authenticate.admin(request);

  const response = await admin.graphql(
    `#graphql
    mutation CreateProduct($input: ProductInput!) {
      productCreate(input: $input) {
        product {
          id
          title
          handle
        }
        userErrors {
          field
          message
        }
      }
    }`,
    {
      variables: {
        input: {
          title: "New Product",
          vendor: "My Store",
          productType: "Widget",
          tags: ["new", "featured"],
        },
      },
    }
  );

  const { data } = await response.json();
  if (data.productCreate.userErrors.length > 0) {
    return json({ errors: data.productCreate.userErrors }, { status: 422 });
  }
  return json({ product: data.productCreate.product });
};

App Bridge Resource Picker (v4)

import { useAppBridge } from "@shopify/app-bridge-react";
import { useState } from "react";
import { Button } from "@shopify/polaris";

export default function ProductSelector() {
  const shopify = useAppBridge();
  const [selected, setSelected] = useState<string[]>([]);

  const handleSelectProducts = async () => {
    const selection = await shopify.resourcePicker({
      type: "product",
      multiple: true,
    });

    if (selection) {
      setSelected(selection.map((p) => p.id));
    }
  };

  return (
    <>
      <Button onClick={handleSelectProducts}>Select Products</Button>
      <p>Selected IDs: {selected.join(", ")}</p>
    </>
  );
}

Best Practices

  • Use the Remix CLI template — it handles session storage, CSRF, OAuth token refresh, and frame-ancestor CSP headers automatically
  • Store sessions in a persistent database (Prisma + PostgreSQL in production) — the default SQLite storage is unsuitable for multi-instance deployments
  • Scope creep hurts conversion — only request the minimum scopes needed; merchants see the scope list during installation
  • Use App Bridge for navigation and modals — direct window.location navigation breaks the embedded iframe context
  • Validate webhook HMAC signatures — even for mandatory GDPR webhooks that you don't act on
  • Test reinstall flows — merchants who uninstall and reinstall must receive fresh OAuth tokens without stale session data
  • Use LATEST_API_VERSION in development only — pin to a specific version (e.g., 2025-01) in production to avoid breaking changes
  • Handle payment_required errors — Apps on the App Store may encounter billing requirement errors if merchants exceed their plan

Common Pitfalls

ProblemSolution
"Refused to display in frame" CSP errorEnsure your Remix server returns frame-ancestors https://*.myshopify.com https://admin.shopify.com in Content-Security-Policy
OAuth redirect loop after installCheck that your app URL in shopify.app.toml matches the URL your server is reachable at — mismatch causes infinite redirects
Session not found on subsequent requestsUse a persistent session storage (Prisma/PostgreSQL); SQLite doesn't work across Fly.io or Render instances
App Bridge useAppBridge() returns nullWrap your Remix app root with <AppProvider> from @shopify/shopify-app-remix/react
Webhooks registered but not firingWebhooks registered during afterAuth may not persist after app update — call shopify.registerWebhooks in a separate route for verification
"Invalid HMAC" on webhook endpointEnsure raw body is read before any JSON parsing middleware — use getRawBody before Express/Remix body parsing

Related Skills

  • @shopify-admin-api
  • @shopify-webhooks
  • @shopify-checkout-extensions
  • @shopify-storefront-api
  • @oauth-implementation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.97%
按下载量换算55

Claude

33.63%
按下载量换算50

Cursor

18.18%
按下载量换算27

Gemini CLI

8.91%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills