@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.
- package/bin/run.js +5 -9
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +4 -4
- package/content/guidance/b2c/b2c-ordering/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +3 -3
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +6 -6
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +31 -21
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +23 -2
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +2 -2
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +2 -2
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +4 -4
- package/content/guidance/index.json +935 -258
- package/content/guidance/mcp/{cip → b2c-mcp-cip}/SKILL.md +10 -8
- package/content/guidance/mcp/{b2c-config → b2c-mcp-config}/SKILL.md +10 -9
- package/content/guidance/mcp/{debugger → b2c-mcp-debugger}/SKILL.md +9 -8
- package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/SKILL.md +81 -10
- package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +49 -25
- package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
- package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +86 -79
- package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
- package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/content/guidance/storefront-next/sfnext-components/SKILL.md +98 -136
- package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
- package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +116 -113
- package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +100 -150
- package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +83 -97
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +73 -97
- package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +96 -131
- package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
- package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
- package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +152 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/content/guidance/storefront-next/sfnext-performance/SKILL.md +75 -105
- package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +103 -116
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
- package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/content/guidance/storefront-next/sfnext-routing/SKILL.md +86 -143
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
- package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
- package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
- package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
- package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +80 -89
- package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +105 -138
- package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
- package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/dist/commands/mcp.d.ts +8 -2
- package/dist/commands/mcp.js +54 -20
- package/dist/guidance.d.ts +4 -1
- package/dist/guidance.js +23 -5
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +3 -3
- package/dist/server.d.ts +10 -0
- package/dist/server.js +21 -0
- package/dist/skill-references.js +5 -5
- package/dist/tools/cartridges/index.js +1 -0
- package/dist/tools/cip/index.js +6 -3
- package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
- package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
- package/dist/tools/diagnostics/debug-start-session.js +1 -1
- package/dist/tools/scapi/index.d.ts +4 -1
- package/dist/tools/scapi/index.js +4 -2
- package/dist/tools/scapi/scapi-code.d.ts +2 -2
- package/dist/tools/scapi/scapi-code.js +17 -61
- package/dist/utils/types.d.ts +6 -0
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +20 -0
- package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +31 -21
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
- package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
- package/oclif.manifest.json +21 -4
- package/package.json +3 -3
- package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
- package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
- package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
- package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
- package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/jobs.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
- /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
# Component authoring standards
|
|
2
|
-
|
|
3
|
-
## Vertical extensions — existing components always have priority
|
|
4
|
-
|
|
5
|
-
When building a vertical extension (`src/extensions/<vertical>/`), check what the **base template already renders** before creating anything new.
|
|
6
|
-
|
|
7
|
-
**The rule**: if a base component already renders equivalent content at the same location, do NOT create an extension component that duplicates it. Extensions add what is missing — they never recreate what already exists.
|
|
8
|
-
|
|
9
|
-
### Decision gate (run this before creating any extension component)
|
|
10
|
-
|
|
11
|
-
1. **Find the base component** — read the relevant route and trace what components it renders.
|
|
12
|
-
2. **Check every rendered section** — does the base already render this content (description, accordion, badge, banner, etc.)?
|
|
13
|
-
3. **If yes** — use a UITarget slot on the existing content, or customise it via token/variant. Do not create a parallel extension component that renders the same thing.
|
|
14
|
-
4. **If no** — the extension is justified. Register it at the correct UITarget.
|
|
15
|
-
|
|
16
|
-
### Concrete examples
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
❌ WRONG — base ProductView already renders a description accordion ("Overview").
|
|
20
|
-
ProductDetailsExtension adds its own "Overview" section → duplicate.
|
|
21
|
-
|
|
22
|
-
✅ CORRECT — base already renders description + adapter sections (Specifications, Care Instructions…).
|
|
23
|
-
ProductDetailsExtension only adds the two sections the base does NOT have:
|
|
24
|
-
Shipping & Returns, Warranty Info.
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
❌ WRONG — base renders product title in ProductInfo.
|
|
29
|
-
The vertical extension renders product title again in a brand stamp.
|
|
30
|
-
|
|
31
|
-
✅ CORRECT — brand stamp adds ONLY the brand line ("<BRAND> · <tagline>")
|
|
32
|
-
above the existing ProductInfo, not the title.
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Do not create duplicates unless the user explicitly asks for them.**
|
|
36
|
-
The cost of a duplicate is paid on every page load, in every test, in every Figma sync. The correct
|
|
37
|
-
approach is almost always a UITarget slot or a CSS token override.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Extend before create — mandatory check before any new component
|
|
42
|
-
|
|
43
|
-
Before writing a single line of a new component, answer these questions in order:
|
|
44
|
-
|
|
45
|
-
1. **Does an existing component already do this?** Search `src/components/` and `src/components/ui/` by name and by behaviour.
|
|
46
|
-
2. **Can an existing component cover this with a new CVA variant?** A new `variant` or `size` value is always cheaper than a new file.
|
|
47
|
-
3. **Can composition cover this?** Wrap an existing component in a thin composite rather than duplicating it.
|
|
48
|
-
4. **Only if all three answers are no** — create a new component.
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
// ❌ WRONG — creating BrandPrimaryButton when Button already exists
|
|
52
|
-
export function BrandPrimaryButton({ children }: Props) {
|
|
53
|
-
return <button className="bg-[#1e6f3a] text-white ...">{children}</button>
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ✅ CORRECT — new CVA variant on the existing Button primitive
|
|
57
|
-
// In src/components/ui/button.tsx, add to buttonVariants:
|
|
58
|
-
brand: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
59
|
-
|
|
60
|
-
// ✅ CORRECT — thin composite when behaviour differs
|
|
61
|
-
export function AddToCartButton(props: AddToCartButtonProps) {
|
|
62
|
-
return <Button variant="default" {...props}>Add to Cart</Button>
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Multi-vertical extension governance
|
|
69
|
-
|
|
70
|
-
When a vertical needs to extend a component, choose the right maintenance model upfront:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
Does the change only affect visual tokens (color, font, spacing)?
|
|
74
|
-
└─ YES → CVA variant on the existing component. Token system handles most of this via brand.css.
|
|
75
|
-
└─ NO → Is this structural change needed by only one vertical?
|
|
76
|
-
└─ YES → src/extensions/<vertical-name>/ via UITarget injection. Never touch core.
|
|
77
|
-
└─ NO → Will another vertical need the same structural pattern?
|
|
78
|
-
└─ YES → Add a slot/renderProp to the BASE component.
|
|
79
|
-
Each vertical provides its own implementation of that slot.
|
|
80
|
-
└─ UNSURE → Build vertical-specific first (extensions/).
|
|
81
|
-
Promote to base when a second vertical needs the same pattern.
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Never add vertical-specific logic (if brandA / if brandB) to a shared component.** If you find yourself writing that, the slot/render-prop pattern is missing from the base component.
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Layer model — know which layer you are in before writing a line
|
|
89
|
-
|
|
90
|
-
| Layer | Where | What lives here |
|
|
91
|
-
|-------|-------|----------------|
|
|
92
|
-
| **Primitive** | `src/components/ui/` | Shadcn-sourced, Radix-backed primitives. Pure rendering, no business logic, no SCAPI. |
|
|
93
|
-
| **Composite** | `src/components/` | Assembled from primitives. May accept loaders/data props. No direct SCAPI calls. |
|
|
94
|
-
| **Page / Route** | `src/routes/` | Loader, action, error boundary, page layout. Fetches data, passes to composites. |
|
|
95
|
-
| **Extension** | `src/extensions/<name>/` | Opt-in additions via UITarget. Self-contained. Never modify core from inside an extension. |
|
|
96
|
-
|
|
97
|
-
Do not skip layers. A page component should not build raw `<button>` elements. A primitive should not call `useFetcher`.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Primitives (`src/components/ui/`)
|
|
102
|
-
|
|
103
|
-
These files come from Shadcn and must be treated as infrastructure, not business components.
|
|
104
|
-
|
|
105
|
-
**When extending a primitive:**
|
|
106
|
-
- Do not edit the primitive file directly (it may be refreshed from Shadcn upstream).
|
|
107
|
-
- Create a wrapper component in `src/components/` instead.
|
|
108
|
-
- Re-export from the wrapper so imports stay consistent.
|
|
109
|
-
|
|
110
|
-
**Allowed changes to primitive files:**
|
|
111
|
-
- Adding a new CVA variant that maps to an existing semantic token — that's it.
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## CVA — class-variance-authority
|
|
116
|
-
|
|
117
|
-
All styled components with more than one visual state use CVA.
|
|
118
|
-
|
|
119
|
-
```tsx
|
|
120
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
121
|
-
import { cn } from '@/lib/utils'
|
|
122
|
-
|
|
123
|
-
const badgeVariants = cva(
|
|
124
|
-
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors',
|
|
125
|
-
{
|
|
126
|
-
variants: {
|
|
127
|
-
variant: {
|
|
128
|
-
default: 'border-transparent bg-primary text-primary-foreground',
|
|
129
|
-
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
130
|
-
destructive: 'border-transparent bg-destructive text-white',
|
|
131
|
-
outline: 'text-foreground',
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
defaultVariants: { variant: 'default' },
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Rules:
|
|
140
|
-
- Every variant value must use semantic token classes only. No raw hex.
|
|
141
|
-
- `cn()` from `@/lib/utils` is always the last call — enables external className overrides.
|
|
142
|
-
- Export the `*Variants` function alongside the component so it can be reused in related components.
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## data-slot attributes
|
|
147
|
-
|
|
148
|
-
Every presentational element in a component tree must carry a `data-slot` attribute for testing and Figma tracing.
|
|
149
|
-
|
|
150
|
-
```tsx
|
|
151
|
-
// ✅
|
|
152
|
-
<div data-slot="product-tile">
|
|
153
|
-
<div data-slot="product-tile-image">…</div>
|
|
154
|
-
<div data-slot="product-tile-body">…</div>
|
|
155
|
-
</div>
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
The slot name should be kebab-case and match the component name.
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## TypeScript requirements
|
|
163
|
-
|
|
164
|
-
- All props are explicitly typed. No `any`.
|
|
165
|
-
- Use `React.ComponentProps<'element'>` to extend native element props.
|
|
166
|
-
- Discriminated unions for components with mutually exclusive prop shapes.
|
|
167
|
-
- `asChild` pattern (via Radix `Slot`) for polymorphic rendering — never accept an `as` prop.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Copyright header
|
|
172
|
-
|
|
173
|
-
Every `.ts` / `.tsx` file must begin with the Apache 2.0 header. ESLint enforces this.
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## Naming conventions
|
|
178
|
-
|
|
179
|
-
| Thing | Convention | Example |
|
|
180
|
-
|-------|-----------|---------|
|
|
181
|
-
| Component files | kebab-case | `product-tile.tsx` |
|
|
182
|
-
| Component exports | PascalCase | `ProductTile` |
|
|
183
|
-
| Variant objects (CVA) | camelCase + "Variants" suffix | `productTileVariants` |
|
|
184
|
-
| data-slot values | kebab-case matching component | `product-tile` |
|
|
185
|
-
| Hook files | kebab-case prefixed with "use-" | `use-cart.ts` |
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Storybook requirement
|
|
190
|
-
|
|
191
|
-
Every new component in `src/components/` must have a `.stories.tsx` file.
|
|
192
|
-
- One story per CVA variant.
|
|
193
|
-
- Default export: `{ title: 'Components/ComponentName', component: ComponentName }`.
|
|
194
|
-
- Include a snapshot story (`name: 'Snapshot'`) so CI can diff it.
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Accessibility checklist
|
|
199
|
-
|
|
200
|
-
Before marking a component complete, verify:
|
|
201
|
-
|
|
202
|
-
- [ ] Interactive elements are native `<button>` or `<a>`, not `<div onClick>`.
|
|
203
|
-
- [ ] All inputs have an associated `<Label>` using `htmlFor` (or Radix `Label` with `asChild`).
|
|
204
|
-
- [ ] Focus ring uses `focus-visible:ring-ring focus-visible:ring-[3px]` — matches the button primitive.
|
|
205
|
-
- [ ] Color information is not communicated by color alone (pair with icon or text).
|
|
206
|
-
- [ ] Motion: wrap animations in `prefers-reduced-motion` if not handled by Tailwind's `motion-safe:` prefix.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Project Structure Reference
|
|
2
|
-
|
|
3
|
-
Storefront Next is a pnpm monorepo with a React Router v7 retail application.
|
|
4
|
-
|
|
5
|
-
## Key architecture
|
|
6
|
-
|
|
7
|
-
- **Monorepo:** pnpm workspaces, packages under `packages/`
|
|
8
|
-
- **Main app:** `packages/template-retail-rsc-app/` — React Router v7 retail application
|
|
9
|
-
- **Build tool:** Vite with SSR
|
|
10
|
-
- **Routing:** React Router v7 file-based routing
|
|
11
|
-
- **Styling:** Tailwind CSS v4, utility-first, token-driven
|
|
12
|
-
- **Commerce:** Salesforce Commerce Cloud (SCAPI) integration
|
|
13
|
-
|
|
14
|
-
## Theme file layout (the vertical surface)
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
src/theme/
|
|
18
|
-
├── tailwind.css # CSS variable → Tailwind utility bridge
|
|
19
|
-
└── tokens/
|
|
20
|
-
├── brand.css # ← the ONLY file that changes per vertical
|
|
21
|
-
├── core.css # semantic roles (bg, fg, card, primary, …)
|
|
22
|
-
├── header.css # header / footer surfaces
|
|
23
|
-
├── status.css # destructive / warning / success / info
|
|
24
|
-
├── swatch.css # variant-selector swatch UI
|
|
25
|
-
└── components.css # payment + cart-specific tokens
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## App file organization
|
|
29
|
-
|
|
30
|
-
- **Routes:** `src/routes/` (file-based, mapped in `src/routes.ts`)
|
|
31
|
-
- **Components (composite):** `src/components/`
|
|
32
|
-
- **Components (Shadcn primitives):** `src/components/ui/`
|
|
33
|
-
- **Extensions:** `src/extensions/<name>/`
|
|
34
|
-
- **Providers:** `src/providers/`
|
|
35
|
-
- **Config / fixtures:** `src/config/`
|
|
36
|
-
|
|
37
|
-
## Common commands
|
|
38
|
-
|
|
39
|
-
- `pnpm dev` — start the dev server
|
|
40
|
-
- `pnpm build` — production build
|
|
41
|
-
- `pnpm typecheck` — TypeScript checking
|
|
42
|
-
- `pnpm lint` — ESLint (runs with `--max-warnings 0`)
|
|
43
|
-
- `pnpm test-storybook:snapshot:agent` — Storybook snapshot diff
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Token System Reference
|
|
2
|
-
|
|
3
|
-
## The one rule that overrides everything else
|
|
4
|
-
|
|
5
|
-
**Never use a raw hex value, RGB value, or hardcoded color in any component or CSS file.**
|
|
6
|
-
Always use a semantic Tailwind utility that maps to a CSS variable. The variables are defined in
|
|
7
|
-
`src/theme/tokens/` and bridged to Tailwind utilities in `src/theme/tailwind.css`.
|
|
8
|
-
|
|
9
|
-
```tsx
|
|
10
|
-
// ✅ correct
|
|
11
|
-
<div className="bg-primary text-primary-foreground" />
|
|
12
|
-
|
|
13
|
-
// ❌ wrong — breaks dark mode, breaks vertical theming, breaks Figma sync
|
|
14
|
-
<div style={{ background: '#000000', color: '#ffffff' }} />
|
|
15
|
-
<div className="bg-black text-white" />
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Token files and what they own
|
|
19
|
-
|
|
20
|
-
| File | Owns |
|
|
21
|
-
|------|------|
|
|
22
|
-
| `src/theme/tokens/core.css` | Background, foreground, card, popover, primary, secondary, muted, accent, border, input, ring, separator, rating, charts, sidebar, focus helpers |
|
|
23
|
-
| `src/theme/tokens/brand.css` | Brand palette (`--brand-black`, `--brand-white`, `--brand-gray-*`, `--brand-primary`). **This is the only file that changes per vertical.** |
|
|
24
|
-
| `src/theme/tokens/header.css` | Header background/foreground, header menu surfaces, footer. Dark header = black bg / white text. |
|
|
25
|
-
| `src/theme/tokens/status.css` | Destructive, warning, success, info, status-positive/warning/critical, active-bg |
|
|
26
|
-
| `src/theme/tokens/swatch.css` | Swatch color, labeled, pill — variant selector UI only |
|
|
27
|
-
| `src/theme/tokens/components.css` | Payment provider colors, cart-specific tokens |
|
|
28
|
-
|
|
29
|
-
## Semantic token meanings — use the right one
|
|
30
|
-
|
|
31
|
-
### Text colors
|
|
32
|
-
| Token class | When to use |
|
|
33
|
-
|-------------|-------------|
|
|
34
|
-
| `text-foreground` | Default body text, headings |
|
|
35
|
-
| `text-muted-foreground` | Secondary labels, helper text, placeholder, metadata |
|
|
36
|
-
| `text-primary-foreground` | Text on a `bg-primary` surface (e.g. button label) |
|
|
37
|
-
| `text-secondary-foreground` | Text on a `bg-secondary` surface |
|
|
38
|
-
| `text-accent-foreground` | Text on a `bg-accent` surface (hover chips, tags) |
|
|
39
|
-
| `text-destructive` | Error text, destructive action labels |
|
|
40
|
-
| `text-card-foreground` | Text inside card surfaces |
|
|
41
|
-
|
|
42
|
-
### Background colors
|
|
43
|
-
| Token class | When to use |
|
|
44
|
-
|-------------|-------------|
|
|
45
|
-
| `bg-background` | Page/app background |
|
|
46
|
-
| `bg-primary` | CTAs, filled buttons, strong actions |
|
|
47
|
-
| `bg-secondary` | Secondary button fill, subtle section bg |
|
|
48
|
-
| `bg-muted` | Skeleton, disabled surfaces, subtle fills |
|
|
49
|
-
| `bg-accent` | Hover state, selected chip, tag bg |
|
|
50
|
-
| `bg-card` | Card and tile surfaces |
|
|
51
|
-
| `bg-popover` | Dropdown, tooltip, modal backgrounds |
|
|
52
|
-
|
|
53
|
-
### Borders
|
|
54
|
-
| Token class | When to use |
|
|
55
|
-
|-------------|-------------|
|
|
56
|
-
| `border-border` | Standard dividers, list separators — uses alpha so it renders correctly on ANY surface color |
|
|
57
|
-
| `border-border-subtle` | Form inputs, card edges — slightly more visible |
|
|
58
|
-
| `border-input` | Input field border specifically |
|
|
59
|
-
| `ring-ring` | Focus ring on interactive elements |
|
|
60
|
-
|
|
61
|
-
**Never use `border-black`, `border-gray-*`, or `divide-gray-*`.** Use `border-border` or `border-border-subtle`.
|
|
62
|
-
|
|
63
|
-
### Header/navigation surfaces
|
|
64
|
-
| Token class | When to use |
|
|
65
|
-
|-------------|-------------|
|
|
66
|
-
| `bg-[--header-background]` | Header band background |
|
|
67
|
-
| `text-[--header-foreground]` | Header text and icons |
|
|
68
|
-
| `bg-[--header-menu-background]` | Mega/dropdown menu panel |
|
|
69
|
-
| `bg-[--footer-background]` | Footer background |
|
|
70
|
-
|
|
71
|
-
### Status and feedback
|
|
72
|
-
| Token class | When to use |
|
|
73
|
-
|-------------|-------------|
|
|
74
|
-
| `text-destructive` / `bg-destructive` | Delete, remove, error state |
|
|
75
|
-
| `bg-warning-bg` / `text-warning-foreground` | Caution messages |
|
|
76
|
-
| `text-status-positive` | In-stock, success indicator |
|
|
77
|
-
| `text-status-critical` | Out of stock, error badge |
|
|
78
|
-
| `bg-active-bg` / `text-active-foreground` | Active/authorized badge |
|
|
79
|
-
|
|
80
|
-
## Dark mode rules
|
|
81
|
-
|
|
82
|
-
**Do not write `dark:bg-black` or any dark: hardcoded color.**
|
|
83
|
-
Dark mode is fully handled by `.dark` overrides in `src/theme/tokens/core.css` and other token files.
|
|
84
|
-
Using semantic classes automatically gets the correct dark value.
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
// ✅ correct — dark mode is automatic
|
|
88
|
-
<div className="bg-card text-card-foreground" />
|
|
89
|
-
|
|
90
|
-
// ❌ wrong
|
|
91
|
-
<div className="bg-white dark:bg-gray-900 text-black dark:text-white" />
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
The only valid `dark:` usage is for classes that reference another semantic token:
|
|
95
|
-
|
|
96
|
-
```tsx
|
|
97
|
-
// ✅ valid dark: override pattern
|
|
98
|
-
className="dark:bg-input/30 dark:border-input"
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## What changes per vertical — and what does not
|
|
102
|
-
|
|
103
|
-
### Changes (vertical-specific, lives in `src/theme/tokens/brand.css`)
|
|
104
|
-
- Brand palette values (`--brand-black`, `--brand-primary`, `--brand-gray-*`)
|
|
105
|
-
- Logo treatment (`--header-logo-filter`)
|
|
106
|
-
- Brand-specific component tokens
|
|
107
|
-
|
|
108
|
-
### Does NOT change (shared, lives in core/header/status/swatch/components)
|
|
109
|
-
- Semantic token names and their Tailwind utility names
|
|
110
|
-
- Dark mode pairing rules
|
|
111
|
-
- Component variant logic (CVA)
|
|
112
|
-
- Border alpha values
|
|
113
|
-
- Status and feedback colors
|
|
114
|
-
|
|
115
|
-
**Never override core.css, header.css, status.css, swatch.css, or components.css to create a vertical.**
|
|
116
|
-
Only `brand.css` changes between verticals.
|
|
117
|
-
|
|
118
|
-
## Tailwind utility bridge
|
|
119
|
-
|
|
120
|
-
All token → Tailwind utility mappings are defined in `src/theme/tailwind.css`.
|
|
121
|
-
If a CSS variable exists in a token file but has no Tailwind utility in `tailwind.css`, add it there
|
|
122
|
-
before using it in a component. Do not use arbitrary `[--variable-name]` syntax for variables that
|
|
123
|
-
should be in the bridge.
|
|
124
|
-
|
|
125
|
-
```css
|
|
126
|
-
/* src/theme/tailwind.css — add new token bridge entries here */
|
|
127
|
-
--color-my-new-token: var(--my-new-token);
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Then use `bg-my-new-token` in components.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Troubleshooting Reference
|
|
2
|
-
|
|
3
|
-
## Token not found in Tailwind utilities
|
|
4
|
-
If a CSS variable exists in a token file but has no Tailwind utility in `tailwind.css`:
|
|
5
|
-
- Open `src/theme/tailwind.css`.
|
|
6
|
-
- Add a bridge entry: `--color-my-new-token: var(--my-new-token);`.
|
|
7
|
-
- Then use `bg-my-new-token` in components — never the `bg-[--my-new-token]` arbitrary syntax.
|
|
8
|
-
|
|
9
|
-
## Colors look wrong in dark mode
|
|
10
|
-
- You probably hardcoded a color (`bg-white`, `text-black`, raw hex) instead of using a semantic token.
|
|
11
|
-
- Replace with the semantic utility (`bg-background`, `text-foreground`, etc.). Dark mode is handled by `.dark` overrides in the token files automatically.
|
|
12
|
-
|
|
13
|
-
## Vertical changes leak into other verticals
|
|
14
|
-
- You edited a shared token file (`core.css`, `header.css`, `status.css`, `swatch.css`, `components.css`). Move the change into `brand.css`.
|
|
15
|
-
- Or you added `if (vertical)` logic to a shared component. Replace it with a CVA variant, a slot/render-prop on the base, or an extension.
|
|
16
|
-
|
|
17
|
-
## Component already exists
|
|
18
|
-
If a scan finds an existing component that covers the need:
|
|
19
|
-
- Add a new CVA variant instead of creating a new component.
|
|
20
|
-
- Wrap in a thin composite if behaviour differs.
|
|
21
|
-
- Never duplicate.
|
|
22
|
-
|
|
23
|
-
## Local pages won't render without SCAPI
|
|
24
|
-
- Use fixtures: create `src/config/<vertical>-fixtures.ts` and short-circuit the `_app.tsx` and `_app.product.$productId.tsx` loaders during vertical development.
|
|
25
|
-
- Restore the real SCAPI calls once credentials are available.
|
|
26
|
-
|
|
27
|
-
## Linter errors after changes
|
|
28
|
-
Run `pnpm lint:fix` first. If errors remain, check:
|
|
29
|
-
- Missing copyright header (required on every `.ts`/`.tsx` file).
|
|
30
|
-
- Raw hex value or hardcoded Tailwind color — replace with a semantic token class.
|
|
31
|
-
- Missing `data-slot` attribute on a component root.
|
|
32
|
-
|
|
33
|
-
## Snapshot tests fail after visual changes
|
|
34
|
-
Run `pnpm test-storybook:snapshot:agent -- --updateSnapshot` to update baselines after intentional visual changes.
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sfnext-custom-apis
|
|
3
|
-
description: End-to-end workflow for consuming custom SCAPI endpoints from a Storefront Next project — adding them as typed clients via `b2c sfnext scapi add custom`, discovering their schema, and calling them from loaders/actions/useScapiFetcher. Use this skill whenever the user wants to call a custom API from their Storefront Next app, gets a 404 or 401 when calling a custom endpoint from their sfnext loader, needs to add a custom API as a typed client in their storefront, asks about the full workflow from custom API cartridge to sfnext consumption, or says 'custom API in storefront next'. Also use when they ask how createApiClients exposes custom API methods or how to use useScapiFetcher with a custom endpoint. NOT for writing the custom API cartridge files (schema.yaml/script.js) from scratch — see b2c:b2c-custom-api-development. NOT for just checking registration status — see b2c-cli:b2c-scapi-custom.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Custom APIs in Storefront Next
|
|
7
|
-
|
|
8
|
-
This skill covers the end-to-end workflow for implementing and consuming custom SCAPI endpoints from a Storefront Next project.
|
|
9
|
-
|
|
10
|
-
## Overview
|
|
11
|
-
|
|
12
|
-
Custom APIs let you define your own REST endpoints on B2C Commerce. In a Storefront Next project, you call these from loaders and actions just like standard SCAPI clients — with full type safety.
|
|
13
|
-
|
|
14
|
-
### End-to-End Workflow
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Create custom API → Deploy & register → Add typed client → Discover schema → Call from loader
|
|
18
|
-
(cartridge) (b2c code deploy) (sfnext scapi add) (scapi schemas) (createApiClients)
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Step 1: Create the Custom API
|
|
22
|
-
|
|
23
|
-
A custom API consists of three files in a cartridge:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
my-cartridge/cartridge/rest-apis/my-loyalty-api/
|
|
27
|
-
├── schema.yaml # OpenAPI 3.0 schema (endpoints, params, responses)
|
|
28
|
-
├── api.json # API metadata (version, security scheme)
|
|
29
|
-
└── script.js # Implementation (controller script)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
For full details on writing these files, see the `b2c:b2c-custom-api-development` skill.
|
|
33
|
-
|
|
34
|
-
**Key choices that affect the client:**
|
|
35
|
-
|
|
36
|
-
| Choice | Impact |
|
|
37
|
-
|--------|--------|
|
|
38
|
-
| Directory name (`my-loyalty-api`) | Becomes the API name for `scapi add` |
|
|
39
|
-
| `type` in api.json (`shopper` or `admin`) | Determines auth scheme and whether `siteId` is required |
|
|
40
|
-
| Paths in schema.yaml | Become the methods on the typed client |
|
|
41
|
-
|
|
42
|
-
## Step 2: Deploy and Register
|
|
43
|
-
|
|
44
|
-
Deploy the cartridge and verify the custom API is registered:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
# deploy the cartridge
|
|
48
|
-
b2c code deploy ./my-cartridge --activate
|
|
49
|
-
|
|
50
|
-
# verify registration
|
|
51
|
-
b2c scapi custom status
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
A successful registration shows `status: active` for your endpoints. If you see `not_registered`, debug with:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
b2c scapi custom status --status not_registered --columns type,apiName,endpointPath,errorReason
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
See `b2c-cli:b2c-scapi-custom` for full diagnostics.
|
|
61
|
-
|
|
62
|
-
## Step 3: Add as Typed Client
|
|
63
|
-
|
|
64
|
-
Once registered, add the custom API to your Storefront Next project:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
b2c sfnext scapi add custom my-loyalty-api v1
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
This generates typed client code. The client becomes available as:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
const clients = createApiClients(context);
|
|
74
|
-
clients.myLoyaltyApi.getPoints({...});
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Step 4: Discover the API Shape
|
|
78
|
-
|
|
79
|
-
Use schema browsing to understand your custom API's endpoints and response types:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# list endpoints
|
|
83
|
-
b2c scapi schemas get custom my-loyalty-api v1 --list-paths
|
|
84
|
-
|
|
85
|
-
# expand a specific endpoint
|
|
86
|
-
b2c scapi schemas get custom my-loyalty-api v1 \
|
|
87
|
-
--expand-paths /loyalty/points/{customerId}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
This shows you the exact parameter names and response shape to use in your loader.
|
|
91
|
-
|
|
92
|
-
## Step 5: Call from Loaders and Actions
|
|
93
|
-
|
|
94
|
-
### Calling from a Loader (Shopper API)
|
|
95
|
-
|
|
96
|
-
```typescript
|
|
97
|
-
import { createApiClients } from '@/lib/api-clients';
|
|
98
|
-
|
|
99
|
-
export function loader({ params, context }: LoaderFunctionArgs) {
|
|
100
|
-
const clients = createApiClients(context);
|
|
101
|
-
return {
|
|
102
|
-
loyaltyPoints: clients.myLoyaltyApi.getPoints({
|
|
103
|
-
params: {
|
|
104
|
-
path: { customerId: params.customerId },
|
|
105
|
-
query: { siteId: context.siteId }
|
|
106
|
-
}
|
|
107
|
-
}).then(({ data }) => data),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Calling from an Action (Mutation)
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
import { data } from 'react-router';
|
|
116
|
-
import { createApiClients } from '@/lib/api-clients';
|
|
117
|
-
|
|
118
|
-
export async function action({ request, context }: ActionFunctionArgs) {
|
|
119
|
-
const formData = await request.formData();
|
|
120
|
-
const clients = createApiClients(context);
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
await clients.myLoyaltyApi.redeemPoints({
|
|
124
|
-
params: {
|
|
125
|
-
path: { customerId: formData.get('customerId') as string },
|
|
126
|
-
query: { siteId: context.siteId },
|
|
127
|
-
body: { points: Number(formData.get('points')) }
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
return data({ success: true });
|
|
131
|
-
} catch (error) {
|
|
132
|
-
return data({ success: false, error: error.message }, { status: 400 });
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Using useScapiFetcher (Interactive)
|
|
138
|
-
|
|
139
|
-
For on-demand fetching triggered by user interactions:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
import { useScapiFetcher } from '@/hooks/use-scapi-fetcher';
|
|
143
|
-
|
|
144
|
-
export function useLoyaltyPoints(customerId: string) {
|
|
145
|
-
const parameters = useMemo(
|
|
146
|
-
() => ({
|
|
147
|
-
params: {
|
|
148
|
-
path: { customerId },
|
|
149
|
-
query: { siteId: getSiteId() }
|
|
150
|
-
}
|
|
151
|
-
}),
|
|
152
|
-
[customerId]
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const fetcher = useScapiFetcher(
|
|
156
|
-
'myLoyaltyApi',
|
|
157
|
-
'getPoints',
|
|
158
|
-
parameters
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
return {
|
|
162
|
-
points: fetcher.data,
|
|
163
|
-
isLoading: fetcher.state === 'loading',
|
|
164
|
-
refresh: () => fetcher.load(),
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Step 6: Debug Issues
|
|
170
|
-
|
|
171
|
-
| Issue | Cause | Solution |
|
|
172
|
-
|-------|-------|----------|
|
|
173
|
-
| Client property not available | Forgot `sfnext scapi add` | Run `b2c sfnext scapi add custom <name> <version>` |
|
|
174
|
-
| 404 from custom endpoint | API not registered | Check `b2c scapi custom status`; redeploy with `--activate` |
|
|
175
|
-
| 401 Unauthorized | Wrong security scheme | Shopper APIs use ShopperToken; Admin APIs use BearerToken |
|
|
176
|
-
| Missing `siteId` error | Shopper custom APIs require siteId | Always include `siteId` in query params for Shopper APIs |
|
|
177
|
-
| Schema returns empty | API not yet registered | Deploy and activate the cartridge first, then browse schemas |
|
|
178
|
-
| Types outdated after schema change | Stale generated types | Re-run `b2c sfnext scapi add custom <name> <version> --force` |
|
|
179
|
-
|
|
180
|
-
## Custom API Client Naming
|
|
181
|
-
|
|
182
|
-
The API directory name maps to a camelCase property on `createApiClients()`:
|
|
183
|
-
|
|
184
|
-
| Directory Name | Client Property | Example Call |
|
|
185
|
-
|---------------|-----------------|-------------|
|
|
186
|
-
| `my-loyalty-api` | `clients.myLoyaltyApi` | `clients.myLoyaltyApi.getPoints({...})` |
|
|
187
|
-
| `order-status` | `clients.orderStatus` | `clients.orderStatus.getStatus({...})` |
|
|
188
|
-
| `inventory-check` | `clients.inventoryCheck` | `clients.inventoryCheck.checkStock({...})` |
|
|
189
|
-
|
|
190
|
-
## Shopper vs Admin Custom APIs
|
|
191
|
-
|
|
192
|
-
| Aspect | Shopper API | Admin API |
|
|
193
|
-
|--------|-------------|-----------|
|
|
194
|
-
| Auth scheme | ShopperToken (SLAS) | BearerToken (Account Manager) |
|
|
195
|
-
| Requires `siteId` | Yes | No |
|
|
196
|
-
| Called from | Storefront loaders/actions | Admin tools, batch jobs |
|
|
197
|
-
| Typical use | Customer-facing features | Back-office operations |
|
|
198
|
-
|
|
199
|
-
Most Storefront Next custom APIs are **Shopper** type since they serve storefront pages.
|
|
200
|
-
|
|
201
|
-
## Common Pitfalls
|
|
202
|
-
|
|
203
|
-
| Pitfall | Problem | Solution |
|
|
204
|
-
|---------|---------|----------|
|
|
205
|
-
| Using admin auth for a shopper endpoint | 401 errors in storefront context | Set `type: "shopper"` in api.json |
|
|
206
|
-
| Forgetting to redeploy after schema changes | Stale endpoints | Redeploy cartridge and re-add client with `--force` |
|
|
207
|
-
| Not including `siteId` for shopper APIs | Request rejected | Always pass `siteId` in query params |
|
|
208
|
-
| Calling custom API before registration completes | Intermittent 404s | Wait for `status: active` in `b2c scapi custom status` |
|
|
209
|
-
|
|
210
|
-
## Related Skills
|
|
211
|
-
|
|
212
|
-
- `storefront-next:sfnext-scapi-management` - Managing typed clients (add/remove/list)
|
|
213
|
-
- `storefront-next:sfnext-data-fetching` - Loader/action/useScapiFetcher patterns
|
|
214
|
-
- `b2c:b2c-custom-api-development` - Creating the custom API cartridge (schema + script + mapping)
|
|
215
|
-
- `b2c-cli:b2c-scapi-custom` - Checking custom API registration status
|
|
216
|
-
- `b2c-cli:b2c-scapi-schemas` - Schema discovery commands
|
|
217
|
-
- `b2c-cli:b2c-code` - Deploying and activating code versions
|
|
218
|
-
|
|
219
|
-
## Reference Documentation
|
|
220
|
-
|
|
221
|
-
- [Workflow Examples](references/WORKFLOW-EXAMPLES.md) - Complete end-to-end worked examples
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{"query": "My custom API endpoint returns 404 when I try to call it from my storefront next app using createApiClients. The cartridge is deployed but something isn't connecting. How do I debug this end-to-end?", "should_trigger": true},
|
|
3
|
-
{"query": "I deployed a custom loyalty-points API and now I need to add it to my storefront next project with b2c sfnext scapi add custom and then call it from my account page loader. Walk me through the full workflow.", "should_trigger": true},
|
|
4
|
-
{"query": "I have a custom shopper API that I can call from Postman but when I call it through createApiClients in my storefront next loader I get a 401 unauthorized. How do I fix the auth scheme mismatch between my api.json and the sfnext context?", "should_trigger": true},
|
|
5
|
-
{"query": "What's the complete end-to-end workflow for making a custom SCAPI endpoint callable as a typed client from my storefront next loaders? I have the cartridge registered and want to know the sfnext-specific steps.", "should_trigger": true},
|
|
6
|
-
{"query": "After running b2c sfnext scapi add custom my-inventory-api v1, how do I use the generated typed client in my storefront next route loader to call the checkStock endpoint?", "should_trigger": true},
|
|
7
|
-
{"query": "I need to write the schema.yaml OpenAPI spec and script.js controller for a new custom API that returns product recommendations based on browsing history.", "should_trigger": false},
|
|
8
|
-
{"query": "How do I check whether my custom API endpoints are registered and active on my sandbox instance? I just want to see the registration status.", "should_trigger": false},
|
|
9
|
-
{"query": "I need to call the standard shopperProducts.getProduct API from my product detail page loader. What's the pattern for using createApiClients with the built-in clients?", "should_trigger": false},
|
|
10
|
-
{"query": "I want to add the shopper-search standard SCAPI to my storefront next project so I can build a search page.", "should_trigger": false},
|
|
11
|
-
{"query": "How do I deploy my custom API cartridge code version to the sandbox and activate it using the b2c CLI?", "should_trigger": false}
|
|
12
|
-
]
|