Skip to main content
skill CX Codex

api-platform-resources — Claude Code skill: API setup

api-platform-resources is a Claude Code skill for configuring API Platform resources for REST and GraphQL. It activates for resource creation and changes to operations, pagination, or OpenAPI docs.

MIT ★ 234 updated 2026-10-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dev-toolings/superpowers-symfony --skill api-platform-resources -a claude-code
Open on GitHub

What api-platform-resources does

The skill helps define a class with #[ApiResource], choose its CRUD operations, and configure collection pagination. For API documentation, it uses typed OpenAPI objects rather than an openapiContext array.

Once an operation is declared, API Platform stops adding the automatic CRUD set. For example, operations: [new Get()] does not add a collection operation, Post, or Delete. The skill also guides checks of generated routes and tests for declared operations. On Symfony 6.4 LTS, pin the API Platform components to ~4.3.0.

What it helps with

  • expose a class as an API resource
  • choose the exact CRUD operations
  • configure collection pagination
  • document operations with typed OpenAPI objects
  • check routes and tests for declared operations

Example prompts for the agent

  • Expose this class with #[ApiResource] and list the operations it should support.
  • Configure pagination for this collection through the resource attributes.
  • Replace openapiContext with typed OpenAPI objects, then check the routes.

How to install api-platform-resources

1Skills CLI (Vercel)

npx skills add dev-toolings/superpowers-symfony --skill api-platform-resources -a claude-code

2Manually: put the files in place

~/.claude/skills/api-platform-resources/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/api-platform-resources/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about api-platform-resources

How do I install api-platform-resources in Claude Code?

Run npx skills add dev-toolings/superpowers-symfony --skill api-platform-resources -a claude-code. The skill file is at ~/.claude/skills/api-platform-resources/SKILL.md.

What does api-platform-resources do?

It guides API Platform resource setup, including operations, pagination, and typed OpenAPI documentation. It also covers checking generated routes and tests.

What happens when I declare an explicit operation list?

Declaring any operation disables automatic CRUD generation. For instance, operations: [new Get()] does not add collection, Post, or Delete operations.

Source text

SKILL.md · MIT
---
name: api-platform-resources
description: Configure API Platform resources (v5, 4.4, 4.3) with explicit operations, pagination, and typed OpenAPI for clean, versioned REST/GraphQL APIs
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 Resources (Symfony)

## Use when
- Exposing a new entity or class as an `#[ApiResource]`.
- Choosing exactly which of `Get`, `GetCollection`, `Post`, `Put`, `Patch`, and `Delete` the API offers.
- Tuning collection pagination (items per page, partial pagination, client control).
- Documenting operations with typed OpenAPI objects instead of `openapiContext` arrays.

## Default workflow
1. Install only the components you need: `api-platform/symfony`, `api-platform/doctrine-orm`, and optionally `api-platform/graphql`; on Symfony 6.4 LTS, pin them to `~4.3.0`.
2. List every operation in `operations:`, since declaring any one stops the automatic CRUD, and `Put` is never automatic.
3. Set `uriTemplate`, `requirements`, `status`, or `routePrefix` only where the defaults do not fit.
4. Configure pagination through resource attributes or `api_platform.defaults` in `config/packages/api_platform.yaml`.
5. Describe operations with `openapi:` model objects, set `validationContext` groups, then check the routes and the OpenAPI export.

## Guardrails
- Declaring one operation removes the default CRUD: an `operations: [new Get()]` resource has no collection, `Post`, or `Delete`.
- `openapiContext` arrays are deprecated in v4: use the typed `openapi:` option.
- `collectionOperations` and `itemOperations` no longer exist.
- `paginationClientEnabled` lets clients disable pagination: keep `paginationMaximumItemsPerPage` set.

## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.

## Output contract
- The resource class with its explicit operation list and the routes it produces.
- Pagination and OpenAPI settings, with the reason for each override.
- Route listing and test results for each declared operation.

## References
- `reference.md`

© dev-toolings · MIT · dev-toolings/superpowers-symfony

Similar skills

All skills for Backend and APIs →

From the same set51

The whole set →
api-platform-security api-platform-security secures API Platform operations with security expressions, voters, and validation-phase access checks in Symfony. CX Codex +1 ★ 234repo stars e2e-panther-playwright The e2e-panther-playwright skill guides Symfony E2E tests with Panther for browser flows and Playwright for more involved cases. Use it when JavaScript behavior is beyond what WebTestCase can observe. CX Codex +1 ★ 234repo stars doctrine-relations Skill guides you through defining Doctrine relationships (OneToMany, ManyToMany, ManyToOne) with correct owning and inverse sides, cascade strategies, and N+1 query prevention. CX Codex +1 ★ 234repo stars doctrine-fetch-modes doctrine-fetch-modes guides Doctrine ORM and DBAL 4 query optimization in Symfony. Fixes N+1 queries, configures lazy loading, and implements DTO hydration. CX Codex +1 ★ 234repo stars messenger-retry-failures messenger-retry-failures sorts out failed Symfony Messenger handlers: whether a message deserves another attempt, when it goes straight to the failure transport, and how to pull it back. CX Codex +1 ★ 234repo stars api-platform-state-providers Configures API Platform State Providers and Processors in Symfony. It helps decouple data retrieval and persistence from Doctrine entities. CX Codex +1 ★ 234repo stars api-platform-dto-resources The api-platform-dto-resources skill decouples your API contract from Doctrine entities in API Platform via Symfony's Object Mapper. CX Codex +1 ★ 234repo stars api-platform-filters api-platform-filters tells the agent how to wire search, range, date and boolean filters into API Platform collection endpoints in Symfony, and how to leave the deprecated attribute behind. CX Codex +1 ★ 234repo stars

Project sponsors

Companies that keep this analytics open