core-event-bus

Implement a type-safe event bus for inter-module communication.

1|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/diadia0000/ForWanna --skill core-event-bus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-event-bus
Source: https://github.com/diadia0000/ForWanna/tree/main/.claude/skills/core/EventBus
Command: npx skills add https://github.com/diadia0000/ForWanna --skill core-event-bus

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides a type-safe, centralized event bus for cross-module communication, solving the issue of modular A notifying module B and ensuring a streamlined communication process.

Core Features & Use Cases

  • Type-Safe Events: Ensures that event payloads match the expected types, preventing runtime errors.
  • Event Registration & Unregistration: Allows modules to subscribe to and unsubscribe from specific events.
  • Event Broadcasting: Enables modules to broadcast events to all subscribed handlers.
  • Once-Only Events: Allows handlers to be executed only once for a particular event.
  • Use Case: For a game development scenario, the core-event-bus Skill can be used to handle events like player movement, resource collection, or network status changes across different game modules.

Quick Start

To subscribe to the 'player:moved' event, use the following command: EventBus.on('player:moved', (payload) => { /* handler logic */ }).

Frequently Asked Questions about core-event-bus

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

FAQPage Schema
How does a type-safe event bus handle inter-module communication?

A type-safe event bus manages inter-module communication by allowing modules to subscribe to specific events and broadcast payloads, ensuring the payload types match expectations to prevent runtime errors. It decouples senders from receivers.

How do I subscribe to and broadcast events in an event-driven architecture?

You subscribe to events by registering a handler function for a specific event name, and broadcast events by emitting that name with a payload. The event bus then executes all subscribed handlers with the payload.

When do I need a centralized event bus for software architecture?

You need a centralized event bus when decoupling complex software systems where modules must notify each other of state changes, such as player movement or network status updates in game development, without direct dependencies.

Can I execute an event handler only once for a specific broadcast?

Yes, the event bus supports once-only events, allowing a handler to be executed a single time for a particular event before being automatically unregistered from future broadcasts.

Does event bus broadcasting support type-safe payload handling without dependencies?

Yes, this event bus implementation operates with zero dependencies and ensures type-safe payload handling during event broadcasting, verifying that event payloads match the expected types defined in the handler.

How do I unregister a module from receiving specific events?

You unregister a module by calling the unsubscription method for the specific event, removing its handler from the event bus so it no longer receives broadcasts for that event type.