jame581/godotprompter/event-bus
Claude Code and agent skill by jame581/godotprompter
- community
Checking that the SKILL.md file is still in the repository.
Use when setting up decoupled node communication — a global EventBus autoload with typed signals. Not for adding signals to an existing bus
Install
npx vskill@latest install jame581/godotprompter/event-busSKILL.md
The same SKILL.md was published earlier as jame581/godotprompter/event-bus.
Event Bus in Godot 4.3+
A global signal hub that lets unrelated nodes communicate without holding references to each other. All examples target Godot 4.3+ with no deprecated APIs.
Related skills: component-system for direct signal communication between components, csharp-signals for C#-specific signal patterns, dependency-injection for alternative decoupling approaches, ability-system for an EventBus usage example with ability events.
1. What is an Event Bus
An EventBus is a singleton autoload that acts as a central registry for signals. Instead of nodes connecting directly to each other, every node connects to (or emits on) the shared EventBus. This removes the need for one node to hold a reference to another.
Flow diagram
NodeA emits the signal. NodeB and NodeC each connected to EventBus independently. Neither knows the other exists.
2. When to Use vs Direct Signals
| Scenario | Recommended approach | |
|---|---|---|
| Parent notifying its own child | Direct signal or method call | |
| Child notifying its parent | Direct signal (bubble up) | |
| Two nodes with the same parent | Direct signal via parent | |
| Completely unrelated nodes in the tree | Event bus | |
| UI reacting to gameplay state changes | Event bus | |
| Audio manager reacting to game events | Event bus | |
| Data manager / save system reacting | Event bus | |
| Tight, performance-sensitive inner loop | Direct method call |
Rule of thumb: if you would otherwise need get_node("../../SomeDistantNode") or a hard-coded NodePath, the event bus is a better fit.
3. Basic EventBus
Create res://autoloads/event_bus.gd (or EventBus.cs), then register it in Project → Project Settings → Globals → Autoload with the name EventBus.
GDScript (autoloads/event_bus.gd)
C# (Autoloads/EventBus.cs)
4. Connecting to Events
Consumers connect in _ready(). In C#, always disconnect in _ExitTree(): the bus outlives its consumers and its signals are custom, a case Godot does not disconnect when the consumer is freed, so the next emit would throw ObjectDisposedException.
GDScript
C#
5. Emitting Events
Producers call EventBus.<signal_name>.emit(...) (GDScript) or EmitSignal(SignalName.*) (C#). The producer does not know which nodes are listening.
GDScript
C#
6. Typed Signal Parameters
Type every signal parameter. An untyped bus degrades into "what shape is this payload?" archaeology at every call site, and typos in parameter counts only surface at runtime. For anything richer than two or three primitives, pass a small Resource or a class_name'd data object rather than growing the parameter list.
Typed signal declarations, payload-object patterns, and the C# [Signal] delegate equivalents: references/typed-signals.md
7. Anti-patterns
Four recurring failures: routing everything through the bus when a parent could just reach its own child (over-decoupling); handlers whose side effects emit further signals, so tracing one event means reading every handler; circular chains, where a listener re-emits the signal it just received and loops forever; and connecting without disconnecting in C#, which leaks the handler for the bus's lifetime.
Each anti-pattern with the failing code, why it hurts, and the fix, in GDScript and C#: references/anti-patterns.md
8. Testing
Use GUT to verify both producer-side emission (watch_signals(event_bus) then assert_signal_emitted_with_parameters(...)) and consumer-side reactions (emit on the bus, then assert on the consumer's state). Always test against the real autoload EventBus retrieved via get_tree().root.get_node("EventBus"), not a fresh instance.
See references/testing.md for full producer-side and consumer-side test files plus a GUT-helper reference table.
9. Checklist
- [ ]
EventBusautoload is registered in Project → Project Settings → Globals → Autoload - [ ] All signals use typed parameters (
signal foo(bar: int)) — no untyped signals - [ ] Every consumer connects in
_ready()and disconnects in_exit_tree()(mandatory in C#) - [ ] Producers emit through
EventBus, not by calling consumer methods directly - [ ] No node holds a direct reference to another unrelated node just to emit or receive signals
- [ ] Complex payloads use a
Resourcesubclass, not a rawDictionary - [ ] No handler re-emits the same signal it just received (prevents infinite loops)
- [ ] No event bus signal used where a direct parent-child call or signal is simpler
- [ ] GUT tests cover both emission (producer) and reception (consumer) for critical signals
- [ ] C# handlers verified to disconnect in
_ExitTree()before merging
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/event-bus/SKILL.md
Popularity
- Repository stars
- 965
- Repository forks
- 63
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jame581/godotprompter/event-bus)