headless-intelligent-search
БесплатноБез исполняемых скриптовНе проверенApply when implementing search functionality, faceted navigation, or autocomplete in a headless VTEX storefront. Covers product_search…
от vtex★ 47 звёзд на GitHubОб этом скилле
Intelligent Search API Integration
When this skill applies
Use this skill when implementing product search, category browsing, autocomplete, or faceted filtering in a headless VTEX storefront.
- Building a search results page with product listings
- Implementing faceted navigation (category, brand, price, color filters)
- Adding autocomplete suggestions to a search input
- Wiring up search analytics events for Intelligent Search ranking
Do not use this skill for:
- BFF architecture and API routing decisions (use
headless-bff-architecture) - Checkout or cart API integration (use
headless-checkout-proxy) - Caching strategy and TTL configuration (use
headless-caching-strategy)
Decision rules
- Call Intelligent Search directly from the frontend — it is the ONE exception to the "everything through BFF" rule. It is fully public and requires no authentication.
- Do NOT proxy Intelligent Search through the BFF unless you have a specific need (e.g., server-side rendering). Proxying adds latency on a high-frequency operation.
- Always use the API's
sortparameter and facet paths for filtering and sorting — never re-sort or re-filter results client-side. - Always include
pageandlocaleparameters in every search request. - When paginating beyond the first page, always reuse the
operatorandfuzzyvalues returned by the API from the first page — the API decides these values dynamically based on the search query. - Always send analytics events to the Intelligent Search Events API — without them, search ranking degrades over time.
Search endpoints overview:
| Endpoint | Method | Purpose |
|---|---|---|
/product_search/{facets} |
GET | Search products by query and/or facets |
/facets/{facets} |
GET | Get available filters for a query |
/autocomplete_suggestions |
GET | Get term and product suggestions while typing |
/top_searches |
GET | Get the 10 most popular search terms |
/correction_search |
GET | Get spelling correction for a misspelled term |
/search_suggestions |
GET | Get suggested terms similar to the search term |
/banners/{facets} |
GET | Get banners configured for a query |
Facet combination rules:
- Same facet type → OR (union): Selecting "Red" and "Blue" for color returns products matching either color
- Different facet types → AND (intersection): Selecting "Red" color and "Nike" brand returns only red Nike products
Hard constraints
Constraint: MUST send analytics events to Intelligent Search Events API
Every headless search implementation MUST send analytics events to the Intelligent Search Events API - Headless. At minimum, send search impression events when results are displayed and click events when a product is selected from search results.
Why this matters
Intelligent Search uses machine learning to rank results based on user behavior. Without analytics events, the search engine has no behavioral data and cannot personalize or optimize results. Over time, search quality degrades compared to stores that send events. Additionally, VTEX Admin search analytics dashboards will show no data.
Detection
If a search implementation renders results from Intelligent Search but has no calls to sp.vtex.com/event-api or the Intelligent Search Events API → STOP immediately. Analytics events must be implemented alongside search.
Correct
// search-analytics.ts — sends events to Intelligent Search Events API
const ACCOUNT_NAME = "mystore";
const EVENTS_URL = `https://sp.vtex.com/event-api/v1/${ACCOUNT_NAME}/event`;
interface SearchEvent {
type: "search.query" | "search.click" | "search.add_to_cart";
text: string;
misspelled: boolean;
match: number;
operator: string;
locale: string;
agent: string;
url: string;
products?: Array<{ productId: string; position: number }>;
}
export async function sendSearchEvent(event: SearchEvent): Promise<void> {
try {
await fetch(EVENTS_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(event),
keepalive: true, // ensures event is sent even during navigation
});
} catch (error) {
// Analytics failures should not break the UI
console.warn("Failed to send search event:", error);
}
}
// Usage: call after rendering search results
function onSearchResultsRendered(query: string, products: Product[]): void {
sendSearchEvent({
type: "search.query",
text: query,
misspelled: false,
match: products.length,
operator: "and",
locale: "en-US",
agent: "my-headless-store",
url: window.location.href,
products: products.map((p, i) => ({
productId: p.productId,
position: i + 1,
})),
});
}
Wrong
// Search works but NO analytics events are sent — search ranking degrades
async function search
Установить headless-intelligent-search в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл headless-intelligent-search?
Apply 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.
Как установить скилл headless-intelligent-search?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл headless-intelligent-search запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic