Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sales-app-extensibility

БесплатноБез исполняемых скриптовНе проверен

Apply when building, customizing, or deploying extensions for VTEX Sales App. Covers the complete 7-step workflow from prerequisite checks through code…

vtexот vtex★ 47 звёзд на GitHub

Об этом скилле

Sales App Extensibility

When this skill applies

Use this skill when building, customizing, or deploying extensions for VTEX Sales App.

  • Adding features to the cart page (promotions, loyalty, services)
  • Adding features to the Product Detail Page (badges, recommendations, warranties)
  • Adding features to the menu (user profile, navigation, metrics)
  • Integrating external APIs into Sales App extensions
  • Generating, scaffolding, or validating extension code for Sales App

Do not use this skill for:

  • Regular FastStore storefront customization (use faststore-storefront)
  • Building VTEX IO apps (use vtex-io-* skills)
  • Sales App core development or framework modifications

Prerequisite: FastStore project

The project root must contain: biome.json, faststore.json, package.json, tsconfig.json, turbo.json.

If any are missing, STOP. The user must install FastStore first:

npx @vtex/fsp-cli init
# Prompt: "What is the application name?" → enter name or press Enter for default
cd <application-name> && yarn

Documentation: https://beta.fast.store/getting-started

Prerequisite: Sales App module

Inside the FastStore project, a Sales App workspace must exist (typically at packages/sales-app) with src/, package.json, and tsconfig.json. Check root package.json "workspaces" for a path containing sales-app. If missing, STOP:

yarn add @vtex/sales-app -D -W
npx fsp create
# Prompts: account name → "Sales App" → path (default or custom)
# Then add the path to root package.json "workspaces" array
yarn install

Documentation: https://beta.fast.store/sales-app/setting-up

Do NOT proceed to discovery or code generation until both prerequisites are confirmed.

Decision rules

Follow the mandatory 7-step workflow (Steps 0–6) in order. Do not skip steps.

Step Purpose Gate
0 Check prerequisites FastStore + Sales App installed → proceed; otherwise STOP
1 Discovery Understand what the user wants to build
2 Requirements & Plan Map requirements → generate plan → wait for user approval
3 Code Generation & Validation Generate Component.tsx + Component.css (plain CSS, never .module.css) + index.tsx → validate
4 Documentation Generate docs/<ExtensionName>.md explaining the extension
5 Local Testing Provide dev commands and URLs
6 Build & Deploy Build command → deployment guide

Extension point selection

Extension Point Category Available Hooks Layout Shift
cart.cart-list.after Cart useCart, useExtension No
cart.cart-item.after Cart useCart, useCartItem, useExtension Yes
cart.order-summary.after Cart useCart, useExtension Yes
pdp.sidebar.before PDP usePDP, useCart, useExtension Yes
pdp.sidebar.after PDP usePDP, useCart, useExtension Yes
pdp.content.after PDP usePDP, useCart, useExtension Yes
menu.item Menu useExtension No
menu.drawer-content Menu useCurrentUser, useExtension No

Hook availability

  • useCart → all cart + PDP extensions
  • useCartItem → cart.cart-item.after only
  • useCurrentUser → menu.drawer-content only
  • usePDP → PDP extensions only
  • useExtension → all extension points

Template selection

  • No API + no hooks → simple template
  • No API + hooks → hook template
  • API + no auth → API template
  • API + VTEX IO proxy → IO proxy template (recommended)
  • API + direct auth → direct auth template (insecure, warn user)
  • API doc provided → generate TypeScript interfaces from extracted response shapes; no API doc → use ${DATA_INTERFACE} placeholder

API authentication strategy

  1. Recommended: VTEX IO Proxy App — IO app stores keys server-side. Extension uses credentials: 'include' with a relative path (/_v/my-api/data).
  2. Insecure: Direct Auth — Keys in frontend code, visible in browser. Testing/development only.

Hard constraints

Constraint: Component must return JSX.Element, never null

defineExtensions expects ExtensionPointComponent which returns Element, not Element | null.

Why this matters Returning null causes a TypeScript compilation error. The build will fail.

Detection return null in any component registered with defineExtensions.

Correct

export function MyExtension(): JSX.Element {
  if (!data) return (<></>);
  return <div>{data.value}</div>;
}

Wrong

export function MyExtension(): JSX.Element | null {
  if (!data) return null;
  return <div>{data.value}</div>;
}

Constraint: Guard optional properties before use

CartItem.manualPrice (number | undefined), CartItem.productRefId (string | undefined), CartItem.attachments (Attachment[] | undefined) must be guarded.

Why this matters TypeScript strict mode

Полный SKILL.md на GitHub

Установить sales-app-extensibility в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/code-templates-and-patterns.mdreferences/design-guidelines.mdreferences/discovery-and-use-cases.mdreferences/documentation-template.mdreferences/extension-points-hooks-and-types.mdreferences/local-dev-build-and-deploy.mdreferences/static-analysis-rules.md

FAQ

Что делает скилл sales-app-extensibility?

Apply when building, customizing, or deploying extensions for VTEX Sales App. Covers the complete 7-step workflow from prerequisite checks through code generation to deployment, including extension points (cart, PDP, menu), React hooks (useCart, usePDP, useCartItem, useCurrentUser, useExtension), TypeScript types, secure API integration patterns, and API documentation ingestion (OpenAPI, URLs, or inline specs) to generate typed integrations.

Как установить скилл sales-app-extensibility?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sales-app-extensibility запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sales-app-extensibility с