dev-toolings/superpowers-symfony115 installs
api-platform-state-providers
Master API Platform State Providers and Processors (v5, 4.4, 4.3) (ProviderInterface/ProcessorInterface) to decouple data retrieval and persistence from entities
How do I install this agent skill?
npx skills add https://github.com/dev-toolings/superpowers-symfony --skill api-platform-state-providersIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides instructional content and code examples for implementing State Providers and Processors in API Platform (Symfony). No security issues or malicious patterns were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Api Platform State Providers (Symfony)
Use when
- Reading data from a source other than the default Doctrine provider.
- Wrapping the Doctrine provider to post-process results (return a DTO, enforce a tenant scope).
- Business logic must run before or after persisting (hashing, slug, dispatching a message).
- A v4 read endpoint must dispatch a query or command through a processor.
Default workflow
- Implement
ProviderInterface::provide()returningiterable|object|null, wherenullgives a 404 (v3.4 declaresmixed). - To keep Doctrine fetching, inject
api_platform.doctrine.orm.state.item_providerandapi_platform.doctrine.orm.state.collection_providerwith#[Autowire]. - Implement
ProcessorInterface::process()and delegate toapi_platform.doctrine.orm.state.persist_processororremove_processor. - Wire them with
provider:andprocessor:on the resource or the operation; autoconfiguration registers them, and theapi_platform.state_providerorapi_platform.state_processortag is only needed without it. - For a processor on
GETorGetCollection, addwrite: true(v4 only).
Guardrails
- Run pre-persist logic before calling the inner processor and side effects after it returns.
- A processor returns the created or modified object, and nothing for
DELETE. write: trueon safe methods is v4 only: v3.4 processors run on write methods only.DataProviderandDataPersisterare v2 interfaces and no longer exist.
Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
Output contract
- The providers and processors added, and the operations they are wired to.
- Which built-in services are decorated.
- Tests for the not-found, success, and side-effect paths.
References
reference.md
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/dev-toolings/superpowers-symfony/api-platform-state-providers">View api-platform-state-providers on skillZs</a>