Skilllibrary godot
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.
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/13-game-engines-and-creative-tech/godot" ~/.claude/skills/merceralex397-collab-skilllibrary-godot && rm -rf "$T"
manifest:
13-game-engines-and-creative-tech/godot/SKILL.mdsource content
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 (
) files or scene (.gd
) definitions.tscn - 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
orunity
skillsunreal-engine - 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
, etc. Prefer the most specific built-in node before creating custom ones.CharacterBody3D - Use typed GDScript 2.0 syntax. Declare
, usevar speed: float = 200.0
for inspector properties,@export
for deferred node refs.@onready var sprite: Sprite2D = $Sprite2D - Wire signals with the new syntax. Prefer
over legacy string-basedbutton.pressed.connect(_on_button_pressed)
. Define custom signals asconnect()
and emit withsignal health_changed(new_hp: int)
.health_changed.emit(hp) - Leverage the node lifecycle.
for initialization after tree entry,_ready()
for per-frame logic,_process(delta)
for fixed-step physics,_physics_process(delta)
/_enter_tree()
for setup/teardown._exit_tree() - Compose scenes over inheritance. Build reusable behaviors as child scenes (component pattern). A
containsPlayer.tscn
,StateMachine
,Hitbox
as children rather than a deep class hierarchy.AnimationPlayer - Use Resources for data. Create custom
Resources (class_name
) for configs:.tres
withclass_name WeaponStats extends Resource
. Reference via@export var damage: int
.@export var weapon: WeaponStats - Register autoloads for globals. Use Project → Autoload for singletons: event bus (
), scene manager, global game state. Access asEvents.gd
.Events.player_died.emit() - Instantiate scenes correctly.
at load time,var scene := preload("res://enemies/slime.tscn")
, thenvar instance := scene.instantiate()
.add_child(instance) - Implement state machines with enums.
with aenum State { IDLE, RUN, JUMP, FALL }
block inmatch
for clear state transitions._physics_process - Animate properly. Use
for complex sequences,AnimationPlayer
with blend trees for character animation,AnimationTree
for procedural tweens.create_tween() - Handle physics correctly.
usingCharacterBody2D.move_and_slide()
property. Usevelocity
withArea2D
/body_entered
signals for triggers and hitboxes.body_exited - Organize by feature.
,res://player/
,res://enemies/
— co-locateres://ui/
,.tscn
, and.gd
files per feature rather than by file type..tres
Decision rules
- Prefer scene composition (child nodes) over deep class inheritance hierarchies.
- Use
for designer-tunable values; hard-code only true constants.@export - Choose
for movement/collision;_physics_process
for visuals and UI._process - Use Resources (
) for shared data configs; avoid storing game data in autoloads..tres - Prefer
for known scenes; usepreload()
only when the path is dynamic.load() - Use signals for decoupled communication; direct node references (
) for tightly-coupled parent-child relationships.$Path
Output requirements
— scene tree diagram showing node types and hierarchyNode Architecture
— typed GDScript 2.0 code withGDScript Implementation
,@export
, signals@onready
— list of signal connections and their callablesSignal Wiring
— how to test in-editor: scene running, remote inspector, print debuggingValidation
References
- Godot 4 documentation: https://docs.godotengine.org/en/stable/
- GDScript reference: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/
- Node lifecycle: https://docs.godotengine.org/en/stable/tutorials/scripting/node_lifecycle.html
Related skills
— alternative engine, C# basedunity
— alternative engine, C++/Blueprint basedunreal-engine
— higher-level game mechanics designgame-design-systems
— persistence patterns applicable to Godot's Resource systemsave-load-state
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.