/godot-dev:godot-gdscriptfrom godot-dev
Enforces typed GDScript with warnings-as-errors, typed arrays, signals, await, lambdas, resources as data, and @tool scripts for maintainable Godot projects.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Typed GDScript turns most runtime errors into load errors, which a headless gate can see. The
rest of the method is about the places where GDScript stays silent: a lambda that changed its own
copy, an await that never returns, a resource two scenes share without knowing it.
| The situation | Read |
|---|---|
Typing a script; := that fails to parse; typed arrays and dictionaries; casts; class_name or preload | reference/typing.md |
| Raising warnings to errors; what a warning message means; untyped legacy code; "(Warning treated as error.)" | reference/warnings.md |
Signals that fire twice or never; bind; a lambda that changed nothing; an await that hangs; one-shot connections | reference/signals-await.md |
Data in .tres files; @export; a value two instances share; @tool scripts | reference/resources-as-data.md |
| A ready typed resource and a signal hub to start from | templates/parcel_data.gd · templates/courier_signals.gd |
Old Godot syntax (yield, onready var, export var) | godot-version-guard |
Scene and resource text, ids, [connection] sections | godot-scene-files |
| Unit tests for GDScript | godot-testing |
| C# instead of GDScript | godot-csharp |
| Autoloads, scene changes, saving | godot-scene-flow |
extends Node
signal parcel_delivered(parcel_id: StringName, reward: int)
const ParcelData = preload("parcel_data.gd")
@export var speed: float = 4.0
var carrying: Array[ParcelData] = []
var gate_codes: Dictionary[StringName, int] = {}
@onready var spawn: Marker2D = %Spawn
func deliver(late_seconds: float) -> int:
var total: int = 0
for parcel: ParcelData in carrying:
total += parcel.delivery_reward(late_seconds)
parcel_delivered.emit(parcel.id, parcel.delivery_reward(late_seconds))
carrying.clear()
return total
:= is fine when the value has one.
var x := d["a"] does not, and is a parse error at any level.Dictionary value, get(), json.data) goes into a typed local before use:
var n: float = d["n"]. A float into an int truncates without a word (2.7 becomes 2).$Node and %Unique lookups in a member initialiser need @onready; without it the script
fails to load by default.Level 1 warnings print nothing headless. Level 2 makes the script fail to load with the message and "(Warning treated as error.)", which a gate sees.
python3 scripts/gdscript_strict.py settings # the [debug] block for project.godot
GODOT_BIN=/path/to/Godot python3 scripts/gdscript_strict.py check path/to/project
GODOT_BIN=/path/to/Godot python3 scripts/gdscript_strict.py --selftest
The profile raises 21 warnings to 2: untyped_declaration, the four unsafe_* access and call
warnings, unused and shadowed names, confusable_capture_reassignment,
int_as_enum_without_cast, narrowing_conversion, integer_division, unreachable and
standalone code. check copies the project to a temp folder under a name of its own (the
project and its user:// folder are never touched), puts the profile in the copy's
override.cfg, imports it, loads every .gd, and prints one FAIL line per message: exit 0
clean, 2 a script failed, 3 nothing verified, 1 usage. The selftest proves the templates load
under the profile, an untyped counter-example fails with "has no static type ... (Warning
treated as error.)" and loads under the default levels, a driver exercises both templates, and a
project folder with an autoload, a class_name and a uid reference passes untouched. Every
message, its fix, @warning_ignore and directory_rules for legacy folders:
reference/warnings.md.
The scripts the other godot-dev skills ship load with untyped_declaration at 2, the level
godot-new-project sets, but not all of them under the whole profile: the JSON readers and
Variant helpers trip mostly the unsafe_* warnings. Under the profile, keep a copied script in a
folder directory_rules holds at 0, or type it before it counts as done.
| Do | Because |
|---|---|
sig.emit(...), sig.connect(callable) | a misspelt signal fails at load; emit_signal("name") fails only when it runs |
guard with is_connected | a second connect of one callable is an ERROR: line and returns 31 |
CONNECT_ONE_SHOT for "the first time only" | it runs once over two emits |
bind knowing the order | bound arguments come after the emitted ones |
| connect methods of the listener, not lambdas capturing nodes | a freed target's method connection is removed; a lambda capturing a freed node errors at the next emit |
capture an Array to share state with a lambda | locals are captured by value: count += 1 inside changes only the lambda's copy |
give every important await a timeout | an await on a freed emitter never returns, and nothing is printed |
await process_frame first in an -s script's _initialize | the root is not inside the tree yet; get_tree() is null |
templates/courier_signals.gd carries connect_once and wait_for_gate(gate, timeout_s), the
timed await that disconnects itself; the selftest drives both.
Prefer const ParcelData = preload("parcel_data.gd"): local to the file, no import needed, no
global name to collide, and usable as a type (var p: ParcelData). Use class_name only when the
editor must list the type (a custom Resource in New Resource, a node in Create Node) or the
whole project needs it, and pick a name that carries the subject (class_name CourierRunParcel,
not class_name Parcel). Two scripts with one class_name make one of them fail to load ("hides a global script
class"), and class_name resolves only after an --import has written the class cache.
A Resource script with @export fields plus .tres files is the data layer: parcel kinds,
sentry tunings, route definitions. templates/parcel_data.gd is one, templates/parcel_express.tres
an instance of it by relative path. Three facts decide most bugs:
load() of one path returns one shared object; a [sub_resource] in a scene is shared by every
instance unless resource_local_to_scene is set; duplicate() makes a copy..tres loads, so validation in a setter covers the files too.@export loses
every saved value.@tool scripts run in the editor; Engine.is_editor_hint() is false in a headless run, also in a
@tool script, so a headless check covers only the game branch (reference/resources-as-data.md).
load() returns non-null for a script that fails to compile; read
the error lines (a Logger tap, or gdscript_strict.py check).The editor's warning panel, the inspector widgets of @export_* hints, @tool behaviour
inside the editor and warnings in an exported game are outside a headless check.
| Not here | Go to |
|---|---|
| Old Godot syntax, renamed APIs, converting a project | godot-version-guard |
.tscn and .tres text, ids, uids | godot-scene-files |
| Test runners, assertions, CI exit codes | godot-testing |
| Proving a whole project loads and runs, the verdict | godot-verify |
| C# scripts | godot-csharp |
| Autoload state, scene changes, saves | godot-scene-flow |
reference/resources-as-data.md (opens in a new tab)reference/signals-await.md (opens in a new tab)reference/typing.md (opens in a new tab)reference/warnings.md (opens in a new tab)scripts/gdscript_strict.py (opens in a new tab)templates/courier_signals.gd (opens in a new tab)templates/parcel_data.gd (opens in a new tab)templates/parcel_express.tres (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub tipoli5890/game-studio --plugin godot-dev28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK./godot-2d-spritesSprite frames into Godot: frames.json to SpriteFrames, AnimatedSprite2D, sheet slicing, pivots, filtering and import for pixel art./godot-3d-controllerMove a 3D character in Godot: CharacterBody3D grounding, slopes and steps, third and first person, lane runner, click-to-move./godot-3d-modelsBring a glTF model into Godot: import settings, post-import script, materials, LODs, collision; audit it against a triangle and texture budget.