add-query-filter
Add custom query parameter filters to entity endpoints. Use when extending search/filter capabilities beyond the base pagination. Triggers on "add filter", "query parameter", "search filter", "filter by".
npx skills add majiayu000/claude-skill-registry --skill add-query-filter-madooei-backend-template --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Add Query Filter Adds custom query parameter filters to entity schemas and repository implementations. ## Quick Reference **Files to modify**: 1. `src/schemas/{entity}.schema.ts` - Add filter to query params schema 2. `src/repositories/mockdb/{entity}.mockdb.repository.ts` - Implement filter logic 3. `src/repositories/mongodb/{entity}.mongodb.repository.ts` - Implement filter logic 4. `tests/schemas/{entity}.schema.test.ts` - Test new filter 5. `tests/repositories/{entity}.*.repository.test.ts` - Test filter behavior ## Prerequisites - Entity schema exists with `{entity}QueryParamsSchema` - Repository implementations exist ## Instructions ### Step 1: Add Filter to Query Params Schema Update `src/schemas/{entity}.schema.ts`: ```typescript import { z } from "zod"; import { queryParamsSchema } from "@/schemas/shared.schema"; // Extend the base query params with entity-specific filters export const {entity}QueryParamsSchema = queryParamsSchema.extend({ // Existing filters... createdBy: z.string().optional(), // Add new filter {filterName}: z.string().optional(), // OR for enum filter status: z.enum(["draft", "published", "archived"]).optional(), // OR for boolean filter (from query s
- Quick Reference
- Prerequisites
- Instructions
- Step 1: Add Filter to Query Params Schema
- Step 2: Implement Filter in MockDB Repository
- Step 3: Implement Filter in MongoDB Repository
- Step 4: Add Schema Tests
- Step 5: Add Repository Tests
- Common Filter Patterns
- String Exact Match
- String Array (IN query)
- Partial Text Match
- Null/Not Null Check
- Adding MongoDB Indexes for Filters
What does the add-query-filter skill do?
Add custom query parameter filters to entity endpoints. Use when extending search/filter capabilities beyond the base pagination. Triggers on "add filter", "query parameter", "search filter", "filter by".
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill add-query-filter-madooei-backend-template --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
