This skill helps an agent write GDScript that parses on the project’s Godot version and behaves the way the engine schedules it. It checks the version and warning settings in project.godot, types members and returns by default, and puts code in the right callback among _init, _ready, _physics_process and _process.
It includes patterns for a typed node script, typing values that come back as Variant, and a coroutine that survives its node being freed. A bundled GDScript check loads every script with autoloads and class_name types registered and lists each broken file with the engine’s parse error. The gotchas cover Cannot infer the type, silent awaits and 4.7 behaviour changes.
What You Get
- A workflow that matches the project’s version and warning settings, types by default and verifies compile and runtime behaviour
- Patterns for a typed node script, typing Variant results and a coroutine that survives node removal
- A compile-check script that loads every .gd file and reports the engine’s parse error and line per broken file
- A gotcha list for type inference errors, silent awaits, missing class_name cache, 4.7 return-type and packed-array changes and 3.x syntax
Common Use Cases
- Fixing Cannot infer the type of variable errors in a GDScript project
- Debugging a coroutine whose code after await never runs
- Finding why an @onready variable is null
- Porting Godot 3 scripts to the 4.x annotations and await syntax
What Makes It Unique
The skill explains why Godot’s own —check-only misleads: it parses one file without autoloads, so scripts that name an autoload fail. It ships a compile check that loads every script with autoloads and class names registered, and it records 4.7 changes such as inherited override return types and packed-array element writes that skip setters.
Under The Hood
The agent loads the SKILL.md and, when needed, a reference on every export and other annotation, typed collections and lifecycle order. It runs commands in your project: a headless asset import on a fresh checkout, the Godot binary headless with the bundled compile-check script, and a short headless run of the main scene with the log redirected to a file and searched with grep, plus the optional Python project checker from the godot-nodes-scenes skill. It reads project files and writes the log file; it makes no network calls. The shipped GDScript check is a file type the scanner cannot read, so what it does was not analysed and is worth a look before you run it.