| name | godot |
| description | Implements Godot 4 features using GDScript, scene tree composition, signals, resources, and node lifecycle hooks. Use when writing or reviewing GDScript code, designing scene hierarchies, wiring signals, creating custom Resources, or structuring a Godot project. Do not use for Unity or Unreal Engine work. |
| license | Apache-2.0 |
| compatibility | {"clients":["openai-codex","gemini-cli","opencode","github-copilot"]} |
| metadata | {"owner":"codex","domain":"godot","maturity":"draft","risk":"low","tags":["godot","gdscript","scene-tree","signals"]} |
Purpose
Provides concrete GDScript patterns, scene tree architecture, signal wiring, resource management, and project organization conventions for Godot 4 development.
When to use this skill
- Writing or reviewing GDScript (
.gd) files or scene (.tscn) definitions
- Designing node hierarchies, signal connections, or custom Resource types
- Structuring a Godot project: autoloads, folder layout, scene composition
- Implementing gameplay systems: physics bodies, animation, state machines, UI
Do not use this skill when
- The project uses Unity or Unreal Engine — prefer
unity or unreal-engine skills
- The task is about general game design theory with no Godot-specific implementation
- Work is purely about 3D asset creation or shader authoring with no GDScript involvement
Operating procedure
- Identify the node type. Select the correct base:
Node2D, CharacterBody2D, Control, Node3D, CharacterBody3D, etc. Prefer the most specific built-in node before creating custom ones.
- Use typed GDScript 2.0 syntax. Declare
var speed: float = 200.0, use @export for inspector properties, @onready var sprite: Sprite2D = $Sprite2D for deferred node refs.
- Wire signals with the new syntax. Prefer
button.pressed.connect(_on_button_pressed) over legacy string-based connect(). Define custom signals as signal health_changed(new_hp: int) and emit with health_changed.emit(hp).
- Leverage the node lifecycle.
_ready() for initialization after tree entry, _process(delta) for per-frame logic, _physics_process(delta) for fixed-step physics, _enter_tree() / _exit_tree() for setup/teardown.
- Compose scenes over inheritance. Build reusable behaviors as child scenes (component pattern). A
Player.tscn contains StateMachine, Hitbox, AnimationPlayer as children rather than a deep class hierarchy.
- Use Resources for data. Create custom
class_name Resources (.tres) for configs: class_name WeaponStats extends Resource with @export var damage: int. Reference via @export var weapon: WeaponStats.
- Register autoloads for globals. Use Project → Autoload for singletons: event bus (
Events.gd), scene manager, global game state. Access as Events.player_died.emit().
- Instantiate scenes correctly.
var scene := preload("res://enemies/slime.tscn") at load time, var instance := scene.instantiate(), then add_child(instance).
- Implement state machines with enums.
enum State { IDLE, RUN, JUMP, FALL } with a match block in _physics_process for clear state transitions.
Decision rules
- Prefer scene composition (child nodes) over deep class inheritance hierarchies.
- Use
@export for designer-tunable values; hard-code only true constants.
- Choose
_physics_process for movement/collision; _process for visuals and UI.
- Use Resources (
.tres) for shared data configs; avoid storing game data in autoloads.
- Prefer
preload() for known scenes; use load() only when the path is dynamic.
- Use signals for decoupled communication; direct node references (
$Path) for tightly-coupled parent-child relationships.
Output requirements
Node Architecture — scene tree diagram showing node types and hierarchy
GDScript Implementation — typed GDScript 2.0 code with @export, @onready, signals
Signal Wiring — list of signal connections and their callables
Validation — how to test in-editor: scene running, remote inspector, print debugging
References
Related skills
unity — alternative engine, C# based
unreal-engine — alternative engine, C++/Blueprint based
game-design-systems — higher-level game mechanics design
save-load-state — persistence patterns applicable to Godot's Resource system
Failure handling
- If the Godot version is ambiguous, assume Godot 4.x and typed GDScript 2.0 syntax.
- If a node type is unclear, check the class hierarchy in docs before choosing a base.
- If performance issues arise, profile with Godot's built-in monitors before optimizing.
- If the task requires C# or GDExtension, note the limitation and suggest the appropriate approach.