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.
npx agentmods add skills/gerard-labs/superpowers-api-platform/api-platform-state-providersnpx skills add gerard-labs/superpowers-api-platform --skill api-platform-state-providersgit clone --depth 1 https://github.com/gerard-labs/superpowers-api-platformWrote 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.
[](https://agentmods.dev/skills/gerard-labs/superpowers-api-platform/api-platform-state-providers)<a href="https://agentmods.dev/skills/gerard-labs/superpowers-api-platform/api-platform-state-providers"><img src="https://agentmods.dev/badge/skills/gerard-labs/superpowers-api-platform/api-platform-state-providers.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00118 | $0.00554 |
| Opus 5 | $0.00059 | $0.00277 |
| Sonnet 5 | $0.00024 | $0.00111 |
| Haiku 4.5 | $0.00012 | $0.00055 |
Grade A, and why
api-platform-state-providers 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 6d 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.
What it actually says
API Platform 4.3 — State Providers
Use when
- A
Get/GetCollectionoperation needs a transformation between the data source and the API representation. - You want to decorate the Doctrine read pipeline (e.g. to add audit logging or shape an Output DTO).
- A response payload depends on a request header (versioning, locale).
- A Resource is backed by a non-Doctrine source (external API, in-memory store, search engine).
Default workflow
- Scaffold with
php bin/console make:state-provider. - Inject the Doctrine item / collection providers via
#[Autowire(service: '…')](modern decoration pattern). - Discriminate collection vs item with
$operation instanceof CollectionOperationInterface. - Return
nullfor missing items (API Platform emits a 404 automatically). - Wire on the operation:
new Get(provider: MyProvider::class).
Guardrails
- Inject a repository or a service, never
EntityManagerInterfacedirectly inside a Provider. - Do not code role checks inside the Provider — use
security:on the operation or a voter. - Do not persist from a Provider; that is the Processor's job.
- Remove any
SerializerAwareProviderInterface/SerializableProviderimplementation — those interfaces are deprecated since 4.2 and gone in 5.0.
Progressive disclosure
SKILL.mdcovers the basic pattern and rules.reference.mdcarries the full decoration recipe, the collection-vs-item discriminator, a header-versioned example, and an N+1-avoidance reminder.
Output contract
- A new Provider class in
src/State/wired on the operation. - Functional tests covering the happy path and the null/404 case.
- No legacy interfaces remaining; no hardcoded security inside the Provider.
References
reference.md
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.
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.
- 6d ago First seen · 45 lines · 118 tokens per session scan A b73487ef95aa
api-platform-state-providers is a skill published in the GitHub repository gerard-labs/superpowers-api-platform (2 stars, last pushed 3mo ago), licensed MIT. It adds 118 tokens to every session and 554 once invoked, about $0.0006 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.
Other skills, from other repositories
symfony:doctrine-events
React to Doctrine entity lifecycle in Symfony with attribute listeners (#[AsDoctrineListener]/#[AsEntityListener], ORM 3) and lifecycle callbacks.
symfony:api-platform-dto-resources
Map entities to API DTOs in API Platform v4 with the Symfony Object Mapper (#[Map], stateOptions) for decoupled input/output contracts.
symfony:api-platform-filters
Implement API Platform filters - v4 Parameters API (QueryParameter) and legacy.
symfony:api-platform-versioning
Evolve API Platform APIs via deprecation (deprecationReason/sunset, RFC 8594/9745), the recommended alternative to versioning; plus path/header strategies.
symfony:config-env-parameters
Manage Symfony configuration with .env files, parameters, secrets vault, and environment-specific settings.
symfony:doctrine-fetch-modes
Optimize Doctrine fetching with DTO hydration (SELECT NEW; partial removed in ORM 3), lazy loading, query hints, and DBAL 4 access.