From storefront-next
Build Storefront Next extensions using target-config.json, target points, routes, and translation namespaces. Includes the base-audit gate for deciding when to extend vs override.
How this skill is triggered — by the user, by Claude, or both
Slash command
/storefront-next:sfnext-extensionsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill covers the Storefront Next extension system — modular features that plug into the storefront via target points.
This skill covers the Storefront Next extension system — modular features that plug into the storefront via target points.
Extensions are self-contained feature modules that add components, routes, translations, and providers to a Storefront Next storefront without modifying core code.
An extension is the right tool for adding something the storefront does not already render. Before scaffolding one, confirm you actually need it — a duplicated section costs you on every page load, every test, and every design sync.
Run this gate before writing any extension code:
Find the base. Open the relevant route in src/routes/ and trace every component it renders.
Check each section you intend to add. Does the base already render equivalent content at that location (a description, accordion, badge, banner, title…)?
brand.css value), or inject into a UITarget slot on the existing content. Adding a duplicate section is a bug, not a feature.targetId.Decide the layer for what's missing:
Is the change purely visual (color, font, spacing)?
└─ YES → Token / CVA change (brand.css or a component variant). No extension needed.
└─ NO → Is the new structure needed by only one storefront/vertical?
└─ YES → Extension at a UITarget slot (this skill). Never edit core.
└─ NO → It's a shared pattern — add a slot/render-prop to the BASE
component instead, and let each consumer fill it.
Rule of thumb: extensions add what is missing; they never recreate what already exists. When in doubt, prefer a UITarget slot or a token override over a new component.
See Base Audit Reference for worked examples of the gate.
src/extensions/my-extension/
├── target-config.json # Target configuration (components/providers)
├── components/ # Extension components
├── routes/ # Extension routes (auto-registered)
├── locales/ # Extension translations (auto-namespaced)
└── providers/ # Extension context providers
The target-config.json file declares how the extension integrates:
{
"components": [
{
"targetId": "header.before.cart",
"path": "extensions/my-extension/components/badge.tsx",
"order": 0
}
],
"contextProviders": [
{
"path": "extensions/my-extension/providers/my-provider.tsx",
"order": 0
}
]
}
Target points are named insertion slots in the storefront layout (for example, header.before.cart). Extensions insert components at these points via targetId.
Extension availability is managed in src/extensions/config.json, where each extension is keyed by an SFDC_EXT_* marker.
Files in the routes/ directory auto-register as routes:
// src/extensions/my-extension/routes/my-route.tsx
export function loader() {
return { message: 'Hello' };
}
export default function MyRoute() {
const { message } = useLoaderData();
return <div>{message}</div>;
}
Translations are auto-namespaced as extPascalCase based on the directory name:
src/extensions/my-extension/locales/
├── en-US/translations.json
└── it-IT/translations.json
const {t} = useTranslation('extMyExtension');
t('welcome');
Mark extension integration points in core code:
// Single line marker
/** @sfdc-extension-line SFDC_EXT_MY_FEATURE */
import myFeature from '@extensions/my-feature';
// Block marker
{/* @sfdc-extension-block-start SFDC_EXT_MY_FEATURE */}
<Link to="/my-feature">My Feature</Link>
{/* @sfdc-extension-block-end SFDC_EXT_MY_FEATURE */}
See Extension Examples Reference for complete examples.
target-config.json rather than editing core filesorder in target-config.json to control rendering orderstorefront-next:sfnext-i18n - Translation patterns and namespace usagestorefront-next:sfnext-routing - How extension routes integrate with the routerstorefront-next:sfnext-components - Component patterns used in extensionsnpx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin storefront-nextCreates and configures Storefront Next projects for Salesforce Commerce Cloud. Covers CLI creation, project structure, environment variables, and the sfnext development workflow.
Adds custom actions and blocks at contextually relevant spots throughout the Shopify Admin using Admin UI Extensions, and scaffolds new extensions via Shopify CLI.
Builds Shopify checkout UI extensions with Preact/Remote DOM rendering, UI primitives, extension targets, checkout APIs, metafield access, post-purchase extensions, and thank-you page customization. Use for customizing Shopify checkout.