@salesforce/b2c-dx-mcp 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/bin/run.js +5 -9
  2. package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
  3. package/content/guidance/b2c/b2c-onboarding/SKILL.md +4 -4
  4. package/content/guidance/b2c/b2c-ordering/SKILL.md +2 -2
  5. package/content/guidance/b2c/b2c-querying-data/SKILL.md +2 -2
  6. package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +3 -3
  7. package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
  8. package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +6 -6
  9. package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
  10. package/content/guidance/b2c-cli/b2c-cip/SKILL.md +3 -3
  11. package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +1 -1
  12. package/content/guidance/b2c-cli/b2c-config/SKILL.md +31 -21
  13. package/content/guidance/b2c-cli/b2c-content/SKILL.md +1 -1
  14. package/content/guidance/b2c-cli/b2c-debug/SKILL.md +1 -1
  15. package/content/guidance/b2c-cli/b2c-docs/SKILL.md +23 -2
  16. package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
  17. package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
  18. package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +1 -1
  19. package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +3 -3
  20. package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +1 -1
  21. package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +1 -1
  22. package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +1 -1
  23. package/content/guidance/b2c-cli/b2c-sites/SKILL.md +1 -1
  24. package/content/guidance/b2c-cli/b2c-slas/SKILL.md +1 -1
  25. package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +2 -2
  26. package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +2 -2
  27. package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +1 -1
  28. package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +2 -2
  29. package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +4 -4
  30. package/content/guidance/index.json +935 -258
  31. package/content/guidance/mcp/{cip → b2c-mcp-cip}/SKILL.md +10 -8
  32. package/content/guidance/mcp/{b2c-config → b2c-mcp-config}/SKILL.md +10 -9
  33. package/content/guidance/mcp/{debugger → b2c-mcp-debugger}/SKILL.md +9 -8
  34. package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/SKILL.md +81 -10
  35. package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +49 -25
  36. package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
  37. package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
  38. package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
  39. package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  40. package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +86 -79
  41. package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
  42. package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  43. package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
  44. package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  45. package/content/guidance/storefront-next/sfnext-components/SKILL.md +98 -136
  46. package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  47. package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  48. package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
  49. package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  50. package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  51. package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +116 -113
  52. package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  53. package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  54. package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +100 -150
  55. package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
  56. package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  57. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
  58. package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
  59. package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +83 -97
  60. package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
  61. package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +73 -97
  62. package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  63. package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +47 -44
  64. package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  65. package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
  66. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +59 -114
  67. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
  68. package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +96 -131
  69. package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
  70. package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
  71. package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +152 -131
  72. package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  73. package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
  74. package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
  75. package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  76. package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  77. package/content/guidance/storefront-next/sfnext-performance/SKILL.md +75 -105
  78. package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  79. package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  80. package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +103 -116
  81. package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
  82. package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
  83. package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  84. package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
  85. package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  86. package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
  87. package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  88. package/content/guidance/storefront-next/sfnext-routing/SKILL.md +86 -143
  89. package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
  90. package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  91. package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
  92. package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  93. package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
  94. package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  95. package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
  96. package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
  97. package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  98. package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
  99. package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +80 -89
  100. package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
  101. package/content/guidance/storefront-next/sfnext-testing/SKILL.md +105 -138
  102. package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
  103. package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
  104. package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  105. package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
  106. package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  107. package/dist/commands/mcp.d.ts +8 -2
  108. package/dist/commands/mcp.js +54 -20
  109. package/dist/guidance.d.ts +4 -1
  110. package/dist/guidance.js +23 -5
  111. package/dist/registry.d.ts +2 -1
  112. package/dist/registry.js +3 -3
  113. package/dist/server.d.ts +10 -0
  114. package/dist/server.js +21 -0
  115. package/dist/skill-references.js +5 -5
  116. package/dist/tools/cartridges/index.js +1 -0
  117. package/dist/tools/cip/index.js +6 -3
  118. package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
  119. package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
  120. package/dist/tools/diagnostics/debug-start-session.js +1 -1
  121. package/dist/tools/scapi/index.d.ts +4 -1
  122. package/dist/tools/scapi/index.js +4 -2
  123. package/dist/tools/scapi/scapi-code.d.ts +2 -2
  124. package/dist/tools/scapi/scapi-code.js +17 -61
  125. package/dist/utils/types.d.ts +6 -0
  126. package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +20 -0
  127. package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
  128. package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
  129. package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
  130. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
  131. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
  132. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
  133. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
  134. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
  135. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
  136. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
  137. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
  138. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
  139. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
  140. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
  141. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
  142. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +31 -21
  143. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
  144. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
  145. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
  146. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
  147. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
  148. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
  149. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
  150. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
  151. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +1 -1
  152. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
  153. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
  154. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
  155. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
  156. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
  157. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
  158. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +2 -2
  159. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
  160. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
  161. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +4 -4
  162. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
  163. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
  164. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
  165. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
  166. package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
  167. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
  168. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
  169. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
  170. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
  171. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
  172. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
  173. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
  174. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
  175. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  176. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
  177. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
  178. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
  179. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  180. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
  181. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
  182. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  183. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
  184. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
  185. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  186. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  187. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
  188. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  189. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  190. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
  191. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
  192. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  193. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  194. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
  195. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
  196. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
  197. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  198. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
  199. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
  200. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
  201. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
  202. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
  203. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
  204. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
  205. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  206. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
  207. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  208. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
  209. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
  210. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
  211. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
  212. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
  213. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
  214. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
  215. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
  216. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
  217. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
  218. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
  219. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  220. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
  221. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
  222. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  223. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  224. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
  225. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
  226. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  227. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  228. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
  229. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
  230. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
  231. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
  232. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  233. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
  234. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
  235. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  236. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
  237. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
  238. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  239. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
  240. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
  241. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
  242. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  243. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
  244. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
  245. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  246. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
  247. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
  248. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  249. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
  250. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
  251. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
  252. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  253. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
  254. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
  255. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
  256. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
  257. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
  258. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
  259. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
  260. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
  261. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  262. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
  263. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
  264. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  265. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
  266. package/oclif.manifest.json +21 -4
  267. package/package.json +3 -3
  268. package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
  269. package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  270. package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  271. package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  272. package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  273. package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
  274. package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  275. package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  276. package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  277. package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  278. package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
  279. package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  280. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  281. package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  282. package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
  283. package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  284. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
  285. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
  286. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  287. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  288. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  289. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  290. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
  291. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
  292. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  293. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  294. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  295. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  296. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
  297. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
  298. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  299. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  300. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  301. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
  302. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
  303. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  304. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
  305. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
  306. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/jobs.md +0 -0
  307. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
  308. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
  309. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
  310. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
  311. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
  312. /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
@@ -0,0 +1,57 @@
1
+ # Action Hooks
2
+
3
+ Action hooks let an extension run server-side code at fixed points in the checkout actions (fraud checks, address verification, payment enrichment) without editing the action files. UI slots are separate; see the main skill.
4
+
5
+ ## Available hook ids
6
+
7
+ The ids live in `ACTION_HOOK_IDS` in `src/targets/action-hook.server.ts`; `pnpm extensions:list` prints them too.
8
+
9
+ | Constant | Hook id |
10
+ |----------|---------|
11
+ | `CHECKOUT_FRAUD_AFTER_SUBMIT_CONTACT_INFO` | `sfcc.checkout.fraud.afterSubmitContactInfo` |
12
+ | `CHECKOUT_ADDRESS_VERIFICATION_AFTER_SUBMIT_SHIPPING_ADDRESS` | `sfcc.checkout.addressVerification.afterSubmitShippingAddress` |
13
+ | `CHECKOUT_SHIPPING_AFTER_METHODS_FETCH` | `sfcc.checkout.shipping.afterMethodsFetch` |
14
+ | `CHECKOUT_SHIPPING_AFTER_METHOD_SELECT` | `sfcc.checkout.shipping.afterMethodSelect` |
15
+ | `CHECKOUT_PAYMENTS_AFTER_SUBMIT_PAYMENT` | `sfcc.checkout.payments.afterSubmitPayment` |
16
+ | `CHECKOUT_FRAUD_BEFORE_PLACE` | `sfcc.checkout.fraud.beforePlace` (blocking) |
17
+ | `CHECKOUT_PAYMENTS_BEFORE_PLACE_ORDER` | `sfcc.checkout.payments.beforePlaceOrder` (blocking) |
18
+ | `CHECKOUT_PAYMENTS_AFTER_PLACE_ORDER` | `sfcc.checkout.payments.afterPlaceOrder` |
19
+
20
+ ## Register a handler
21
+
22
+ ```json
23
+ {
24
+ "actionHooks": [
25
+ { "hookId": "sfcc.checkout.fraud.beforePlace", "handler": "extensions/my-extension/hooks/fraud-check.ts", "order": 0 }
26
+ ]
27
+ }
28
+ ```
29
+
30
+ `handler` is a path relative to `src/`; the module's default export is the handler. It receives the hook context (`{ data, actionContext }`) and returns the (optionally modified) context, or nothing to pass it through.
31
+
32
+ ```typescript
33
+ import { ActionHookError } from '@/targets/action-hook.server';
34
+ import type { ActionHookContext } from '@/targets/action-hook.server';
35
+
36
+ export default async function fraudCheck(context: ActionHookContext) {
37
+ const risky = await scoreOrder(context.data); // your own server-side call
38
+ if (risky) {
39
+ throw new ActionHookError('We could not process this order.', 'sfcc.checkout.fraud.beforePlace', 'placeOrder');
40
+ }
41
+ return context;
42
+ }
43
+ ```
44
+
45
+ The constructor is `ActionHookError(message, hookId, step)`; the step is echoed in the 400 response.
46
+
47
+ ## Semantics
48
+
49
+ - Handlers for one hook run in series as a waterfall, ordered by `order`; each receives the previous handler's output. With no handlers the original context is returned unchanged.
50
+ - Throwing `ActionHookError` aborts the action and returns an HTTP 400 JSON response with your message and the step.
51
+ - Each handler has a timeout (a few seconds); a slow handler is treated as a failure, so do not make long calls inside hooks.
52
+ - Non-blocking hooks (the default): an unexpected error is logged, the failing handler is skipped and the action continues. Blocking hooks (`fraud.beforePlace`, `payments.beforePlaceOrder` run with `blocking: true`): an unexpected error fails the action, so a broken fraud or payment check cannot silently let an order through.
53
+ - Keep handlers server-safe: they run in the action, so use `*.server` modules freely and never put secrets in client-visible config (use `server-config.ts`).
54
+
55
+ ## Adding a new hook point
56
+
57
+ Call `runHookSafe` from an action with a new id you add to `ACTION_HOOK_IDS`, as `src/routes/action.place-order.ts` does. Pass `blocking: true` only when a failure must stop the action. Then run `pnpm extensions:list` to confirm it is discovered.
@@ -1,65 +1,68 @@
1
- # Base Audit Reference
1
+ # Base Audit: Extend, Restyle, or Edit
2
2
 
3
- Use this before building an extension or adding a section to a page. The goal is to decide **whether to extend at all**, and if so, **at which layer** — so you never ship a component that duplicates something the base template already renders.
3
+ Use this before building an extension or adding a section to a page. The goal is to decide whether to extend at all, and if so at which layer, so you never ship a component that duplicates something the storefront already renders. You own the whole project, so the choices are about keeping changes small and upgrade-friendly, not about who is allowed to edit what.
4
4
 
5
- ## The gate, step by step
5
+ ## The gate
6
6
 
7
- 1. **Find the base component.** Open the route in `src/routes/` and trace what it renders down to the section you care about.
8
- 2. **Check every rendered section.** For each thing you want to add, ask: does the base already render equivalent content here?
7
+ 1. **Find what renders today.** Open the route in `src/routes/` and follow it down to the component for the area you care about.
8
+ 2. **Check every section you plan to add.** Does the base already render equivalent content there (a description, accordion, badge, banner, title)?
9
9
  3. **Branch:**
10
- - **Already rendered** → restyle via token/brand layer or a CVA variant, or inject into a UITarget slot on the existing content. Do **not** create a parallel component.
11
- - **Not rendered** → an extension (or a base slot) is justified.
12
- 4. **Pick the layer for what's genuinely missing:**
10
+ - Already rendered: change its look or behavior in place, or fill an existing slot next to it. Do not add a parallel component.
11
+ - Not rendered: continue to step 4.
12
+ 4. **Choose the layer:**
13
13
 
14
- ```
15
- Purely visual (color, font, spacing)?
16
- └─ YES → Token / CVA change. No extension.
17
- └─ NO → Needed by only one storefront/vertical?
18
- └─ YES → Extension at a UITarget slot.
19
- └─ NO → Shared pattern → add a slot/render-prop to the BASE component.
20
- ```
14
+ ```
15
+ Purely visual (color, font, radius, spacing)?
16
+ YES -> Token or component-variant change (storefront-next:sfnext-theming). No extension.
17
+ NO -> Does a UITarget slot exist where it belongs?
18
+ YES -> Extension filling that slot (this skill).
19
+ NO -> Is it a one-off for this storefront?
20
+ YES -> Edit the route or component directly.
21
+ NO -> Edit the base component to add a <UITarget> slot (or a render prop),
22
+ then fill it from an extension.
23
+ ```
21
24
 
22
- ## Worked examples
25
+ Rule of thumb: extensions add what is missing; they do not recreate what exists. If you keep editing the same base file for the same feature, give it a slot.
23
26
 
24
- ### Example 1 — duplicate section (wrong) vs additive section (right)
27
+ ## Worked examples (real slots)
25
28
 
26
- ```
27
- ❌ WRONG — base ProductView already renders a description accordion ("What's in it:").
28
- The extension adds its own "What's in it" section → duplicate content on the PDP.
29
+ Find them with `pnpm extensions:list`. The ids below are from a current project; confirm in yours.
29
30
 
30
- ✅ CORRECT — base already renders description + adapter sections (Ingredients, How to Use…).
31
- The extension adds ONLY the sections the base does not have
32
- (e.g. "Shipping & Fresh Guarantee", a brand story block).
33
- ```
31
+ | You want | Already in base? | Layer |
32
+ |----------|------------------|-------|
33
+ | A "store finder" link beside the cart icon | No; `sfcc.header.before.cart` exists | Extension component on that slot (how the store locator does it) |
34
+ | An installment-payment message under the PDP price | No; `sfcc.pdp.bnpl.message` exists | Extension component on that slot (the BNPL demo does this) |
35
+ | A reviews section on the PDP | No; `sfcc.pdp.reviews.section` and `sfcc.pdp.reviews.rating` exist | Extension (the ratings and reviews demo) |
36
+ | A returns and warranty card on the PDP | Yes: `sfcc.pdp.returnsWarranty` and `sfcc.pdp.collapsibles` already render content | Replace or extend what the product-content extension fills; do not add another card |
37
+ | Make the primary button a new color | Button exists | Token change, no extension |
38
+ | A denser product tile | Tile exists | New component variant, no extension |
39
+ | A promo strip above the header, nothing fits | No slot | Edit the header component, and add a `<UITarget>` if you expect to reuse the seam |
40
+ | Block an order when a fraud check fails | Server hook `sfcc.checkout.fraud.beforePlace` exists | Action hook (see [Action Hooks](ACTION-HOOKS.md)), not UI |
34
41
 
35
- ### Example 2 — restyle, don't re-render
42
+ ### Duplicate section (wrong) vs additive section (right)
36
43
 
37
44
  ```
38
- ❌ WRONG — base renders the product title in ProductInfo.
39
- A brand "stamp" extension renders the product title again.
45
+ WRONG: the PDP already renders collapsible product-detail sections. The extension adds its own
46
+ accordion with the same headings -> two copies of the same content.
40
47
 
41
- ✅ CORRECT — the stamp adds ONLY the brand line ("ACME · Handmade")
42
- above the existing ProductInfo. The title stays where the base renders it.
48
+ RIGHT: fill or extend what the existing collapsibles slot renders, or add only sections
49
+ the base lacks.
43
50
  ```
44
51
 
45
- ### Example 3 — pick the right layer
52
+ ### Restyle, do not re-render
46
53
 
47
- | Desired change | Already in base? | Correct layer |
48
- |----------------|------------------|---------------|
49
- | Make the primary button green | Button exists | Token change in `brand.css` (no extension) |
50
- | Add a "compact" tile density | Tile exists | New CVA variant on the tile |
51
- | Add a site-wide promo banner above nav | Not rendered, one storefront only | Extension at `header.before.nav` |
52
- | Add a "sustainability meta" line every storefront will want | Not rendered, shared pattern | Slot / render-prop on the BASE tile/product component |
54
+ ```
55
+ WRONG: an extension renders the product title again so it can style it.
56
+ RIGHT: adjust the title's token or variant; add only the new line (for example a badge) in a slot.
57
+ ```
53
58
 
54
- ## Finding the slots and base render points
59
+ ## Finding slots and render points
55
60
 
56
61
  ```bash
57
- # from packages/template-retail-rsc-app — list every UITarget slot in use
58
- rg "UITarget" src/ -l
59
-
60
- # read a target file to find its targetId values, e.g.
61
- # <UITarget targetId="header.before.nav" />
62
- # <UITarget targetId="pdp.add-to-cart.below" />
62
+ pnpm extensions:list # every UITarget id and action hook id, with where it is used
63
+ pnpm extensions:list -- --json # machine-readable
64
+ rg "UITarget" src/ -l # files that render slots
65
+ rg 'targetId="sfcc.pdp' src/ # slots for one area
63
66
  ```
64
67
 
65
- If no suitable slot exists where you need it and the page is one you own, a direct route edit is acceptable — but still run the audit first so you don't duplicate existing content. Prefer a UITarget slot when one fits.
68
+ The build fails when `target-config.json` names a `targetId` that no `<UITarget>` renders, so a typo is caught immediately. If no slot suits and the page is yours to change, a direct edit is fine, after running the audit so you do not duplicate existing content.
@@ -0,0 +1,58 @@
1
+ # CLI and Install
2
+
3
+ The `sfnext` CLI (from `@salesforce/storefront-next-dev`, available in your project) manages extensions. Run commands from the project root, or pass `--project-directory`.
4
+
5
+ ```bash
6
+ sfnext extensions list # installed extensions
7
+ sfnext extensions create -n "My Extension" -d "What it does" # scaffold a new extension
8
+ sfnext extensions install -e SFDC_EXT_STORE_LOCATOR # install a registered extension
9
+ sfnext extensions remove -e SFDC_EXT_BOPIS # remove one (comma-separate several)
10
+ sfnext extensions remove -e SFDC_EXT_STORE_LOCATOR --yes # also remove dependents without prompting
11
+ pnpm extensions:list # UITarget ids and action hook ids (not the same as `list`)
12
+ ```
13
+
14
+ Run `sfnext extensions <command> --help` for the exact flags in your version.
15
+
16
+ ## create
17
+
18
+ Scaffolds `src/extensions/<kebab-name>/` (components, locales, hooks, routes, README) and registers a `SFDC_EXT_*` entry in `src/extensions/config.json`. It does not create `target-config.json` content for you; add it when you have a component to plug in.
19
+
20
+ ## install and remove
21
+
22
+ Registered extensions are listed in `src/extensions/config.json`, each with a marker key, `name`, `description`, `folder`, optional `dependencies`, and `installationInstructions` / `uninstallationInstructions` pointing at files in `instructions/`. Shipped registrations include Store Locator, BOPIS (depends on Store Locator and Multiship), Multiship, and the demo extensions BNPL, Customer Preferences, Ratings and Reviews, Product Content, and Shipping Delivery. The theme-switcher folder is present but not registered.
23
+
24
+ - `install` copies the extension folder and merges the marked snippets (see markers below) into base files from a source template repository (`--source-git-url`/`-s` overrides the default).
25
+ - `remove` reverses that and, when other installed extensions depend on the target, asks before removing them (`--yes` skips the prompt).
26
+ - Always commit or stash first and review the diff: installs touch base files such as `root.tsx`, the header and the footer.
27
+
28
+ ## Agent-driven install instructions
29
+
30
+ `instructions/*.mdc` are step-by-step prompts a coding agent can follow to install or uninstall an extension. Treat them as a starting point: they are generated from the source template repository and can lag behind your project (for example file paths or a temporary clone folder name). If a step mentions a file that does not exist in your project, prefer `sfnext extensions install`, or compare against the extension's own `README.md`.
31
+
32
+ To author instructions for your own extension (an extension whose integration edits are marked with `SFDC_EXT_*` markers):
33
+
34
+ ```bash
35
+ sfnext create-instructions -d . -c <extension-config.json> -e SFDC_EXT_MY_FEATURE
36
+ ```
37
+
38
+ Options include `-f` for the specific files that contain markers, `-b` for the template branch, and `-o` for the output directory (default `./instructions`).
39
+
40
+ ## Markers
41
+
42
+ | Marker | Meaning |
43
+ |--------|---------|
44
+ | `@sfdc-extension-line SFDC_EXT_X` | The comment line and the single line that follows it belong to the extension |
45
+ | `@sfdc-extension-block-start SFDC_EXT_X` / `@sfdc-extension-block-end SFDC_EXT_X` | Everything between belongs to the extension |
46
+ | `@sfdc-extension-file SFDC_EXT_X` | The whole file belongs to the extension and is removed on uninstall |
47
+
48
+ Rules: use the exact `SFDC_EXT_*` key from `config.json`; never nest different markers; only mark code the extension truly needs outside its folder.
49
+
50
+ ## After install or remove
51
+
52
+ ```bash
53
+ pnpm locales:aggregate-extensions # regenerate src/extensions/locales (also runs in dev/build)
54
+ pnpm config:aggregate-extensions # regenerate src/extensions/config (also runs in dev/build)
55
+ pnpm typecheck && pnpm lint
56
+ ```
57
+
58
+ Then read the extension's README for environment variables, SLAS scopes, or custom SCAPI endpoints it needs. Store Locator, for example, relies on the store data your instance exposes; check its README.
@@ -1,116 +1,79 @@
1
- # Extension Examples Reference
1
+ # Extension Examples
2
2
 
3
- ## Store Locator Extension
3
+ Read the shipped extensions in `src/extensions/` before writing your own; these three cover the common shapes. Confirm paths in your project, since extensions evolve.
4
4
 
5
- A complete extension adding store locator functionality:
5
+ ## Simplest: BNPL (one slot, one API module)
6
6
 
7
7
  ```
8
- src/extensions/store-locator/
8
+ src/extensions/bnpl/
9
9
  ├── target-config.json
10
- ├── components/
11
- │ ├── store-locator-badge.tsx # Badge in header
12
- │ └── store-locator-map.tsx # Map component
13
- ├── routes/
14
- │ └── store-locator.tsx # /store-locator page
10
+ ├── components/ # includes components/target/bnpl-target.tsx
11
+ ├── context/ # bnpl-context
12
+ ├── lib/api/bnpl.server.ts # mock provider calls; replace bodies for a real provider
15
13
  ├── locales/
16
- │ ├── en-US/translations.json
17
- │ └── de-DE/translations.json
18
- └── providers/
19
- └── store-provider.tsx # Store data context
14
+ └── README.md
20
15
  ```
21
16
 
22
- ### target-config.json
23
-
24
17
  ```json
25
18
  {
26
19
  "components": [
27
- {
28
- "targetId": "header.after.logo",
29
- "path": "extensions/store-locator/components/store-locator-badge.tsx",
30
- "order": 0
31
- }
32
- ],
33
- "contextProviders": [
34
- {
35
- "path": "extensions/store-locator/providers/store-provider.tsx",
36
- "order": 0
37
- }
20
+ { "targetId": "sfcc.pdp.bnpl.message", "path": "extensions/bnpl/components/target/bnpl-target.tsx", "order": 0 }
38
21
  ]
39
22
  }
40
23
  ```
41
24
 
42
- ### Route
25
+ The target component is a thin default-exported adapter: it reads a context (`useBnpl()`), returns `null` when there is nothing to show, and wraps streamed promises in `Suspense`/`Await`. Keep slot components small and null-safe, because the slot renders wherever the base places it.
43
26
 
44
- ```typescript
45
- // src/extensions/store-locator/routes/store-locator.tsx
46
- import { createApiClients } from '@/lib/api-clients';
47
- import { useTranslation } from 'react-i18next';
27
+ ## Several slots: Ratings and Reviews
48
28
 
49
- export function loader({ context }: LoaderFunctionArgs) {
50
- const clients = createApiClients(context);
51
- return {
52
- stores: clients.shopperStores.getStores({...}).then(({ data }) => data),
53
- };
54
- }
29
+ Three entries in one `target-config.json` fill three different places:
55
30
 
56
- export default function StoreLocatorPage({ loaderData }) {
57
- const { t } = useTranslation('extStoreLocator');
31
+ | targetId | Component |
32
+ |----------|-----------|
33
+ | `sfcc.pdp.reviews.section` | `components/target/reviews-section-target.tsx` |
34
+ | `sfcc.pdp.reviews.rating` | `components/target/reviews-summary-target.tsx` |
35
+ | `sfcc.account.orderDetail.lineReview` | `components/target/order-line-review-target.tsx` |
58
36
 
59
- return (
60
- <div>
61
- <h1>{t('title')}</h1>
62
- {/* Render store map and list */}
63
- </div>
64
- );
65
- }
66
- ```
37
+ It also has `context/`, `providers/`, `routes/`, `lib/` and `locales/`. Pattern: one target adapter per slot, shared logic in context and `lib`.
67
38
 
68
- ### Translations
39
+ ## Routes, provider, middleware: Store Locator
69
40
 
70
- ```json
71
- // src/extensions/store-locator/locales/en-US/translations.json
72
- {
73
- "title": "Find a Store",
74
- "searchPlaceholder": "Enter city or zip code",
75
- "noResults": "No stores found nearby"
76
- }
41
+ ```
42
+ src/extensions/store-locator/
43
+ ├── target-config.json # sfcc.header.before.cart -> components/header/store-locator-badge.tsx
44
+ ├── components/ context/ hooks/ stores/ locales/ tests/
45
+ ├── middlewares/ # wired into base files via SFDC_EXT_ markers
46
+ ├── providers/store-locator.tsx # mounted in root.tsx via @sfdc-extension-block markers
47
+ └── routes/
48
+ ├── _app.store-locator.tsx # page inside the app layout
49
+ ├── action.set-selected-store.ts # action route
50
+ └── resource.stores.ts # resource (JSON) route
77
51
  ```
78
52
 
79
- ## Integration Marker Patterns
53
+ This extension needs edits outside its folder (for example `root.tsx` and other base components), which is why it uses `SFDC_EXT_STORE_LOCATOR` markers; see [CLI and Install](CLI-AND-INSTALL.md). Route file names follow flat-route conventions: `_app.` prefix for routes in the app layout, `action.` and `resource.` for non-UI routes.
80
54
 
81
- ### Single-Line Import
55
+ ## Wrapper slot
82
56
 
83
- ```typescript
84
- /** @sfdc-extension-line SFDC_EXT_STORE_LOCATOR */
85
- import StoreLocatorBadge from '@extensions/store-locator/components/store-locator-badge';
86
- ```
57
+ A slot that has children keeps the base content and lets the extension decorate it (for example `sfcc.emailSignUp.consent.marketing`). The component receives `children`:
87
58
 
88
- ### Block Integration
59
+ ```tsx
60
+ import type { ReactNode } from 'react';
89
61
 
90
- ```typescript
91
- /* @sfdc-extension-block-start SFDC_EXT_STORE_LOCATOR */
92
- <Link to="/store-locator" className="flex items-center gap-2">
93
- <MapPinIcon className="h-4 w-4" />
94
- <span>{t('storeLocator')}</span>
95
- </Link>
96
- /* @sfdc-extension-block-end SFDC_EXT_STORE_LOCATOR */
62
+ export default function ConsentWrapper({ children }: { children?: ReactNode }) {
63
+ return <div className="rounded border p-2">{children}</div>;
64
+ }
97
65
  ```
98
66
 
99
- ## BOPIS Extension (Buy Online, Pick Up In Store)
67
+ Use `pnpm extensions:list` to see which slots are wrappers in your project.
100
68
 
101
- ```json
102
- {
103
- "components": [
104
- {
105
- "targetId": "product.detail.fulfillment",
106
- "path": "extensions/bopis/components/pickup-selector.tsx",
107
- "order": 0
108
- },
109
- {
110
- "targetId": "cart.item.fulfillment",
111
- "path": "extensions/bopis/components/pickup-info.tsx",
112
- "order": 0
113
- }
114
- ]
115
- }
116
- ```
69
+ ## Server hook: fraud check
70
+
71
+ See [Action Hooks](ACTION-HOOKS.md) for a `sfcc.checkout.fraud.beforePlace` handler and the blocking rules.
72
+
73
+ ## Checklist for a new extension
74
+
75
+ 1. Run the [Base Audit](BASE-AUDIT.md) gate.
76
+ 2. `sfnext extensions create -n "Name" -d "..."`.
77
+ 3. Add components, then `target-config.json` entries with `sfcc.` target ids from `pnpm extensions:list`.
78
+ 4. Add `locales/<lang>/translations.json` and use the `ext<PascalName>` namespace.
79
+ 5. Run `pnpm dev`, check the slot in the browser, then `pnpm typecheck && pnpm lint`.
@@ -1,148 +1,93 @@
1
1
  ---
2
2
  name: sfnext-hybrid-storefronts
3
- description: Implement hybrid storefronts that run Storefront Next alongside SFRA or SiteGenesis. Use when planning gradual migration from SFRA, configuring hybrid proxy for local development, setting up session bridging between storefronts, or routing traffic between old and new implementations.
3
+ description: >-
4
+ Run Storefront Next alongside an existing SFRA or SiteGenesis storefront for a gradual migration. Use for hybrid mode, PUBLIC__app__hybrid__enabled, legacyRoutes (exact, :param, * wildcard, { pattern, suffix }), HYBRID_PROXY_ENABLED, SFCC_ORIGIN, HYBRID_ROUTING_RULES, vite-plugins/hybrid-proxy.ts, the dwsid session bridge, sharing login/cart between SFRA and Storefront Next, eCDN routing rules, cookie domain for hybrid, "[Hybrid Proxy] SFCC returned a redirect to 404", blank proxied pages, or lost sessions when crossing storefronts. Do not use for the cookie-domain settings themselves beyond the hybrid checklist (use `storefront-next:sfnext-security`), auth code (use `storefront-next:sfnext-authentication`), or MRT deployment (use `storefront-next:sfnext-deployment`).
4
5
  ---
5
6
 
6
- # Hybrid Storefronts Skill
7
+ # Hybrid Storefronts
7
8
 
8
- This skill covers running Storefront Next alongside an existing SFRA or SiteGenesis storefront — enabling gradual migration without a full rewrite.
9
+ A hybrid storefront serves some pages from Storefront Next (on Managed Runtime) and the rest from SFRA/SiteGenesis on the B2C instance, under one hostname.
9
10
 
10
- ## Overview
11
+ - **Production:** Cloudflare eCDN routes by URL pattern (see `b2c-cli:b2c-ecdn`). The dev proxy is never used.
12
+ - **Local development:** a Vite dev-server plugin proxies non-Storefront-Next paths to your sandbox so both appear at `http://localhost:5173`. It only runs under `pnpm dev` and is a no-op in production builds. Full guide: `docs/README-HYBRID-PROXY.md` in your project.
11
13
 
12
- A hybrid storefront splits traffic between Storefront Next (for new or migrated pages) and an existing SFRA/SiteGenesis storefront (for pages not yet migrated). Session bridging ensures users maintain authentication and cart state across both implementations.
14
+ ## Two sets of configuration
13
15
 
14
- ## Architecture
15
-
16
- ```
17
- Customer Request
18
- ↓
19
- CDN / eCDN (Cloudflare) ← Production: routes based on URL patterns
20
- ↓
21
- ┌─────────────────────────────┐
22
- │ Storefront Next │ SFRA/SiteGenesis │
23
- │ (MRT) │ (B2C Instance) │
24
- └────────┴────────────────────┘
25
- ↕ Session Bridge (shared cookies) ↕
26
- ```
27
-
28
- **Production:** Cloudflare eCDN handles routing between Storefront Next and SFRA based on origin rules.
29
-
30
- **Local Development:** A Vite dev server plugin (`hybridProxyPlugin` from `@salesforce/storefront-next-dev`) proxies non-matching requests to your SFCC sandbox, simulating the eCDN split at `localhost:5173`.
31
-
32
- ## Configuration
33
-
34
- Hybrid mode is configured entirely through environment variables — there is no extension directory.
35
-
36
- ### Application Config (All Environments)
37
-
38
- These `PUBLIC__` variables are bundled into the app and required in all environments:
16
+ | Set | Variables | Where it applies |
17
+ |---|---|---|
18
+ | App config | `PUBLIC__app__hybrid__enabled`, `PUBLIC__app__hybrid__legacyRoutes` | **Every** environment (local, staging, production) |
19
+ | Dev proxy | `HYBRID_PROXY_ENABLED`, `SFCC_ORIGIN`, `HYBRID_ROUTING_RULES`, `HYBRID_PROXY_LOCALE`, `PUBLIC__app__defaultSiteId` | `pnpm dev` only |
39
20
 
40
21
  ```bash
41
- # Enable hybrid mode — activates the client-side legacy-routes middleware
42
22
  PUBLIC__app__hybrid__enabled=true
23
+ PUBLIC__app__hybrid__legacyRoutes='["/cart", "/checkout", "/product/:id", "/categoryLv1/*"]'
43
24
 
44
- # Routes that belong to SFRA — client-side <Link> clicks to these trigger full-page loads
45
- # Supports exact paths and React Router parameterized routes
46
- PUBLIC__app__hybrid__legacyRoutes='["/cart", "/checkout", "/product/:id"]'
47
- ```
48
-
49
- ### Proxy Plugin Config (Local Development Only)
50
-
51
- These configure the Vite dev server proxy and have no effect in production:
52
-
53
- ```bash
54
- # Enable the proxy
55
25
  HYBRID_PROXY_ENABLED=true
56
-
57
- # Your SFCC sandbox origin
58
- SFCC_ORIGIN=https://zzrf-001.dx.commercecloud.salesforce.com
59
-
60
- # Routing rules: Cloudflare eCDN expression format
61
- # Paths matching → Storefront Next; paths not matching → proxied to SFCC
62
- HYBRID_ROUTING_RULES='(http.request.uri.path matches "^/$" or http.request.uri.path matches "^/product.*" or http.request.uri.path matches "^/category.*" or http.request.uri.path matches "^/resource.*" or http.request.uri.path matches "^/action/.*")'
63
-
64
- # Optional: locale for SFRA path transformation (falls back to PUBLIC__app__i18n__fallbackLng)
65
- HYBRID_PROXY_LOCALE=en-GB
26
+ SFCC_ORIGIN=https://zzrf-001.dx.commercecloud.salesforce.com # your sandbox hostname, not the SCAPI host
27
+ HYBRID_PROXY_LOCALE=en-GB # optional; falls back to i18n fallbackLng
28
+ HYBRID_ROUTING_RULES='(http.request.uri.path matches "^/$" or http.request.uri.path matches "^/login.*" or http.request.uri.path matches "^/logout.*" or http.request.uri.path matches "^/signup.*" or http.request.uri.path matches "^/reset-password.*" or http.request.uri.path matches "^/account.*" or http.request.uri.path matches "^/social-callback.*" or http.request.uri.path matches "^/product.*" or http.request.uri.path matches "^/category.*" or http.request.uri.path matches "^/search.*" or http.request.uri.path matches "^/resource.*" or http.request.uri.path matches "^/action/.*")'
66
29
  ```
67
30
 
68
- ## Client-Side Navigation Middleware
69
-
70
- The `legacy-routes.client.ts` middleware intercepts client-side navigation to SFRA-owned routes:
71
-
72
- 1. User clicks `<Link to="/checkout">`
73
- 2. React Router begins client-side navigation
74
- 3. Middleware checks if `/checkout` matches any pattern in `legacyRoutes`
75
- 4. If yes → forces a full-page navigation so the CDN/proxy routes to SFRA
76
- 5. If no → continues normal client-side rendering
77
-
78
- This prevents React Router from trying to render pages that belong to SFRA.
31
+ `HYBRID_ROUTING_RULES` lists what **Storefront Next owns** (same Cloudflare `http.request.uri.path matches "<regex>"` clauses, joined by `or`, as your eCDN rules). Anything not matching is proxied to SFRA. `^/resource.*` and `^/action/.*` are always required. Include every auth route you migrated (`/login`, `/logout`, `/signup`, `/reset-password`, `/social-callback`) or login breaks. `legacyRoutes` is the inverse: what SFRA owns, so a `<Link>` to it forces a full page load instead of a React Router 404. Keep both in sync with the production eCDN rules.
79
32
 
80
- ## Session Bridging
33
+ ## legacyRoutes patterns
81
34
 
82
- Both storefronts share the same session cookies (`dwsid`, `cc-*`) on a common domain:
35
+ Each entry is a string or `{ pattern, suffix }`.
83
36
 
84
- ### Cookie Handling (Local Dev)
37
+ | Form | Example | Matches |
38
+ |---|---|---|
39
+ | Exact | `/cart` | `/cart` only |
40
+ | Named param | `/product/:id` | one segment |
41
+ | Wildcard | `/categoryLv1/*` | anything under the prefix (`/categoryLv1/shoes/running`), **not** the bare `/categoryLv1` (list it separately); `*` may appear mid-pattern |
42
+ | Catch-all | `*` | every path |
43
+ | With suffix | `{ "pattern": "/product/:id", "suffix": ".html" }` | redirect appends `.html` (SFCC SEO URLs) |
85
44
 
86
- The proxy handles cookies in three layers:
87
- 1. **Set-Cookie header rewriting** — SFCC response `Domain=.salesforce.com` → `Domain=localhost`
88
- 2. **Storefront Next server cookies** — Written directly to localhost, no rewriting needed
89
- 3. **Client-side cookie interception** — Injected script patches `document.cookie` for SFRA's JS
45
+ The matching middleware is `src/middlewares/legacy-routes.client.ts` (helpers in `legacy-routes.ts`). The eCDN regex `^/categoryLv1.*` matches the bare path while `/categoryLv1/*` does not; use `^/categoryLv1(/.*)?$` on the eCDN side to align them.
90
46
 
91
- ### SFRA to Storefront Next
47
+ ## Session bridge
92
48
 
93
- When navigating from SFRA to Storefront Next:
94
- 1. SFRA provides session credentials (dwsgst/dwsrst tokens)
95
- 2. Storefront Next exchanges the bridge token for SLAS tokens
96
- 3. Normal SLAS cookie-based auth resumes
49
+ There is no token exchange and no client-side sync. The bridge is the `dwsid` cookie (plus `dw_dnt` for tracking consent):
97
50
 
98
- ### Storefront Next to SFRA
51
+ 1. Storefront Next's auth middleware extracts `dwsid` from the SLAS response and persists it.
52
+ 2. `dwsid` and `dw_dnt` are **not** site-namespaced, so SFRA reads and writes them directly. Other `cc-*` cookies are namespaced per site and are Storefront Next's own.
53
+ 3. The browser sends them on every request; the next full request to either side sees the shared session.
99
54
 
100
- When navigating from Storefront Next to SFRA:
101
- 1. Shared `dwsid` cookie maintains session continuity
102
- 2. Full-page navigation triggered by legacy-routes middleware
103
- 3. CDN/proxy routes request to SFCC origin
55
+ For this to work across subdomains, cookie domain must be configured on **both** sides and agree: `app.cookies.domain` (or `commerce.sites[].cookies.domain`, or `PUBLIC__app__cookies__domain=.example.com`) in Storefront Next, and Business Manager > Merchant Tools > Site Preferences > **Hybrid Auth Settings** cookie-domain level `2` (level `0` is host-only; level `1` is rejected). Details and verification checklist: `storefront-next:sfnext-security` and `docs/README-COOKIE-DOMAIN.md`. Cookie inventory: `storefront-next:sfnext-authentication`.
104
56
 
105
- ## Traffic Routing Patterns
57
+ ## Edit the proxy where customers edit it
106
58
 
107
- ### Gradual Migration Strategy
59
+ The plugin is wired in `vite-plugins/hybrid-proxy.ts` (called from `vite.config.ts`, development mode only). Edit there, not in `vite.config.ts`. It reads `url.prefix` and the site/locale alias catalog from `config.server.ts` automatically.
108
60
 
109
- 1. **Phase 1** — Homepage, product, and category pages on Storefront Next
110
- 2. **Phase 2** — Account and search pages
111
- 3. **Phase 3** — Cart and checkout flow
112
- 4. **Phase 4** — Full migration, remove SFRA
61
+ - **Path rewriting:** `/cart` becomes `/s/<siteId>/<locale>/cart`, `/` becomes `/s/<siteId>`. With `url.prefix` of `/:localeId` or `/:siteId/:localeId` the proxy reuses the site/locale already in the path (`/uk/cart` becomes `/s/<siteId>/uk/cart`), and only treats a segment as site/locale if it is a known id or alias.
62
+ - **Escape hatches (last resort):** `rewritePath(pathname)` returns an SFRA path or `null` to fall through; `routeMatcher(pathname, rules)` replaces the matcher. Keep `shouldRouteToNext` as the fallback so dev stays aligned with eCDN.
63
+ - Target origin priority: `SFCC_ORIGIN`, then `SCAPI_PROXY_HOST`, then the SCAPI host from `shortCode`.
113
64
 
114
- ### Required Routing Rules
65
+ ## Automatic behaviors
115
66
 
116
- Some patterns must always route to Storefront Next:
117
-
118
- | Pattern | Why |
119
- | -------------- | ---------------------------------------------- |
120
- | `^/resource.*` | React Router resource routes (data endpoints) |
121
- | `^/action/.*` | React Router actions (form submissions) |
122
-
123
- ### Keep Rules in Sync
124
-
125
- `HYBRID_ROUTING_RULES` (what Storefront Next owns) and `PUBLIC__app__hybrid__legacyRoutes` (what SFRA owns) are complementary. Any path not in routing rules that could be a `<Link>` target should be in `legacyRoutes`.
126
-
127
- ## Common Considerations
128
-
129
- - **Cookie domains** — Both storefronts must share a cookie domain for session bridging
130
- - **CDN configuration** — Update eCDN origin rules as pages migrate
131
- - **SEO continuity** — Maintain URL structure to preserve search rankings
132
- - **Cart synchronization** — Basket state is consistent via shared session cookies
67
+ - Rewrites `Domain=.salesforce.com` cookies to `localhost`, rewrites SFCC URLs in HTML/JSON bodies, decompresses gzip/brotli/deflate before rewriting, and injects a `document.cookie` interceptor into proxied HTML (localhost workaround only, not used in production).
68
+ - Never proxies Vite internals, `*.data`, `/mobify/*` and static asset extensions; always proxies `/on/demandware.static/*` and `/on/demandware.store/*`.
69
+ - SFRA `plugin_redirect` answering `200` with a `Location` header is converted to a `302`.
133
70
 
134
71
  ## Troubleshooting
135
72
 
136
- | Issue | Cause | Solution |
137
- | --------------------------------- | -------------------------- | ------------------------------------------------- |
138
- | Lost session crossing storefronts | Cookie domain mismatch | Ensure shared parent domain |
139
- | Cart items disappear | Basket not synced | Verify session bridge cookies (`dwsid`, `cc-*`) |
140
- | Redirect loops | Conflicting routing rules | Check eCDN rules and `legacyRoutes` consistency |
141
- | 404 on SFRA pages (local dev) | Missing from routing rules | Add path to `HYBRID_ROUTING_RULES` |
142
- | React Router 404 on legacy route | Missing from legacyRoutes | Add path to `PUBLIC__app__hybrid__legacyRoutes` |
73
+ | Symptom | Cause | Fix |
74
+ |---|---|---|
75
+ | Logged out after visiting a Storefront Next page; log says `[Hybrid Proxy] SFCC returned a redirect to 404` | A migrated route is missing from `HYBRID_ROUTING_RULES`; SFCC 404s and clears cookies (proxy strips those `Set-Cookie`s) | Add the path pattern |
76
+ | React Router 404 or error boundary when clicking a legacy link | Path missing from `legacyRoutes` | Add it (mind `*` vs bare parent) |
77
+ | Session lost crossing storefronts | Cookie domain mismatch, or BM Hybrid Auth level differs | Align both sides; check for duplicate cookies |
78
+ | Blank proxied page | Upstream `200` + `Location` (fixed in dev), or unsupported compression | Fix the SFRA cartridge or add an eCDN rule for production |
79
+ | Works locally, wrong backend in production | `HYBRID_ROUTING_RULES` drifted from eCDN rules | Sync them |
80
+ | Wrong locale in the SFRA path | `url.prefix` or `HYBRID_PROXY_LOCALE` mismatch | Check `url.prefix`; set `HYBRID_PROXY_LOCALE` to the site's default locale |
81
+ | Proxy does nothing | `HYBRID_PROXY_ENABLED` not `true`, or not in dev mode | Check `.env` and `pnpm dev` |
82
+
83
+ Env-var reference, path transformation and custom matcher: [references/HYBRID-PROXY-CONFIG.md](references/HYBRID-PROXY-CONFIG.md).
143
84
 
144
85
  ## Related Skills
145
86
 
146
- - `storefront-next:sfnext-authentication` - SLAS token management and session cookies
147
- - `storefront-next:sfnext-deployment` - MRT deployment for hybrid setup
148
- - `storefront-next:sfnext-configuration` - Environment configuration for hybrid mode
87
+ - `storefront-next:sfnext-authentication` - cookies and SLAS sessions
88
+ - `storefront-next:sfnext-security` - cookie domain, CSP
89
+ - `storefront-next:sfnext-deployment` - MRT deployment
90
+ - `storefront-next:sfnext-configuration` - `config.server.ts` and `PUBLIC__` overrides
91
+ - `storefront-next:sfnext-routing` - site/locale URL prefixes
92
+ - `b2c-cli:b2c-ecdn` - production routing rules
93
+ - `b2c-cli:b2c-mrt` - Managed Runtime environments