All skills
davila7 avatar

/algolia-search

@1deb97c

Expert patterns for Algolia search implementation, indexing strategies, React InstantSearch, and relevance tuning Use when: adding search to, algolia, instantsearch, search api, search functionality.

Use this Skill: https://skilld.dev/gh/davila7/claude-code-templates/algolia-search

This session only. Nothing lands on disk.

SKILL.md

≈54 tokens always: the name and description. ≈420 when used: this file.

Algolia Search Integration

Patterns

React InstantSearch with Hooks

Modern React InstantSearch setup using hooks for type-ahead search.

Uses react-instantsearch-hooks-web package with algoliasearch client. Widgets are components that can be customized with classnames.

Key hooks:

  • useSearchBox: Search input handling
  • useHits: Access search results
  • useRefinementList: Facet filtering
  • usePagination: Result pagination
  • useInstantSearch: Full state access

Next.js Server-Side Rendering

SSR integration for Next.js with react-instantsearch-nextjs package.

Use <InstantSearchNext> instead of <InstantSearch> for SSR. Supports both Pages Router and App Router (experimental).

Key considerations:

  • Set dynamic = 'force-dynamic' for fresh results
  • Handle URL synchronization with routing prop
  • Use getServerState for initial state

Data Synchronization and Indexing

Indexing strategies for keeping Algolia in sync with your data.

Three main approaches:

  1. Full Reindexing - Replace entire index (expensive)
  2. Full Record Updates - Replace individual records
  3. Partial Updates - Update specific attributes only

Best practices:

  • Batch records (ideal: 10MB, 1K-10K records per batch)
  • Use incremental updates when possible
  • partialUpdateObjects for attribute-only changes
  • Avoid deleteBy (computationally expensive)

⚠️ Sharp Edges

Issue Severity Solution
Issue critical See docs
Issue high See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides standard integration patterns for Algolia Search with React and Next.js, alongside data synchronization guidelines. No security issues or malicious practices were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1deb97c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 10 hours ago.

Activeupdated 8 months ago
source
vibeship-spawner-skills (Apache 2.0)

README badge

README badge for davila7/claude-code-templates/algolia-search