Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
makfly avatar

Symfony:doctrine Fetch Modes Skill

  • 425 installs
  • 190 repo stars
  • Updated August 6, 2026
  • makfly/superpowers-symfony

symfony:doctrine-fetch-modes is an agent skill that configures Doctrine ORM fetch modes in Symfony applications to control lazy and eager loading, eliminate N+1 queries, and keep API entity hydration correct.

About

symfony:doctrine-fetch-modes is a skill from makfly/superpowers-symfony that guides developers through Doctrine ORM fetch mode configuration in Symfony projects. It covers LAZY, EAGER, and EXTRA_LAZY settings on entity associations, fetch join patterns in DQL and QueryBuilder, and serialization-safe hydration for JSON API responses. Developers reach for symfony:doctrine-fetch-modes when Symfony APIs show N+1 query explosions, unexpected lazy-load failures during serialization, or over-eager joins bloating memory. The skill maps Symfony controller and serializer contexts to the correct association fetch strategy and documents tradeoffs for collection versus single-valued relations.

  • LAZY, EAGER, and EXTRA_LAZY modes
  • Association-level fetch configuration
  • N+1 query diagnosis and fixes
  • Repository and serializer hydration pitfalls
  • Symfony Doctrine mapping alignment

Symfony:Doctrine Fetch Modes by the numbers

  • 425 all-time installs (skills.sh)
  • Ranked #21 of 68 PHP & Laravel skills by installs in the Skillselion catalog
  • Data as of Aug 11, 2026 (Skillselion catalog sync)
npx skills add https://github.com/makfly/superpowers-symfony --skill symfonydoctrine-fetch-modes

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs425
repo stars190
Last updatedAugust 6, 2026
Repositorymakfly/superpowers-symfony

How do you fix Doctrine N+1 queries in Symfony?

Configure Doctrine ORM fetch modes in Symfony to control lazy and eager loading, cut N+1 queries, and keep API entity hydration correct.

Who is it for?

Symfony backend developers debugging N+1 queries or incorrect lazy-loaded relations in Doctrine ORM API endpoints.

Skip if: Skip symfony:doctrine-fetch-modes when using Eloquent, Prisma, or raw SQL without Doctrine ORM in the Symfony stack.

When should I use this skill?

User reports N+1 queries, lazy-loading exceptions, or asks to configure Doctrine fetch modes in a Symfony project.

What you get

Updated entity association fetch annotations, DQL fetch joins, and verified query counts for Symfony API responses.

  • Entity fetch annotations
  • Fetch join queries
  • Query count verification notes

Files

SKILL.mdMarkdownGitHub ↗

Doctrine Fetch Modes (Symfony)

Use when

  • Designing entity relations or schema evolution.
  • Improving Doctrine correctness/performance.

Default workflow

1. Model ownership/cardinality and transactional boundaries. 2. Apply mapping/schema changes with migration safety. 3. Tune fetch/query behavior for hot paths. 4. Verify lifecycle behavior with targeted tests.

Guardrails

  • Keep owning/inverse sides coherent.
  • Avoid destructive migration jumps in one release.
  • Eliminate accidental N+1 and over-fetching.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • Entity/migration changes.
  • Integrity and performance decisions.
  • Validation outcomes and rollback notes.

References

  • reference.md
  • docs/complexity-tiers.md

Related skills

FAQ

What problem does symfony:doctrine-fetch-modes solve?

symfony:doctrine-fetch-modes configures Doctrine ORM lazy and eager fetch strategies in Symfony to stop N+1 query loops, prevent serialization lazy-load failures, and keep API entity hydration predictable for JSON responses.

Which fetch modes does the skill cover?

symfony:doctrine-fetch-modes covers Doctrine LAZY, EAGER, and EXTRA_LAZY association settings plus DQL fetch joins and QueryBuilder patterns, tuning collection and single-valued relations for Symfony API performance.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.