/godot-agent-skills:godot-gdscriptfrom godot-agent-skills
Writes correct, statically typed GDScript for Godot 4.7, covering script layout, typed containers, signals, await, and engine compile checks. Use when writing, reviewing, or fixing .gd files.
Ships in godot-agent-skills. 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.
Check after every edit: python scripts/gd_check.py [paths] compiles every .gd file with the real engine and returns {file, line, msg} errors. Autoloads and class_names resolve like they do at runtime. Look up any engine API with ../godot-core/scripts/api_lookup.py before you use it.
@tool / @icon / @abstract → class_name → extends → ## doc comment
signals → enums → constants → static vars → @export vars → vars → @onready vars
_static_init → _init → _enter_tree → _ready → _process/_physics_process → other virtuals
public methods → _private methods → inner classes
Use snake_case for files, functions and variables, PascalCase for classes and nodes, CONSTANT_CASE for constants and enum values. Indent with tabs. Prefix private members with _.
var speed := 5.0 infers the type. Use var target: Node3D when there's no initializer. Use : Variant only on purpose.Array[Enemy], Dictionary[StringName, int] (4.4+). Typed arrays reject wrong element types at runtime.-> void. In 4.7, an override of a typed-return method must return on every path.node as Enemy returns null when the cast fails, for objects. is tests the type. Use is_instance_valid(x) after any await that might outlive x.debug/gdscript/warnings/untyped_declaration = 2 (Error). Keep inference_on_variant at its default of Error.int / int is integer division. Write float(a) / b when you mean a fraction.signal health_changed(current: int, maximum: int). Emit with health_changed.emit(hp, max_hp).button.pressed.connect(_on_pressed). Add arguments with .bind(id) and one-shot behavior with connect(f, CONNECT_ONE_SHOT). Avoid string forms like connect("x", self, "y").await sig suspends the function. The caller gets control back immediately unless it also awaits. Any function containing await is a coroutine, so the caller must await it to get its return value.await get_tree().create_timer(0.5).timeout and await get_tree().process_frame/physics_frame to busy waits.godot-architecture).var hp: int = 10: followed by an indented set(value): hp = clampi(value, 0, max_hp), or set = _set_hp.@export variants (check them with api_lookup.py @export_range): @export_range(0, 100, 1, "or_greater"), @export_enum, @export_flags_3d_physics, @export_file("*.json"), @export_group("Movement"), @export_subgroup, @export_category, @export_storage, @export_custom, @export_tool_button("Bake", "Bake") (4.4+).@onready var label: Label = %ScoreLabel uses a scene-unique name (%). That's safer than long $A/B/C paths.@abstract class_name Weapon with @abstract func fire() -> void (4.5+). Variadic arguments: func log_all(...parts: Array) -> void (4.5+).var double := func(x: int) -> int: return x * 2. They capture locals by value. Mutate shared state through an Array or Dictionary, or through a member variable.match handles literals, [a, b, ..], {"k": v}, var x bindings and when guards (4.3+).static var/static func, const PRELOADED := preload("res://x.tscn"), &"string_name", ^"Node/Path".## above members (shown in the editor's help and by --gdscript-docs).| Symptom | Cause, then fix |
|---|---|
Invalid access ... on a base object of type 'null instance' | Wrong node path, or used before _ready. Use @onready/%Unique, and get_node_or_null when a node is optional. |
previously freed | An await or deferred call outlived the node. Check is_instance_valid() or is_inside_tree(). |
| Physics or tree changes during a callback error out | Use call_deferred("add_child", n), set_deferred("disabled", true) or queue_free(). |
Cyclic reference / Could not resolve class | class_name cycles between preloads. Use type hints with load() at runtime, or split the shared type into its own script. |
| A signal callback never fires | Connected in _ready of a node that isn't in the tree yet, signature mismatch, or a typo in the signal name. Typed sig.connect() catches typos at parse time. |
| Exported var resets | Value set in _init gets overwritten by the scene file. Initialize in the declaration or in _ready. |
| Mixed tabs and spaces | Tabs only. Godot rejects mixed indentation. |
Deeper patterns, all compiled by the test suite: references/patterns.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
godot, gdscript, game-development, static-typing, compile-check
27 skills in this plugin
/godot-2d2D games in Godot 4.7 - pixel-art and HD setup, TileMapLayer (cells, terrains, custom data, runtime tiles, physics chunking), Parallax2D, Camera2D (limits, smoothing, shake), y-sort and z-index, 2D lights and normal maps, AnimatedSprite2D, one-way platforms, custom drawing, many-sprite performance. Use for platformers, top-down, tile-based or any 2D scene./godot-3d-gameplayBuilding 3D games in Godot 4.7 - third-person and orbit cameras (SpringArm3D), camera-relative movement, lock-on, top-down/RTS/isometric cameras, GridMap + MeshLibrary levels, CSG blockout and baking, modular kit import hints, Path3D rails, interactables, spawners, world-space UI, large worlds and LOD. Use for 3D player controllers, cameras or level building./godot-npx claudepluginhub el4cteo/godot-skills --plugin godot-agent-skillsOther plugins' skills for the same job