/storefront-next:sfnext-extensionsfrom storefront-next
Add, install, or remove Storefront Next extensions including UITarget slots, action hooks, target-config.json, and extension routes. Use for store locator, BOPIS, or multiship features.
Ships in storefront-next. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
An extension is a self-contained folder under src/extensions/<name>/ that adds UI, routes, providers, translations, config and server hooks to the storefront without rewriting base files. The base declares named slots (<UITarget targetId="..." />); an extension's target-config.json says which of its components fill which slot.
Your project ships with several extensions already (store locator, BOPIS, multiship, and demo extensions such as BNPL and ratings and reviews). Look at them before building: they are the reference implementations. See Extension Examples.
Run this before writing code; the full walkthrough is in Base Audit.
src/routes/ down to the place you want to change. Does the base already render equivalent content there?storefront-next:sfnext-theming) or fill an existing slot; do not add a parallel copy.<UITarget> there so later extensions can plug in.Discover what already exists:
pnpm extensions:list # all UITarget ids and server action hook ids (add --json for tooling)
sfnext extensions list # installed extensions
rg "UITarget" src/ # where a slot is rendered
src/extensions/my-extension/
├── target-config.json # which components/providers/hooks plug in where
├── components/ # UI, including the components named in target-config.json
├── routes/ # auto-registered routes (flat-route file naming)
├── providers/ # context providers (listed in target-config.json)
├── hooks/ context/ middlewares/ stores/ # as needed
├── locales/<lang>/translations.json
├── config.ts # optional client-side defaults
├── server-config.ts # optional server-only defaults
└── README.md
Create the scaffold with sfnext extensions create -n "My Extension" -d "What it does" (adds the folder, a README and an entry in src/extensions/config.json). Import across the project with the normal alias: @/extensions/my-extension/.... There is no @extensions alias.
{
"components": [
{ "targetId": "sfcc.header.before.cart", "path": "extensions/my-extension/components/header/badge.tsx", "order": 0 }
],
"contextProviders": [
{ "path": "extensions/my-extension/providers/my-provider.tsx", "order": 0 }
],
"actionHooks": [
{ "hookId": "sfcc.checkout.payments.afterSubmitPayment", "handler": "extensions/my-extension/hooks/after-payment.ts", "order": 0 }
]
}
path is relative to src/ and points at a module whose default export is the component (no required props; read context or hooks inside). Multiple components on one slot render in ascending order; duplicate orders warn because their order is not deterministic.<UITarget targetId="..."><Base /></UITarget>) is a wrapper slot: the extension component receives the base content as children."enabled": false to switch it off, and "hint" as a label for the dev-mode overlay. A top-level "devOnly": true skips the whole file in production builds.target-config.json exists in src/extensions/<name>/.targetId must exist as a <UITarget> in the source; otherwise the build fails and names the orphan. Ids are namespaced: use the exact sfcc.-prefixed ids reported by pnpm extensions:list (for example sfcc.header.before.cart, sfcc.pdp.bnpl.message, sfcc.pdp.reviews.section, sfcc.cart.orderSummary.before).pnpm dev, UITarget dev mode shows markers so you can see which slots exist and what fills them.Server-side hooks (actionHooks, checkout steps) have their own semantics: Action Hooks.
routes/ is merged into the route tree with React Router flat-route naming: _app.store-locator.tsx (inside the app layout), action.set-selected-store.ts (action), resource.stores.ts (resource route). See src/extensions/store-locator/routes/.locales/<lang>/translations.json is namespaced ext + PascalCase folder name (my-extension -> extMyExtension): useTranslation('extMyExtension'). pnpm dev and pnpm build run pnpm locales:aggregate-extensions for you and write src/extensions/locales/; that folder is generated, do not edit it.config.ts default-exports a plain, JSON-serializable object. It is merged into config.app.extension.<camelName> (read with useConfig() in components or getConfig() on the server) and can be overridden per environment with PUBLIC__app__extension__<camelName>__<key>. It is exposed to the browser: never put secrets there.server-config.ts lands at config.app.serverExtension.<camelName>, has no PUBLIC__ override, is unreachable from client code (the build fails if a client chunk imports it), and is read with getConfig(context) in loaders, actions and middleware.pnpm config:aggregate-extensions (also run by dev and build) writes src/extensions/config/; generated, do not edit. Folder names must be letters, digits and hyphens starting with a letter. See docs/README-CONFIG.md.Extensions that modify base files mark their edits with comments so they can be installed and removed cleanly:
selectedStoreMiddleware /** @sfdc-extension-line SFDC_EXT_STORE_LOCATOR */,
// @sfdc-extension-block-start SFDC_EXT_STORE_LOCATOR
import { StoreLocatorProvider } from '@/extensions/store-locator/providers/store-locator';
// @sfdc-extension-block-end SFDC_EXT_STORE_LOCATOR
/** @sfdc-extension-file SFDC_EXT_STORE_LOCATOR */ // marks an entire file as belonging to the extension
Use them when the extension needs edits outside its folder (middleware registration, a nav link, a loader) and you want sfnext extensions remove to be able to undo them. Each marker name (SFDC_EXT_*) is a key in src/extensions/config.json. Install, remove and marker details: CLI and Install.
BNPL, customer preferences, ratings and reviews, and product content ship with mock fixtures. To integrate a real provider, replace the bodies of their API functions (for example src/extensions/bnpl/lib/api/bnpl.server.ts). To drop one, use sfnext extensions remove -e SFDC_EXT_BNPL, then run pnpm locales:aggregate-extensions. docs/README-FEATURE-STUBS.md describes finding stubs with grep -r "@feature-stub" src/.
order deliberately and give each slot entry a distinct value.@/extensions/... and keep translations in the extension's own namespace.pnpm dev once so the aggregation and registries regenerate, and commit nothing from src/extensions/locales/ or src/extensions/config/ by hand.storefront-next:sfnext-overview - project map and where things livestorefront-next:sfnext-components - component conventions used inside extensionsstorefront-next:sfnext-routing - how extension routes join the route treestorefront-next:sfnext-i18n - translation namespaces and locale filesstorefront-next:sfnext-configuration - config.ts layering and PUBLIC__ overridesstorefront-next:sfnext-theming - token and brand changes that do not need an extensionstorefront-next:sfnext-commerce-features - checkout, multiship, BOPIS flowsstorefront-next:sfnext-page-designer - merchant-editable blocksb2c:b2c-hooks - B2C platform-side hooks (different from Storefront Next action hooks)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
storefront-next, extensions, uitarget, target-config, bopis, multiship
npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin storefront-next25 skills in this plugin
/sfnext-accessibilityBuild and fix accessible UI in a Storefront Next storefront (WCAG 2.1 AA): jsx-a11y lint findings, missing accessible names and labels, form error association, dialog focus management, aria-live status messages, keyboard behavior, color contrast, and verifying fixes with Storybook a11y/play() tests and the e2e axe scan with its baseline. Use for "accessibility", "a11y", "WCAG", "screen reader", "aria-label", "focus trap", "axe violation", pnpm lint:a11y, pnpm a11y, a11y-baseline.json, skip-a11y, STORYBOOK_A11Y_TEST_MODE, or an accessibility audit finding to fix. Do not use for general lint/typecheck gates (use `storefront-next:sfnext-quality-gates`), writing non-accessibility tests (use `storefront-next:sfnext-testing`), or color/token design (use `storefront-next:sfnext-theming`)./sfnext-analytics-consentStorefront Next analytics: engagement adapters (Einstein, Active Data, Data 360), adding a custom adapter, tracking consent gating, PageViewTracker, useAnalytics events, and first-touch attribution (dw_attribution). Use when configuring engagement.adapters in config.server.ts, writing an adapter with hasConsent, registering it in initializeEngagementAdapters, wiring the consent banner (trackingConsent, consentCategories, dw_dnt), firing trackViewProduct/trackCartItemAdd events, debugging why no analytics events are sent, or passing campaign attribution to orders. Do not use for general config loading or env vars (use `storefront-next:sfnext-configuration`), CSP/script allowlisting of third-party tags (use `storefront-next:sfnext-security`), or SEO meta/JSON-LD (use `storefront-next:sfnext-seo`)./sfnext-authenticationWork with Storefront Next's server-only authentication and session architecture (SLAS guest/registered tokens, httpOnly cookies, auth.server.ts middleware). Use for getAuth, useAuth, updateAuth, destroyAuth, protecting account routes, login/logout actions, guest-to-registered basket/wishlist merge, "session expired" redirects, 401 recovery loops, cc-at/cc-nx/usid/dwsid cookies, cookie names or expiry, passwordless login, social login, OTP email verification, passkeys, guest order lookup, or refresh-token lifetime settings. Do not use for Turnstile, CSP headers or cookie-domain config (use `storefront-next:sfnext-security`), calling SCAPI clients (use `storefront-next:sfnext-scapi`), or sharing sessions with SFRA (use `storefront-next:sfnext-hybrid-storefronts`)./sfnext-commerce-featuresCatalogue and router for optional Storefront Next commerce features: Shopper Context (qualifiers, source codes), Order Management returns/cancel/tracking (SOM/OMS), delivery estimates, feature stubs (@feature-stub), guest order lookup, the app_storefrontnext_base email cartridge, and the shipped extensions (bnpl, bopis, multiship, store-locator, ratings-reviews, customer-preferences, product-content, shipping-delivery, theme-switcher). For each: which flag, SLAS scope, Business Manager setting, cartridge, or extension registry entry it needs, and which in-project doc to read. Use when asked how to enable a feature, why a feature does not render, what prerequisites a feature has, or which stubs are mock data. Do not use for building a new extension (use `storefront-next:sfnext-extensions`), config loading (use `storefront-next:sfnext-configuration`), or SLAS login flows (use `storefront-next:sfnext-authentication`)./sfnext-componentsBuild and modify UI components in a Storefront Next storefront: page components with Suspense and use()/Await, createPage and withSuspense, Tailwind v4 token classes, shape tokens (rounded-ui, shadow-ui, border-ui), shadcn/ui primitives in src/components/ui (sync-shadcn), CVA variants, data-slot, DynamicImage, lazy-loaded overlays, and Storybook stories with snapshot tests. Use when creating or editing a component in src/components, adding a shadcn primitive, fixing styling that ignores the theme, writing a *.stories.tsx file, or running pnpm storybook:test. Do not use for re-branding colors, fonts, or logos (use `storefront-next:sfnext-theming`), route loaders (use `storefront-next:sfnext-data-fetching`), or Page Designer registration (use `storefront-next:sfnext-page-designer`)./sfnext-configurationConfigure a Storefront Next app: config.server.ts (defineConfig, metadata/runtime/app), AppConfig types in src/types/config.ts, PUBLIC__ environment variable overrides, getConfig(context) / useConfig(), extension config (app.extension, app.serverExtension), protected paths, server-only secrets, and multi-site settings (commerce.sites, url.prefix, seoRoutes, siteAliasMap, cookie domain). Use when editing config.server.ts, adding a config value, an env var is ignored or "not applied", `pnpm config:inspect` / `config:push-env`, "Ignoring environment variable" warnings, protected config path errors, setting up a second site or locale URLs, or going through the pre-launch config checklist. Do not use for creating a project or the npm script list (use `storefront-next:sfnext-project-setup`), pushing bundles or MRT env management (use `storefront-next:sfnext-deployment` / `b2c-cli:b2c-mrt`), or hybrid proxy and cookie-sharing with SFRA (use `storefront-next:sfnext-hybrid-storefronts`).Other plugins' skills for the same job