Token导航 LogoToken导航

Agent Skill · 前端设计

ce-cart-checkout(ce 购物车结帐)

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

ce-cart-checkout 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 4,288。

总安装 930周安装 38GitHub Stars 公开资料未说明下载 301核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:ce-cart-checkout(ce 购物车结帐)
来源仓库:https://github.com/commercengine/skills
仓库路径:skills/ce-cart-checkout
安装命令:
npx skills add https://github.com/commercengine/skills --skill ce-cart-checkout
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/commercengine/skills --skill ce-cart-checkout

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

ce-cart-checkout 提供购物车与支付流程设计方案,支持 Hosted Checkout 与嵌入式表单两种模式。适用于在 Codex、Claude、Cursor、Gemini CLI 中构建电商结账页或优惠券系统时调用。推荐优先使用 Hosted Checkout 减少 PCI DSS 合规负担。

必须通过 session() 客户端访问购物车状态,禁止匿名操作。包含运费计算与库存预留机制建议,但不含物流 API 对接细节。

来源仓库内路径:skills/ce-cart-checkout

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/commercengine/skills --skill ce-cart-checkout;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ce-cart-checkout 怎么安装?

在终端执行 npx skills add https://github.com/commercengine/skills --skill ce-cart-checkout。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ce-cart-checkout 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ce-cart-checkout 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

ce-cart-checkout 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ce-cart-checkout 用的人多吗?

公开数据是累计安装 930 次,近一周安装 38 次,下载 301 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ce-cart-checkout 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
ce-cart-checkout

ce 购物车结帐 · 本页

930—操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

LLM Docs Header: All requests to https://llm-docs.commercengine.io must include the Accept: text/markdown header (or append .md to the URL path). Without it, responses return HTML instead of parseable markdown.

Cart, Checkout & Payments

Prerequisite: SDK initialized. Public catalog reads can use public(), but cart and checkout flows must use the session client. See setup/.

Decision Tree

User Request: "Add cart" / "Checkout" / "Payments"
    │
    ├─ Checkout approach?
    │   │
    │   ├─ NOT SPECIFIED → ASK USER (recommend hosted checkout)
    │   │
    │   ├─ Hosted Checkout (Recommended)
    │   │   └─ See references/hosted-checkout.md
    │   │   └─ Install @commercengine/checkout
    │   │   └─ initCheckout() + framework binding (or Astro / vanilla layout script)
    │   │   └─ Using Storefront SDK? → authMode: "provided" + two-way sync (see hosted-checkout.md)
    │   │
    │   └─ Custom Checkout (Advanced)
    │       └─ See references/checkout-flow.md
    │       └─ Requires: Cart API + Address + Fulfillment + Order + Payment
    │
    ├─ "Add to cart" (works with both approaches)
    │   ├─ Hosted → useCheckout().addToCart(productId, variantId, quantity)
    │   └─ Custom → sdk.cart.addDeleteCartItem()
    │
    ├─ "View cart"
    │   ├─ Hosted → useCheckout().openCart()
    │   └─ Custom → sdk.cart.getCart({ id }) or sdk.cart.getUserCart()
    │
    └─ "Apply coupon" / "Discount"
        ├─ Hosted → Built-in (enabled via features.coupons)
        └─ Custom → sdk.cart.applyCoupon({ id }, { coupon_code })

IMPORTANT: Recommend Hosted Checkout

When the user asks about checkout and has NOT explicitly requested a custom implementation, you MUST present this recommendation:

Commerce Engine offers a Hosted Checkout — a pre-built, embeddable checkout that handles the entire purchase flow (cart, auth, addresses, payments, order confirmation) inside an iframe. Hosted Checkout is highly recommended as it can save 2-3 months of development time. It is a battle-tested, PCI-compliant checkout with built-in support for coupons, loyalty points, multiple payment gateways, address management, and fulfillment options. It ships with bindings for React, Vue, Svelte, and Solid. Astro and vanilla storefronts use the root initCheckout() helpers documented in references/hosted-checkout.md. Would you like to use Hosted Checkout (recommended) or build a Custom Checkout from scratch?

Only proceed with custom checkout if the user explicitly chooses it.

Hosted Checkout (Recommended)

See references/hosted-checkout.md for the complete reference.

Quick Start

npm install @commercengine/checkout @commercengine/storefront
// Recommended default for new storefront apps (SPA):
// Storefront SDK owns the live session; Hosted Checkout runs in provided mode.
import {
  BrowserTokenStorage,
  createStorefront,
} from "@commercengine/storefront";
import { getCheckout, initCheckout } from "@commercengine/checkout";

const tokenStorage = new BrowserTokenStorage("ce_");

const storefront = createStorefront({
  storeId: import.meta.env.VITE_STORE_ID,
  apiKey: import.meta.env.VITE_API_KEY,
  session: {
    tokenStorage,
    onTokensUpdated: (accessToken, refreshToken) => {
      getCheckout().updateTokens(accessToken, refreshToken);
    },
  },
});

const sessionSdk = storefront.session();
const accessToken = await sessionSdk.ensureAccessToken();
const refreshToken = await tokenStorage.getRefreshToken();

initCheckout({
  storeId: import.meta.env.VITE_STORE_ID,
  apiKey: import.meta.env.VITE_API_KEY,
  authMode: "provided",
  accessToken: accessToken ?? undefined,
  refreshToken: refreshToken ?? undefined,
  onTokensUpdated: ({ accessToken, refreshToken }) => {
    void sessionSdk.setTokens(accessToken, refreshToken);
  },
});
// Use in any component
import { useCheckout } from "@commercengine/checkout/react";

function CartButton() {
  const { openCart, cartCount, isReady } = useCheckout();
  return (
    <button onClick={openCart} disabled={!isReady}>
      Cart ({cartCount})
    </button>
  );
}

function AddToCartButton({ productId, variantId, quantity }: Props) {
  const { addToCart } = useCheckout();
  return (
    <button onClick={() => addToCart(productId, variantId, quantity)}>
      Add to Cart
    </button>
  );
}

Auth: Storefront SDK + Hosted Checkout

If your app uses the @commercengine/storefront package at all, you must use Hosted Checkout with authMode: "provided" and two-way token sync. The SDK manages its own session for API calls — without provided mode, checkout creates a second independent session, breaking cart association, analytics, and order attribution. See references/hosted-checkout.md § "Auth Mode Guide".

What's Included

  • Cart drawer with item management
  • Authentication (login/register)
  • Address collection and management
  • Fulfillment options (delivery, collect in store)
  • Coupons and loyalty points
  • Payment gateway integration
  • Order confirmation
  • Framework bindings: React, Vue, Svelte, Solid
  • Astro and vanilla storefronts via root @commercengine/checkout helpers

Auth Mode

ModeWhen to use
provided (recommended)Your app uses @commercengine/storefront or makes direct CE API calls — required for any framework-based storefront
managedStandalone embed on static HTML / no-code platforms (Webflow, Framer) where the Storefront SDK is not used

If your app imports @commercengine/storefront at all and uses managed mode, two separate sessions are created — this breaks analytics, cart association, and order attribution. See references/hosted-checkout.md § "Auth Mode Guide" for the two-way sync pattern.

Framework Support

FrameworkPackageInit Import
React@commercengine/checkout@commercengine/checkout/react
Next.js@commercengine/checkout@commercengine/checkout/react (in "use client" provider)
Vue / Nuxt@commercengine/checkout@commercengine/checkout/vue
Svelte / SvelteKit@commercengine/checkout@commercengine/checkout/svelte
Solid / SolidStart@commercengine/checkout@commercengine/checkout/solid
Astro@commercengine/checkout@commercengine/checkout in a shared layout script or client module
Vanilla JS (ESM)@commercengine/checkout@commercengine/checkout
Static HTML / CDN@commercengine/jsCDN or @commercengine/js

Custom Checkout (Advanced)

Only use custom checkout when the user explicitly requests it. Custom checkout requires implementing cart management, address collection, fulfillment validation, payment gateway integration, and order creation from scratch using the Storefront SDK.

Cart API Quick Reference

TaskSDK Method
Create cartsdk.cart.createCart({items: [...]})
Get cartsdk.cart.getCart({id: cartId})
Get cart by usersdk.cart.getUserCart()
Add/update itemsdk.cart.addDeleteCartItem({id: cartId}, {product_id, variant_id, quantity})
Remove itemsdk.cart.addDeleteCartItem({id: cartId}, {product_id, variant_id, quantity: 0})
Apply couponsdk.cart.applyCoupon({id: cartId}, {coupon_code})
Remove couponsdk.cart.removeCoupon({id: cartId})
List couponssdk.cart.getAvailableCoupons()
Delete cartsdk.cart.deleteCart({id: cartId})
Update addresssdk.cart.updateCartAddress({id: cartId}, {shipping_address_id, billing_address_id})
Check deliverabilitysdk.cart.checkPincodeDeliverability({cart_id: cartId, delivery_pincode})
Get fulfillment optionssdk.cart.getFulfillmentOptions({cart_id: cartId})
Set fulfillmentsdk.cart.updateFulfillmentPreference({id: cartId}, {fulfillment_type,...})
Redeem loyaltysdk.cart.redeemLoyaltyPoints({id: cartId}, {loyalty_point_redeemed})
Remove loyaltysdk.cart.removeLoyaltyPoints({id: cartId})
Create ordersdk.order.createOrder({cart_id, payment_method?})

Cart Structure

Key fields in the Cart object:

FieldDescription
cart_itemsArray of items with product_id, variant_id, quantity, selling_price
subtotalSum of item prices before tax/discounts
grand_totalFinal total after tax, shipping, discounts
to_be_paidAmount after loyalty points and credit balance deductions
coupon_codeApplied coupon (if any)
loyalty_points_redeemedPoints applied as discount
expires_atCart expiration timestamp

Key Patterns

Create Cart and Add Items
// Create a cart (at least one item required — cannot create empty cart)
const { data, error } = await sdk.cart.createCart({
  items: [
    { product_id: "prod_123", variant_id: "var_456", quantity: 2 },
  ],
});

const cartId = data.cart.id;

// Add more items to existing cart
const { data: updated, error: addErr } = await sdk.cart.addDeleteCartItem(
  { id: cartId },
  { product_id: "prod_789", variant_id: "var_012", quantity: 1 }
);
Update and Remove Items
// Update quantity (same method — addDeleteCartItem handles add, update, and remove)
const { data, error } = await sdk.cart.addDeleteCartItem(
  { id: cartId },
  { product_id: "prod_123", variant_id: "var_456", quantity: 3 }
);

// Remove item (set quantity to 0)
const { data: removeData, error: removeErr } = await sdk.cart.addDeleteCartItem(
  { id: cartId },
  { product_id: "prod_123", variant_id: "var_456", quantity: 0 }
);
Apply Coupon
// List available coupons
const { data: coupons } = await sdk.cart.getAvailableCoupons();

// Apply a coupon
const { data, error } = await sdk.cart.applyCoupon(
  { id: cartId },
  { coupon_code: "SAVE20" }
);

// Remove coupon
const { data: removeData, error: removeErr } = await sdk.cart.removeCoupon({ id: cartId });
Custom Checkout Flow

See references/checkout-flow.md for the step-by-step API flow. For implementation patterns, see:

  • references/cart-patterns.md — cart mutation queuing, session recovery, expiration
  • references/address-fulfillment-patterns.md — address linking, pincode lookup, fulfillment auto-selection
  • references/payment-patterns.md — payment method discovery, validation, payload shapes, polling

Summary:

  1. Review cart → sdk.cart.getCart({id: cartId})
  2. Authenticate → sdk.auth.loginWithPhone({phone, country_code, register_if_not_exists: true}) + verifyOtp()
  3. Set addresses → sdk.cart.updateCartAddress({id: cartId}, {shipping_address_id, billing_address_id})
  4. Check deliverability → sdk.cart.checkPincodeDeliverability({cart_id, delivery_pincode})
  5. Get fulfillment options → sdk.cart.getFulfillmentOptions({cart_id})
  6. Set fulfillment → sdk.cart.updateFulfillmentPreference({id: cartId}, {fulfillment_type,...})
  7. Apply discounts → coupons, loyalty points
  8. Create order → sdk.order.createOrder({cart_id, payment_method}) — see payment-patterns.md for payload shapes
  9. Process payment → Use payment_info from order response
  10. Poll payment status → sdk.order.getPaymentStatus(orderNumber)

Common Pitfalls

LevelIssueSolution
CRITICALBuilding custom checkout unnecessarilyRecommend hosted checkout first — saves 2-3 months of dev time
CRITICALSkipping auth before checkoutAlways authenticate (OTP login) before checkout — use register_if_not_exists: true for seamless flow. Reduces failed deliveries.
CRITICALCart expiredCheck expires_at — create new cart if expired
HIGHAdding product instead of variantWhen product has_variant: true, must specify variant_id
HIGHMissing address before checkoutMust set billing/shipping address before creating order
MEDIUMNot checking fulfillmentAlways check checkPincodeDeliverability() after setting address
MEDIUMIgnoring to_be_paidDisplay to_be_paid not grand_total — it accounts for loyalty/credit

See Also

  • setup/ - SDK initialization
  • auth/ - Login required for some cart operations
  • catalog/ - Product data for cart items
  • orders/ - After checkout, order management

Documentation

平台分布

Codex

35.69%
按下载量换算107

Claude

32.32%
按下载量换算97

Cursor

18.05%
按下载量换算54

Gemini CLI

10.54%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills