Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Implementing Search Filter

ASecurity

Implement search and filter interfaces with comprehensive frontend components and backend query optimization.

517 stars
0 votes
0 copies
4 views
Added 12/19/2025
developmentjavascripttypescriptpythongojavasqlreactnextjsfastapidjango

Works with

cursorcliapi

Security Analysis

A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Scanned 2/12/2026

Install to Claude Code

$npx -y skills add ancoleman/ai-design-components --skill implementing-search-filter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Implementing Search Filter?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Implementing Search Filter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ancoleman-implementing-search-filter/badge)](https://www.skillsdirectory.com/skills/ancoleman-implementing-search-filter)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: implementing-search-filter
description: 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.
---

# 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

Attribution

ancolemanancoleman
View sourceMore from ancoleman →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →