add-event-listener

add-event-listener is a skill for Claude Code, Codex from tarlepp/symfony-flex-backend. It costs 31 tokens per session (1,052 once invoked), scanned A, original, MIT.

A coding guide for creating or changing Symfony event listeners and Doctrine lifecycle listeners. It explains how to register them, preserve event order, and test their behavior in the repository's existing style.

In plain words
What is it for?
Use it when adding or updating PHP classes that react to Symfony events or Doctrine entity lifecycle events. It helps inspect event contracts, choose the right registration pattern, and add or update tests.
Why use it?
It reduces the risk of using the wrong event system, registering a listener incorrectly, or changing behavior without tests. It also helps keep event handlers focused and consistent with the project.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or updating PHP classes that react to Symfony events or Doctrine entity lifecycle events. It helps inspect event contracts, choose the right registration pattern, and add or update tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tarlepp/symfony-flex-backend/add-event-listener
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-event-listener
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-event-listener

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tarlepp/symfony-flex-backend/add-event-listener"><img src="https://agentmods.dev/badge/skills/tarlepp/symfony-flex-backend/add-event-listener.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,052 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.00031 $0.01052
Opus 5.5 $0.00012 $0.00421
Sonnet 5.5 $0.00006 $0.00210
Haiku 4.5 $0.00003 $0.00105

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

Security

Grade A, and why

add-event-listener 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-event-listener/SKILL.md · 98 lines

How it starts

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

What is this?

Use this skill when creating or updating an event listener, its registration, or its behavior. It covers Symfony EventDispatcher listeners and Doctrine lifecycle listeners; these are separate event systems.

Follow the shared skill guidance, including .github/copilot-instructions.md and doc/AI_RULES.md.

Table of Contents ᐞ

Workflow ᐞ

  1. Read composer.json, symfony.lock, the dispatch site or framework event contract, and nearby handlers and tests. Identify the event system, exact event name, payload type, dispatch timing, and any dispatcher-specific registration. Do not infer these from a class name alone.
  2. Read the event-handling guide before choosing a listener over a subscriber. Extend an existing handler when the responsibility matches; preserve its registration style unless a conversion is part of the task. For a Symfony subscriber, follow .github/skills/add-event-subscriber/SKILL.md.
  3. Put listener classes in src/EventListener/. Keep handlers focused on event adaptation and delegate business logic to an existing resource or service. Use constructor injection, explicit parameter and return types, and the event argument type supported by the installed package. Do not mark a service readonly when lazy proxying may apply.
  4. Wire the listener explicitly: config/services.yaml excludes src/EventListener/ from automatic service discovery. Follow config/packages/event_listeners.yaml for service definitions and autowiring. For Symfony events, use kernel.event_listener with the correct event and method, or AsEventListener on an explicitly registered service. Do not register the same callback with both an attribute and a tag.
  5. For Doctrine lifecycle events, follow UserEntityEventListener and its doctrine.event_listener tags instead of Symfony event registration. Match method names and event arguments to the ORM event. A global Doctrine listener receives events for multiple entity types, so guard the entity type. Check connection scope, UnitOfWork/change-set rules, and whether changes made at that lifecycle stage will actually be persisted. Do not call flush() recursively from a flush-triggered handler. Distinguish global lifecycle listeners from entity-specific Doctrine entity listeners; the latter require their own mapping and registration.
  6. For updates, preserve event names, callback methods, priorities, dispatcher or connection scope, propagation, and exception behavior unless explicitly changing them. For ordering-sensitive behavior, inspect neighboring handlers and justify the priority; higher Symfony priorities run first. Decide main-request versus subrequest handling for HTTP events from the required behavior rather than adding a blanket guard.
  7. Keep request-specific data out of shared service state. Preserve validation, authorization, and sensitive-data handling. Do not swallow exceptions, perform unrelated side effects, or treat synchronous events as background jobs.
  8. Follow .github/skills/write-tests/SKILL.md. Cover the handler's effect, relevant no-op paths, invalid inputs, and failures. Add registration coverage through the actual caller boundary: dispatch a Symfony event through the container's dispatcher, or persist/update and flush an entity through Doctrine as appropriate. Direct method calls alone do not prove that registration or lifecycle persistence works. Verify ordering, subrequests, and exactly-once invocation when relevant.
  9. Update the event-handling guide or other relevant documentation if the change establishes a new registration convention or observable behavior.

Read the full file on GitHub · 98 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 · 98 lines · 31 tokens per session scan A 48ec03f3a304

Subscribe to this mod's changes

add-event-listener is a skill published in the GitHub repository tarlepp/symfony-flex-backend (288 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 1,052 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-20.