symfony:doctrine-batch-processing

A Symfony guide for processing large amounts of data with Doctrine, Symfony's database mapping tool. It covers reading records in batches, saving changes safely, and clearing memory as work progresses.

In plain words
What is it for?
Use it for bulk updates, imports, exports, entity or schema changes, and improving database-heavy Symfony code while checking relations and avoiding repeated queries.
Why use it?
It helps prevent long-running jobs from using too much memory, making too many database queries, or accidentally loading excessive data.

Skill for Claude CodeCodex

Part of the superpowers-symfony plugin — 37 skills, 13 commands, 7 agents, 1 hook shipped together

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.

agentmods
npx agentmods add skills/dev-toolings/superpowers-symfony/doctrine-batch-processing
Any agent
npx skills add dev-toolings/superpowers-symfony --skill doctrine-batch-processing
Clone the repo
git clone --depth 1 https://github.com/dev-toolings/superpowers-symfony

Made for: Claude Code, Codex.

Or install superpowers-symfony, the plugin that ships this one along with the rest of its 37 skills, 13 commands, 7 agents, 1 hook.

Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 235 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00032 $0.00235
Opus 5 $0.00016 $0.00118
Sonnet 5 $0.00006 $0.00047
Haiku 4.5 $0.00003 $0.00023

Measured 3d ago against content hash 31f61dce1541, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

symfony:doctrine-batch-processing 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/doctrine-batch-processing/SKILL.md · 43 lines

What it actually says

Doctrine Batch Processing (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
Files

What ships with it

1 file 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 · 43 lines · 32 tokens per session scan A 31f61dce1541

Subscribe to this mod's changes

symfony:doctrine-batch-processing is a skill published in the GitHub repository dev-toolings/superpowers-symfony (206 stars, last pushed 27d ago), licensed MIT. It adds 32 tokens to every session and 235 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

laravel-database-optimization

Laravel database optimization patterns. Use when writing Eloquent queries, creating migrations, configuring caching, debugging slow queries, or optimizing database performance. Triggers on tasks involving N+1 queries, indexing, Redis caching, pagination, or database transactions.

AsyrafHussin/agent-skills · 55 tokens

laravel-eloquent

Eloquent and query-layer engineering rules for Laravel — eliminating N+1, choosing a pagination strategy, short atomic transactions, casts and scopes on the model, where raw SQL is allowed, and how migrations declare the schema those queries depend on. Use when writing or reviewing Eloquent models, migrations, query…

Foysal50x/skills · 93 tokens

architecture-patterns

Use this skill when choosing a system-level architecture (monolith, modular monolith, microservices, event-driven, serverless, clean/hexagonal, or DDD) for a new or growing PHP application, or when weighing a premature move to a more distributed style. Provides a decision guide and the common pitfalls that cause…

garrettw/php-arch-skills · 77 tokens

create-doctrine-repository

Create the repository in the Adapter layer. This is the ONLY class that touches the database — all handlers delegate to it. Covers multistore patterns with ShopConstraint when the entity requires it. Trigger: "create repository for {Domain}".

jeffsenso/prestashop-skills · 54 tokens

application-layer

Use this skill when writing controllers, structuring use cases, or implementing Service Layer / Application Layer and Command/Query/Handler (CQRS) patterns in PHP applications. Triggers on questions about thin controllers, handler responsibilities, service definition, or DTO usage.

garrettw/php-arch-skills · 55 tokens

event-sourcing

Use this skill when evaluating or implementing Event Sourcing in a PHP application. Triggers on questions about event stores, aggregates, projections, snapshots, event replay, temporal queries, CQRS with event sourcing, or PHP event-sourcing libraries (Ecotone, Prooph, EventSauce, Patchlevel). Distinguishes Event…

garrettw/php-arch-skills · 86 tokens