api-platform-dto-resou…
Map entities to API DTOs in API Platform (v5, 4.4, 4.3) with the Symfony Object Mapper (#[Map], stateOptions) for decoupled…
Optimize Doctrine fetching with DTO hydration (SELECT NEW), fetch joins, lazy loading, query hints, and DBAL 4 access
Claude Code
$ npx -y skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes --agent claude-code
Codex
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a codex -y
Cursor
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a cursor -y
Gemini CLI
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a gemini-cli -y
GitHub Copilot
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a github-copilot -y
OpenCode
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a opencode -y
Windsurf
$ npx skills add dev-toolings/superpowers-symfony --skill doctrine-fetch-modes -a windsurf -y
name: doctrine-fetch-modes description: Optimize Doctrine fetching with DTO hydration (SELECT NEW), fetch joins, lazy loading, query hints, and DBAL 4 access capabilities: [read, search, edit, shell] tags: [doctrine, performance] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep - Write - Edit - Bash
1. Confirm the N+1 or over-fetch in the Symfony profiler before changing any mapping. 2. Keep relations on `fetch: 'LAZY'`; set `fetch: 'EXTRA_LAZY'` on large collections so `count()`, `contains()` and `slice()` run targeted SQL. 3. Load the relations a use case needs with a fetch join in the repository (`addSelect()` plus `leftJoin()`). 4. For read-only lists, project into a `readonly` DTO with `SELECT NEW` (constructor argument order must match the `NEW` list). 5. Use `Query::HINT_READ_ONLY` or an index-by alias (`createQueryBuilder('p', 'p.id')`) when the result is only displayed or looked up by id. 6. For raw SQL, use the DBAL 4 methods (`fetchAllAssociative()`, `fetchOne()`, `executeStatement()`).
Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.
Map entities to API DTOs in API Platform (v5, 4.4, 4.3) with the Symfony Object Mapper (#[Map], stateOptions) for decoupled…
Implement API Platform filters - Parameters API (QueryParameter, v5/4.4/4.3) and the #[ApiFilter] attribute deprecated since 4.4…
Configure API Platform resources (v5, 4.4, 4.3) with explicit operations, pagination, and typed OpenAPI for clean, versioned…
Secure API Platform resources with security expressions, voters, securityPostValidation, and operation-level access control
Control API Platform serialization with groups, #[Context], IRI links (readableLink/writableLink), and custom context builders
Master API Platform State Providers and Processors (v5, 4.4, 4.3) (ProviderInterface/ProcessorInterface) to decouple data…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.