godot-patterns
Installation
SKILL.md
Godot 4 GDScript Patterns
Idiomatic patterns for Godot 4.x projects written in GDScript. Verified against the Godot 4.7 documentation; most guidance applies to every 4.x release.
When to Activate
- Writing or reviewing
.gdfiles - Designing a scene tree or deciding which node owns what
- Choosing between a signal, a direct call, an autoload, or a Resource
- Debugging "node not found", freed-object, or signal-connection errors
- Structuring a game so its logic can be tested without running the renderer
Core Principles
- Type everything. Typed GDScript catches bugs at parse time and speeds up the editor.
- Call down, signal up. A parent may call methods on its children. A child announces events with signals and never reaches up to its parent.
- Keep game logic out of Nodes where you can. Plain
RefCountedorResourceclasses can be tested headlessly. Nodes should draw and forward input. - Data lives in Resources, not in scripts full of constants.
- Autoloads are global state. Use as few as you can and treat each one as a public API.