commerce-product-catalog

Use when configuring or troubleshooting the B2B/B2C Commerce product catalog — ProductCatalog, ProductCategory, ProductCategoryProduct, WebStoreCatalog, CommerceEntitlementPolicy, product attributes, and product variants. Trigger keywords: product catalog, product category, commerce catalog, entitlement policy, product variants, product attributes, catalog visibility. NOT for CPQ product catalog (bundles, options, price rules) or for loading standard Product2/Pricebook2 data outside Commerce.

Best use case

commerce-product-catalog is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when configuring or troubleshooting the B2B/B2C Commerce product catalog — ProductCatalog, ProductCategory, ProductCategoryProduct, WebStoreCatalog, CommerceEntitlementPolicy, product attributes, and product variants. Trigger keywords: product catalog, product category, commerce catalog, entitlement policy, product variants, product attributes, catalog visibility. NOT for CPQ product catalog (bundles, options, price rules) or for loading standard Product2/Pricebook2 data outside Commerce.

Teams using commerce-product-catalog should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/commerce-product-catalog/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/admin/commerce-product-catalog/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/commerce-product-catalog/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How commerce-product-catalog Compares

Feature / Agentcommerce-product-catalogStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when configuring or troubleshooting the B2B/B2C Commerce product catalog — ProductCatalog, ProductCategory, ProductCategoryProduct, WebStoreCatalog, CommerceEntitlementPolicy, product attributes, and product variants. Trigger keywords: product catalog, product category, commerce catalog, entitlement policy, product variants, product attributes, catalog visibility. NOT for CPQ product catalog (bundles, options, price rules) or for loading standard Product2/Pricebook2 data outside Commerce.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Commerce Product Catalog

This skill activates when a practitioner needs to create, configure, or troubleshoot the B2B or B2C Commerce product catalog — including category hierarchy setup, product assignment to categories, entitlement policy configuration for buyer visibility, and product attribute/variant modeling. It does not cover CPQ catalog configuration or standard Product2/Pricebook2 data loading outside of a Commerce context.

---

## Before Starting

Gather this context before working on anything in this domain:

- Confirm which WebStore record the work targets and retrieve its Id. A store can be associated with only one ProductCatalog at a time via the WebStoreCatalog junction object.
- Identify how many BuyerGroup records exist and which CommerceEntitlementPolicy records are linked to each. Buyer entitlement per product is capped at 2,000 buyer groups for search indexing — exceeding this silently drops products from search results.
- Confirm whether the store uses Salesforce Search or Einstein Search. Both require a manual search index rebuild after catalog or entitlement changes — changes do not propagate automatically.
- Check if products use attribute sets (for variants). ProductAttributeSet and ProductAttribute records drive the variant model and must be configured before Product2 variant records can be created.

---

## Core Concepts

### ProductCatalog and WebStoreCatalog

`ProductCatalog` is the top-level container for a Commerce catalog. Each store is linked to exactly one `ProductCatalog` through a `WebStoreCatalog` junction record. A single `ProductCatalog` can serve multiple stores, but a store may not reference multiple catalogs simultaneously. Attempting to create a second `WebStoreCatalog` for the same store results in a validation error.

`ProductCategory` records form the navigational and organizational hierarchy within a catalog. Categories are linked to their catalog via the `CatalogId` field on `ProductCategory`. Categories can be nested (parent–child) to arbitrary depth, though very deep hierarchies increase page-load time and are an operational anti-pattern.

Products are assigned to categories through `ProductCategoryProduct` junction records — one per Product2-per-category assignment. A product can belong to multiple categories within the same catalog.

### CommerceEntitlementPolicy and Buyer Visibility

`CommerceEntitlementPolicy` records control which products a buyer group can see and purchase. A policy is linked to a `BuyerGroup` through `CommerceEntitlementPolicyGroup`. Products are explicitly included in a policy via `CommerceEntitlementProduct` records.

The platform limit that causes the most production incidents: a single product can be included in at most **2,000 buyer groups** for search index purposes. If a product is assigned to more than 2,000 buyer groups (via entitlement policies), Salesforce silently excludes it from search results for those buyer groups beyond the cap. There is no error message. The product still appears via direct URL or catalog browsing, but search will not surface it.

### Product Variants and Attribute Sets

Product variants in Commerce are modeled using `ProductAttributeSet` (the set of attributes, e.g., Color, Size) and `ProductAttribute` (individual attribute definitions). A parent product (`Product2` with `IsActive = true`) holds the attribute set reference. Child variant products are separate `Product2` records linked to the parent via the `VariantParentId` field. Each child represents a specific combination of attribute values (e.g., Blue + Large).

Attribute sets must be created and assigned to the parent product before child variants can be created. Attempting to create a variant product without a configured attribute set results in a validation error. Attribute values are stored on `ProductAttributeSetProduct` junction records.

### Search Index Dependency

The Commerce search index is a separate, asynchronous data store derived from the catalog. It must be explicitly rebuilt — via Setup > B2B Commerce > [Store] > Search Index — after any of the following:
- Adding or removing products from categories
- Creating or modifying CommerceEntitlementPolicy records
- Activating or deactivating Product2 records
- Changing WebStoreCatalog associations

Until the index rebuild completes, buyer-facing search results will reflect the previous state.

---

## Common Patterns

### Pattern A: Single Catalog, Flat Category Hierarchy

**When to use:** Stores with fewer than 200 SKUs and a single buyer segment where all buyers see the same products.

**How it works:**
1. Create one `ProductCatalog` record.
2. Create `ProductCategory` records directly under the catalog (no nesting) or with one level of nesting.
3. Create `ProductCategoryProduct` for each Product2 → Category assignment.
4. Create one `WebStoreCatalog` linking the catalog to the store.
5. Create one `CommerceEntitlementPolicy` and one `BuyerGroup`; link all products to the policy.
6. Rebuild the search index.

**Why not the alternative:** Nesting categories deeply (3+ levels) for small catalogs adds configuration overhead and slows storefront category navigation without benefit.

### Pattern B: Single Catalog, Segmented Entitlement Policies

**When to use:** Multiple buyer tiers (e.g., Gold, Silver, Public) need different product visibility within the same store and catalog structure.

**How it works:**
1. Create one `ProductCatalog` and assign it to the store via `WebStoreCatalog`.
2. Create `ProductCategory` records shared across all buyer tiers.
3. Create separate `BuyerGroup` and `CommerceEntitlementPolicy` per tier.
4. Assign products to the appropriate policies via `CommerceEntitlementProduct` records.
5. Monitor total buyer group assignments per product — stay below 2,000.
6. Rebuild the search index after any policy change.

**Why not the alternative:** Separate catalogs per buyer tier requires separate stores (one catalog per store) and multiplies administrative overhead. Segmented entitlement within one catalog is the canonical Commerce approach.

### Pattern C: Variant Products with Attribute Sets

**When to use:** Products that come in multiple configurations (e.g., clothing in multiple sizes and colors, equipment in multiple voltages).

**How it works:**
1. Create a `ProductAttributeSet` record (e.g., "Apparel Attributes").
2. Create `ProductAttribute` records linked to the set (e.g., Color, Size).
3. Create the parent `Product2` record and link the attribute set.
4. Create child `Product2` variant records — one per attribute combination — with `VariantParentId` pointing to the parent.
5. Set attribute values on each child via `ProductAttributeSetProduct`.
6. Add only the parent product to `ProductCategoryProduct`; children are discoverable via the parent on the PDP.
7. Assign the parent and children to `CommerceEntitlementProduct` records as needed.

**Why not the alternative:** Creating separate, unrelated Product2 records for each variant breaks the storefront PDP variant selector and prevents buyers from switching between variants on the same page.

---

## Decision Guidance

| Situation | Recommended Approach | Reason |
|---|---|---|
| All buyers see the same products | Single BuyerGroup + Single EntitlementPolicy | Simplest setup; fewest records; easiest to maintain |
| Multiple buyer tiers, different product visibility | Multiple BuyerGroups + multiple EntitlementPolicies | Native Commerce entitlement model; stays within one catalog and one store |
| Need separate pricing AND separate product catalogs | Separate stores with separate catalogs | One catalog per store is a platform constraint; pricing differences alone don't require separate catalogs |
| Products in multiple configurations | Variant Products with ProductAttributeSet | Provides storefront variant selector UX; keeps SKU navigation coherent |
| Product visible in admin but missing from buyer search | Rebuild search index; verify entitlement; check 2,000 group cap | Search index is async; entitlement is separate from category assignment |
| Need to move product from one catalog to another | Delete ProductCategoryProduct in old catalog; create new in new catalog; check entitlement policy | Products themselves (Product2) are org-wide; catalog membership is controlled by junction records |

---

## Recommended Workflow

Step-by-step instructions for an AI agent or practitioner working on this task:

1. **Identify the target store and current catalog.** Query `WebStoreCatalog` for the store's `WebStoreId` to confirm the active `ProductCatalogId`. Note: only one record is allowed per store.
2. **Design the category hierarchy.** Sketch the top-level categories and any sub-categories. Prefer 2 levels maximum for operational simplicity. Create `ProductCategory` records with `CatalogId` pointing to the active catalog.
3. **Assign products to categories.** Create `ProductCategoryProduct` junction records for each Product2 → ProductCategory pairing. A product can belong to multiple categories.
4. **Configure entitlement policies.** For each buyer segment, create or verify a `CommerceEntitlementPolicy` linked to the appropriate `BuyerGroup` via `CommerceEntitlementPolicyGroup`. Create `CommerceEntitlementProduct` records for each product the segment should see. Verify total buyer group assignments per product remain under 2,000.
5. **Configure variant products if applicable.** Ensure `ProductAttributeSet` and `ProductAttribute` records are in place before creating child variant `Product2` records. Set `VariantParentId` on each child.
6. **Rebuild the search index.** Navigate to Setup > B2B Commerce > [Store Name] > Search Index and initiate a full rebuild. Wait for the job to complete before testing buyer-facing search.
7. **Validate buyer visibility end-to-end.** Log in as a buyer user in the appropriate BuyerGroup, search for a product, and confirm it appears. Confirm that products outside the buyer's entitlement policy do not appear.

---

## Review Checklist

Run through these before marking work in this area complete:

- [ ] `WebStoreCatalog` has exactly one record for the target store with the correct `ProductCatalogId`
- [ ] All `ProductCategory` records have a valid `CatalogId` and correct `ParentCategoryId` hierarchy
- [ ] `ProductCategoryProduct` records exist for all products that should appear in at least one category
- [ ] Each buyer group has an active `CommerceEntitlementPolicy` linked via `CommerceEntitlementPolicyGroup`
- [ ] `CommerceEntitlementProduct` records exist for every product the buyer group should see
- [ ] No product is assigned to more than 2,000 buyer groups across all entitlement policies
- [ ] Search index rebuild was initiated and completed successfully after all catalog and entitlement changes
- [ ] Variant products have `VariantParentId` set and all child variants are linked to the parent's attribute set

---

## Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

1. **One catalog per store — hard constraint** — A `WebStore` record can have exactly one active `WebStoreCatalog` junction. Attempting to insert a second `WebStoreCatalog` for the same store raises a validation rule error. To switch catalogs, delete the existing `WebStoreCatalog` first, then create the new one.
2. **2,000 buyer group cap is silent** — If a product is included in more than 2,000 `CommerceEntitlementPolicy` records (and thus more than 2,000 buyer groups), it is silently excluded from search index results for buyer groups beyond the 2,000 limit. No error, no warning, no Apex trigger fires. The product still appears via direct navigation but buyers cannot discover it via search.
3. **Search index does not auto-rebuild** — Adding a product to a category or an entitlement policy does not trigger any automatic search reindex. Buyers will not see new products in search until an admin initiates a full or incremental index rebuild from Setup.
4. **Category assignment does not equal buyer visibility** — Assigning a product to a `ProductCategory` makes it organizationally visible in the Commerce admin but does not make it visible to buyers. Buyer visibility requires a `CommerceEntitlementProduct` record in the buyer group's active entitlement policy AND an up-to-date search index.
5. **Variant children require attribute set before creation** — A child variant `Product2` record cannot be saved without an existing, valid `ProductAttributeSet` linked to the parent product. Creating variants before the attribute set is configured results in a validation error that does not always provide a clear field-level message in the UI.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| ProductCatalog record | Top-level catalog container associated to the store via WebStoreCatalog |
| ProductCategory records | Hierarchical category structure within the catalog |
| ProductCategoryProduct records | Junction records assigning Product2 to categories |
| WebStoreCatalog record | Junction linking one ProductCatalog to one WebStore |
| CommerceEntitlementPolicy records | Controls which products each buyer group can see and buy |
| CommerceEntitlementProduct records | Junction records listing products visible under a given policy |
| Search Index rebuild confirmation | Setup record showing successful completion of search index rebuild |
| Variant configuration | ProductAttributeSet, ProductAttribute, and child Product2 records with VariantParentId set |

---

## Related Skills

- admin/b2b-commerce-store-setup — Use when setting up the WebStore, BuyerGroup, and storefront configuration before the catalog is populated
- data/product-catalog-data-model — Use when bulk-loading Product2, Pricebook2, and PricebookEntry records outside a Commerce context

Related Skills

commerce-lwc-components

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when building or customizing Lightning Web Components for B2B Commerce or D2C LWR storefronts — product display tiles, cart line-item components, checkout step components, wishlist buttons, and product comparison widgets that rely on Commerce Storefront wire adapters from the commerce namespace. NOT for standard LWC development outside a Commerce store context, not for Aura-based Community Builder components, and not for legacy B2B Commerce (CloudCraze) Aura widgets.

product-catalog-migration-cpq

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when bulk-loading or migrating Salesforce CPQ product catalog configuration data — SBQQ-namespaced objects including Product2, ProductOption, PriceRule, PriceAction, DiscountSchedule, DiscountCategory, ConfigurationAttribute, and OptionConstraint — across orgs or from an external source system. Trigger keywords: CPQ bulk load, SBQQ product migration, ProductOption insert order, CPQ trigger disable, price rule migration, CPQ sandbox refresh catalog, bundle migration. NOT for standard product import or CRM product migration (use product-catalog-data-model). NOT for CPQ quote or subscription data migration. NOT for Industries CPQ (Vlocity) catalog migration.

product-catalog-migration-commerce

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when migrating product catalog data into Salesforce B2B Commerce — covers category hierarchy, product attributes, images, pricing, and variant structure using the Commerce Import API. NOT for CPQ product catalog migration, post-migration catalog configuration, or commerce catalog taxonomy planning.

product-catalog-data-model

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when modeling, loading, or troubleshooting Salesforce product and pricebook data — covering the Product2 → Pricebook2 → PricebookEntry three-object chain, standard pricebook constraints, bulk load sequencing (Product2 → Standard PBE → custom Pricebook2 → custom PBE), UseStandardPrice inheritance, and product hierarchy strategies. NOT for Salesforce CPQ product and pricing model (use cpq-vs-standard-products-decision). NOT for Industries CPQ catalog-item model (use industries-cpq-vs-salesforce-cpq). NOT for Opportunity Line Item mechanics.

commerce-order-history-migration

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when migrating historical order records into Salesforce Order Management — covers the required object creation sequence (Order > OrderDeliveryGroup > OrderItem > OrderSummary), LifeCycleType=Unmanaged for historical orders, and OrderSummary creation via ConnectAPI. NOT for standard Opportunity migration, CPQ legacy order migration using SBQQ objects, or active order processing.

commerce-inventory-data

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when managing inventory data in Salesforce Omnichannel Inventory (OCI) — covers stock level APIs, warehouse location mapping, IMPEX bulk upload, inventory availability queries, reservation management, and reorder point design. NOT for Field Service Lightning inventory management, Salesforce standard Product object stock fields, or CPQ product configuration.

commerce-analytics-data

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when analyzing B2C Commerce storefront metrics (conversion funnel, cart abandonment, product performance, revenue trends) via the Business Manager Reports and Dashboards app, or when deriving B2B Commerce analytics via SOQL on core platform objects or the CRM Analytics B2B Commerce template. NOT for CRM Analytics platform configuration, Einstein Analytics, Experience Cloud analytics, or general Salesforce report builder usage.

headless-commerce-architecture

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when designing or evaluating a headless B2C Commerce storefront architecture — covering the Composable Storefront (PWA Kit on Managed Runtime), SCAPI-first API design, frontend framework selection, latency budgets, and caching strategy. NOT for standard SFRA storefronts, Experience Cloud headless CMS delivery, B2B Commerce architecture, or SCAPI implementation-level coding (use apex/headless-commerce-api for that).

cpq-vs-standard-products-decision

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when deciding whether to implement Salesforce CPQ or stay with standard Products and Pricebooks for quoting and pricing. Triggers: 'should we buy CPQ or use standard pricebooks', 'is CPQ worth the cost for our quoting process', 'product bundling without CPQ', 'guided selling vs manual product selection', 'complex pricing rules or multi-dimensional discounting'. NOT for CPQ implementation details, NOT for CPQ package installation or configuration, NOT for Revenue Cloud Advanced.

composable-commerce-architecture

8
from PranavNagrecha/AwesomeSalesforceSkills

Composable commerce on Salesforce: headless API layer, micro-frontends, BFF pattern, CDN strategy, third-party composability over B2C/B2B Commerce. NOT for the standard B2C Storefront UX (use b2c-commerce-storefront-setup). NOT for Salesforce Order Management basics (use salesforce-order-management-setup).

commerce-integration-patterns

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when designing or diagnosing end-to-end integration between Salesforce B2B or D2C Commerce and external systems — including ERP pricing/inventory, PIM product sync, payment gateways, shipping providers, tax engines, and order management systems (OMS). Covers CartExtension Apex namespace (PricingCartCalculator, ShippingCartCalculator, InventoryCartCalculator), RegisteredExternalService custom metadata, payment gateway architecture, and Product2 External ID patterns. NOT for generic Salesforce integration (platform events, Mulesoft, REST APIs unrelated to commerce), NOT for CommercePayments adapter implementation details (see apex/commerce-payment-integration), NOT for storefront UI or LWC development.

headless-commerce-api

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when building custom headless storefronts that call Salesforce Commerce API (SCAPI) — including Shopper API authentication with SLAS OAuth2 JWT tokens, integrating Commerce SDK React hooks, wiring Shopper Basket/Checkout APIs, and handling SCAPI-specific load-shedding and caching behavior. NOT for standard LWR storefront configuration, declarative Experience Builder layouts, legacy OCAPI integrations, or architecture-level headless decisions — use admin/headless-commerce-architecture for pattern selection.