add-event

Generate Event and Listener classes for a Bespoke package and update config.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/bespoke-uk/bespoke-mono --skill add-event
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-event
Source: https://github.com/bespoke-uk/bespoke-mono/tree/main/.claude/skills/add-event
Command: npx skills add https://github.com/bespoke-uk/bespoke-mono --skill add-event

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The tool provides a quick scaffold to add an event and optional listener to a Bespoke package, enabling consistent event-driven behavior across packages.

Core Features & Use Cases

  • Generates an Event class at src/Events/{EventName}.php.
  • Generates a Listener class at src/Listeners/{ListenerName}.php (if requested).
  • Updates registration in config/{package-name}.php for the event/listener.
  • Demonstrates event naming conventions and typical usage patterns.

Quick Start

Provide a package path, an EventName in PascalCase, and an optional ListenerName to scaffold, following the documented conventions.

Frequently Asked Questions about add-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold an event and listener in a PHP package?

To scaffold an event and listener in a PHP package, provide the package path, an EventName in PascalCase, and an optional ListenerName. The tool generates the Event and Listener classes and updates the package config accordingly.

What is the best way to add event-driven behavior to a Bespoke package?

The best way to add event-driven behavior to a Bespoke package is using a scaffolding generator to create Event classes at src/Events/ and Listener classes at src/Listeners/, ensuring consistent naming conventions and automatic registration config updates.

Does the event generator require a listener name to function?

No, the event generator does not require a listener name to function. You must provide a package path and an EventName in PascalCase, while the ListenerName is optional and only generates a Listener class when specified.

How does event registration work when generating events for a Bespoke package?

Event registration works by automatically updating the config/{package-name}.php file when generating events for a Bespoke package. This wires up the generated Event and Listener classes within the package configuration.

Can I use this scaffolding tool to generate events for any PHP framework?

No, you cannot use this scaffolding tool to generate events for any PHP framework. It applies specifically to package-level event scaffolding within Bespoke packages, following its documented naming conventions and directory structures.