/storefront-next:sfnext-deploymentfrom storefront-next
Builds and deploys a Storefront Next storefront to Managed Runtime (MRT) and B2C Commerce. Handles pnpm build/push, cartridge deployment, env var sync, bundle size checks, and project upgrades. Use when push fails, deployment returns 500, or before go-live.
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.
A storefront ships as two independent deployments:
| Deployment | Target | Command |
|---|---|---|
| App bundle (SSR server + client assets) | Managed Runtime | pnpm build then pnpm push |
| Base cartridge (Page Designer metadata, notification Custom API) | B2C Commerce instance (WebDAV code version) | pnpm cartridge:deploy |
If Business Manager Storefront Setup created your project, reuse its MRT project, environments, and SLAS client. Guides: deployment, launch.
pnpm build # extension locales + config aggregation, cartridge:generate, react-router build -> build/
pnpm start # preview the production build at http://localhost:3000
pnpm bundlesize # build with bundle size limits enforced
Run pnpm typecheck, pnpm lint, and pnpm test before pushing. Node 24 is required locally and on MRT (runtime.ssrParameters.ssrFunctionNodeVersion: '24.x').
push does not build; it fails if build/ is missing.
pnpm build && pnpm push # upload only (not deployed to an env unless a target is set)
pnpm push -- -m "Release 42" -e staging --wait # deploy to an env and wait
| Need | Provide |
|---|---|
| Credentials | MRT_API_KEY (or --api-key, --credentials-file, ~/.mobify); MRT_CLOUD_ORIGIN for a non-default MRT origin |
| Project slug | MRT_PROJECT / -p / SFCC_MRT_PROJECT / dw.json mrtProject (set it explicitly; push errors without one) |
| Target env | MRT_TARGET / -e. Required with --wait. Without it the bundle uploads but is not deployed |
Put MRT_PROJECT and MRT_TARGET in .env for local pushes. Store MRT_API_KEY in your shell or CI secret store, not in committed files. Flags and other commands: storefront-next:sfnext-project-setup references/SFNEXT-CLI.md. Inspect without deploying: pnpm sfnext create-bundle -d . -o .bundle.
Bundle history, rolling back to an earlier bundle, and environment management are generic MRT tasks: b2c mrt bundle history|list|deploy, see b2c-cli:b2c-mrt. Live logs: MCP mrt_logs_watch / mrt_logs_watch_poll, or b2c mrt tail-logs.
.env is not uploaded by push. Set runtime config on the MRT environment:
pnpm config:push-env # b2c mrt env var push: reads .env, shows a diff, asks to confirm
b2c mrt env var push -f .env.staging -p my-project -e staging --yes # explicit file, skips prompt
b2c mrt env var set PUBLIC__app__defaultSiteId=MySite -p my-project -e staging
pnpm sfnext config inspect --project my-project --environment staging # see what is applied
push excludes MRT_-prefixed keys by default. Review the file first: PUBLIC__ values are browser-visible, and local-only values should not be pushed. Variable naming and limits: Salesforce's environment variables guide. Rules for what to set: storefront-next:sfnext-configuration.
pnpm cartridge:generate # Page Designer metadata from decorators (also run by pnpm build)
pnpm cartridge:validate # validate generated JSON
pnpm cartridge:deploy # upload cartridges/ to the instance
pnpm cartridge:deploy -- --delete --reload # wipe old files first, then activate the code version
pnpm push and is manual by default.-s/--server or SFCC_SERVER), WebDAV credentials, and either --code-version or OAuth credentials to discover the active version (--reload also needs OAuth with OCAPI code_versions access). Settings resolve from flags, env, or dw.json; see b2c-cli:b2c-code for the shared auth model.sfnext setup-base-cartridge --slas-client-id <id> (docs/README-EMAIL-CARTRIDGE.md).The project ships .github/workflows/deploy.yml: on push to the latest branch (or manual dispatch) it builds, runs pnpm push --wait (needs secret MRT_API_KEY, variables MRT_PROJECT, MRT_TARGET), and deploys cartridges with the b2c code-deploy action (needs SFCC_SERVER, SFCC_CLIENT_ID, secret SFCC_CLIENT_SECRET). Each job skips cleanly when its configuration is absent. Read the file before changing branch names or environments.
pnpm typecheck && pnpm lint && pnpm test pass; pnpm bundlesize within limits.pnpm config:inspect shows no unintended demo values.app.engagement.adapters replaced or disabled.images.host switched from the DIS staging host to production; realmHostMappings for custom domains.references/MRT-DEPLOYMENT.md).url.seoRoutes has an entry per active site if enabled (protected: needs a rebuild).storefront-next:sfnext-security); robots and sitemap handled (storefront-next:sfnext-seo).storefront-next:sfnext-site-audit) and fix what it finds.Your project records storefrontNext.templateRelease, templateVersion, and minSdkVersion in package.json; docs/COMPATIBILITY.md maps template releases to the SDK (@salesforce/storefront-next-dev / -runtime) versions they need. Follow the step-by-step guides in docs/migrations/ (for example react-router-7.18: pin react-router and every @react-router/* package to exactly 7.18.2, and seo-url-rules). Upgrade SDK packages, run pnpm install, pnpm typecheck, and tests, then redeploy.
| Symptom | Cause / fix |
|---|---|
Build directory ... does not exist | Run pnpm build before pnpm push |
| Push: project slug required | Set MRT_PROJECT (or -p) |
| Push: credentials required / 401 | MRT_API_KEY missing or for a different MRT user; check --credentials-file |
--wait error about environment | Add -e <env> or MRT_TARGET |
| 500 after deploy | Required PUBLIC__ variables missing on that MRT environment; pnpm sfnext config inspect --environment <env>; tail logs (b2c-cli:b2c-mrt) |
| Env var "not applied" on MRT | Key not in config.server.ts (ignored with a warning) or a protected path; see storefront-next:sfnext-configuration |
| Stale Page Designer components | Cartridge not regenerated/deployed or code version not activated |
| Build fails on client chunk importing server config | server-config.ts imported from client code |
storefront-next:sfnext-project-setup - Scripts, CLI reference, first runstorefront-next:sfnext-configuration - Config and env var rules, multi-site/base path/cookie domainstorefront-next:sfnext-page-designer - Decorators and cartridge metadatastorefront-next:sfnext-performance - Bundle size and Lighthousestorefront-next:sfnext-quality-gates - Pre-push lint/type/test gatesstorefront-next:sfnext-site-audit - Pre-launch audit of the deployed storefrontb2c-cli:b2c-mrt - MRT projects, environments, bundles, env vars, redirects, logsb2c-cli:b2c-code - Code version and cartridge deploy with the b2c CLIProject docs/README-BASE-PATH.md, README-MULTI-DOMAIN.md, README-COOKIE-DOMAIN.md, README-EMAIL-CARTRIDGE.md, docs/migrations/; b2c docs search "<topic>" --category sfnext.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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`).Other plugins' skills for the same job