In short.
Doctrine Transactions is an instruction pack for coding assistants helping Symfony developers, with useful transaction guidance but conflicting failure recovery examples. Its reference distinguishes ORM wrapInTransaction() from DBAL Connection::transactional() and illustrates optimistic and pessimistic locking. Guidance to clear and reuse an EntityManager is not reconciled with the reference's statement that the transaction helper closes it after failure. Nothing was executed; compatibility and database behavior remain unverified.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the full content/skills/doctrine-transactions folder represented by SKILL.md and reference.md at commit 83522d88f20313c1db6f042a5a49c0e9e0b258b1, plus the repository-root LICENSE notice outside that folder. Other repository skills, build tooling, dependency implementations and application configuration are outside scope. Nothing was executed. Assistant compatibility, generated-code quality, transaction recovery, database-specific locking and performance remain unverified.
The overview
Identity
The doctrine-transactions skill belongs to dev-toolings/superpowers-symfony. It consists of SKILL.md, which gives an assistant a short workflow and guardrails, and reference.md, which supplies PHP examples and explanations. It is written guidance for an assistant, rather than a transaction-handling library.
The original resource folder is [https://github.com/dev-toolings/superpowers-symfony/tree/main/content/skills/doctrine-transactions]. The version assessed here is commit 83522d88f20313c1db6f042a5a49c0e9e0b258b1.
Assessment
The skill is useful as a checklist for reviewing where a Symfony service begins and ends a database operation, when it saves pending changes, and how it handles competing updates. Concrete examples make the distinction between ORM transactions and raw SQL transactions easier to follow.
Its weakest area is recovery after failed writes. The reference gives inconsistent guidance about EntityManager state and an insufficiently explained reconnect-and-retry example. These passages require developer review before adoption, especially for important write operations. Runtime reliability and improvements to assistant output were not assessed.
Users
The intended users are Symfony developers asking a coding assistant to implement or review Doctrine database writes. Relevant situations include creating several related records together, preventing two workers from processing the same order, and detecting conflicting edits.
Beginners can use the reference to understand transactions and locking, but the examples assume familiarity with PHP services, entities and Doctrine. Experienced developers are better positioned to resolve the recovery inconsistencies and adapt the fragments to their application.
Capabilities
The instructions cover service-level transaction boundaries, grouping related writes, flush strategies, optimistic version checks, pessimistic row locks, constraint violations and EntityManager state after rollback. They ask the assistant to explain the chosen locking strategy and how conflicts reach the user.
The reference also distinguishes an ORM helper that flushes pending entity changes from DBAL Connection::transactional(), whose example performs raw SQL without flushing ORM work. These are documented capabilities of the guidance; the files do not enforce them or demonstrate successful assistant behavior.
Using it
Requirements
Applying the examples requires a PHP application using Doctrine and an appropriate database. The reference names ORM 3.x and DBAL 4.x as its target and discusses ORM 2.9+ as a legacy case. Minimum PHP, Symfony and database versions are not specified, and compatibility was not verified.
SKILL.md declares read, search, edit and shell capabilities, including Read, Glob, Grep, Write, Edit and Bash tool names. This declaration does not establish compatibility with a particular assistant host or that every permission is necessary for every task. No required model is identified.
Mechanism
The short skill provides the workflow, while a relative link points the assistant to reference.md for implementation details. Its default approach puts the transaction boundary in a service, groups related changes and chooses a concurrency strategy.
Optimistic locking uses a version field to detect conflicting edits. Pessimistic locking holds a database lock during a short critical operation. The helper example leaves flushing to wrapInTransaction(), which the reference says flushes before committing and closes the EntityManager if its callback throws.
Setup
Keep SKILL.md and reference.md together so the relative reference remains usable, and follow the chosen assistant host's documented method for loading skills. The two files contain no host-specific installation procedure or supported-host list.
Check the application's Doctrine versions before adapting any example. SKILL.md identifies itself as generated by bun run build, but the generator is outside this folder; that note does not establish an end-user build requirement.
Example
The supplied createOrder example calls wrapInTransaction(), constructs an Order, adds OrderItem objects, persists the order and returns it from the callback. According to the reference, the helper flushes the pending changes before commit.
This illustrates grouping related entity writes into one operation. It is a fragment rather than a complete application: the necessary domain classes, mappings and surrounding configuration are not supplied in the folder. No order creation or rollback was executed.
Assessment & evidence
Limitations
The reference says wrapInTransaction() closes the EntityManager when its callback throws, while other recovery guidance recommends clearing the manager and immediately fetching entities again. It does not explain how a closed manager becomes usable. Clearing managed entities and recovering a closed manager are not established as equivalent by these files.
The connection-loss example reconnects and immediately retries flush() on the same manager. It does not establish the previous transaction's outcome, manager usability or protection against duplicate work. Safe retry behavior therefore remains unverified.
In the optimistic-lock example, the explicit lock() call occurs before the try block. The displayed conflict handler consequently does not cover an exception raised by that call. The clear(User::class) example also lacks demonstrated compatibility with the declared ORM 3 target. No executable tests or runtime results accompany these examples.
Reasoning
The design rationale is to make related writes succeed or fail together and make concurrent changes explicit. Grouping writes avoids the separate commits illustrated by multiple flushes outside an explicit transaction. A service-level boundary gives one application operation a clear owner.
The skill recommends version checks for editing conflicts and short pessimistic locks for critical sections. Keeping HTTP requests and mail outside locked transactions is part of its guidance. The files provide no measurements of throughput, contention or performance gains.
Alternatives
A developer can read reference.md directly without loading the assistant skill. Within that reference, the documented approaches are an implicit transaction around a flush, an explicit ORM transaction for coordinated entity work, and DBAL Connection::transactional() for raw SQL.
These approaches address different work: the DBAL example does not flush pending ORM changes. The supplied material does not compare competing assistant skills or establish that this resource is more accurate or complete than another guide.
Evidence
The assessment is based on the complete text of the two Markdown files and the repository-level LICENSE at commit 83522d88f20313c1db6f042a5a49c0e9e0b258b1. It does not include independent Doctrine documentation, assistant transcripts or runtime results.
The exact skill source is [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/content/skills/doctrine-transactions/SKILL.md]. The implementation reference is [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/content/skills/doctrine-transactions/reference.md].
Access & freshness
Costs
The MIT notice grants permission free of charge. Neither skill file provides assistant pricing, model usage estimates or infrastructure costs. Charges for the chosen assistant, model, database or hosting environment are unknown, so total operating cost cannot be established.
Rights
The repository LICENSE is the MIT License, with a 2024 copyright notice. It permits use, copying, modification, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.
The licence disclaims warranties and liability. Redistributing the skill and reference should retain the captured LICENSE notice. Its source is [https://raw.githubusercontent.com/dev-toolings/superpowers-symfony/83522d88f20313c1db6f042a5a49c0e9e0b258b1/LICENSE].
Freshness
The source snapshot was captured on 17 November 2026 at 10:51:55.583 UTC and is pinned to commit 83522d88f20313c1db6f042a5a49c0e9e0b258b1. This establishes the version discussed, not when its technical guidance was last validated.
The reference explicitly addresses the transition from ORM transactional() to wrapInTransaction() and names ORM 3.x / DBAL 4.x as its target. Current main-branch contents and compatibility with any particular installed release are unknown.
Actions
Before using generated changes, verify EntityManager recovery, connection-loss retries, optimistic-lock exception handling and clear() signatures against the installed Doctrine versions. Resolve the recovery inconsistencies before copying those snippets.
Use a disposable database to check atomic rollback, constraint failures, concurrent edits and competing row locks. The reference suggests ./vendor/bin/phpunit --filter=Transaction, php bin/console doctrine:schema:validate and php bin/console doctrine:schema:update --dump-sql. These are suggested commands only; none was run, and the existence of matching transaction tests is unknown.
