@salesforce/b2c-dx-mcp 3.2.0 → 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 (313) 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/execution-registry.js +9 -9
  122. package/dist/tools/scapi/index.d.ts +4 -1
  123. package/dist/tools/scapi/index.js +4 -2
  124. package/dist/tools/scapi/scapi-code.d.ts +2 -2
  125. package/dist/tools/scapi/scapi-code.js +17 -61
  126. package/dist/utils/types.d.ts +6 -0
  127. package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +20 -0
  128. package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
  129. package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
  130. package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
  131. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
  132. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
  133. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
  134. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
  135. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
  136. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
  137. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
  138. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
  139. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
  140. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
  141. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
  142. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
  143. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +31 -21
  144. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
  145. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
  146. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
  147. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
  148. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
  149. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
  150. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
  151. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
  152. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +1 -1
  153. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
  154. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
  155. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
  156. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
  157. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
  158. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
  159. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +2 -2
  160. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
  161. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
  162. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +4 -4
  163. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
  164. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
  165. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
  166. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
  167. package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
  168. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
  169. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
  170. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
  171. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
  172. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
  173. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
  174. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
  175. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
  176. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  177. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
  178. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
  179. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
  180. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  181. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
  182. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
  183. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  184. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
  185. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
  186. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  187. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  188. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
  189. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  190. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  191. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
  192. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
  193. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  194. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  195. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
  196. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
  197. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
  198. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  199. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
  200. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
  201. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
  202. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
  203. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
  204. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
  205. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
  206. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  207. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
  208. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  209. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
  210. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
  211. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
  212. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
  213. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
  214. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
  215. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
  216. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
  217. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
  218. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
  219. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
  220. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  221. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
  222. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
  223. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  224. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  225. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
  226. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
  227. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  228. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  229. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
  230. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
  231. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
  232. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
  233. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  234. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
  235. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
  236. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  237. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
  238. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
  239. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  240. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
  241. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
  242. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
  243. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  244. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
  245. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
  246. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  247. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
  248. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
  249. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  250. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
  251. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
  252. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
  253. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  254. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
  255. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
  256. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
  257. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
  258. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
  259. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
  260. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
  261. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
  262. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  263. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
  264. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
  265. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  266. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
  267. package/oclif.manifest.json +21 -4
  268. package/package.json +3 -3
  269. package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
  270. package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  271. package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  272. package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  273. package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  274. package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
  275. package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  276. package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  277. package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  278. package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  279. package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
  280. package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  281. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  282. package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  283. package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
  284. package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  285. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
  286. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
  287. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  288. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  289. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  290. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  291. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
  292. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
  293. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  294. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  295. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  296. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  297. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
  298. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
  299. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  300. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  301. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  302. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
  303. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
  304. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  305. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
  306. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
  307. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/jobs.md +0 -0
  308. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
  309. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
  310. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
  311. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
  312. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
  313. /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
@@ -0,0 +1,85 @@
1
+ # Performance self-review checklist
2
+
3
+ Run this on your own diff before you call a change done, especially when it adds a loader, fetcher, Suspense boundary, modal, context or action. For each section, find the relevant lines in the diff, answer the questions, and fix what fails. Related docs in your project: `docs/README-DATA.md`, `docs/README-SUSPENSE.md`, `docs/README-REVALIDATION.md`, `docs/README-PERFORMANCE.md`.
4
+
5
+ Impact of a problem is roughly: traffic of the page x instances of the component on it x cost of one occurrence. A fetch in a product tile on a listing page multiplies by every tile; a layout loader re-run multiplies by every action on every page.
6
+
7
+ ## 1. Fetch efficiency
8
+
9
+ Map the fetch topology for each user gesture (load, navigation, add to cart, open modal): which loaders, fetchers and SCAPI calls run, and in what order.
10
+
11
+ - [ ] Overlapping loaders: do two active loaders read the same resource? Move it to the lowest common layout and share via `useRouteLoaderData`.
12
+ - [ ] Dependent data chained across round trips (fetch A, then B using A, then enrichment) belongs in one loader, with independent calls started in parallel first.
13
+ - [ ] Write-in-read: does a GET path create or mutate server state (for example "get or create basket")? Reads called from many places then race or duplicate writes. Separate creation from reads.
14
+ - [ ] Prefetch and consume: if one component prefetches and another consumes the same data, they must share one fetcher key, or the data is fetched twice.
15
+ - [ ] Unstable references in effect dependencies (object or array literals, fresh callbacks) re-fire fetches on every render. Depend on primitives or stable refs.
16
+ - [ ] Fetcher hooks inside list items: N items means N registered fetchers and, when they load on mount, N requests. A `useFetcher` used only on interaction is not amplification; one that loads on mount is. Lift the data into the parent loader or a single batched call (`fetchProductsByIds`).
17
+ - [ ] Payload: only the `expand`/`select` values the UI renders.
18
+
19
+ ## 2. Fetcher misuse
20
+
21
+ Is this a fetcher that should be a loader?
22
+
23
+ - [ ] A fetch on mount or render whose inputs are known at request time (route params, search params, cookies, context) belongs in the loader. This includes indirect forms: `useEffect` calls an async function that calls `fetch` or `fetcher.load()`, and fetches inside error fallbacks.
24
+ - [ ] Does the component ignore `loaderData` and re-fetch the same data? Use the loader data.
25
+ - [ ] Legitimate uses: gesture-gated loads (click, hover, open), client-only inputs (geolocation, local selection), re-fetching after a mutation, intent-based prefetch.
26
+
27
+ ## 3. Suspense placement
28
+
29
+ - [ ] Every `use(promise)` and `<Await>` has a `<Suspense>` ancestor.
30
+ - [ ] The boundary is as low as possible: it wraps only the subtree that reads the promise, not the page or layout.
31
+ - [ ] The fallback reserves the final size (no layout shift) and is not `null` above the fold without reserved space.
32
+
33
+ ## 4. Suspense granularity
34
+
35
+ - [ ] Independent consumers have sibling boundaries, so a slow promise does not hold back a fast one.
36
+ - [ ] One logical unit that must appear together shares one boundary and one promise composed in the loader.
37
+ - [ ] No boundary wrapped around content that is already resolved.
38
+
39
+ ## 5. Promise stability
40
+
41
+ A new promise object on each render restarts suspension and flashes the fallback.
42
+
43
+ - [ ] Stable sources only: `loaderData`, `useRouteLoaderData`, `useOutletContext`, props derived from them, `useRef`, `useState` lazy-pinned, module constants.
44
+ - [ ] No `Promise.all/race/allSettled`, `.then/.catch/.finally`, `new Promise`, or async IIFE in render. No `useMemo` around a promise.
45
+ - [ ] Fixes: compose and transform in the loader (`.then` there); split into separate boundaries; pin with `useState(() => ...)` or re-pin with `useRef` keyed on inputs.
46
+
47
+ ## 6. Hydration and render stability
48
+
49
+ Render scope should not exceed data-change scope.
50
+
51
+ - [ ] Values read only inside event handlers or callbacks live in `useRef`, or are read at call time (for example `matchMedia` inside the handler), not in state or Context.
52
+ - [ ] Hidden subscribers: components that subscribe to a store but render nothing visible still re-render; return `null` early or move the subscription to the component that renders.
53
+ - [ ] Context values are memoized (`useMemo`/`useCallback`); check every field each consumer reads during render, and split state from updaters.
54
+ - [ ] Subscriptions sit at the consumer, or in a render-nothing manager that writes to a ref/store.
55
+ - [ ] `useSyncExternalStore`: `getServerSnapshot` matches the first client render; `getSnapshot` returns a stable reference when nothing changed.
56
+
57
+ ## 7. Revalidation scope
58
+
59
+ After an action, every active loader re-runs by default.
60
+
61
+ - [ ] For each new or changed action and each active loader (matched chain, mounted resource fetchers, open modals and drawers): is there overlap (does the result change what the loader reads) and is the value otherwise unavailable (provider not already updated)? If either is false, gate the loader with `shouldRevalidate`.
62
+ - [ ] Confirm the trigger is a real submission (`Form`, `useSubmit`, `fetcher.submit`). Raw `fetch` or SCAPI client calls trigger nothing.
63
+ - [ ] Modals and drawers count twice: as targets (fetchers they load when open) and as triggers (actions they submit). Unmount them when closed (`useDeferredUnmount`).
64
+ - [ ] A gate must inspect the action path or `actionResult`; checking only that `formAction` is set still re-runs on everything.
65
+ - [ ] Do not gate off a re-run that is the sync mechanism for a provider.
66
+
67
+ See `storefront-next:sfnext-revalidation`.
68
+
69
+ ## 8. Client-side transforms
70
+
71
+ - [ ] Shape data in the loader, not during render: lookup maps, chained filter/map passes, deep spreads, slug or URL normalization.
72
+ - [ ] `useMemo` does not fix transforming loader data on every mount; move it to the loader.
73
+ - [ ] Exceptions: values derived from UI state (selected variant, local filter), and work inside event handlers.
74
+
75
+ ## 9. Also check
76
+
77
+ - [ ] Images: LCP image has `priority="high"` and is not lazy; `widths` match the layout.
78
+ - [ ] New dependency: check bundle impact with `pnpm bundlesize`; lazy-load heavy, hidden UI.
79
+ - [ ] Third-party scripts: `async` or `defer`, loaded after consent where required.
80
+ - [ ] New preconnect only for origins used on every page.
81
+ - [ ] Added routes export the right `shouldRevalidate`.
82
+
83
+ ## Reporting
84
+
85
+ For each finding note where it is (file and line), the rule it breaks, who pays (every shopper, every tile, every action), and the smallest fix. Prefer fixing the highest-multiplier problems first.
@@ -0,0 +1,58 @@
1
+ # Suspense and streaming recipes
2
+
3
+ Read `docs/README-SUSPENSE.md` in your project for the full guide.
4
+
5
+ ## Placement
6
+
7
+ Every component that calls `use(promise)` or renders `<Await>` must sit under a `<Suspense>`. Place the boundary as low as possible, around only the subtree that reads the promise, so the rest of the page is not held back. A consumer with no boundary above it suspends the nearest ancestor (often the whole route) and blocks the shell.
8
+
9
+ ```tsx
10
+ // Bad: boundary wraps the page; one slow promise hides everything
11
+ <Suspense fallback={<PageSkeleton />}><Page /></Suspense>
12
+
13
+ // Good: boundary wraps only the reader
14
+ <Header />
15
+ <Suspense fallback={<ReviewsSkeleton />}><Reviews promise={loaderData.reviews} /></Suspense>
16
+ ```
17
+
18
+ ## Granularity
19
+
20
+ - Independent data: sibling boundaries, so each resolves on its own.
21
+ - One logical unit that must appear together: one promise composed in the loader, one boundary.
22
+ - Do not nest a boundary per field of one entity; do not share one boundary across unrelated promises.
23
+
24
+ ## Promise stability
25
+
26
+ Stable sources: `loaderData`, `useRouteLoaderData`, `useOutletContext`, props passed from those, `useRef`, `useState` lazy pinned, module-level constants.
27
+
28
+ Unstable (new identity each render): `Promise.all/race/allSettled` in render, `.then`/`.catch`/`.finally` chains in render, `new Promise`, async IIFEs, `useMemo(() => promise)`.
29
+
30
+ Fixes:
31
+
32
+ ```ts
33
+ // in the loader: compose there
34
+ const summary = Promise.all([a(), b()]).then(([x, y]) => ({ x, y }));
35
+ return { summary };
36
+ ```
37
+
38
+ ```tsx
39
+ // component-local promise that depends on props: pin it
40
+ const [promise] = useState(() => fetchSomething(id)); // lazy pin, fixed for mount
41
+ // or re-pin only when the key changes
42
+ const ref = useRef<{ key: string; p: Promise<Data> }>();
43
+ if (ref.current?.key !== id) ref.current = { key: id, p: fetchSomething(id) };
44
+ ```
45
+
46
+ Client-side `fetchSomething` here must be a fetcher-driven or already-started promise; prefer composing in the loader whenever the data is knowable there.
47
+
48
+ ## Skeletons
49
+
50
+ Size the skeleton to the final content (same height and grid) to avoid layout shift. For listing grids reuse the product-grid skeleton and `DeferredProductGrid`.
51
+
52
+ ## Critical Page Designer regions
53
+
54
+ Page-level LCP region: `await` the page in the loader and render `<Region critical>` (no region fallback element). Component-level data inside keeps its own boundaries.
55
+
56
+ ## Errors in streamed data
57
+
58
+ A rejected promise reaches the nearest `errorElement` on `<Await>` or the route `ErrorBoundary`. For optional sections use `errorElement={null}` and log in the loader; for important ones show an inline retry.
@@ -1,160 +1,147 @@
1
1
  ---
2
2
  name: sfnext-project-setup
3
- description: Create and configure Storefront Next projects. Use when creating a new storefront, understanding project structure, setting up environment variables, or running the sfnext CLI for the first time. Covers project creation, directory layout, .env configuration, and sfnext CLI basics.
3
+ description: >-
4
+ Create and bootstrap a Storefront Next project, and learn its layout, npm scripts, and first-run workflow.
5
+ Use when creating a new storefront, running `sfnext create-storefront` (`--vertical` starter theme, `--defaults`,
6
+ `--template`, `--output-dir`), choosing between Business Manager Storefront Setup and the CLI, fixing
7
+ `pnpm install` / Node 24 problems, copying `.env.default` to `.env`, asking "what does this folder do" or
8
+ "which pnpm script do I run", or running `b2c sfnext` / `pnpm sfnext` commands for the first time.
9
+ Do not use for config.server.ts or PUBLIC__ env var rules (use `storefront-next:sfnext-configuration`),
10
+ building/pushing to Managed Runtime (use `storefront-next:sfnext-deployment`), or a conceptual tour of the
11
+ architecture (use `storefront-next:sfnext-overview`).
4
12
  ---
5
13
 
6
- # Project Setup Skill
14
+ # Storefront Next Project Setup
7
15
 
8
- This skill guides you through creating and configuring a Storefront Next project — a server-rendered SPA built on React 19, React Router 7, Vite, and Tailwind CSS v4.
16
+ A Storefront Next project is a server-rendered React 19 / React Router 7 / Vite / Tailwind v4 app that runs on Managed Runtime (MRT). All SCAPI calls run server-side. You own the project code after it is created.
9
17
 
10
- ## Overview
18
+ **Read the project's own `AGENTS.md` first.** It ships in every project (`CLAUDE.md` is a copy) and is the authority for data-loading, Suspense, state, image, and navigation rules. This skill never overrides it. Detailed guides live in the project's `docs/README-*.md`.
11
19
 
12
- Storefront Next storefronts run on Managed Runtime (MRT) with all SCAPI requests executing server-side. Use Business Manager storefront setup for an instance-connected storefront; use `create-storefront` for local exploration. Project application source uses TypeScript (`.ts`/`.tsx`); follow the project's configuration for build scripts.
20
+ ## Prerequisites
13
21
 
14
- ## Creating a Project
22
+ - Node.js >= 24 (`package.json` `engines`; MRT also runs Node 24)
23
+ - pnpm >= 10.28
24
+ - A B2C Commerce instance with a SLAS public client, your organization ID, and the SCAPI short code (unless you only want the bundled demo backend)
15
25
 
16
- ### Via Business Manager (instance-connected storefront)
26
+ ## Choose how to start
17
27
 
18
- Prefer storefront setup: it creates API clients, MRT resources, initial configuration,
19
- and a deployment. Reuse those resources; do not create replacement SLAS clients or
20
- MRT projects as routine setup. Choose the [GitHub workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm-github.html)
21
- or [local-code workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm.html).
22
- Use the downloaded `env.txt` as the project's `.env`; do not invent tenant/site IDs
23
- or expose its secrets. Guide the user through Business Manager when setup is needed.
28
+ | Path | Use when |
29
+ | --- | --- |
30
+ | Business Manager **Storefront Setup** (GitHub or local-code workflow) | You want an instance-connected storefront. It creates the SLAS client, the MRT project/environments, initial config, and a first deployment. Reuse those resources; do not create replacement SLAS clients or MRT projects as routine setup. Use the downloaded `env.txt` as `.env`. Guides: [GitHub workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm-github.html), [local-code workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm.html) |
31
+ | `sfnext create-storefront` | You want a fresh local project from a starter theme, with your own extension selection and credentials |
32
+ | Clone / "Use this template" of a published starter repo | You prefer plain git; the project README lists the starter repositories |
24
33
 
25
- ### Via CLI (local exploration)
34
+ Never invent tenant/site IDs and never echo secrets from `env.txt`.
26
35
 
27
- Use for template exploration without provisioning instance resources. To connect
28
- to the user's instance, follow storefront setup above and use its configuration.
36
+ ## Create a project with the CLI
29
37
 
30
38
  ```bash
31
- # Create a new storefront project (interactive)
39
+ # Interactive: pick a starter theme, name, extensions, and credentials
32
40
  pnpm dlx @salesforce/storefront-next-dev create-storefront
41
+ # or, with the b2c CLI (auto-installs the sfnext plugin on first use)
42
+ b2c sfnext create-storefront
33
43
 
34
- # Or create with a name flag
35
- pnpm dlx @salesforce/storefront-next-dev create-storefront --name my-storefront
36
-
37
- # Navigate into the project
38
- cd my-storefront
39
-
40
- # Install dependencies
41
- pnpm install
42
-
43
- # Start development server
44
- pnpm dev
45
- ```
46
-
47
- ## Project Structure
48
-
49
- ```
50
- my-storefront/
51
- ├── .env.default # Default environment variables (template)
52
- ├── .env # Local overrides (git-ignored)
53
- ├── config.server.ts # Centralized configuration with defaults
54
- ├── vite.config.ts # Vite build configuration
55
- ├── package.json # Dependencies and scripts
56
- ├── src/
57
- │ ├── app.css # Global styles and Tailwind theme
58
- │ ├── root.tsx # Root layout component
59
- │ ├── routes/ # File-based routes (React Router 7)
60
- │ │ ├── _app.tsx # App layout (authenticated shell)
61
- │ │ ├── _app._index.tsx # Home page
62
- │ │ └── _app.product.$productId.tsx
63
- │ ├── components/ # Reusable UI components
64
- │ │ ├── ui/ # shadcn/ui base components (customizable)
65
- │ │ └── ... # Custom components
66
- │ ├── config/ # Configuration schema and context
67
- │ │ └── schema.ts # Config type definitions
68
- │ ├── lib/ # Utilities and API client setup
69
- │ │ ├── api-clients.ts # createApiClients() factory
70
- │ │ ├── utils.ts # cn() utility and helpers
71
- │ │ └── registry.ts # Page Designer component registry
72
- │ ├── locales/ # Translation files
73
- │ │ └── en-US/
74
- │ │ └── translations.json
75
- │ ├── middlewares/ # Server middleware
76
- │ │ ├── auth.server.ts # Authentication middleware
77
- │ │ └── basket.server.ts # Basket middleware
78
- │ ├── providers/ # React context providers
79
- │ ├── hooks/ # Custom React hooks
80
- │ ├── extensions/ # Extension modules
81
- │ └── test-utils/ # Shared test utilities
82
- ├── public/ # Static assets
83
- └── cartridges/ # Page Designer cartridge metadata
44
+ # Non-interactive
45
+ sfnext create-storefront -n my-storefront --vertical cosmetic -o ./projects
46
+ sfnext create-storefront -n my-storefront --defaults
84
47
  ```
85
48
 
86
- See [Project Structure Reference](references/PROJECT-STRUCTURE.md) for detailed directory explanations.
49
+ | Flag | Meaning |
50
+ | --- | --- |
51
+ | `-n, --name` | Project name |
52
+ | `-V, --vertical` | Starter theme: `fashion` (default with `--defaults`), `cosmetic`, `foundations`, `footwear`, `furniture`, `luxury` |
53
+ | `-t, --template` | Template repo URL or local path (overrides `--vertical`) |
54
+ | `-b, --template-branch` | Branch or tag to clone |
55
+ | `-d, --defaults` | Accept all defaults, no prompts (CI) |
56
+ | `-o, --output-dir` | Where to create the project |
87
57
 
88
- ## Environment Setup
58
+ What it does: shallow-clones the chosen starter, removes `.git`, asks which **extensions** to keep (and trims the rest; manage them later with `sfnext extensions ...`, see `storefront-next:sfnext-extensions`), prompts for the values in `config-meta.json` (SLAS client ID, organization ID, short code), and writes `.env` from `.env.default`.
89
59
 
90
- For Business Manager-created storefronts, use the downloaded configuration.
91
- For local CLI exploration, copy `.env.default` to `.env`:
60
+ Then:
92
61
 
93
62
  ```bash
94
- cp .env.default .env
63
+ cd my-storefront
64
+ pnpm install
65
+ pnpm dev # http://localhost:5173
95
66
  ```
96
67
 
97
- ### Required Variables
68
+ ## First run
98
69
 
99
- Use values from the selected storefront. This is a configuration example, not a
100
- request to provision new credentials. See Salesforce's [Environment Variables](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html)
101
- for public/server-only visibility and supported paths.
70
+ `.env.default` ships with a public demo backend so `cp .env.default .env && pnpm dev` boots. **Only `.env` is read**; `.env.default` is never loaded. Replace the three required values with your own before pointing at real data:
102
71
 
103
72
  ```bash
104
- PUBLIC__app__commerce__api__clientId=your-client-id
105
- PUBLIC__app__commerce__api__organizationId=your-org-id
106
- PUBLIC__app__commerce__api__siteId=your-site-id
107
- PUBLIC__app__commerce__api__shortCode=your-short-code
108
- PUBLIC__app__defaultSiteId=your-site-id
109
- PUBLIC__app__commerce__sites='[{"id":"your-site-id","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"}],"supportedCurrencies":["USD"]}]'
73
+ PUBLIC__app__commerce__api__clientId=...
74
+ PUBLIC__app__commerce__api__organizationId=...
75
+ PUBLIC__app__commerce__api__shortCode=...
110
76
  ```
111
77
 
112
- See [Environment Variables Reference](references/ENV-VARIABLES.md) for the complete variable list and naming rules.
78
+ Restart the dev server after editing `.env`. Dev fails fast if the short code is missing. Everything else has defaults in `config.server.ts`; see `storefront-next:sfnext-configuration`. If the project should target your own site, also set `PUBLIC__app__defaultSiteId` and `PUBLIC__app__commerce__sites` (JSON array) as described there.
113
79
 
114
- ## Development Commands
80
+ Before shipping, run through the pre-launch gate in `storefront-next:sfnext-deployment` (demo analytics IDs, staging image host, demo credentials).
115
81
 
116
- ```bash
117
- # Start development server with hot reload
118
- pnpm dev
82
+ ## Project layout (short form)
119
83
 
120
- # Build for production
121
- pnpm build
84
+ ```
85
+ my-storefront/
86
+ ├── AGENTS.md / CLAUDE.md # Rules for coding agents -- read first
87
+ ├── config.server.ts # All app config defaults (metadata / runtime / app)
88
+ ├── config-meta.json # Values create-storefront prompts for
89
+ ├── .env.default, .env # Required credentials; only .env is loaded
90
+ ├── package.json # Scripts + storefrontNext version stamp
91
+ ├── react-router.config.ts, vite.config.ts, vite-plugins/
92
+ ├── src/
93
+ │ ├── routes/ # Flat file routes (_app.*, _checkout.*, _empty.*, action.*, resource.*)
94
+ │ ├── components/ (ui/ = primitives), hooks/, providers/, lib/, middlewares/
95
+ │ ├── extensions/ # Optional feature modules + config.json registry
96
+ │ ├── theme/ # index.css entry, tokens/, overrides/
97
+ │ ├── locales/ # <lang-REGION>/translations.json
98
+ │ ├── scapi/ # Generated + custom SCAPI clients
99
+ │ ├── targets/ # UI target (extension point) system
100
+ │ └── types/config.ts # AppConfig type
101
+ ├── cartridges/app_storefrontnext_base # Page Designer metadata cartridge
102
+ ├── docs/ # README-*.md guides, COMPATIBILITY.md, migrations/
103
+ ├── instructions/ # Extension install/uninstall guides (.mdc)
104
+ ├── e2e/ # Playwright suite (own package)
105
+ └── public/
106
+ ```
122
107
 
123
- # Run tests
124
- pnpm test
108
+ See [PROJECT-STRUCTURE.md](references/PROJECT-STRUCTURE.md) for route families, key files, and where to go for each concern.
125
109
 
126
- # Run Storybook
127
- pnpm storybook
110
+ ## Scripts and CLI
128
111
 
129
- # Check bundle size
130
- pnpm bundlesize:test
131
- ```
112
+ Run `pnpm <script>`. The most used: `dev`, `build`, `start` (preview the production build on :3000), `typecheck`, `lint`, `test`, `push`, `cartridge:generate|validate|deploy`, `config:inspect`, `config:push-env`, `bundlesize`, `storybook`. Full table in [SCRIPTS.md](references/SCRIPTS.md). The project's `package.json` `scripts` is the source of truth; grep it instead of guessing.
113
+
114
+ The `sfnext` binary (from `@salesforce/storefront-next-dev`, already a project dependency) is also reachable as `pnpm sfnext <cmd>` or `b2c sfnext <cmd>` (the b2c CLI prefers the project-local copy when run inside the project). Command reference: [SFNEXT-CLI.md](references/SFNEXT-CLI.md). The template also exposes `pnpm b2c` for the b2c CLI.
132
115
 
133
- ## Non-Negotiable Rules
116
+ ## Conventions worth knowing up front
134
117
 
135
- 1. **TypeScript only** — `.ts` and `.tsx` files; JavaScript files are blocked by ESLint
136
- 2. **Server-only data loading** — Use `loader` functions; never use client loaders
137
- 3. **Synchronous loaders** — Return promises, do not use `async`/`await` (enables streaming)
138
- 4. **Tailwind CSS 4 only** — No inline styles, CSS modules, or separate CSS files
139
- 5. **Use `createPage()` HOC** — Standardizes page patterns with Suspense
118
+ - Application code is TypeScript/TSX only (`node scripts/check-typescript-only.js` flags stray `.js`). Linting is OxLint (`pnpm lint`, zero warnings), formatting is Biome (`pnpm format`).
119
+ - Imports use the `@/` alias to `src/`. Server-only modules are suffixed `.server.ts`.
120
+ - Use the site-aware `Link`/`NavLink` from `@/components/link` and `useNavigate` from `@/hooks/use-navigate`, not the React Router originals.
121
+ - Server `loader`/`action` only; no `clientLoader`/`clientAction`. Await only critical data; return non-critical data as promises (`storefront-next:sfnext-data-fetching`).
122
+ - Version compatibility between your project and the SDK: `package.json#storefrontNext` and `docs/COMPATIBILITY.md`.
140
123
 
141
124
  ## Troubleshooting
142
125
 
143
- | Issue | Cause | Solution |
144
- | ----------------------- | ----------------------------------- | ----------------------------------------------------- |
145
- | SCAPI 401 errors | Missing or invalid credentials | Verify `.env` variables match your Commerce Cloud org |
146
- | JavaScript file errors | `.js`/`.jsx` files in source | Rename to `.ts`/`.tsx`; ESLint blocks JS files |
147
- | Dev server not starting | Missing dependencies | Run `pnpm install` |
148
- | Config not loading | Missing `config.server.ts` defaults | Define defaults before using environment overrides |
126
+ | Symptom | Cause / fix |
127
+ | --- | --- |
128
+ | `pnpm install` fails or engine warning | Node < 24 or pnpm < 10.28; upgrade both |
129
+ | Dev server exits immediately about short code | `PUBLIC__app__commerce__api__shortCode` missing in `.env` (not `.env.default`) |
130
+ | SCAPI 401/403 | Client ID / organization ID / short code do not match the same org, or the SLAS client lacks scopes; run `sfnext setup-base-cartridge --slas-client-id <id>` only if the base cartridge scopes are the issue |
131
+ | `.env` change ignored | Restart `pnpm dev`; check with `pnpm config:inspect` |
132
+ | Unknown `sfnext` command via `b2c` | First use installs the plugin; run inside the project so the local copy is used |
149
133
 
150
- ## Related Skills
134
+ ## Finding more
151
135
 
152
- - `storefront-next:sfnext-configuration` - Ongoing configuration management and multi-site setup
153
- - `storefront-next:sfnext-routing` - File-based routing conventions
154
- - `storefront-next:sfnext-data-fetching` - Server-side data loading patterns
155
- - `storefront-next:sfnext-deployment` - Building and deploying to MRT
136
+ - Project `AGENTS.md` doc index and `docs/README-*.md`
137
+ - `b2c docs search "<topic>" --category sfnext` (or MCP `docs_search`) for the published Storefront Next guides
156
138
 
157
- ## Reference Documentation
139
+ ## Related Skills
158
140
 
159
- - [Project Structure Reference](references/PROJECT-STRUCTURE.md) - Detailed directory and file explanations
160
- - [Environment Variables Reference](references/ENV-VARIABLES.md) - Complete variable list and naming rules
141
+ - `storefront-next:sfnext-overview` - Architecture and concept tour
142
+ - `storefront-next:sfnext-configuration` - config.server.ts, PUBLIC__ env vars, multi-site URLs
143
+ - `storefront-next:sfnext-deployment` - Build, push to MRT, cartridge deploy, pre-launch gate
144
+ - `storefront-next:sfnext-routing` - File routes and site-aware links
145
+ - `storefront-next:sfnext-extensions` - Install, remove, and create extensions
146
+ - `storefront-next:sfnext-theming` - Rebranding `src/theme/`
147
+ - `b2c-cli:b2c-mrt` - Generic MRT project/environment management
@@ -1,99 +1,61 @@
1
- # Project Structure Reference
2
-
3
- ## Top-Level Files
4
-
5
- | File | Purpose |
6
- | ------------------ | ------------------------------------------------------------------------------------------ |
7
- | `config.server.ts` | Centralized configuration with typed defaults; environment variables override these values |
8
- | `.env.default` | Template of all supported environment variables; copy to `.env` for local development |
9
- | `.env` | Local environment overrides (git-ignored) |
10
- | `vite.config.ts` | Vite build configuration including plugins (static registry, etc.) |
11
- | `package.json` | Dependencies, scripts, and bundle size limits (`bundlesize` config) |
12
- | `tsconfig.json` | TypeScript configuration with `@/` path alias mapping to `src/` |
13
-
14
- ## Source Directory (`src/`)
15
-
16
- ### `src/routes/`
17
-
18
- File-based routing using React Router 7 flat-routes convention. File names map to URL paths:
19
-
20
- | File | URL |
21
- | ----------------------------------- | ------------------------------------ |
22
- | `_app.tsx` | Layout wrapper (no URL segment) |
23
- | `_app._index.tsx` | `/` (home page) |
24
- | `_app.product.$productId.tsx` | `/product/:productId` |
25
- | `_app.category.$categoryId.tsx` | `/category/:categoryId` |
26
- | `_app.cart.tsx` | `/cart` |
27
- | `resource.api.client.$resource.tsx` | Resource route for `useScapiFetcher` |
28
-
29
- Each route module can export: `loader`, `action`, `default` (component), `meta`, `handle`, `ErrorBoundary`.
30
-
31
- ### `src/components/`
32
-
33
- Reusable UI components organized in directories:
34
-
35
- ```
36
- src/components/product-tile/
37
- ├── index.tsx # Component implementation
38
- ├── index.test.tsx # Vitest unit tests
39
- └── stories/
40
- └── index.stories.tsx # Storybook stories
41
- ```
42
-
43
- **`src/components/ui/`** — shadcn/ui components added via `npx shadcn@latest add <name>`. These are copied into your codebase and can be customized directly.
44
-
45
- ### `src/config/`
46
-
47
- Configuration system:
48
-
49
- - `schema.ts` — TypeScript type definitions for the config shape
50
- - `context.tsx` — React context provider (`ConfigProvider`) and `useConfig()` hook
51
- - `index.ts` — Exports `getConfig()` and `useConfig()`
52
-
53
- ### `src/lib/`
54
-
55
- Utilities and shared logic:
56
-
57
- - `api-clients.ts` — `createApiClients(context)` factory for SCAPI clients
58
- - `utils.ts` — `cn()` class name utility (merges Tailwind classes)
59
- - `registry.ts` — Page Designer component registry
60
- - `static-registry.ts` — Auto-generated by Vite plugin (do not edit)
61
-
62
- ### `src/locales/`
63
-
64
- Translation files organized by locale:
65
-
66
- ```
67
- src/locales/
68
- ├── en-US/translations.json
69
- ├── de-DE/translations.json
70
- └── fr-FR/translations.json
71
- ```
72
-
73
- ### `src/middlewares/`
74
-
75
- Server middleware:
76
-
77
- - `auth.server.ts` — SLAS authentication, token management, `getAuth(context)`
78
- - `basket.server.ts` — Basket middleware and request-context basket resource helpers
79
-
80
- ### `src/extensions/`
81
-
82
- Extension modules with their own routes, components, translations, and providers. Extensions typically include `target-config.json` (for `targetId` component/provider insertion) and are registered in `src/extensions/config.json`.
83
-
84
- ### `src/test-utils/`
85
-
86
- Shared test utilities:
87
-
88
- - `config.ts` — Mock configuration for tests
89
- - `context-provider-utils.ts` — Context provider helpers
90
- - `context-provider.tsx` — Test wrapper providers
91
-
92
- ## Build Output
93
-
94
- - `build/` — Production build output (server and client bundles)
95
- - `coverage/` — Test coverage reports
96
-
97
- ## Cartridges
98
-
99
- - `cartridges/` — Page Designer cartridge with experience metadata (component/page JSON definitions generated by MCP tools)
1
+ # Project Structure
2
+
3
+ A short map of a Storefront Next project. The project's `AGENTS.md` ("Project Structure") is authoritative and kept current; use `ls` on the project rather than trusting any long listing, including this one.
4
+
5
+ ## Top level
6
+
7
+ | Path | Purpose |
8
+ | --- | --- |
9
+ | `AGENTS.md`, `CLAUDE.md` | Rules and doc index for coding agents |
10
+ | `config.server.ts` | Typed defaults for the whole app (`metadata`, `runtime`, `app`). Edited by you; overridden per environment with `PUBLIC__` env vars |
11
+ | `config-meta.json`, `config-metadata/` | Values `sfnext create-storefront` prompts for; config metadata |
12
+ | `.env.default` / `.env` | Required credentials and MRT target. Only `.env` is read |
13
+ | `package.json` | Scripts, dependencies, and `storefrontNext` (`templateRelease`, `templateVersion`, `minSdkVersion`) |
14
+ | `react-router.config.ts`, `vite.config.ts`, `vite-plugins/` | Framework and build config; plugins for bundle size, env validation, hybrid proxy, server-only-config guard |
15
+ | `components.json` | shadcn config (CSS entry is `src/theme/index.css`) |
16
+ | `cartridges/app_storefrontnext_base/` | Base cartridge; Page Designer metadata is generated into it |
17
+ | `docs/` | `README-*.md` guides, `COMPATIBILITY.md`, `migrations/` upgrade guides |
18
+ | `instructions/` | Install/uninstall instructions for extensions (`.mdc`) |
19
+ | `e2e/` | Playwright end-to-end and accessibility suite (its own package) |
20
+ | `scripts/` | Helper scripts behind `lint:a11y`, `lint:css`, `bundlesize:compare`, `storybook:test`, `extensions:list`, ... |
21
+ | `.storybook/`, `.github/`, `.devcontainer/`, `.claude/skills/sync-shadcn` | Storybook, CI workflows, dev container, in-project skill for syncing shadcn primitives |
22
+ | `public/` | Static assets (fonts, images, robots.txt, favicon) |
23
+
24
+ ## `src/`
25
+
26
+ | Path | Notes |
27
+ | --- | --- |
28
+ | `routes/` | Flat file routes. Families: `_app.*` (storefront shell), `_checkout.*`, `_empty.*` (login, signup, maintenance; minimal chrome), `action.*` (server mutations), `resource.*` (resource routes). Products and categories are splats: `_app.p.$.tsx`, `_app.c.$.tsx`. Orders use `$orderNo`. See `storefront-next:sfnext-routing` |
29
+ | `routes.ts`, `route-paths.ts` | Route registration and typed path helpers (`routeHref`) |
30
+ | `root.tsx`, `entry.client.tsx`, `entry.server.tsx`, `app-wrapper.tsx` | App shell and entry points. `root.tsx` imports `src/theme/index.css` |
31
+ | `components/` | Feature components; `components/ui/` holds UI primitives you own; `components/link` is the site-aware `Link`/`NavLink` |
32
+ | `hooks/` | Includes `use-navigate` and `use-current-site-and-locale-ref` |
33
+ | `providers/` | React context providers |
34
+ | `lib/` | Domain folders (`auth/`, `cart/`, `checkout/`, `product/`, `order/`, ...), `api-clients.server.ts` (`createApiClients(context)`), `url.server.ts` (`buildUrlFromContext`), `page-designer/` (registry, loader), `decorators/`, `revalidation/` |
35
+ | `middlewares/` | Server middlewares (`app-config`, `site-context`, `i18next`, `auth`, `basket`, `security-headers`, `logging`, ...). Ordering is in `src/server/middleware-registry.ts` |
36
+ | `scapi/` | Generated and custom SCAPI clients (`@/scapi` barrel); see `storefront-next:sfnext-scapi` |
37
+ | `extensions/` | Optional feature modules; `config.json` is the extension registry; per-extension `config.ts` / `server-config.ts` feed app config |
38
+ | `targets/` | UI target (extension point) system |
39
+ | `theme/` | `index.css` entry, `base.css`, `tailwind.css`, `tokens/`, `overrides/`, `animations.css`; see `storefront-next:sfnext-theming` |
40
+ | `locales/` | One folder per language-region (`en-US`, `de-DE`, ...) with `translations.json`; see `storefront-next:sfnext-i18n` |
41
+ | `types/config.ts` | `AppConfig` / `Config` types and the `getConfig` / `useConfig` type augmentation |
42
+ | `analytics/`, `design-system/`, `test-utils/` | Tracking components, design-system docs stories, shared test helpers (`@/test-utils/config`, `context-provider`, `request-helpers`, ...) |
43
+
44
+ ## Where to look for each concern
45
+
46
+ | Concern | Start here |
47
+ | --- | --- |
48
+ | Data loading, Suspense, state, images | `AGENTS.md` "Performance & Data Rules", `docs/README-DATA.md`, `README-SUSPENSE.md`, `README-STATE.md` |
49
+ | All config options | `docs/README-CONFIG.md` (required/optional tables), `docs/README-CONFIG-OPTIONS.md` |
50
+ | Multi-site, locale URLs, SEO routes | `docs/README-MULTI-SITE.md` |
51
+ | Auth and cookies | `docs/README-AUTH.md` |
52
+ | Page Designer | `docs/README-PAGE-DESIGNER.md` |
53
+ | Upgrading | `docs/COMPATIBILITY.md`, `docs/migrations/` |
54
+
55
+ ## Page Designer metadata
56
+
57
+ Component metadata is generated from decorators by `pnpm cartridge:generate` (also run by `pnpm build`) into `cartridges/app_storefrontnext_base/`, validated with `pnpm cartridge:validate`, and deployed to the B2C instance with `pnpm cartridge:deploy` (not part of `pnpm push`). See `storefront-next:sfnext-deployment` and `storefront-next:sfnext-page-designer`.
58
+
59
+ ## Adding UI primitives
60
+
61
+ The project ships an in-project `sync-shadcn` skill (`.claude/skills/sync-shadcn`) and `scripts/upgrade-shadcn.js` for pulling updated shadcn primitives into `src/components/ui/` without losing local changes. Prefer that over a raw `npx shadcn add`.