api-platform-state-providers — Claude Code skill: setup guide
Configures API Platform State Providers and Processors in Symfony. It helps decouple data retrieval and persistence from Doctrine entities.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a claude-codeWhat api-platform-state-providers does
This skill guides Claude Code through implementing ProviderInterface and ProcessorInterface across API Platform versions 4.3, 4.4, and v5. It helps fetch records from custom stores or decorate default Doctrine services with #[Autowire].
For write pipelines, it wires processors delegating to built-in persist or remove handlers. Keep in mind that legacy DataProvider and DataPersister interfaces from v2 are obsolete, and setting write: true on safe methods requires API Platform v4.
What it helps with
- fetch API resource state from external services instead of Doctrine
- decorate built-in providers to return DTOs or enforce tenant scopes
- execute business logic like password hashing before persisting entities
- attach processors to GET endpoints using the
write: trueoption
Example prompts for the agent
- Create a custom State Provider that returns a user DTO from an external service.
- Decorate the Doctrine item provider to enforce a tenant boundary.
- Implement a State Processor to dispatch an event before persisting the entity.
How to install api-platform-state-providers
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a claude-code2Manually: put the files in place
~/.claude/skills/api-platform-state-providers/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-platform-state-providers/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a codex2Manually: put the files in place
.agents/skills/api-platform-state-providers/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a cursor2Manually: put the files in place
.cursor/skills/api-platform-state-providers/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/api-platform-state-providers2Manually: put the files in place
.github/skills/api-platform-state-providers/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/api-platform-state-providersManually: put the files in place
.devin/skills/api-platform-state-providers/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-state-providers
How do I install api-platform-state-providers in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill api-platform-state-providers -a claude-code. You can also place the skill file directly at ~/.claude/skills/api-platform-state-providers/SKILL.md.
What does api-platform-state-providers do?
It equips Claude Code with workflows for decoupling data access in Symfony API Platform. It covers custom providers, processors, DTO transformations, and test patterns.
Does it support legacy API Platform v2 DataPersister interfaces?
It does not support v2 contracts because they were removed. The skill works strictly with modern ProviderInterface and ProcessorInterface.
Source text
SKILL.md · MIT
--- name: api-platform-state-providers description: Master API Platform State Providers and Processors (v5, 4.4, 4.3) (ProviderInterface/ProcessorInterface) to decouple data retrieval and persistence from entities 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 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 1. Implement `ProviderInterface::provide()` returning `iterable|object|null`, where `null` gives a 404 (v3.4 declares `mixed`). 2. To keep Doctrine fetching, inject `api_platform.doctrine.orm.state.item_provider` and `api_platform.doctrine.orm.state.collection_provider` with `#[Autowire]`. 3. Implement `ProcessorInterface::process()` and delegate to `api_platform.doctrine.orm.state.persist_processor` or `remove_processor`. 4. Wire them with `provider:` and `processor:` on the resource or the operation; autoconfiguration registers them, and the `api_platform.state_provider` or `api_platform.state_processor` tag is only needed without it. 5. For a processor on `GET` or `GetCollection`, add `write: 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: true` on safe methods is v4 only: v3.4 processors run on write methods only. - `DataProvider` and `DataPersister` are 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`
© dev-toolings · MIT · dev-toolings/superpowers-symfony