- Home
- Skills
- Jwynia
- Agent Skills
- Godot Best Practices
godot-best-practices_skill
- TypeScript
22
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jwynia/agent-skills --skill godot-best-practices- SKILL.md12.3 KB
Overview
This skill guides AI agents to produce clean, idiomatic Godot 4.x GDScript and robust scene architecture. It focuses on naming, type hints, node referencing, signals-first communication, resource loading strategies, and common game patterns like state machines, object pooling, and save systems. Use it to ensure maintainable, performant, and refactor-friendly Godot projects.
How this skill works
The skill inspects requested code or scene descriptions and applies Godot 4.x best practices: explicit type hints, @onready typed node references, typed signals, preload/load guidelines, and a consistent script section order. It recommends patterns for decoupled communication (signal up, call down), resource management (preload vs load vs threaded), and common gameplay systems (enum state machines, object pools, Resource-based saves). It also flags anti-patterns and suggests concrete replacements.
When to use it
- Generating new GDScript scripts or templates
- Designing scene hierarchies and node references
- Implementing state machines, object pools, or save/load systems
- Optimizing performance or resource loading strategies
- Reviewing or refactoring existing Godot 4.x GDScript code
Best practices
- Use explicit type hints everywhere for autocomplete and static checks
- Prefer @onready typed references and %UniqueName for critical nodes
- Emit typed signals from children; connect and handle them in parents (signal up, call down)
- Preload small/critical resources, load large optional assets at runtime, use ResourceLoader for async
- Organize scripts with sections: signals, enums, exports, constants, vars, onready, lifecycle, public, private
- Avoid deep fragile paths, logic-heavy autoloads, polling in _process, and untyped signal strings
Example use cases
- Generate a player controller script with typed node refs, exports, and state machine scaffold
- Create an object pool singleton for bullets or particles with acquire/release methods
- Design a save/load system using a custom Resource and ResourceSaver/Loader patterns
- Refactor a scene to replace get_node() calls with @onready typed variables and %unique names
- Recommend resource loading changes to prevent stutter using preload or threaded loading
FAQ
Use preload for small or critical assets that must be available immediately. Use load or ResourceLoader threaded requests for large or optional assets to avoid startup cost and stutter.
When should I use signals vs direct method calls?
Use signals to decouple children from parents and for broadcast-style events. Use direct calls when a parent controls a specific child and needs synchronous behavior. Follow "signal up, call down."