doctrine-orm

doctrine-orm is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 69 tokens per session (3,034 once invoked), scanned A, original, MIT.

A guide to Doctrine ORM 3 and DBAL 4 in Symfony. Doctrine ORM maps PHP objects to database records, while DBAL provides a lower-level way to work with databases.

In plain words
What is it for?
Use it to investigate N+1 queries, choose loading strategies, order migrations, lock database rows, process batches and keep Messenger workers connected to the database.
Why use it?
It avoids advice that mixes library versions or causes slow pages, unsafe migrations, closed database managers or lost connections in background workers.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the frameworks-virtuoso plugin — 12 skills shipped together

Good fit Use it to investigate N+1 queries, choose loading strategies, order migrations, lock database rows, process batches and keep Messenger workers connected to the database.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krzysztofsurdy/code-virtuoso/doctrine-orm
Install

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.

Any agent
npx skills add krzysztofsurdy/code-virtuoso --skill doctrine-orm
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install frameworks-virtuoso, the plugin that ships this one along with the rest of its 12 skills.

Wrote 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.

agentmods badge for doctrine-orm

README.md
[![agentmods](https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/doctrine-orm/github.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/doctrine-orm)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/doctrine-orm"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/doctrine-orm/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doctrine-orm

Your own site · 80×15
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/doctrine-orm"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/doctrine-orm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,034 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.03034
Opus 5.5 $0.00028 $0.01214
Sonnet 5.5 $0.00014 $0.00607
Haiku 4.5 $0.00007 $0.00303

Measured 3d ago against content hash 9dbede900a26, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

doctrine-orm 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.

skills/frameworks/symfony/doctrine-orm/SKILL.md · 167 lines

How it starts

The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Doctrine ORM and DBAL

Doctrine advice from memory goes wrong in a few repeatable ways: it mixes ORM 2 and 3, it "fixes" N+1 with EAGER mappings, it trusts a migration that is only safe on a stopped site, and it forgets that an exception closes the EntityManager. This skill gives the version facts and the decision rules. It does not restate the API: fetch the page for the installed version through docs-lookup, and use the official Doctrine and Symfony docs listed under each reference.

Step 1: find the installed versions

Read composer.lock, not the constraints in composer.json.

jq -r '.packages[] | select(.name|test("^doctrine/(orm|dbal|doctrine-bundle|doctrine-migrations-bundle|migrations)$")) | .name+" "+.version' composer.lock
php -r 'echo PHP_VERSION, "\n";'

PHP 8.4 or newer changes the answer for lazy loading and partial objects (see below).

Version matrix

Verified 2026-10-22 against https://www.doctrine-project.org/projects/orm.html, https://www.doctrine-project.org/projects/dbal.html, https://symfony.com/releases and the composer.json of each package.

Stack DoctrineBundle ORM DBAL MigrationsBundle
Symfony 8.1, PHP 8.4+ 3.3 (needs PHP 8.4) 3.7 4.5 4.0 (needs PHP 8.4 and bundle 3)
Symfony 7.4, PHP 8.4+ 3.3 3.7 4.5 4.0
Symfony 7.4, PHP 8.2 or 8.3 2.19 (Symfony 6.4 and 7.x only) 3.7 4.5 3.8

ORM 3.7 runs on PHP 8.1+ and DBAL 4.5 on PHP 8.2+. DoctrineBundle 3 refuses ORM 2. The migrations library is on 3.9 in every row.

Doctrine ORM docs under /en/latest/ describe the unreleased 4.0. Read https://www.doctrine-project.org/projects/doctrine-orm/en/3.7/ (and doctrine-migrations/en/3.9/) for the installed line.

What changed that affects daily code:

Change Since Do this instead
EntityManager::transactional() removed ORM 3.0 wrapInTransaction()
Query::iterate() removed ORM 3.0 toIterable() (yields the entity, not an array)
PARTIAL DQL removed, then back for array hydration in 3.2 and objects in 3.3 ORM 3.0 to 3.3 SELECT NEW DTO, or PARTIAL on 3.3+
Native lazy objects on PHP 8.4+ (recommended, deprecated to leave off) ORM 3.5 DoctrineBundle 3 always enables them. Partial objects then load missing fields on first access
LockMode::NONE is a no-op, Paginator deprecated for OffsetPaginator ORM 3.7 Call refresh() when you need a reload
Connection::query(), exec(), executeUpdate(), Result::fetchAll() removed DBAL 4.0 executeQuery(), executeStatement(), fetchAllAssociative()
SQLLogger removed DBAL 4.0 DBAL logging middleware
Nested transactions always use savepoints DBAL 4.0 Nothing, but expect savepoint SQL

Read the full file on GitHub · 167 lines

Files

What ships with it

5 files 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.

Changes

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.

  1. 3d ago First seen · 167 lines · 69 tokens per session scan A 9dbede900a26

Subscribe to this mod's changes

doctrine-orm is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (36 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 3,034 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-23.

Related

Other skills, from other repositories

bigquery-udfs

Creates, deploys, and troubleshoots BigQuery User-Defined Functions (UDFs) and Remote Functions across SQL, JavaScript, Python, and Cloud Run endpoints. Use when writing custom scalar or aggregate functions in BigQuery, installing PyPI packages or Cloud Storage libraries in a Python or JavaScript UDF, or calling…

google/skills · 132 tokens

supabase

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…

supabase/agent-skills · 185 tokens

k2

Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.

cloudflare/skills · 38 tokens

kotlin-backend-jpa-entity-mapping

Model Kotlin persistence code correctly for Spring Data JPA and Hibernate. Covers entity design, identity and equality, uniqueness constraints, relationships, fetch plans, and common ORM (Object-Relational Mapping) traps specific to Kotlin. Use when creating or reviewing JPA (Java Persistence API) entities, diagnosing…

Kotlin/kotlin-agent-skills · 104 tokens

solr-extending

To build Solr plugins: SearchComponent, QParser, URP, DocTransformer.

griddynamics/rosetta · 23 tokens

yida-data-management

A tool for querying, adding, and updating Yida form records, child tables, process records, and task-center data. It keeps ordinary forms and approval workflows on their separate data interfaces.

openyida/openyida · 89 tokens