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-processorsnpx skills add gerard-labs/superpowers-api-platform --skill api-platform-state-processorsgit 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-processors)<a href="https://agentmods.dev/skills/gerard-labs/superpowers-api-platform/api-platform-state-processors"><img src="https://agentmods.dev/badge/skills/gerard-labs/superpowers-api-platform/api-platform-state-processors.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 | $0.00000 | $0.00639 |
| Opus 5 | $0.00000 | $0.00319 |
| Sonnet 5 | $0.00000 | $0.00128 |
| Haiku 4.5 | $0.00000 | $0.00064 |
Grade A, and why
api-platform-state-processors 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 3d 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.
This is a copy
86% identical to tg-rich-digest — 385 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
What it actually says
API Platform 4.3 — State Processors
Use when
- A
Post/Put/Patch/Deleteoperation needs custom write logic (transformation, dispatching, side effect). - You want to decorate the Doctrine persist / remove processor while keeping the default behavior.
- The write must be asynchronous (long ERP call, PDF generation) — use the native Messenger mode.
- You apply CQRS and want to dispatch a Command to a bus instead of persisting directly.
Default workflow
- Scaffold with
php bin/console make:state-processor. - Inject
api_platform.doctrine.orm.state.persist_processor(andremove_processorwhen relevant) via#[Autowire(service: ...)]. - Discriminate
Deletewith$operation instanceof DeleteOperationInterfaceif a single Processor covers all writes. - For async-only operations, prefer the native
messenger: 'input'mode +status: 202over a custom Processor. - Wire on the operation:
new Post(processor: MyProcessor::class).
Guardrails
- No business logic in the Processor — orchestrate a service or a CQRS handler.
- Wrap multi-entity writes in a transaction (
wrapInTransactionordoctrine_transactionmiddleware). - POST returns the persisted entity / DTO (API Platform emits 201 + Location).
- DELETE returns
null(API Platform emits 204). - If you want Doctrine persist + async dispatch, decorate
persist_processor. Do not usemessenger: true, which bypasses Doctrine entirely.
Progressive disclosure
SKILL.mdcovers posture and rules.reference.mdcarries the full Autowire decoration recipe, the native Messenger modes, the CQRS pattern, theDeleteOperationInterfacediscriminator, and the 202 /output: falsesemantics.
Output contract
- A new Processor class in
src/State/wired on the operation. - Transactional integrity guaranteed for multi-entity writes.
- Functional tests for the happy path + 422 + 403 + idempotency / retry where async is involved.
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.
- 3d ago First seen · 46 lines · 0 tokens per session scan A 6ba1dea4cdf7
api-platform-state-processors is a skill published in the GitHub repository gerard-labs/superpowers-api-platform (2 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 639 tokens. A static security scan graded it A with 0 findings. It is 86% identical to tg-rich-digest, differing in 385 lines, and is treated as a copy.
Other skills, from other repositories
api-integrations
Expose external APIs to Falcon Foundry via OpenAPI specs. TRIGGER when user asks to "create an API integration", "adapt an OpenAPI spec for Foundry", "expose an API to workflows", "connect to a third-party API", or runs foundry api-integrations create. Also trigger when user has an OpenAPI/Swagger spec and wants it…
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:bootstrap-check
Verify Symfony project configuration including .env, services.yaml, doctrine settings, and framework requirements.