api-platform-resources
Skill2 starsChanged 6 months agoMITView on GitHub
Design or evolve API Platform 4.3 resources — choose operations (Get/GetCollection/Post/Put/Patch/Delete), apply the Resource-First principle (Resource ≠ Entity), enforce the IRI-only relation rule, model subresources with Link(fromClass:, toProperty:), set shortName / uriTemplate / itemUriTemplate, configure content negotiation (formats, patch_formats, LDP Allow/Accept-Post 4.3), and avoid the legacy Symfony controllers pattern. Trigger on requests like "create an API resource", "add an operation", "expose nested orders under a customer", or "model a subresource".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- fatonh/symfony-skillstheir own version, first seen Jun 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- fatonh/symfony-skills★ 35same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- api-platform-dto-resourcesSkill
- api-platform-errorsSkill
- api-platform-file-uploadSkill
- api-platform-filtersSkill
- api-platform-identifiersSkill
- api-platform-mcpSkill
- api-platform-mutatorsSkill
- api-platform-openapiSkill
- api-platform-paginationSkill
- api-platform-performanceSkill
- api-platform-resilienceSkill
- api-platform-securitySkill
- api-platform-serializationSkill
- api-platform-state-processorsSkill
- api-platform-state-providersSkill
- api-platform-testsSkill
- api-platform-upgradeSkill
- api-platform-userSkill
- api-platform-versioningSkill
- bootstrap-checkSkill
- brainstormingSkill
- config-env-parametersSkill
- controller-cleanupSkill
- cqrs-and-handlersSkill
- daily-workflowSkill
- doctrine-batch-processingSkill
- doctrine-fetch-modesSkill
- doctrine-fixtures-foundrySkill
- doctrine-migrationsSkill
- doctrine-relationsSkill
- doctrine-transactionsSkill
- effective-contextSkill
- executing-plansSkill
- functional-testsSkill
- interfaces-and-autowiringSkill
- makefile-disciplineSkill
- messenger-retry-failuresSkill
- ports-and-adaptersSkill
- quality-checksSkill
- rate-limitingSkill
- runner-selectionSkill
- strategy-patternSkill
- symfony-cacheSkill
- symfony-messengerSkill
- symfony-schedulerSkill
- symfony-votersSkill
- tdd-with-pestSkill
- tdd-with-phpunitSkill
- test-doubles-mockingSkill
- using-symfony-superpowersSkill
- value-objects-and-dtosSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
No magic operations: declare each one.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Platform 4.3 — Resources & operations
Use when
- Designing a new
#[ApiResource]or evolving an existing one. - Choosing which operations to expose and how to scope them.
- Modeling subresources (orders under a customer, items under an order).
- Forcing the IRI-only rule on relations.
Default workflow
- Define the operation boundary — which payload, which invariants, which actor.
- Declare the operations explicitly (
new Get(...),new Post(...), etc.) with per-operation groups, security, validation. - Apply the Resource-First principle — keep the Resource decoupled from the Entity unless they are genuinely identical.
- Validate the contract end-to-end (
debug:router,api:openapi:export, functional tests).
Guardrails
- Resource ≠ Entity. The Resource is the external contract; do not let it leak Doctrine specifics.
- IRI-only on relations: never accept a scalar
int $customerId, always aCustomer $customerthat API Platform resolves from/api/customers/.... - No
use_symfony_listeners: trueunless you really need a Symfony controller — the providers/processors path is preferred. - No magic operations: declare each one.
paginationItemsPerPagedefault is 30 in 4.x (not 20).
Progressive disclosure
SKILL.mdcovers posture and decisions.reference.mdcarries the full 4.3 patterns: subresources withLink,itemUriTemplate, content negotiation, anti-patterns, legacy controllers (to avoid).
Output contract
- Updated
#[ApiResource]attributes with explicit operations and contexts. - Justification for IRI-only (or, exceptionally, embedded) choices.
- Functional test coverage on each operation, including 404 / 401 / 403 / 422.
- Generated routes confirmed via
php bin/console debug:router | grep api.
References
reference.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

