add-doctrine-entity

add-doctrine-entity is a skill for Claude Code, Codex from tarlepp/symfony-flex-backend. It costs 29 tokens per session (780 once invoked), scanned A, original, MIT.

A repository-specific workflow for adding or changing a Doctrine ORM entity, which is a PHP class mapped to a database table. It covers the entity's persistence mapping, repository, resource, migration, tests, and related conventions.

In plain words
What is it for?
Use it to add a persisted domain object or change its fields, relationships, timestamps, deletion behavior, or Doctrine mapping. It also guides the required migration and persistence tests.
Why use it?
Adding stored data involves more than creating a class: the database schema, application mapping, and tests must agree. This helps keep those changes consistent with the existing Symfony project.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it to add a persisted domain object or change its fields, relationships, timestamps, deletion behavior, or Doctrine mapping. It also guides the required migration and persistence tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tarlepp/symfony-flex-backend/add-doctrine-entity
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 tarlepp/symfony-flex-backend --skill add-doctrine-entity
Clone the repo
git clone --depth 1 https://github.com/tarlepp/symfony-flex-backend

Made for: Claude Code, Codex.

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 add-doctrine-entity

README.md
[![agentmods](https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-doctrine-entity/github.svg)](https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-doctrine-entity)
Your own site
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-doctrine-entity"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-doctrine-entity/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 add-doctrine-entity

Your own site · 80×15
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-doctrine-entity"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-doctrine-entity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 780 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.00029 $0.00780
Opus 5.5 $0.00012 $0.00312
Sonnet 5.5 $0.00006 $0.00156
Haiku 4.5 $0.00003 $0.00078

Measured today against content hash 05d15e1f72d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-doctrine-entity 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 today.

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.

.github/skills/add-doctrine-entity/SKILL.md · 67 lines

How it starts

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

Add a Doctrine entity

Use this skill when adding a persisted domain entity or changing an existing entity's Doctrine mapping. In this repository, every entity must have a corresponding repository and resource. A CRUD REST endpoint, DTOs, and AutoMapper configuration are separate concerns and should be added when the requested behavior needs them.

Follow the shared skill guidance in .github/skills/shared-guidance.md.

Workflow

  1. Check composer.json for the current PHP, Doctrine ORM, and migrations versions, and symfony.lock for installed recipes. Inspect a similar entity and its tests under src/Entity/ and tests/ before choosing a pattern. Use AGENTS.md and the existing implementation as the architectural source of truth.
  2. Confirm what the entity needs to support: REST input/output, relations, audit fields, and soft/hard deletion. Reuse an existing entity trait or shared pattern only when its behavior fits; do not add unrelated fields.
  3. Place the class in src/Entity/ and use Doctrine ORM PHP attributes. Persisted application entities normally implement App\Entity\Interfaces\EntityInterface; follow the existing UUID, timestamp, and blameable conventions where applicable. Check how the interface and traits behave before using them, and account for read-only or derived entities that have different requirements.
  4. Define column types, nullability, lengths, indexes, unique constraints, and relationship ownership explicitly and consistently with the schema. Use typed properties and methods. For relationships, update both sides only where the existing bidirectional association pattern requires it. Avoid accidental lazy-loading or serialization cycles.
  5. If entity properties are exposed through the API, add the appropriate Serializer groups and OpenAPI attributes following nearby entities. Keep API exposure intentional; do not expose sensitive fields. Put request validation constraints on the appropriate DTO as well as entity-level constraints only where existing patterns call for them.
  6. Generate a migration inside the PHP development container with bin/console doctrine:migrations:diff. Review the generated SQL and migration class for data safety, nullability, indexes, foreign keys, defaults, and reversible behavior. Edit the generated migration when needed. Never use doctrine:schema:update or hand-write ad hoc SQL to change a live schema. Do not run migrations against production.
  7. Add tests for entity behavior, ORM mapping, persistence, and relationships as applicable, following .github/skills/write-tests/SKILL.md.
  8. Add a corresponding repository under src/Repository/, extending or following BaseRepository and its entity-specific typing conventions. Reuse the existing repository methods and traits; add custom queries only when the entity requires them.
  9. Add a corresponding resource under src/Resource/, extending RestResource with the entity and repository types. Keep orchestration and business behavior in the resource, and use the existing resource lifecycle patterns where relevant. An entity's repository and resource are required even when it has no CRUD controller.
  10. If the request needs DTOs, request mapping, or a CRUD REST endpoint, follow .github/skills/add-rest-resource/SKILL.md for those parts. Add these layers only when required by the requested behavior.

Read the full file on GitHub · 67 lines

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. today First seen · 67 lines · 29 tokens per session scan A 05d15e1f72d0

Subscribe to this mod's changes

add-doctrine-entity is a skill published in the GitHub repository tarlepp/symfony-flex-backend (288 stars, last pushed today), licensed MIT. It adds 29 tokens to every session and 780 once invoked, about $0.0001 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-18.

Related

Other skills, from other repositories

horse-database-pooling

Guide for setting up thread-safe database connection pooling (FireDAC / UniDAC) in multithreaded Horse applications.

HashLoad/horse · 30 tokens

api-platform-performance

Tune API Platform 4.3 + Doctrine + Symfony performance — recognize the 4.x default trap eagerloading.forceeager: true (often counter-productive, switch to false + targeted join fetches), use EXTRALAZY for large collections, project DTOs in DQL (NEW App\\Dto\\PostListItem(...)) to avoid hydrating full entities for list…

gerard-labs/superpowers-api-platform · 0 tokens

doctrine-batch-processing

Process large-volume Doctrine datasets (million-row imports, mass updates, ETL) without memory blowup. Use toIterable() + EntityManager::clear() per batch, partial hydration with DQL projection (NEW App\Dto\X(...)), HINTREADONLY when entities aren't mutated, MEMORYPEAKUSAGE tracking. Trigger on "iterate over all…

gerard-labs/superpowers-api-platform · 108 tokens

doctrine-fetch-modes

Tune Doctrine fetch modes to eliminate N+1 and over-hydration — LAZY (default), EXTRALAZY for huge collections (count(), contains() without load), EAGER per-property only with justification, partial hydration with addSelect(), IndexBy for O(1) lookups, HINTREADONLY. Covers the API Platform 4.x eagerloading.forceeager…

gerard-labs/superpowers-api-platform · 130 tokens

doctrine-transactions

Handle Doctrine transactions correctly — EntityManager::wrapInTransaction() for atomic multi-entity writes, doctrinetransaction Messenger middleware for command-bus atomicity, Doctrine\ORM\OptimisticLockException handling with #[Version] column, isolation levels, flush strategies (per-request vs explicit). Trigger…

gerard-labs/superpowers-api-platform · 92 tokens

api-integration-architect

Design, implement, debug, and optimize API integrations with expert-level patterns for REST, GraphQL, webhooks, and authentication flows.

sickn33/agentic-awesome-skills · 33 tokens