godot-gdscript
Skill29 starsChanged 6 months agoMITView on GitHub
Godot 4 GDScript code quality: static typing, signal architecture, coroutines, design patterns, performance optimization, and GDScript-specific idioms. Use when writing or reviewing .gd files in Godot 4 projects for: (1) Enforcing static typing standards, (2) Designing signal and node communication patterns, (3) Implementing state machines/command/observer patterns in GDScript, (4) Optimizing GDScript performance, (5) Reviewing GDScript code for anti-patterns.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Wade-DevCode/awesome-coding-skills-cntheir own version, first seen Nov 8, 2026
- MindsMaster/godot-claude-code-skillstheir own version, first seen Oct 25, 2026
- gamedev-skills/awesome-gamedev-agent-skillstheir own version, first seen Oct 23, 2026
- gosomea/dsh-godot-aitheir own version, first seen Oct 8, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- gamedev-skills/awesome-gamedev-agent-skills★ 6.4ksame name
- gosomea/dsh-godot-ai★ 9same name
- Wade-DevCode/awesome-coding-skills-cn★ 7same name
- MindsMaster/godot-claude-code-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- godot-csharpSkill
- godot-gdextensionSkill
- godot-shaderSkill
- godotSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
ALL variables, parameters, and return types must have explicit type annotations:
- Very specific: line 32
Use @onready for typed node references:
- Very specific: line 46
Use @export_group and @export_subgroup for inspector organization
- Distinctive: line 64
Prefer signals for decoupled communication between nodes
- Very specific: line 65
Never connect signals in _process() — connects every frame
- Very specific: line 66
Always disconnect in _exit_tree() if node may outlive the connection
- Very specific: line 67
Use EventBus autoload for global events, direct signals for parent-child
- Very specific: line 86
Never use yield() — that's Godot 3 syntax.
- Very specific: line 116
Use duplicate_deep() for nested resources (Godot 4.5+).
- Distinctive: line 137
Script backtracing: Call stacks available even in Release builds (4.5+)
- Very specific: line 146
Use _physics_process for movement/physics, _process for visuals/UI
- Very specific: line 148
Use StringName for frequently compared strings: &"animation_name"
- Very specific: line 149
Avoid Array.find() in hot paths — use Dictionary lookups
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Godot GDScript Specialist
GDScript 2.0 code quality, patterns, and optimization for Godot 4.6 projects.
Static Typing (Mandatory)
ALL variables, parameters, and return types must have explicit type annotations:
# YES — typed
var health: float = 100.0
var inventory: Array[Item] = []
func take_damage(amount: float, source: Node3D) -> void:
func get_items() -> Array[Item]:
# NO — untyped
var health = 100.0
func take_damage(amount, source):Use @onready for typed node references:
@onready var health_bar: ProgressBar = %HealthBar
@onready var sprite: Sprite2D = $Visuals/Sprite2DEnable unsafe_* warnings in project settings to catch untyped code.
File Organization
- One
class_nameper file — file name matches class insnake_caseplayer_character.gd→class_name PlayerCharacter
- Scripts extend the node type they're attached to
- Use
@export_groupand@export_subgroupfor inspector organization
Signal Architecture
signal health_changed(new_health: float, old_health: float)
signal died(source: Node)
# Modern emit syntax (Godot 4)
health_changed.emit(_current_health, _previous_health)
died.emit(killer)
# Typed connections
health_changed.connect(_on_health_changed)
# One-shot
health_changed.connect(_on_damaged_once, CONNECT_ONE_SHOT)- Prefer signals for decoupled communication between nodes
- Never connect signals in
_process()— connects every frame - Always disconnect in
_exit_tree()if node may outlive the connection - Use
EventBusautoload for global events, direct signals for parent-child
Coroutines and Async
# Await a signal
await get_tree().create_timer(0.5).timeout
# Await a tween
var tween := create_tween()
tween.tween_property(sprite, "modulate:a", 0.0, 0.3)
await tween.finished
# Await parallel operations
var timer := get_tree().create_timer(1.0)
var tween := create_tween().tween_property(self, "position", target, 1.0)
await timer.timeout # or await tween.finishedNever use yield() — that's Godot 3 syntax. Use await exclusively.
Design Patterns
State Machine
enum State { IDLE, RUNNING, JUMPING, FALLING, ATTACKING }
var _current_state: State = State.IDLE
func _physics_process(delta: float) -> void:
match _current_state:
State.IDLE:
_process_idle(delta)
State.RUNNING:
_process_running(delta)For complex states, use node-based state machines (each state is a child Node).
Resource Pattern
class_name WeaponData extends Resource
@export var damage: float = 10.0
@export var attack_speed: float = 1.0
@export var weapon_type: WeaponTypeResources are shared by default — use resource.duplicate() for per-instance data.
Use duplicate_deep() for nested resources (Godot 4.5+).
Composition Over Inheritance
@onready var health_component: HealthComponent = %HealthComponent
@onready var hitbox_component: HitboxComponent = %HitboxComponent
func _ready() -> void:
health_component.died.connect(_on_died)
hitbox_component.hit_received.connect(_on_hit_received)Maximum inheritance depth: 3 levels after Node base.
Post-4.3 GDScript Features
From references/current-best-practices.md in the godot skill:
- Variadic arguments (4.5+):
func log(prefix: String, values: Variant...) -> void: - Abstract classes (4.5+):
@abstract class_name BaseEnemyand@abstract func get_pattern() - Script backtracing: Call stacks available even in Release builds (4.5+)
Performance
- Disable
_processand_physics_processwhen not needed:set_process(false) set_physics_process(false) - Use
_physics_processfor movement/physics,_processfor visuals/UI - Cache node references in
@onready— neverget_node()in_process - Use
StringNamefor frequently compared strings:&"animation_name" - Avoid
Array.find()in hot paths — useDictionarylookups - Object pooling for frequently spawned objects (projectiles, particles)
- Typed arrays (
Array[Type]) are faster than untyped arrays - Threshold for GDScript → GDExtension: if a function runs >1000 times per frame
Common GDScript Anti-Patterns
- Untyped variables and functions — disables compiler optimizations
- Using
$NodePathin_processinstead of caching with@onready - Deep inheritance trees instead of composition
- Signals for synchronous communication — use direct method calls
- String comparisons instead of enums or
StringName - Dictionaries for structured data instead of typed Resources
- God-class Autoloads that manage everything
- Editor signal connections — invisible in code, hard to track
- Using
yield()instead ofawait
Tooling
ripgrep for GDScript: No gdscript type exists. Always use --glob "*.gd"
or glob: "*.gd". Using --type gdscript produces a hard error.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

