Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

godot-gdscript — Claude Code skill: what it does, how to install

Guides coding assistants in writing statically typed GDScript 2.0 for Godot 4.7 and porting legacy scripts from Godot 3.x. Helpful when structuring node lifecycles and signals.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript -a claude-code
Open on GitHub

What godot-gdscript does

This skill guides agents when editing .gd files for Godot 4.7. It enforces static types on variables and function signatures, catching syntax bugs early during parsing. The instructions separate frame rendering from physics logic, keeping movement routines inside _physics_process.

It handles the modern GDScript syntax introduced in 4.x. Signal connections use Callable objects instead of strings, coroutines run via await, and variables exposed to the Inspector use @export. Calling $NodePath inside _init() fails because the node has not entered the tree yet. Because of that rule, references belong in @onready or _ready().

The skill accounts for breaking changes in Godot 4.7. Overridden methods now inherit the parent's typed return, which means every execution path must return a value. Scene instancing and C# scripts are excluded from this skill. Separate guides handle those engine tasks.

What it helps with

  • port Godot 3.x scripts to Godot 4.7 syntax by replacing yield with await
  • apply static typing to GDScript functions, variables, and arrays
  • expose inspector controls with @export and @export_range
  • prevent tree lookup crashes by moving $NodePath calls out of _init()

Example prompts for the agent

  • Convert this legacy 3.x script to Godot 4.7 using await and Callable signal connections.
  • Add static type annotations to Player.gd and expose movement speed with @export.
  • Audit Enemy.gd: move child lookups to @onready and route physics to _physics_process.

How to install godot-gdscript

1Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript -a claude-code

2Manually: put the files in place

~/.claude/skills/godot-gdscript/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/godot-gdscript/

From the same set40

The whole set →
game-feel gamedev-skills Teaches the agent to add feedback to game actions: camera shake, hit-stop, eased tweens, squash and stretch, knockback. For mechanics that work but feel weightless. Claude Code CX Codex Cursor +1 9,400installs game-ui-ux gamedev-skills Engine-neutral game UI architecture skill for responsive layouts, screen stacks, gamepad focus, and event-driven HUD updates. Claude Code CX Codex Cursor +1 9,200installs level-design gamedev-skills Plans playable game levels from blockout through playtesting, covering routes, pacing, gates and encounters. Use it when working on whiteboxes, critical paths or room flow. Claude Code CX Codex Cursor +1 7,500installs camera-systems gamedev-skills Engine-neutral patterns for 2D and 3D game cameras: smooth follow, deadzones, look-ahead, bounds clamping, and third-person collision. Claude Code CX Codex Cursor +1 7,100installs audio-design gamedev-skills A skill that treats game audio as a mixer graph: buses, gain in decibels, sidechain ducking, adaptive music and beat-synced events. Samples use Godot 4.7, Unity gets notes. Claude Code CX Codex Cursor +1 7,100installs performance-optimization gamedev-skills A skill that turns “the game runs slow” into a measured bottleneck and a specific fix: profile first, then pool objects, batch draw calls, cut allocations. Claude Code CX Codex Cursor +1 7,100installs game-ai gamedev-skills Designs NPC decision-making, behavior trees, steering forces, and A* pathfinding. Useful when building game enemy logic across engines. Claude Code CX Codex Cursor +1 7,100installs input-systems gamedev-skills Engine-neutral input system: map keys to named actions, rebinding with conflict detection, keyboard, gamepad and touch support, analog deadzones, input buffering and coyote time. Claude Code CX Codex Cursor +1 6,800installs

Similar

game-automation rehan-remade Launches games, captures GPU-rendered windows, and simulates mouse and keyboard input. Helps an agent verify mods directly inside a running game on Windows and WSL. Claude Code CX Codex Cursor +1 1,500installs reverse-engineering rehan-remade Lets the agent read a game from the inside: decompiled code, dumped asset formats, live memory. Useful when a mod needs an exact function address or the layout of a file. Claude Code CX Codex Cursor +1 1,500installs mod-any-game rehan-remade PC game modding skill that takes an idea from engine reconnaissance and save backups to asset pipelines and in-game testing. Claude Code CX Codex Cursor +1 1,500installs orbit-card heygen-com Adds a 10-second 1920×1080 HyperFrames motion block where a single feature card orbits a dot sphere using exported Blender camera paths. Claude Code CX Codex Cursor +1 9,800installs sdf earthtojake This skill authors and validates SDFormat files for models and worlds, then helps prepare them for simulator handoff. Claude Code CX Codex Cursor +1 10,500installs urdf earthtojake This skill helps create, validate, and debug URDF robot descriptions. Use it when working with links, joints, geometry, meshes, or inertial data. Claude Code CX Codex Cursor +1 10,400installs hatch-pet official openai Creates and packages animated pets and spritesheets for Codex. Use it to turn a character concept, reference image, or brand cues into a pet. Claude Code CX Codex Cursor +1 3,300installs gcode earthtojake Slices STL, 3MF, and OBJ models into printer-ready G-code through OrcaSlicer. Use it when you need a print file without connecting to the printer. Claude Code CX Codex Cursor +1 9,500installs

Questions about godot-gdscript

How do I install godot-gdscript in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-gdscript -a claude-code in your terminal.

What does the godot-gdscript skill do?

It gives agents guidelines for writing idiomatic GDScript 2.0 for Godot 4.7. It covers static typing, @onready node bindings, lifecycle loops, and await calls.

Does godot-gdscript cover scene architecture or C#?

No, it focuses strictly on GDScript code. Scene composition is handled by godot-nodes-scenes, while C# workflows require godot-csharp.

Source text

SKILL.md · Apache-2.0
---
name: godot-gdscript
description: >
  Write idiomatic GDScript for Godot 4.7: static typing, the node lifecycle
  (_ready/_process/_physics_process), @export/@onready/@tool annotations,
  signals, and await for asynchronous flow. Use when editing .gd scripts in a
  Godot project (project.godot), writing or debugging GDScript, or porting 3.x
  GDScript to 4.x (function signatures, yield to await, export to @export).
---

# Godot GDScript (4.x)

Write correct, statically typed GDScript and use the node lifecycle and signal
system the way the engine intends. Targets **Godot 4.7** (GDScript 2.0).

## When to use

- Use when writing or fixing `.gd` files: declaring variables, functions, classes,
  using `@export`/`@onready`, connecting signals, or awaiting coroutines/signals.
- Use when porting Godot 3.x scripts to 4.x and the script no longer parses.

**When *not* to use:** scene/node structure and instancing questions →
`godot-nodes-scenes`; signal *architecture*/decoupling patterns →
`godot-signals-groups`; using C# instead of GDScript → `godot-csharp`.

## Core workflow

1. **Type everything you can.** GDScript 2.0 supports static types
   (`var hp: int = 10`, `func add(a: int, b: int) -> int:`). Types catch errors at
   parse time and speed up the VM. Use `:=` for inferred types.
2. **Use the lifecycle callbacks for their purpose:** `_ready()` once when the node
   and its children enter the tree; `_process(delta)` every rendered frame;
   `_physics_process(delta)` on the fixed physics tick (use it for movement/physics).
3. **Grab node references with `@onready`**, not in `_init()` — children do not exist
   until the node enters the tree.
4. **Expose tunables with `@export`** so designers edit them in the Inspector.
5. **React to events with signals + `await`**, not polling, where it reads cleanly.
6. **Run and read errors.** The Debugger panel prints typed errors with line numbers;
   fix the first error first (later ones are often cascades).

## Patterns

### 1. A typed script with lifecycle, @export, and @onready

```gdscript
extends Node2D
class_name Spinner            # registers a global type usable in other scripts

@export var speed: float = 90.0          # editable in the Inspector (degrees/sec)
@export_range(0, 10, 0.5) var wobble := 2.0
@onready var sprite: Sprite2D = $Sprite2D # resolved when the node enters the tree

func _ready() -> void:
    # Runs once, after children are ready. Safe to touch $Sprite2D here.
    sprite.modulate = Color.AQUA

func _process(delta: float) -> void:
    # delta is seconds since last frame; multiply rates by it for FPS independence.
    rotation_degrees += speed * delta
```

### 2. Signals: declare, emit, connect (4.x Callable syntax)

```gdscript
extends Node

signal health_changed(current: int, maximum: int)   # typed signal params

var health := 100

func take_damage(amount: int) -> void:
    health = maxi(health - amount, 0)    # maxi/maxf are typed; max() returns Variant
    health_changed.emit(health, 100)     # 4.x: emit as a method on the signal

func _ready() -> void:
    # 4.x: connect with a Callable, not a string method name.
    health_changed.connect(_on_health_changed)

func _on_health_changed(current: int, maximum: int) -> void:
    print("HP: %d/%d" % [current, maximum])
```

### 3. await — pause until a timer or signal fires (replaces 3.x yield)

```gdscript
func flash_then_continue() -> void:
    modulate = Color.RED
    await get_tree().create_timer(0.2).timeout   # resume after 0.2s
    modulate = Color.WHITE
    # await any signal: var result = await some_node.some_signal
```

### 4. Lambdas, typed arrays, and safe access

```gdscript
var enemies: Array[Node] = []                    # typed array

func cull_dead() -> void:
    enemies = enemies.filter(func(e): return e.is_inside_tree())

func get_first_name(d: Dictionary) -> String:
    return d.get("name", "unknown")              # default avoids missing-key errors
```

## Pitfalls

- **3.x → 4.x signal API changed.** `emit_signal("x")` still works but prefer
  `x.emit(...)`; `connect("x", self, "_on_x")` is gone — use `x.connect(_on_x)` with a
  Callable. `yield(obj, "sig")` is now `await obj.sig`.
- **`export var` is now `@export var`** (annotation). Likewise `onready`→`@onready`,
  `tool`→`@tool`, `remote`/`master` RPC keywords → the `@rpc(...)` annotation.
- **`@onready` and `$NodePath` in `_init()` fail** — the node isn't in the tree yet.
  Initialize node references in `_ready()` or with `@onready`.
- **Integer division truncates.** `5 / 2 == 2`. Use `5.0 / 2` or cast to `float`.
- **`_process` vs `_physics_process`.** Put `move_and_slide()` and physics in
  `_physics_process(delta)`; using `_process` makes motion frame-rate dependent.
- **`class_name` must be unique** project-wide and is required to use the type name in
  other scripts or as an Inspector type.
- **An override stops parsing after upgrading to 4.7** → since 4.7 an overriding method
  inherits the parent's typed return, so every path must `return` a value (add
  `return null` at the end if needed). Also new in 4.7: setting one element of a packed
  array property (`points[0] = v`) no longer calls that property's setter; reassign the
  whole array if the setter must run.

## References

- For the full annotation list, advanced typing, and style conventions, read
  `references/annotations-and-typing.md`.

## Related skills

- `godot-nodes-scenes` — the scene tree, instancing, and autoloads.
- `godot-signals-groups` — event-driven architecture with signals and groups.
- `godot-resources` — data-driven design with custom `Resource` types.
- `godot-csharp` — the same engine concepts using C#/.NET.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor