skills/instantsearch/SKILL.md
Build production-quality search experiences (autocomplete, search results pages, faceted search) using InstantSearch. Use when user asks to add search, autocomplete, search-as-you-type, faceted filtering, or a search results page to a React, Vue, or vanilla JS application, or mentions Algolia, InstantSearch, or react-instantsearch. Do NOT use for backend index operations (records, synonyms, settings, API keys), use algolia-cli instead. Do NOT use for analytics, recommendations, or MCP server queries, use algolia-mcp instead. Do NOT use for AI/agent/conversational search, use algobot-cli instead.
npx skillsauth add algolia/skills instantsearchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build production-quality search experiences with InstantSearch. Follow the workflow below in order. Do not skip steps.
InstantSearch comes in three libraries. Detect which one applies from the project's dependencies or framework, or ask the user.
| Library | Package | When to use |
| ------------------- | --------------------- | -------------------------------------------------------- |
| React InstantSearch | react-instantsearch | React, Next.js, Remix |
| Vue InstantSearch | vue-instantsearch | Vue, Nuxt |
| InstantSearch.js | instantsearch.js | Vanilla JS, or any framework without a dedicated library |
Once identified, use the matching reference directory (e.g., references/react/) for all technology rules, anti-patterns, styling, glossary, and pattern-specific guidance.
Note: This skill currently has references for React InstantSearch only. If the project uses Vue or vanilla JS, let the user know and ask how they'd like to proceed.
Before writing any code, gather context. First check if InstantSearch is already set up in the codebase (search client, provider, existing widgets). If so, read the existing configuration instead of re-asking.
If starting fresh, go step by step, waiting for the user's answer before moving on.
Credentials: Ask the user for their Algolia app ID, search-only API key, and index name.
Query Suggestions: Ask the user if they have a Query Suggestions index.
Schema: Once you have credentials, fetch a few records from the main index to discover the available attributes and their shape. Confirm with the user rather than asking them to list everything. The schema is needed before you can propose rendering options. No need to fetch from the Query Suggestions index: its shape is standard and handled by the widget.
curl -s -X POST \
"https://${APP_ID}.algolia.net/1/indexes/${INDEX_NAME}/query" \
-H "x-algolia-api-key: ${API_KEY}" \
-H "x-algolia-application-id: ${APP_ID}" \
-H "content-type: application/json" \
-d '{"params": "hitsPerPage=5"}'
Project inspection: Read the project's existing styling approach, breakpoints, layout, responsive patterns, component library, and framework details. Identify which InstantSearch library to use (see table above).
Routes: Find the detail page route pattern (e.g., /products/[id], /articles/[slug]) and look for an existing listing or search results page. If one is found, verify it actually reads query parameters and renders dynamic results (not just a static listing). If none is found or the page is static, ask the user: "What page should search redirect to when a query is submitted? Or is there no results page?"
Placement: Find where the search experience should live in the UI. Refer to the pattern's features reference for guidance, or ask the user.
Rendering: Present the user with concrete, numbered options for how results should appear. These depend on the schema (what attributes are available) and the project's design. Refer to the pattern's features reference for options to present.
Do not proceed until you have credentials, schema, rendering preferences, and an understanding of the project's design.
This skill currently covers autocomplete. If the user asks for a different search pattern (e.g., a search results page, faceted search), let them know and ask how they'd like to proceed.
Patterns available for each library:
| Pattern | React | Vue | JS | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | | Autocomplete | features, styling, anti-patterns | — | — |
Also read and apply the library-level references (apply regardless of pattern):
| Reference | React | Vue | JS | | ---------------- | ----------------------------------------------------------- | --- | --- | | Technology rules | technology-rules.md | — | — | | Anti-patterns | anti-patterns.md | — | — | | Styling | styling.md | — | — | | Glossary | glossary.md | — | — |
If you are unsure how to implement a feature with built-in widgets, ask the user. Do not fall back to legacy libraries or custom connectors.
Follow the library's styling guide step by step, then apply the pattern-specific styling guide. Match the site's existing CSS methodology, color scheme, typography, spacing, and component patterns.
Review your work against the library's anti-patterns, the pattern-specific anti-patterns, and the features checklist. Fix any violations.
tools
Search Algolia indices via the Algolia MCP server, retrieve analytics (top searches, no-result rates, click positions, user counts), and get product recommendations (bought-together, related, trending). Triggers on search, indexing, analytics, Algolia, recommendations, MCP.
tools
Use this skill whenever a user wants to execute operations against Algolia indices or accounts — deleting records, copying/migrating indices, backing up data, importing/exporting records, managing API keys, editing synonyms, configuring rules, changing settings like facets, clearing indices, or automating Algolia in CI/CD pipelines. The key signal is that the user wants to *act on* their Algolia data or configuration (server-side / backend / admin operations), regardless of whether they mention "CLI" or "command line." If someone names a specific Algolia index and wants to change, move, query, or manage it, use this skill. Do NOT use for frontend search UI work (InstantSearch, React components, autocomplete widgets), Algolia dashboard GUI questions, or evaluating Algolia vs. other providers.
tools
Use for anything AI/agent/conversational built on Algolia: algobot CLI, Agent Studio, RAG systems, conversational product discovery, genAI content generation from search results (carousels, descriptions, headers), chatbots or recommendation agents using Algolia as retrieval, config-as-code workflows, multi-environment deploy (dev/staging/prod), memory and personalization, MCP tool integrations, conversation history / GDPR retention, or adding a chat widget alongside InstantSearch. Trigger on: "algobot", "Agent Studio", "RAG with Algolia", "conversational experience", "AI agent" + Algolia, "genAI carousel", "chat widget", or building AI features on top of Algolia search. Do NOT use for raw index ops (records, synonyms, settings) — use algolia-cli. Do NOT use for pure frontend search UI (InstantSearch, autocomplete) with no AI/agent layer.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.