Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

ce-catalogCE 目录

Agent Skill

ce-catalog 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

685

周安装

28

GitHub Stars

公开资料未说明

下载量

220
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

ce-catalog 提供 Commerce Engine 商品目录管理接口规范,支持产品与变体查询。

  • 适用于在 Codex、Claude、Cursor、Gemini CLI 中构建商品展示页或库存管理系统时调用。
  • 需完成匿名认证后方可调用 listProducts 等公共方法。
  • 返回数据结构包含价格、库存与媒体资源引用路径。
  • 不支持实时价格更新推送,需轮询或 webhook 另建通道。

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.

Products & Catalog

Prerequisite: SDK initialized and anonymous auth completed. See setup/.

Quick Reference

TaskSDK Method
List productssdk.catalog.listProducts({page, limit, category_id})
Get product detailsdk.catalog.getProductDetail({product_id})
List variantssdk.catalog.listProductVariants({product_id})
Get variant detailsdk.catalog.getVariantDetail({product_id, variant_id})
List SKUs (flat)sdk.catalog.listSkus()
List categoriessdk.catalog.listCategories()
Search productssdk.catalog.searchProducts({query: searchTerm, filter?, sort?, facets?})
Get reviewssdk.catalog.listProductReviews({product_id})
Submit reviewsdk.catalog.createProductReview({product_id}, {...})
Similar productssdk.catalog.listSimilarProducts({product_id})
Upsell productssdk.catalog.listUpSellProducts({product_id})
Cross-sell productssdk.catalog.listCrossSellProducts({product_id})

Product Hierarchy

Understanding the Product → Variant → SKU relationship is critical:

Product (has_variant: false)
  └─ A simple product with one SKU, one price

Product (has_variant: true)
  ├─ Variant A (Color: Red, Size: M) → SKU: "RED-M-001"
  ├─ Variant B (Color: Red, Size: L) → SKU: "RED-L-001"
  └─ Variant C (Color: Blue, Size: M) → SKU: "BLU-M-001"
ConceptReturn TypeDescriptionWhen to Use
ProductProductBase item with nested variants arrayPLP where one card per product is desired (e.g., "T-Shirt" card showing color/size selectors)
VariantA specific option combo (Color + Size)PDPs, cart items — accessed via listProductVariants() or nested in Product
SKU / ItemItemFlat sellable unit — each variant is its own recordPLP where a flat grid is desired (each color/size combo = separate card), or any page with filters/sorting/search

Decision Tree

User Request
    │
    ├─ "Show products" / "Product list"
    │   ├─ With filters/sorting/search? → sdk.catalog.searchProducts({ query, filter, sort, facets })
    │   │   → Returns Item[] (flat SKUs) + facet_distribution + facet_stats
    │   ├─ Flat grid (no filters)? → sdk.catalog.listSkus()
    │   │   → Returns Item[] (flat SKUs)
    │   └─ One card per product (group variants)? → sdk.catalog.listProducts()
    │       → Returns Product[] (with nested variants)
    │
    ├─ "Product detail page"
    │   ├─ sdk.catalog.getProductDetail({ product_id })
    │   └─ If has_variant → sdk.catalog.listProductVariants({ product_id })
    │
    ├─ "Search" / "Filter" / "Sort"
    │   └─ sdk.catalog.searchProducts({ query, filter, sort, facets })
    │       → Returns Item[] + facet_distribution + facet_stats
    │
    ├─ "Categories" / "Navigation"
    │   └─ sdk.catalog.listCategories()
    │
    ├─ "Reviews"
    │   ├─ Read → sdk.catalog.listProductReviews({ product_id })
    │   └─ Write → sdk.catalog.createProductReview({ product_id }, body)
    │
    └─ "Recommendations"
        ├─ Similar → sdk.catalog.listSimilarProducts()
        ├─ Upsell → sdk.catalog.listUpSellProducts()
        └─ Cross-sell → sdk.catalog.listCrossSellProducts()

Key Patterns

Product Listing Page (PLP)

For PLPs with filters, sorting, or search — use searchProducts (recommended). It returns Item[] (flat SKUs) plus facet_distribution and facet_stats for building filter UI:

const { data, error } = await sdk.catalog.searchProducts({
  query: "running shoes",
  filter: "pricing.selling_price 50 TO 200 AND categories.name = footwear",
  sort: ["pricing.selling_price:asc"],
  facets: ["categories.name", "product_type", "tags"],
  page: 1,
  limit: 20,
});

// data.skus → Item[] (flat list — each variant is its own record)
//   Each Item includes product_slug and variant_slug for building SEO-friendly URLs
// data.facet_distribution → { [attribute]: { [value]: count } }
// data.facet_stats → { [attribute]: { min, max } } (e.g. price range)
// data.pagination → { page, limit, total, total_pages }

// filter also accepts arrays — conditions are AND'd:
// filter: ["product_type = physical", "rating >= 4"]
//
// Nested arrays express OR within AND:
// filter: ["pricing.selling_price 50 TO 200", ["categories.name = footwear", "categories.name = apparel"]]

For PLPs without filters where one card per product is desired (variants grouped under a single card):

const { data, error } = await sdk.catalog.listProducts({
  page: 1,
  limit: 20,
  category_id: ["cat_123"],  // Optional: filter by category
});

// data.products → Product[] (each product may contain a variants array)
// Check product.has_variant to know if options exist

For a flat grid without filters (each variant = separate card):

const { data, error } = await sdk.catalog.listSkus();
// Returns Item[] — same flat type as searchProducts
// Each Item includes product_slug and variant_slug for building SEO-friendly URLs

Product Detail Page (PDP)

const { data, error } = await sdk.catalog.getProductDetail({
  product_id: "blue-running-shoes", // Accepts product ID or slug
});

const product = data?.product;

// Prefer product.variants from getProductDetail.
// Fetch separately only if variants are missing or you specifically need the variants endpoint.
if (product?.has_variant && (!product.variants || product.variants.length === 0)) {
  const { data: variantData } = await sdk.catalog.listProductVariants({
    product_id: product.id,
  });
  // variantData.variants contains all options with pricing and stock
}

Adding a Product to Cart from PDP

After resolving the variant on the PDP, use product.id and variant.id from the getProductDetail response:

// product = data.product from getProductDetail()
// resolvedVariant = the variant matched from product.variants via option selection

if (product.has_variant) {
  // Variant product — must specify both product_id and variant_id
  await sdk.cart.addDeleteCartItem(
    { id: cartId },
    { product_id: product.id, variant_id: resolvedVariant.id, quantity: 1 }
  );
} else {
  // Simple product — variant_id is null
  await sdk.cart.addDeleteCartItem(
    { id: cartId },
    { product_id: product.id, variant_id: null, quantity: 1 }
  );
}

With Hosted Checkout, use addToCart instead:

const { addToCart } = useCheckout();
addToCart(product.id, product.has_variant ? resolvedVariant.id : null, 1);

Canonical Variant URL State (PDP)

Use option query params as source of truth for variant products: ?size=large&color=blue.

  • Query keys should be plain option.key values (no custom prefixes).
  • Render option groups in variant_options order (do not derive option groups by iterating variants).
  • Match a variant only when all option keys match variant.associated_options.
  • Normalize option values consistently before comparison:

- color → compare with option.value.name (use option.value.hexcode for swatch UI) - single-select → compare with option.value

  • variant query param is optional derived state:

- Set/update it when options resolve to one variant. - Remove it when selection is incomplete/invalid. - If URL has only variant, backfill option params from that variant. - If URL has partial options + valid variant, fill only missing options from that variant. - If variant is invalid, fall back to default (is_default, else first variant).

  • Disable Add to Cart until required options are selected and the resolved variant is purchasable (stock_available or backorder).
  • Disable option values that cannot lead to a purchasable variant under current partial selection.

Use canonical SDK types directly:

import type {
  AssociatedOption,
  Product,
  Variant,
  VariantOption,
} from "@commercengine/storefront";

Do not derive these app-level types from OpenAPI schemas.

Reference implementation:

  • references/pdp-option-model.md (URL state + variant matching + attribute/variantOption UI unification)

Attribute vs VariantOption (PDP Consistency)

Treat variant_options as variant-driving attribute keys (usually single-select and color), not as a completely separate display domain.

  • Non-variant products can still expose ProductAttribute values for the same keys.
  • Brands may want the same UI treatment for those keys in PDP, even when product has no variants.
  • Keep one normalized option-display model:

- Variant product: selectable options from variant_options + variant.associated_options. - Non-variant product: read-only option-style groups from attributes for keys/types the brand wants to style as options.

  • If attribute.key overlaps a variant_option.key on variant products, render the variant-option UI once and avoid duplicate attribute rows.
  • Use attribute.key alignment plus attribute type (single-select/color) as primary signals.
  • Cart rule stays strict: only variant products require variant resolution before Add to Cart.

Product Types

TypeDescriptionKey Fields
physicalTangible goods requiring shippingshipping, inventory
digitalDownloadable or virtual productsNo shipping required
bundleGroup of products sold togetherContains sub-items

Inventory & Availability

  • stock_available — Boolean, always present on Product, Variant, and SKU schemas. Use it to disable "Add to Cart" or show "Out of Stock" when false.
  • backorder — Boolean, set per product in Admin. When true, the product accepts orders even when out of stock. If your business allows backorders, keep the button enabled when stock_available is false but backorder is true.
  • Inventory count — Catalog APIs (listProducts, listSkus, etc.) support including inventory data in the response. Use this to display numeric stock levels in the UI.

Customer Groups & Pricing

An advanced feature for B2B storefronts where the admin has configured customer groups (e.g., retailers, stockists, distributors). When customer_group_id is sent in API requests, product listings, pricing, and promotions are returned for that specific group.

Do not pass the header per-call. Set it once via defaultHeaders in SDK config (see setup/ § "Default Headers"). After the user logs in, update the SDK instance with their group ID — all subsequent SDK calls automatically include it.

Wishlists

Commerce Engine supports wishlists (add, remove, fetch) via SDK methods. These skills cover the main storefront flows — for wishlists and other secondary features, refer to the LLM API reference or CE docs.

Common Pitfalls

LevelIssueSolution
CRITICALBuilding PLP with filters using listProducts()Use searchProducts({query, filter, sort, facets}) — it returns data.skus (Item[]) + data.facet_distribution + data.facet_stats. listProducts() returns Product[] with no facets. Uses Meilisearch filter syntax (e.g. "rating > 4 AND product_type = physical").
CRITICALConfusing Product vs Item typeslistProducts() returns Product[] (grouped, with variants array). listSkus() and searchProducts() return Item[] (flat — each variant is its own record).
CRITICALUsing variant as PDP URL source of truth for multi-option productsKeep option params (size, color, etc.) canonical; treat variant as derived/backfill-only.
HIGHResolving variants from a single option or variant_options onlyMatch against variant.associated_options across all option keys.
HIGHDeriving option/variant types from generated schemas in app codeImport SDK types directly from @commercengine/storefront (AssociatedOption, VariantOption, Variant, Product).
MEDIUMTreating attributes and variant_options as unrelated PDP UIsBuild a unified option-display model so shared keys (e.g. metal) can render consistently across variant and non-variant products.
HIGHIgnoring has_variant flagAlways check has_variant before trying to access variant data
HIGHAdding product to cart instead of variantWhen has_variant: true, must add the specific variant, not the product
MEDIUMNot using slug for URLsUse slug field for SEO-friendly URLs — product_id params across catalog endpoints accept both IDs and slugs
MEDIUMMissing paginationAll list endpoints return pagination — use page and limit params
LOWRe-fetching categoriesCategories rarely change — cache them client-side

See Also

  • setup/ - SDK initialization required first
  • cart-checkout/ - Adding products to cart
  • orders/ - Products in order context
  • ssr-patterns/ - SSG / pre-rendering for product pages (Next.js generateStaticParams(), TanStack Start pre-rendering)

Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.76%
按下载量换算81

Claude

32.26%
按下载量换算71

Cursor

16.47%
按下载量换算36

Gemini CLI

8.36%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills