implementing-search-filter
Implements search and filter interfaces for both frontend (React/TypeScript) and backend (Python) with debouncing, query management, and database integration. Use when adding search functionality, building filter UIs, implementing faceted search, or optimizing search performance.
Best use case
implementing-search-filter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implements search and filter interfaces for both frontend (React/TypeScript) and backend (Python) with debouncing, query management, and database integration. Use when adding search functionality, building filter UIs, implementing faceted search, or optimizing search performance.
Teams using implementing-search-filter should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-search-filter/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-search-filter Compares
| Feature / Agent | implementing-search-filter | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implements search and filter interfaces for both frontend (React/TypeScript) and backend (Python) with debouncing, query management, and database integration. Use when adding search functionality, building filter UIs, implementing faceted search, or optimizing search performance.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Search & Filter Implementation Implement search and filter interfaces with comprehensive frontend components and backend query optimization. ## Purpose This skill provides production-ready patterns for implementing search and filtering functionality across the full stack. It covers React/TypeScript components for the frontend (search inputs, filter UIs, autocomplete) and Python patterns for the backend (SQLAlchemy queries, Elasticsearch integration, API design). The skill emphasizes performance optimization, accessibility, and user experience. ## When to Use - Building product search with category and price filters - Implementing autocomplete/typeahead search - Creating faceted search interfaces with dynamic counts - Adding search to data tables or lists - Building advanced boolean search for power users - Implementing backend search with SQLAlchemy or Django ORM - Integrating Elasticsearch for full-text search - Optimizing search performance with debouncing and caching - Creating accessible search experiences ## Core Components ### Frontend Search Patterns **Search Input with Debouncing** - Implement 300ms debounce for performance - Show loading states during search - Clear button (X) for resetting - Keyboard shortcuts (Cmd/Ctrl+K) - See `references/search-input-patterns.md` **Autocomplete/Typeahead** - Suggestion dropdown with keyboard navigation - Highlight matched text in suggestions - Recent searches and popular items - Prevent request flooding with debouncing - See `references/autocomplete-patterns.md` **Filter UI Components** - Checkbox filters for multi-select - Range sliders for numerical values - Dropdown filters for single selection - Filter chips showing active selections - See `references/filter-ui-patterns.md` ### Backend Query Patterns **Database Query Building** - Dynamic query construction with SQLAlchemy - Django ORM filter chaining - Index optimization for search columns - Full-text search in PostgreSQL - See `references/database-querying.md` **Elasticsearch Integration** - Document indexing strategies - Query DSL for complex searches - Faceted aggregations - Relevance scoring and boosting - See `references/elasticsearch-integration.md` **API Design** - RESTful search endpoints - Query parameter validation - Pagination with cursor/offset - Response caching strategies - See `references/api-design.md` ## Implementation Workflows ### Client-Side Search (<1000 items) 1. Load data into memory 2. Implement filter functions in JavaScript 3. Apply debounced search on text input 4. Update results instantly 5. Maintain filter state in React ### Server-Side Search (>1000 items) 1. Design search API endpoint 2. Validate and sanitize query parameters 3. Build database query dynamically 4. Apply pagination 5. Return results with metadata 6. Cache frequent queries ### Hybrid Approach 1. Use client-side filtering for immediate feedback 2. Fetch server results in background 3. Merge and deduplicate results 4. Update UI progressively 5. Cache recent searches locally ## Performance Optimization ### Frontend Optimization **Debouncing Implementation** - Use `debounce` from lodash or custom implementation - Cancel pending requests on new input - Show skeleton loaders during fetch - Script: `scripts/debounce_calculator.js` **Query Parameter Management** - Sync filters with URL for shareable searches - Use React Router or Next.js for URL state - Compress complex queries - See `references/query-parameter-management.md` ### Backend Optimization **Query Optimization** - Create appropriate database indexes - Use query analyzers to identify bottlenecks - Implement query result caching - Script: `scripts/generate_filter_query.py` **Validation & Security** - Sanitize all search inputs - Prevent SQL injection - Rate limit search endpoints - Script: `scripts/validate_search_params.py` ## Accessibility Requirements ### ARIA Patterns - Use `role="search"` for search regions - Implement `aria-live` for result updates - Provide clear labels for filters - Support keyboard-only navigation ### Keyboard Support - Tab through all interactive elements - Arrow keys for autocomplete navigation - Escape to close dropdowns - Enter to select/submit ## Technology Stack ### Frontend Libraries **Primary: Downshift (Autocomplete)** - Accessible autocomplete primitives - Headless/unstyled for flexibility - WAI-ARIA compliant - Install: `npm install downshift` **Alternative: React Select** - Full-featured select/filter component - Built-in async search - Multi-select support ### Backend Technologies **Python/SQLAlchemy** - Dynamic query building - Relationship loading optimization - Query result pagination **Python/Django** - Django Filter backend - Django REST Framework filters - Full-text search with PostgreSQL **Elasticsearch (Python)** - elasticsearch-py client - elasticsearch-dsl for query building ## Bundled Resources ### References - `references/search-input-patterns.md` - Input implementations - `references/autocomplete-patterns.md` - Typeahead patterns - `references/filter-ui-patterns.md` - Filter components - `references/database-querying.md` - SQL query patterns - `references/elasticsearch-integration.md` - Elasticsearch setup - `references/api-design.md` - API endpoint patterns - `references/performance-optimization.md` - Performance tips - `references/library-comparison.md` - Library evaluation ### Scripts - `scripts/generate_filter_query.py` - Build SQL/ES queries - `scripts/validate_search_params.py` - Validate inputs - `scripts/debounce_calculator.js` - Calculate debounce timing ### Examples - `examples/product-search.tsx` - E-commerce search - `examples/autocomplete-search.tsx` - Autocomplete implementation - `examples/sqlalchemy_search.py` - SQLAlchemy patterns - `examples/fastapi_search.py` - FastAPI search endpoint - `examples/django_filter_backend.py` - Django filters ### Assets - `assets/filter-config-schema.json` - Filter configuration - `assets/search-api-spec.json` - OpenAPI specification
Related Skills
lead-research-assistant
Researches and identifies potential customers, leads, and business opportunities for your product or service. Analyzes your offering, finds relevant companies and decision makers, provides contact information, and suggests outreach strategies. Use when looking for leads, researching target customers, identifying decision makers, or planning sales outreach.
Implementing Observability
Instrument the application with Logging, Metrics, and Tracing (OpenTelemetry) to understand system behavior and debug production issues.
implementing-error-handling
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
google-search-console-automation
Automate Google Search Console tasks via Rube MCP (Composio): search performance, URL inspection, sitemaps, and indexing status. Always search tools first for current schemas.
evaluative-research
Methodology for evaluating options, comparing technologies, and making evidence-based decisions between alternatives. Use when the user needs to choose between competing approaches, libraries, or architectures with a structured comparison. Triggers when user says "compare these options", "which approach should we use", "evaluate alternatives", "help me decide between X and Y", "technology comparison", or wants a structured pros/cons/recommendation analysis.
enterprise-search-knowledge-synthesis
Combines search results from multiple sources into coherent, deduplicated answers with source attribution. Handles confidence scoring based on freshness and authority, and summarizes large result sets effectively.
deep-research
Multi-agent deep research pipeline for complex questions (EIP analysis, architecture decisions, cross-client comparisons, protocol design). Use when single-shot answers are insufficient and you need decomposition, parallel investigation, adversarial critique, and a formal output document.
copilot-search
Search the web using Claude Code's WebSearch/WebFetch tools combined with GitHub Copilot CLI to find current documentation, best practices, solutions, and technical information. Use when the user needs to research libraries, find API documentation, troubleshoot errors, or learn about new technologies. Requires Copilot CLI installed.
context7-auto-research
Automatically fetch latest library/framework documentation for Claude Code via Context7 API
codex-web-search
Codex CLI 環境内で Gemini CLI を使用した Web 検索を実行。技術情報、最新ニュース、一般的なリサーチに対応。Use when user asks to search the web, look up information, find recent news, or research a topic within Codex CLI. Also use when user says 調べて, 検索して, 最新情報, ニュース, リサーチ.
codex-search
Search the web using OpenAI Codex CLI to find current documentation, best practices, solutions, and technical information. Use when the user needs to research libraries, find API documentation, troubleshoot errors, or learn about new technologies. Requires Codex CLI installed.
code-surgeon-context-researcher
Use when analyzing a codebase to select relevant files, build dependency maps, and extract architectural patterns for informed implementation planning