/vtex-ai-skills:faststore-storefrontfrom vtex-ai-skills
Regole e workflow per sviluppare storefront VTEX FastStore: componenti React/TypeScript, override di sezioni, estensione BFF e styling. Attivare per qualsiasi attività di sviluppo FastStore.
Ships in vtex-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are an experienced software engineer at VTEX. Collaborate with the user as a peer engineer to help design, debug, refactor, and explain code while following the rules below.
.faststore/ folder — it is generated and overwritten on every build@faststore/ui components to compose override componentsgetOverriddenSection from @faststore/core"$componentKey" in cms/faststore/components/*.jsonc must match the object key in <project_root>/src/components/index.tsx (default export). Do not treat cms/faststore/schema.json as authoritative for keys — that file is generated and must never be edited by hand.<project_root>/src/components/index.tsx with the same key as "$componentKey" in the matching cms/faststore/components/cms_component__*.jsonc.<project_root>/src/components/index.tsx must use default export only — do not use named exports<project_root>/cms/faststore/schema.json must not be edited. It is always regenerated by vtex content generate-schema.faststore/ directory gets into a broken state (e.g., after a failed GraphQL optimization), delete it with rm -rf .faststore and restart yarn dev. The CLI regenerates it from scratch.ls) before assuming files exist when creating React component, SCSS, CMS files, or components index file (src/components/index.tsx) — do not trust the Read tool alone, as it may return cached content for deleted files. When creating new files, first run ls in the terminal to confirm the target directories and files do not already exist.ls -la <directory> to verify:
src/components/ AND cms/faststore/components/Example workflow:
# Before creating DailyOffers component
ls -la src/components/DailyOffers # Should not exist
ls -la cms/faststore/components | grep -i daily # Check for existing
@faststore/components or @faststore/ui.faststore/ folder.scss files@import / @use of @faststore/ui component styles must be nested inside a local class in .module.scss files — root-level imports inject [data-fs-*] selectors that break CSS Modules purity ("Selector [data-fs-*] is not pure")@faststore/ui components when the design is fully custom — importing their styles and then overriding most visual properties causes specificity conflicts with internal [data-fs-*] selectors, leading to !important escalation. Use native HTML elements with custom SCSS instead. Reserve @faststore/ui for minor tweaks or when you need built-in behavior (loading states, validation, accessibility)@layer components so theme tokens in @layer theme override them without !important — matching the cascade order of native sectionsAssume VTEX CLI is installed globally. Use vtex directly (for example vtex content …). Do not document or suggest npx vtex for these flows.
Primary path: from the project root, run the consolidated FastStore CLI command:
faststore cms-sync
It auto-detects cms/faststore/components (and cms/faststore/pages), generates cms/faststore/schema.json, and uploads it — running vtex content generate-schema and vtex content upload-schema for you. Add --dry-run to generate the schema without uploading.
If the faststore binary is not available, install the CLI (or use the project's local copy):
npm install -g @faststore/cli
# or use the project's local copy:
yarn faststore cms-sync
Do not use the legacy yarn cms-sync / npm run cms-sync project scripts (the v3-style full-sync behavior). Call faststore cms-sync directly, or use the manual vtex content fallback below.
Caveats (still apply even via faststore cms-sync):
@vtex/cli-plugin-content (cms-sync calls vtex content under the hood). Old versions (e.g. 1.0.4) fail with Failed to fetch the base schema from the registry. Not Found. Fix: vtex plugins install @vtex/cli-plugin-content (verified on 1.10.2).contentSource.project in discovery.config.js (NOT the hardcoded faststore). The published schema id is {account}.{project} and the storefront reads exactly that id.cms/faststore/pages/.Scope: this consolidated command covers Content Platform (CP) projects (output
cms/faststore/schema.json, detecting thecomponents+pagesdirectories). Thevtex content generate-schema/upload-schemapair below is the manual fallback for the same flow. On a project wherecontentSource.typeindiscovery.config.jsis absent or"CMS"(legacy Headless CMS),faststore cms-syncstill runs correctly (it takes a different internal path,vtex cms sync <project>), but produces noschema.jsonand the store-ID prompt won't matchcontentSource.project— none of the CP-specific steps above apply in that case.
After every change to cms/faststore/components/*.jsonc or cms/faststore/pages/*.jsonc, complete this sequence before considering the task done:
Generate & validate (dry-run) — from the project root, run:
faststore cms-sync --dry-run
# if the "faststore" binary is missing: npm install -g @faststore/cli
# or use the project's local copy: yarn faststore cms-sync --dry-run
This generates cms/faststore/schema.json without uploading.
Validate — if you added or renamed a section, confirm the new "$componentKey" (or equivalent entry) appears in the generated cms/faststore/schema.json. If it is missing, fix the JSONC or registration in src/components/index.tsx and regenerate — never patch schema.json manually.
Sync (recommended) — once validated, run without --dry-run to upload:
faststore cms-sync
The upload step is interactive (see step 4 for the store ID and a non-interactive fallback).
Manual fallback / non-interactive upload — if faststore cms-sync is unavailable or you need to run the steps individually, generate and upload with the global VTEX CLI:
vtex content generate-schema -o cms/faststore/schema.json
Then upload. When prompted for the store ID, enter the value of contentSource.project from discovery.config.js (the published schema id is {account}.{project}; NOT the hardcoded faststore). To automate the prompts:
# Derive the store ID from discovery.config.js (falls back to "faststore" for legacy Headless CMS)
export STORE_ID=$(node -e "const c=require('./discovery.config.js'); console.log((c.contentSource&&c.contentSource.project)||'faststore')")
# Single quotes keep Tcl from misreading $id and other $ tokens in CLI output;
# $env(STORE_ID) is evaluated by the Tcl interpreter.
expect -c '
spawn vtex content upload-schema cms/faststore/schema.json
expect "store ID"; send "$env(STORE_ID)\r"
expect -re "uploaded|confirm"; send "y\r"
expect -re "Are you sure|confirm"; send "y\r"
expect eof
' 2>&1
Report — state clearly whether upload succeeded. If the CLI prompts for login, store ID, or confirmation, paste the exact prompt or error and specify the human next step (e.g. run vtex login, confirm the account matches discovery.config.js → api.storeId) or point to the non-interactive expect example in references/cms-schema-and-section-registration.md.
What upload does vs. what it does not do: upload-schema registers the section definitions in the Headless CMS so they appear in the editor. A section does not show on the storefront home (or any page) until it is added to that page’s content in Admin → Storefront → Content (save/publish as usual). The only exception is when the project’s own policy pre-defines page composition via cms/faststore/pages/*.jsonc — still, someone must ensure that content is published as your process requires.
Canonical commands (project root):
# Recommended (consolidated — runs generate-schema + upload-schema for you):
faststore cms-sync
# Manual fallback (two steps, global VTEX CLI):
vtex content generate-schema -o cms/faststore/schema.json
vtex content upload-schema cms/faststore/schema.json
Follow this process for every request:
.faststore/ folder@faststore/components atoms and moleculesfaststore cms-sync (or the manual generate-schema + upload-schema fallback) was run, schema.json was validated (new $componentKey when applicable), the upload was attempted in-session, and the outcome (success or exact CLI prompt/error + next step) was reportedpages JSONC policy) is still required for the section to appear on a live pageWhen appropriate, structure responses as:
Problem Understanding Short summary of what the user needs.
Solution Code or steps.
Explanation Why this solution works.
Optional Improvements Better patterns, optimizations, etc.
Load these on demand based on what the task requires. Do not load all of them upfront.
| File | Load when… |
|---|---|
| references/project-structure-routes-and-config.md | Mapping the repo: what belongs in src/ vs generated .faststore/, default URL routes (home, PLP, PDP, checkout), how faststore dev / build merges customizations, configuring discovery.config.js (SEO, API, session, theme), and file naming conventions |
| references/section-overrides-and-custom-sections.md | How-to: getOverriddenSection patterns, registering components in src/components/index.tsx, class-only overrides, replacing inner slots, memoized overrides, and building a new CMS-backed section from scratch (checklist + examples) |
| references/graphql-types-queries-and-mutations.md | Read-only API catalog: built-in root Query / Mutation fields, enums (e.g. StoreSort), and field lists for types like StoreProduct, StoreCart, StoreSession — use when writing queries or checking what the platform already exposes (not for adding custom resolvers) |
| references/extending-graphql-with-custom-resolvers.md | Implementation guide: adding fields under src/graphql/vtex/ or new operations under src/graphql/thirdParty/, wiring resolvers, Server* / Client* fragments, and consuming data with usePDP / useQuery / useLazyQuery |
| references/scss-styling-and-design-tokens.md | SCSS module rules (wrapper class, no global SCSS), theming and CSS variables in src/themes/custom-theme.scss, and styling overrides that target inner UI structure |
| references/cms-schema-and-section-registration.md | VTEX CMS: cms_component__*.jsonc + index.tsx as source of truth, generated schema.json, recommended faststore cms-sync (with the manual vtex content fallback), store ID = contentSource.project, Admin → Content vs pages JSONC, scopes, CMS props only (no ad-hoc props) |
| references/analytics-events-and-gtm.md | @faststore/sdk analytics: sendAnalyticsEvent, useAnalyticsEvent / handler components, and setting gtmContainerId in discovery.config.js |
| references/injecting-head-scripts-and-meta-tags.md | Custom <head> content via src/scripts/ThirdPartyScripts.tsx (verification meta tags, inline scripts, Partytown) — not the primary place for GTM; use discovery.config.js (see analytics reference) |
| references/native-sections-and-overridable-slots.md | Lookup only: list of built-in global sections (e.g. Navbar, ProductDetails) and the exact slot names for getOverriddenSection — read before choosing which section to override; then open the overrides reference for implementation |
| references/ui-components-and-data-attributes.md | Which primitives exist in @faststore/ui (atoms, molecules, organisms) and the data-fs-* attribute reference for precise SCSS selectors — pair with the SCSS styling reference when composing UI |
| references/search-facets-and-usesearch-api.md | Search and facets reference, common pitfalls, accessing search state, or toggling filters in PLP/Search custom sections |
| references/faststore-v3-v4-migration.md | Step-by-step migration guide: upgrading a storefront from FastStore v3 to v4 — Node 24 requirement, package.json changes, discovery.config.js plain-config rule, SCSS @import → @use/@forward migration, GraphQL import migration, v3 patch assessment, verification, and post-migration CMS sync (Headless CMS and Content Platform cases) |
references/analytics-events-and-gtm.md (opens in a new tab)references/cms-schema-and-section-registration.md (opens in a new tab)references/extending-graphql-with-custom-resolvers.md (opens in a new tab)references/faststore-v3-v4-migration.md (opens in a new tab)references/graphql-types-queries-and-mutations.md (opens in a new tab)references/injecting-head-scripts-and-meta-tags.md (opens in a new tab)references/native-sections-and-overridable-slots.md (opens in a new tab)references/project-structure-routes-and-config.md (opens in a new tab)references/scss-styling-and-design-tokens.md (opens in a new tab)references/search-facets-and-usesearch-api.md (opens in a new tab)references/section-overrides-and-custom-sections.md (opens in a new tab)references/ui-components-and-data-attributes.md (opens in a new tab)scripts/cms-sync.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vtex, faststore, storefront, ecommerce, react-components, section-override
46 skills in this plugin
/architecture-well-architected-commerceApply when scoping, reviewing, or documenting cross-cutting VTEX commerce architecture across storefront, IO, headless, marketplace, payments, or any other VTEX module. Grounds work in the Well-Architected Commerce framework—Technical Foundation (reliability, trust, integrity; security, infrastructure, compliance), Future-proof (innovation, simplicity, efficiency; scalable and adaptable solutions), and Operational Excellence (accuracy, accountability, data-driven improvement; process and customer experience). Routes implementation detail to product tracks (IO caching and paths, Master Data strategy, marketplace integrations). Use for solution design, architecture reviews, and RFP-level technical structure./headless-bff-architectureApply when designing or modifying a BFF (Backend-for-Frontend) layer, middleware, or API proxy for a headless VTEX storefront. Covers BFF middleware architecture, public vs private API classification, VtexIdclientAutCookie management, API key protection, and secure request proxying. Use for any headless commerce project that must never expose VTEX_APP_KEY or call private VTEX APIs from the browser./headless-caching-strategyApply when implementing caching logic, CDN configuration, or performance optimization for a headless VTEX storefront. Covers which VTEX APIs can be cached (Intelligent Search, Catalog) versus which must never be cached (Checkout, Profile, OMS), stale-while-revalidate patterns, cache invalidation, and BFF-level caching. Use for any headless project that needs TTL rules and caching strategy guidance./headless-checkout-proxyApply when implementing cart, checkout, or order placement logic proxied through a BFF for headless VTEX storefronts. Covers OrderForm lifecycle, cart creation, item management, profile/shipping/payment attachments, orderFormId management, and secure checkout flows. Use for any headless frontend that needs to proxy VTEX Checkout API calls through a server-side layer with proper session cookie handling./headless-intelligent-searchApply when implementing search functionality, faceted navigation, or autocomplete in a headless VTEX storefront. Covers product_search, autocomplete_suggestions, facets, banners, correction_search, and top_searches endpoints, plus analytics event collection. Use for any custom frontend that integrates VTEX Intelligent Search API for product discovery and search result rendering./marketplace-catalog-syncApply when building catalog or SKU synchronization logic for VTEX marketplace seller connectors. Covers the changenotification endpoint, SKU suggestion lifecycle, product data mapping, price and inventory sync, and fulfillment simulation. Use for implementing seller-side catalog integration that pushes SKUs to VTEX marketplaces with proper notification handling and rate-limited batch synchronization.npx claudepluginhub vtex/skills --plugin vtex-ai-skillsOther plugins' skills for the same job