api-platform-filters

api-platform-filters is a skill for Claude Code, Codex from gerard-labs/superpowers-api-platform. It costs 240 tokens per session (905 once invoked), scanned A, original, MIT.

A guide for adding query filters to API Platform 4.3 web endpoints. These filters let clients search, sort, compare, or select only certain fields in returned data.

In plain words
What is it for?
Use it to add exact or partial search, sorting, ranges, full-text search, UUID or linked-resource filters, sparse fieldsets, custom filters, and tenant-specific data restrictions.
Why use it?
It removes guesswork around the newer query-parameter approach and helps avoid invalid filters, slow database queries, and untested edge cases.

Skill for Claude CodeCodex

Part of the gerard plugin — 53 skills, 25 commands, 7 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gerard-labs/superpowers-api-platform/api-platform-filters
Any agent
npx skills add gerard-labs/superpowers-api-platform --skill api-platform-filters
Clone the repo
git clone --depth 1 https://github.com/gerard-labs/superpowers-api-platform

Made for: Claude Code, Codex.

Or install gerard, the plugin that ships this one along with the rest of its 53 skills, 25 commands, 7 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-platform-filters

README.md
[![agentmods](https://agentmods.dev/badge/skills/gerard-labs/superpowers-api-platform/api-platform-filters.svg)](https://agentmods.dev/skills/gerard-labs/superpowers-api-platform/api-platform-filters)
Your own site
<a href="https://agentmods.dev/skills/gerard-labs/superpowers-api-platform/api-platform-filters"><img src="https://agentmods.dev/badge/skills/gerard-labs/superpowers-api-platform/api-platform-filters.svg" alt="Measured on agentmods" height="20"></a>
Per session 240 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 905 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00240 $0.00905
Opus 5 $0.00120 $0.00452
Sonnet 5 $0.00048 $0.00181
Haiku 4.5 $0.00024 $0.00090

Measured 5d ago against content hash 7dadf1d5c3ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

api-platform-filters scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/api-platform-filters/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Platform 4.3 — Filters (modern parameters pattern)

Use when

  • Adding any query filter, sort, range, or full-text search to a GetCollection.
  • Replacing existing #[ApiFilter] annotations (legacy) with the 4.3 modern pattern.
  • Implementing a custom filter via FilterInterface + Json Schema + OpenAPI traits.
  • Wiring a Parameter Provider (IRI converter, read link, custom dynamic group).
  • Enforcing multi-tenant row-level security via a Doctrine SQL Filter.

Default workflow

  1. Identify the columns that must be filterable, sortable, or full-text searchable.
  2. Declare parameters: [...] on the operation with one new QueryParameter(filter: new XxxFilter(), property: '...') per parameter.
  3. Add castToNativeType / castToArray / castFn where the value needs a type or transformation.
  4. Index every filtered column (#[ORM\Index]) and a functional index for case-insensitive partial searches.
  5. Write tests that exercise each filter + boundary cases.

Guardrails

  • property is mandatory in 4.3 on ExactFilter, IriFilter, PartialSearchFilter, UuidFilter — otherwise InvalidArgumentException at compile time. Use the literal property name or the :property placeholder.
  • Never use #[ApiFilter] or extends AbstractFilter in new code — both are deprecated since 4.2 and removed in 5.0.
  • IriFilter for FKs, never an ExactFilter on a scalar userId (IRI-only rule).
  • Indexing is non-optional — without an index, a filter becomes a full scan.
  • PartialSearchFilter sparingly — a case-insensitive partial search bypasses btree indexes; add a functional index on LOWER(col) when used.

Progressive disclosure

  • SKILL.md lists posture, the modern pattern, and rules.
  • reference.md carries the full catalogue, dot-notation nested filters, FreeTextQueryFilter + OrFilter, ComparisonFilter operators (incl. ne 4.3), SortFilter nullsComparison, custom filter recipe (interfaces + traits), Parameter Providers (4.3), PropertyFilter native (4.3), default global parameters, Doctrine SQL Filter for multi-tenant, and the make:filter orm/odm generator.

Read the full file on GitHub · 48 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 48 lines · 240 tokens per session scan A 7dadf1d5c3ad

Subscribe to this mod's changes

api-platform-filters is a skill published in the GitHub repository gerard-labs/superpowers-api-platform (2 stars, last pushed 3mo ago), licensed MIT. It adds 240 tokens to every session and 905 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.