api-platform-filters — Claude Code skill: what it does, how to install
api-platform-filters tells the agent how to wire search, range, date and boolean filters into API Platform collection endpoints in Symfony, and how to leave the deprecated attribute behind.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a claude-codeWhat api-platform-filters does
The skill fixes the order of work: declare parameters with QueryParameter on the operation, then choose a filter class for each parameter. #[ApiFilter] has been deprecated since 4.4, so it survives only in 3.4 code or code that has not been migrated yet.
Which class you get depends on the installed version. Search runs through PartialSearchFilter or FreeTextQueryFilter, ranges through ComparisonFilter, sorting needs SortFilter 4.3, chaining needs ChainFilter 4.4. A custom filter implements FilterInterface and pulls its value out of $context['parameter']. AbstractFilter and filterProperty() are deprecated since 4.4 as well, so they stay in 4.3 and 3.4 code.
Guardrails cover the rest. strictQueryParameterValidation makes unknown query parameters return 400, filtered columns get an #[ORM\Index], and the endpoint is called with matching and non-matching values. Ids and foreign keys take exact matching, because a partial LIKE %value% cannot use an index. Custom filters bind values with generateParameterName() and setParameter() instead of building the query string by hand.
What it helps with
- add search across several properties behind one query parameter
- move
#[ApiFilter]declarations onto the Parameters API - write a filter with query logic the built-in classes miss
- reject unknown query parameters with a 400
- index the columns clients filter on
Example prompts for the agent
- Add filters to the
/api/productscollection: name search, price range and sorting. - Migrate the
#[ApiFilter]attributes in this resource toQueryParameter. - Write a custom filter for the
statusfield and turn onstrictQueryParameterValidation.
How to install api-platform-filters
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a claude-code2Manually: put the files in place
~/.claude/skills/api-platform-filters/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-platform-filters/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a codex2Manually: put the files in place
.agents/skills/api-platform-filters/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a cursor2Manually: put the files in place
.cursor/skills/api-platform-filters/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/api-platform-filters2Manually: put the files in place
.github/skills/api-platform-filters/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/api-platform-filtersManually: put the files in place
.devin/skills/api-platform-filters/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about api-platform-filters
How do I install api-platform-filters in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill api-platform-filters -a claude-code. The skill file lands at ~/.claude/skills/api-platform-filters/SKILL.md.
What does api-platform-filters do?
It tells the agent to declare filters with QueryParameter on the operation, pick a filter class that matches the installed API Platform version, and verify the endpoint with real requests.
Do I still need #[ApiFilter]?
Only for 3.4 code or resources that were never migrated, since the attribute is deprecated from 4.4 onward. The skill works with parameters on the operation and mentions api:upgrade-filter for the conversion.
Source text
SKILL.md · MIT
--- name: api-platform-filters description: "Implement API Platform filters - Parameters API (QueryParameter, v5/4.4/4.3) and the #[ApiFilter] attribute deprecated since 4.4 - for search, date, range, boolean, and custom filtering" capabilities: [read, search, edit, shell] tags: [api-platform] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep - Write - Edit - Bash --- # Api Platform Filters (Symfony) ## Use when - A collection endpoint needs search, exact match, range, date, boolean, or sort query parameters. - One query parameter must search across several properties. - A filter needs custom query logic that the built-in filters do not cover. - Migrating `#[ApiFilter]` declarations (deprecated since 4.4) to the Parameters API, by hand or with `api:upgrade-filter`. ## Default workflow 1. Declare `parameters` with `QueryParameter` on the operation; keep `#[ApiFilter]` only in 3.4 code or code not yet migrated. 2. Choose a filter class per parameter, checking the installed version: `ExactFilter`, `PartialSearchFilter`, `FreeTextQueryFilter`, `OrFilter`, `IriFilter` (4.2+), `ComparisonFilter`, `SortFilter` (4.3+), `StartSearchFilter`, `EndSearchFilter`, `ChainFilter` (4.4+). 3. For a custom filter, implement `FilterInterface` and read the bound value from `$context['parameter']` (`AbstractFilter` and `filterProperty()` are deprecated since 4.4: keep them for 4.3 and 3.4 code). 4. Turn on `strictQueryParameterValidation` so unknown query parameters return 400. 5. Add `#[ORM\Index]` on filtered columns, then request the endpoint with matching and non-matching values. ## Guardrails - Keep filter classes stateless: take request data from `$context`, not the constructor. - Expose only the properties clients need to filter on. - Use exact matching for ids and foreign keys: partial `LIKE %value%` cannot use an index. - In custom filters, validate the value and bind it with `generateParameterName()` and `setParameter()`, never by string concatenation. ## Progressive disclosure - Use this file for execution posture and risk controls. - Open references when deep implementation details are needed. ## Output contract - The parameters per operation, with filter class and accepted syntax (for example `?price[gte]=1000`). - Indexes added for the filtered columns. - Tests for a match, an empty result, and an unknown parameter. ## References - `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony