# Csharp Signals

Use when implementing signals in C#, [Signal] delegates, EmitSignal patterns, async...

- Repository: https://github.com/jame581/GodotPrompter (914 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add jame581/GodotPrompter --skill csharp-signals -g -a claude-code -y`
Codex: `npx skills add jame581/GodotPrompter --skill csharp-signals -g -a codex -y`
Cursor: `npx skills add jame581/GodotPrompter --skill csharp-signals -g -a cursor -y`
Gemini CLI: `npx skills add jame581/GodotPrompter --skill csharp-signals -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add jame581/GodotPrompter`

## Description

Use when implementing signals in C#, [Signal] delegates, EmitSignal patterns, async signal awaiting, and event-driven architecture. Triggers on declaring, emitting, connecting, or awaiting a signal from a C# script, and on a signal crossing between C# and GDScript in either direction.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Signals in C# (Godot 4.x)

This skill is **C# only**. For general C# conventions and project setup, see the **csharp-godot** skill. Godot signals in C# require a different mental model from GDScript: delegates declared with `[Signal]`, strongly-typed `+=`/`-=` connections, and mandatory disconnection in `_ExitTree()`. All examples target Godot 4.x with no deprecated APIs.

> **Related skills:** **csharp-godot** for C# conventions and project setup, **event-bus** for global signal hub architecture, **component-system** for signal-based component communication.

---

## 1. Signal Declaration

Signals are declared as `public delegate void` with the `[Signal]` attribute inside a `partial class` that extends a Godot type. The delegate name **must** end with `EventHandler`, Godot strips that suffix to produce the signal name exposed to the engine.

```csharp
using Godot;

public partial class Player : CharacterBody2D
{
    // Signal name in engine: "HealthChanged"
    [Signal] public delegate void HealthChangedEventHandler(int current, int maximum);

    // Signal name in engine: "Died"
    [Signal] public delegate void DiedEventHandler();

    // Signal name in engine: "ItemCollected"
    [Signal] public delegate void ItemCollectedEventHandler(string itemName);
}
```

**Naming rules:**

| Delegate name                   | Engine signal name  |
|---------------------------------|---------------------|
| `HealthChangedEventHandler`     | `HealthChanged`     |
| `DiedEventHandler`              | `Died`              |
| `ItemCollectedEventHandler`     | `ItemCollected`     |
| `PlayerSpawnedEventHandler`     | `PlayerSpawned`     |

Omitting the `EventHandler` suffix is a compile error: the source generator reports GD0201, "The name of the delegate must end with 'EventHandler'".

The rest: https://github.com/jame581/GodotPrompter/blob/HEAD/skills/csharp-signals/SKILL.md
