sfnext-extensions
БесплатноБез исполняемых скриптовНе проверенAdd, install, or remove Storefront Next extensions: UITarget slots, action hooks, target-config.json, extension routes, and the `sfnext extensions` commands…
от SalesforceCommerceCloud★ 58 звёзд на GitHubОб этом скилле
Storefront Next Extensions
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.
Decision gate: should this be an extension?
Run this before writing code; the full walkthrough is in Base Audit.
- Trace the route in
src/routes/down to the place you want to change. Does the base already render equivalent content there? - Already rendered: restyle it (tokens or a component variant, see
storefront-next:sfnext-theming) or fill an existing slot; do not add a parallel copy. - Not rendered and a slot exists: write an extension.
- Not rendered and no slot fits: edit the base route or component directly (you own the whole project) and, if it is a reusable seam, add a
<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
Structure
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.
target-config.json
{
"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 }
]
}
pathis relative tosrc/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 ascendingorder; duplicate orders warn because their order is not deterministic.- A slot without children is a replacement slot. A slot that wraps base content (
<UITarget targetId="..."><Base /></UITarget>) is a wrapper slot: the extension component receives the base content as children. - Optional per component:
"enabled": falseto switch it off, and"hint"as a label for the dev-mode overlay. A top-level"devOnly": trueskips the whole file in production builds. - Extension components only inject when a
target-config.jsonexists insrc/extensions/<name>/. - Every
targetIdmust exist as a<UITarget>in the source; otherwise the build fails and names the orphan. Ids are namespaced: use the exactsfcc.-prefixed ids reported bypnpm extensions:list(for examplesfcc.header.before.cart,sfcc.pdp.bnpl.message,sfcc.pdp.reviews.section,sfcc.cart.orderSummary.before). - In
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, translations, config
- Routes: any file in
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). Seesrc/extensions/store-locator/routes/. - Translations:
locales/<lang>/translations.jsonis namespacedext+ PascalCase folder name (my-extension->extMyExtension):useTranslation('extMyExtension').pnpm devandpnpm buildrunpnpm locales:aggregate-extensionsfor you and writesrc/extensions/locales/; that folder is generated, do not edit it. - Client config:
config.tsdefault-exports a plain, JSON-serializable object. It is merged intoconfig.app.extension.<camelName>(read
Установить sfnext-extensions в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sfnext-extensions?
Add, install, or remove Storefront Next extensions: UITarget slots, action hooks, target-config.json, extension routes, and the `sfnext extensions` commands. Use for store locator, BOPIS, or multiship, or when deciding whether to extend or edit the base. Not for theming (`storefront-next:sfnext-theming`) or Page Designer blocks (`storefront-next:sfnext-page-designer`).
Как установить скилл sfnext-extensions?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sfnext-extensions запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic